Skip to content

Commit

Permalink
Fixes #250 now the initial positions are fine to show the hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
javierfernandes committed Sep 23, 2015
1 parent 230a14b commit a9c4597
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,10 @@ class ClassDiagramView extends ViewPart implements ISelectionListener, ISourceVi
val graph = new DirectedGraph
graph.direction = PositionConstants.NORTH

val classEditParts = getClassEditParts()

val classToNodeMapping = classEditParts.fold(newHashMap)[map, e |
map.put(e.model as ClassModel, new Node(e.model) => [
width = 100 //e.figure.bounds.width
height = 100 //e.figure.bounds.height
width = e.figure.preferredSize.width
height = e.figure.preferredSize.height
])
map
]
Expand All @@ -196,7 +194,7 @@ class ClassDiagramView extends ViewPart implements ISelectionListener, ISourceVi
])
graph.edges.addAll(relations)

//layout
// layout
val directedGraphLayout = new DirectedGraphLayout
directedGraphLayout.visit(graph)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.eclipse.draw2d.ConnectionLayer
import org.eclipse.draw2d.FreeformLayer
import org.eclipse.draw2d.FreeformLayout
import org.eclipse.draw2d.MarginBorder
import org.eclipse.draw2d.ShortestPathConnectionRouter
import org.eclipse.draw2d.geometry.Rectangle
import org.eclipse.gef.EditPart
import org.eclipse.gef.EditPolicy
Expand All @@ -16,11 +15,10 @@ import org.eclipse.gef.editpolicies.RootComponentEditPolicy
import org.eclipse.gef.editpolicies.XYLayoutEditPolicy
import org.eclipse.gef.requests.ChangeBoundsRequest
import org.eclipse.gef.requests.CreateRequest
import org.uqbar.project.gef.SquareConnectionRouter
import org.uqbar.project.wollok.ui.diagrams.classes.model.ClassDiagram
import org.uqbar.project.wollok.ui.diagrams.classes.model.Shape
import org.uqbar.project.wollok.ui.diagrams.classes.model.commands.MoveOrResizeCommand
import org.eclipse.draw2d.ManhattanConnectionRouter
import org.uqbar.project.gef.SquareConnectionRouter

/**
* @author jfernandes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,4 @@ class InheritanceConnectionEditPart extends ConnectionEditPart {
]
}

// override createFigure() {
// super.createFigure() as PolylineConnection => [
// connectionRouter = new SquareConnectionRouter
// ]
// }

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class ConnectionEditPart extends AbstractConnectionEditPart implements

override activate() {
if (!active) {
super.activate;
super.activate
castedModel.addPropertyChangeListener(this)
}
}
Expand All @@ -41,7 +41,7 @@ abstract class ConnectionEditPart extends AbstractConnectionEditPart implements

override deactivate() {
if (active) {
super.deactivate;
super.deactivate
castedModel.removePropertyChangeListener(this)
}
}
Expand Down

0 comments on commit a9c4597

Please sign in to comment.