Anonymous avatar Anonymous committed 76f73e1

Layouting resolved, location of the items are preserved after performing automatic layout

Comments (0)

Files changed (2)


         graphics.setBackgroundColor(new Color(null, 255, 255, 255));
         graphics.fillRectangle(new Rectangle(p, textSize));
         graphics.drawRectangle((new Rectangle(p, textSize.shrink(1, 0))));
-        graphics.drawString(this.typeName, p.x + 4, p.y);
+        graphics.drawString(this.typeName, p.x + 2, p.y);


 import org.eclipse.draw2d.Figure;
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.draw2d.graph.DirectedGraph;
 import org.eclipse.draw2d.graph.Edge;
     public void layoutDiagramComponents(LimeDiagramEditPart diagram) {
         List<LimeEditPart> children = (List<LimeEditPart>) diagram.getChildren();
         for (LimeEditPart child : children) {
             if (child instanceof ComponentEditPart) {
                 layoutComponentContents(child, child);
             //            if (! (partFigure instanceof ComponentFigure)){
             Dimension nodeSize = partFigure.getPreferredSize()
+            //set the values in the model
+            limeEditPart.getLimeSubpart().setLocation(new Point(n.x, n.y));
+            limeEditPart.getLimeSubpart().setSize(nodeSize);
             Rectangle bounds = new Rectangle(n.x, n.y, nodeSize.width,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.