Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Custom Figure not showing in generated editor(1st GMF project, likely missing something fundamental)
Custom Figure not showing in generated editor [message #1270128] Wed, 12 March 2014 14:23 Go to next message
Scott Finnie is currently offline Scott Finnie
Messages: 78
Registered: October 2011
Member
Hello

My first GMF project and I have the default editor working OK for a simple domain model. Then started on customising the Figures by changing the shape in a Figure Descriptor to an Ellipse instead of Rectangle (i.e. deleted Rectangle & added Ellipse). Re-generated the .gmfgen & launched the .diagram project as an eclipse app; however it's still using the rectangle figure - not the ellipse. Tried cleaning projects & re-generating; no difference.

Any pointers appreciated; gmfgraph below for reference. Platform is Kepler SR1 on OSX 10.7.5, GMF SDK 3.1.0.201306121424.

Thanks.

<?xml version="1.0" encoding="UTF-8"?>
<gmfgraph:Canvas
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition"
    name="subtypes">
  <figures
      name="Default">
    <figures
        xsi:type="gmfgraph:PolylineDecoration"
        name="GenSpecSupertypeTargetDecoration"/>
    <figures
        xsi:type="gmfgraph:PolylineDecoration"
        name="GenSpecSubtypesTargetDecoration"
        lineKind="LINE_DASH"/>
    <descriptors
        name="ClassFigure">
      <actualFigure
          xsi:type="gmfgraph:Rectangle"
          name="ClassFigure">
        <layout
            xsi:type="gmfgraph:FlowLayout"/>
        <children
            xsi:type="gmfgraph:Label"
            name="ClassNameFigure"
            text="&lt;...>"/>
      </actualFigure>
      <accessors
          figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
    </descriptors>
    <descriptors
        name="GenSpecFigure">
      <actualFigure
          xsi:type="gmfgraph:Ellipse"
          name="GenSpecFigure">
        <children
            xsi:type="gmfgraph:Label"
            name="GenSpecRelnameLabel"/>
      </actualFigure>
      <accessors
          figure="//@figures.0/@descriptors.1/@actualFigure/@children.0"/>
    </descriptors>
    <descriptors
        name="GenSpecSupertypeFigure">
      <actualFigure
          xsi:type="gmfgraph:PolylineConnection"
          name="GenSpecSupertypeFigure"
          targetDecoration="//@figures.0/@figures.0"/>
    </descriptors>
    <descriptors
        name="GenSpecSubtypesFigure">
      <actualFigure
          xsi:type="gmfgraph:PolylineConnection"
          name="GenSpecSubtypesFigure"
          targetDecoration="//@figures.0/@figures.1"/>
    </descriptors>
  </figures>
  <nodes
      name="Class"
      figure="ClassFigure"/>
  <nodes
      name="GenSpec"
      figure="GenSpecFigure"/>
  <connections
      name="GenSpecSupertype"
      figure="GenSpecSupertypeFigure"/>
  <connections
      name="GenSpecSubtypes"
      figure="GenSpecSubtypesFigure"/>
  <labels
      name="ClassName"
      figure="ClassFigure"
      accessor="//@figures.0/@descriptors.0/@accessors.0"/>
  <labels
      name="GenSpecName"
      figure="GenSpecFigure"
      accessor="//@figures.0/@descriptors.1/@accessors.0"/>
</gmfgraph:Canvas>
Re: Custom Figure not showing in generated editor [message #1270151 is a reply to message #1270128] Wed, 12 March 2014 14:59 Go to previous messageGo to next message
Scott Finnie is currently offline Scott Finnie
Messages: 78
Registered: October 2011
Member
EDIT:

For some reason the generated code doesn't reflect the .gmfgraph file. GenSpecEditPart.java includes:

public class GenSpecFigure extends RectangleFigure {

   //...
}


If I change it manually to:

public class GenSpecFigure extends Ellipse {

   //...
}


then re-run the editor, it /still/ shows as a rectangle?!?
Re: Custom Figure not showing in generated editor [message #1271144 is a reply to message #1270151] Fri, 14 March 2014 10:48 Go to previous messageGo to next message
Michael Golubev is currently offline Michael Golubev
Messages: 373
Registered: July 2009
Senior Member
Hello,

Weird, what is in the generated createNodeShape() method? What do you see if you set breakpoint there?

Regards,
Michael
Re: Custom Figure not showing in generated editor [message #1279087 is a reply to message #1270128] Fri, 28 March 2014 08:09 Go to previous messageGo to next message
Scott Finnie is currently offline Scott Finnie
Messages: 78
Registered: October 2011
Member
Solved, and as as suspected it was a simple but fundamental misunderstanding on my part.

I had been re-running the .gmfgen file - but hadn't re-created it first (using the 'transform' link in the Dashboard). Did that and everything worked as expected.

Re: Custom Figure not showing in generated editor [message #1279091 is a reply to message #1271144] Fri, 28 March 2014 08:11 Go to previous message
Scott Finnie is currently offline Scott Finnie
Messages: 78
Registered: October 2011
Member
Michael, belated thanks for your reply (hadn't seen it as I evidently hadn't ticked the 'notify response' box).
Previous Topic:Customize XML serialization using ERefence Etype instead of name
Next Topic:How to support Association Classes using GMF?
Goto Forum:
  


Current Time: Sun Sep 21 00:04:00 GMT 2014

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

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