Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Any idea how to show a node with two icons?
Any idea how to show a node with two icons? [message #640291] Sat, 20 November 2010 01:49 Go to next message
Paulo Del Aguila is currently offline Paulo Del AguilaFriend
Messages: 14
Registered: October 2010
Junior Member
hi guys, i have the following situation. I have an atributte node with property type (Enum {string, int, float and date}). I want to show this property in an icon,changing it each time the property is changed. But its posible to have two icons, one for the attribute and another for the type? im guided by the tutorial of end labels in connection and try to do something like that with nodes. but i dont have success.. its posible to do that??

thanks a lot Smile
Re: Any idea how to show a node with two icons? [message #640524 is a reply to message #640291] Mon, 22 November 2010 12:27 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

Could you please elaborate a bit more - perhaps by providing a
screenshot of what you already have and what you'd like to achieve?

Cheers,
Dimitris

Paulo Del Aguila wrote:
> hi guys, i have the following situation. I have an atributte node with
> property type (Enum {string, int, float and date}). I want to show this
> property in an icon,changing it each time the property is changed. But
> its posible to have two icons, one for the attribute and another for the
> type? im guided by the tutorial of end labels in connection and try to
> do something like that with nodes. but i dont have success.. its posible
> to do that??
>
> thanks a lot :)
Re: Any idea how to show a node with two icons? [message #640529 is a reply to message #640291] Mon, 22 November 2010 12:46 Go to previous messageGo to next message
Abhijit Gurav is currently offline Abhijit GuravFriend
Messages: 25
Registered: November 2010
Junior Member
Hi Paulo Del Aguila,

Its possible to give two icons to label, in setIcon for wrapping figure we can set many icons through index.

public void setIcon(Image image, int index)


I hope this will help you.

Regards,
-AG
Re: Any idea how to show a node with two icons? [message #640541 is a reply to message #640524] Mon, 22 November 2010 13:06 Go to previous messageGo to next message
Paulo Del Aguila is currently offline Paulo Del AguilaFriend
Messages: 14
Registered: October 2010
Junior Member
sure Dimitrios, thanks for the reply. I wanted something like that
http://picasaweb.google.com/lh/photo/qMso21gdJ0tQm8WMzwTTx1iAtrNxQBW5q1v74ATp8sM?feat=directlink

i try to do the same of the tutorial of end labels in connection, but into a node.
-------
-- Create the figure descriptor and the label
var labelFigureDescriptor = createFigureDescriptor(labelName + 'Figure');
var label = new GmfGraph!Label;
label.name = labelName;
label.text = attribute;
labelFigureDescriptor.actualFigure = label;

-- Create the diagram label
var diagramLabel = new GmfGraph!DiagramLabel;
diagramLabel.figure = labelFigureDescriptor;
diagramLabel.name = labelName;
diagramLabel.elementIcon = true;
GmfGraph!Canvas.all.first().labels.add(diagramLabel);

var alignmentFacet = new GmfGraph!AlignmentFacet;
alignmentFacet.alignment = GmfGraph!Alignment#BEGINNING;
diagramLabel.facets.add(alignmentFacet);

-- Create the label/attribute mapping in the .gmfmap model
var featureLabelMapping = new GmfMap!FeatureLabelMapping;
featureLabelMapping.diagramLabel = diagramLabel;

featureLabelMapping.features.add(self.eAllStructuralFeatures .selectOne(sf|sf.name = attribute));
featureLabelMapping.readOnly = false;
var nodeMapping = GmfMap!NodeMapping.all.selectOne(lm|lm.domainMetaElement = self);
nodeMapping.labelMappings.add(featureLabelMapping);
------
but i had no success, the node dont appears in the diagram.
Later, i try the @gmf.affixed, but with the node Attribute inside in an compartment of another node Table, and the node affixed Type dont appears in the diagram, conforms the picture below:

http://picasaweb.google.com/lh/photo/950ofnInMG3qcx4baAscCViAtrNxQBW5q1v74ATp8sM?feat=directlink

Re: Any idea how to show a node with two icons? [message #640640 is a reply to message #640529] Mon, 22 November 2010 16:46 Go to previous messageGo to next message
Paulo Del Aguila is currently offline Paulo Del AguilaFriend
Messages: 14
Registered: October 2010
Junior Member
No Real Name, thanks for the reply. i see the method that u said, but is it posible to show more than one icon in the diagram?or one at a time?
Re: Any idea how to show a node with two icons? [message #640746 is a reply to message #640291] Tue, 23 November 2010 00:43 Go to previous messageGo to next message
Paulo Del Aguila is currently offline Paulo Del AguilaFriend
Messages: 14
Registered: October 2010
Junior Member
No Real Name thanks a lot for ur reply, this worked perfectly.
Re: Any idea how to show a node with two icons? [message #640762 is a reply to message #640746] Tue, 23 November 2010 04:57 Go to previous message
Abhijit Gurav is currently offline Abhijit GuravFriend
Messages: 25
Registered: November 2010
Junior Member
Hi,

I am happy that its work for you. Smile

Regards,
-AG
Previous Topic:xsdxml Example
Next Topic:[EWL] Wizard menu error
Goto Forum:
  


Current Time: Sat Nov 29 03:59:30 GMT 2014

Powered by FUDForum. Page generated in 0.05721 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software