Skip to content
Snippets Groups Projects
Commit f1fa72af authored by Simon Barner's avatar Simon Barner
Browse files

Auto Layouter: Style cleanup (no functional change)

parent 28f976d2
No related branches found
No related tags found
1 merge request!63433 auto layouter label size
......@@ -2,4 +2,4 @@ AutoLayoutMenu.java ef3b897cc2fd99cf9ce201f03cffea036555e3ac GREEN
DiagramTapeMeasure.java 72454e6fe5225dab11d3d691baad93aab7a171c0 YELLOW
IAutoLayouter.java de1b11d9e202c7e23352ad85684dbf8a3fd17c7d GREEN
IAutoLayouterTapeMeasure.java df186e0ba505e0ecda211b1df76cf12f3245b47e YELLOW
KielerAutoLayouter.java 9feddf66b525bb4f3768ab67452d0e8e17d399df YELLOW
KielerAutoLayouter.java 25f82e5f671b358cc6baa1327a522f9cbd762e98 YELLOW
......@@ -117,7 +117,6 @@ public class KielerAutoLayouter implements IAutoLayouter {
/** {@inheritDoc} */
@Override
public void performAutoLayout(IHierarchicElement element) {
boolean avUpdateEnabled = isUpdateEnabled();
setUpdateEnabled(false);
KNode rootNode = createKIELERGraph(element);
......@@ -329,13 +328,21 @@ public class KielerAutoLayouter implements IAutoLayouter {
// Create nodes
for(IHierarchicElement child : element.getContainedElements()) {
if(!(child instanceof ILayoutedModelElement)) {
continue;
}
// Adjust size of node to number of connectors and label size
KNode kNode = createInitializedNode();
KShapeLayout kNodeLayout = kNode.getData(KShapeLayout.class);
int width = tapeMeasure.getElementWidth(child);
kNodeLayout.setWidth(truncateSnap2Grid(width, true));
int height = tapeMeasure.getElementHeight(child);
kNodeLayout.setHeight(truncateSnap2Grid(height, true));
kNode.setParent(rootNode);
modelElementsToKNodes.put(child, kNode);
// Setup connectors
EList<IConnector> inputConnectors = new BasicEList<IConnector>();
EList<IConnector> outputConnectors = new BasicEList<IConnector>();
EList<IConnector> undirectedConnectors = new BasicEList<IConnector>();
......@@ -349,15 +356,6 @@ public class KielerAutoLayouter implements IAutoLayouter {
undirectedConnectors.add(connector);
}
}
// Adjust size of node to number of connectors and label size
int width = tapeMeasure.getElementWidth(child);
kNodeLayout.setWidth(truncateSnap2Grid(width, true));
int height = tapeMeasure.getElementHeight(child);
kNodeLayout.setHeight(truncateSnap2Grid(height, true));
kNode.setParent(rootNode);
modelElementsToKNodes.put(child, kNode);
for(IConnector connector : outputConnectors) {
KPort k = createKPortFromIConnector(connector, kNode, outboundConnectorsToKPorts);
if(undirectedConnectors.contains(connector)) {
......@@ -426,7 +424,7 @@ public class KielerAutoLayouter implements IAutoLayouter {
}
/**
* Converts a given {@link IConnection} into a {@link KPort}, and registers it with the given
* Converts a given {@link IConnector} into a {@link KPort}, and registers it with the given
* {@link KNode} (representing the {@link IHierarchicElement} containing the {@link IConnector})
* and a {@link IConnector}-to- {@link KPort} map.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment