Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Eugenia] Color and Size of a Custom Figure
[Eugenia] Color and Size of a Custom Figure [message #769601] Thu, 22 December 2011 11:58 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 15
Registered: December 2011
Junior Member
Hello,

new in Eugenia and the whole GMF stuff i am trying to build a graphical editor.

In my model i am using a custom figure as u can see in the following code snippet:

@gmf.node(label="name", tool.name="MergeData", color="255,100,0",
figure="org.eclipse.epsilon.eugenia.examples.flowchart.diagram.figures.DiamondFigure")
class MergeDiamond {
  @gmf.affixed(foo="bar")
  ref InPort[1..3] inPort;
  @gmf.affixed(foo="bar")
  ref OutPort[1] outPort;
}


In the corresponding ECore2GMF.eol i am trying to fix its size:

var mergeDiamond = GmfGraph!CustomFigure.all.selectOne(r|r.name = "MergeDiamondFigure");
if (mergeDiamond.isDefined()) {
	var label = mergeDiamond.children.selectOne(r|r.name = "MergeDiamondLabelFigure");
	label.text = "";
	var fixSize = new GmfGraph!Dimension;
	fixSize.dx = 41;
	fixSize.dy = 41;
	mergeDiamond.maximumSize = fixSize;
	var fixSize2 = new GmfGraph!Dimension;
	fixSize2.dx = 40;
	fixSize2.dy = 40;
	mergeDiamond.minimumSize = fixSize2;
}



Here is the code of the generated .gmfgraph:

 <descriptors
        name="MergeDiamondFigure">
      <actualFigure
          xsi:type="gmfgraph:CustomFigure"
          name="MergeDiamondFigure"
          qualifiedClassName="org.eclipse.epsilon.eugenia.examples.flowchart.diagram.figures.DiamondFigure">
        <backgroundColor
            xsi:type="gmfgraph:RGBColor"
            red="255"
            green="100"/>
        <maximumSize
            dx="41"
            dy="41"/>
        <minimumSize
            dx="40"
            dy="40"/>
        <children
            xsi:type="gmfgraph:Label"
            name="MergeDiamondLabelFigure"
            text=""/>
      </actualFigure>
      <accessors
          accessor="getFigureMergeDiamondLabelFigure"
          figure="//@figures.0/@descriptors.11/@actualFigure/@children.0"/>
    </descriptors>


But what i thought i would see is not what i did get Sad

1. The custom figure stays white
2. I still can resize it greater than specified maxsize

A similar question for 2. (Is it possible to avoid resizing a figure during its creation and after it?) was asked in another thread, but following the link there i still didn't get an answer to this question and the other two asked there.
I can't post the link cause its my first posting here. So here is the topic and message-id of the thread: Problem with nodes affixed to an ellipse [message #658658]

So, my questions are:

1. Why am i not able to colorize the custom figure?
2. Why is it possible to resize it bigger then given maxsize?
3. Do i have to alter the generated code for creating the affixed Ports in the same Moment the Diamondfigure was created as in aforementioned thread described?

Thanks in advance.

Wolly




Re: [Eugenia] Color and Size of a Custom Figure [message #769607 is a reply to message #769601] Thu, 22 December 2011 12:06 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 918
Registered: July 2009
Senior Member
Hi Wolly,

I'm afraid that all 3 questions are strictly related to GMF (Eugenia goes as far as generating the .gmfxxx models from the annotated .ecore and then passes them on to the GMF generator) so I suspect that experts in the GMF forum will be better positioned to help with these.

Cheers,
Dimitris
Re: [Eugenia] Color and Size of a Custom Figure [message #769609 is a reply to message #769607] Thu, 22 December 2011 12:10 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 15
Registered: December 2011
Junior Member
Hi Dimitris,

thanks for the info. I will then open a new topic there.

Bye,
Wolly
Re: [Eugenia] Color and Size of a Custom Figure [message #769614 is a reply to message #769609] Thu, 22 December 2011 12:14 Go to previous message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 15
Registered: December 2011
Junior Member
For those who have a similar problem here's the message header&id in the GMF-Forum: Color and Size of a Custom Figure [message #769611]
Previous Topic:Call EGL generator from GMF editor (generated with Eugenia)
Next Topic:[Eugenia] Can't draw link in generated editor.
Goto Forum:
  


Current Time: Wed Dec 17 20:05:23 GMT 2014

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

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