Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Fixed anchor points in old implemented diagrams(Fixed anchor points will lead to not displayed connections in the old modeled diagrams)
Fixed anchor points in old implemented diagrams [message #1231277] Tue, 14 January 2014 08:46
Dan Tololoi is currently offline Dan TololoiFriend
Messages: 33
Registered: September 2012
Location: Iasi, Romania

Hello all,

I have changed in my gmf diagrams for each ShapeNodeEditPart inherited element to have in the createNodePlate() method a custom DefaultSizeNodeFigure with fixed points:

protected NodeFigure createNodePlate() {
HashMap<String, PrecisionPoint> anchorLocations = new HashMap<String, PrecisionPoint>();
anchorLocations.put("WEST", new PrecisionPoint(0, 0.5d));
anchorLocations.put("EAST", new PrecisionPoint(1d, 0.5d));
anchorLocations.put("NORTH", new PrecisionPoint(0.5d, 0));
anchorLocations.put("SOUTH", new PrecisionPoint(0.5d, 1d));
DefaultSizeNodeFigureWithFixedAnchors result = new DefaultSizeNodeFigureWithFixedAnchors(
40, 40, anchorLocations);

return result;

It works as expected, but the previously modeled diagrams with no restriction to the anchor points will not display the connections.
In order to achieve this, I have to select "Arrange all" but this will mess the display of the diagram, the way the elements were drawn.

If some of you experienced this and have any idea, please leave a hint. Thank you!
Previous Topic:How to get the ShapeNodeEditPart linked to a model element?
Next Topic:I can create a graph editor [GMF] with graphiti instead of GEF??
Goto Forum:

Current Time: Thu Feb 25 02:42:02 GMT 2021

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

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

Back to the top