From: miettinen Date: Thu, 23 Jan 2014 12:14:13 +0000 (+0000) Subject: When selecting a Sysdyn loop, color the elements which belong to that loop (refs... X-Git-Tag: 1.8.1~153 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=59139d4faaf6fbc6a1c2224153eba04dbaa0945a;p=simantics%2Fsysdyn.git When selecting a Sysdyn loop, color the elements which belong to that loop (refs #3012). git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@28688 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/LoopFactory.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/LoopFactory.java index c5c8727a..0b83ef3f 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/LoopFactory.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/LoopFactory.java @@ -183,7 +183,7 @@ public class LoopFactory extends SysdynElementFactory { private IHintListener hoverHintListener; - private static final Key NODE = new SceneGraphNodeKey(HoverShapeNode.class, "LOOP_NODE"); + private static final Key NODE = new SceneGraphNodeKey(LoopNode.class, "LOOP_NODE"); public LoopImageSceneGraph(Image i) { super(i); @@ -194,7 +194,7 @@ public class LoopFactory extends SysdynElementFactory { super.init(e, parent); // Create new hover shape node for the loop image - final HoverShapeNode node = ElementUtils.getOrCreateNode(e, parent, NODE, "loopHover", HoverShapeNode.class); + final LoopNode node = ElementUtils.getOrCreateNode(e, parent, NODE, "loopHover", LoopNode.class); // Mirror the image if clockwise is selected. Boolean clockwise = e.getHint(SysdynElementHints.KEY_LOOP_CLOCKWISE); @@ -225,7 +225,7 @@ public class LoopFactory extends SysdynElementFactory { @Override public void hintChanged(IHintObservable sender, Key key, Object oldValue, Object newValue) { IElement e = (IElement)sender; - HoverShapeNode shape = (HoverShapeNode) e.getHint(NODE); + LoopNode shape = (LoopNode) e.getHint(NODE); if(shape == null) { return; } @@ -266,7 +266,7 @@ public class LoopFactory extends SysdynElementFactory { // Move the text box into (around) the middle of the loop image AffineTransform at = ElementUtils.getTransform(e); - final HoverShapeNode node = ElementUtils.getOrCreateNode(e, parent, NODE, "loopComment", HoverShapeNode.class); + final LoopNode node = ElementUtils.getOrCreateNode(e, parent, NODE, "loopComment", LoopNode.class); // Unflip the text and image unflipText(e); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/LoopNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/LoopNode.java new file mode 100644 index 00000000..11c9c71f --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/LoopNode.java @@ -0,0 +1,232 @@ +/******************************************************************************* + * Copyright (c) 2014 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.ui.elements; + +import java.awt.Color; +import java.awt.Graphics2D; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.utils.ListUtils; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.request.Read; +import org.simantics.diagram.elements.DiagramNodeUtil; +import org.simantics.g2d.element.ElementHints; +import org.simantics.g2d.element.IElement; +import org.simantics.modeling.ModelingResources; +import org.simantics.scenegraph.INode; +import org.simantics.scenegraph.ParentNode; +import org.simantics.scenegraph.g2d.IG2DNode; +import org.simantics.scenegraph.g2d.nodes.ConnectionNode; +import org.simantics.scenegraph.g2d.nodes.spatial.RTreeNode; +import org.simantics.scenegraph.utils.NodeUtil; +import org.simantics.sysdyn.SysdynResource; +import org.simantics.ui.SimanticsUI; + +/** + * Node for Sysdyn loop elements. + * + * @author Tuomas Miettinen + * + */ +public class LoopNode extends HoverShapeNode { + + /** + * Interface for nodes that can be part of loops + * @author Tuomas Miettinen + * + */ + public interface ILoopComponentNode { + + /** + * Sets or resets the loop selected status + * @param loop The loop which has been selected + * @param selected true iff the loop is selected + */ + public void setLoopSelected(LoopNode loop, boolean selected); + + } + + public static Color HIGHLIGHT_COLOR = Color.decode("#ff5fbf"); + + private boolean selected = false; + + private static final long serialVersionUID = 6173159124691715569L; + + @Override + public void render(Graphics2D g2d) { + super.render(g2d); + + // If the loop is selected, highlight also the elements that belong to the loop. + boolean selected = NodeUtil.isSelected(this, 1); + // Do nothing if the selection is and was off. + if (selected || this.selected != selected) { + this.selected = selected; + // Tell all items belonging to the loop that the loop is selected. + setLoopItemsSelected(); + } + } + + private void setLoopItemsSelected() { + // Get all variables and dependencies in the loop. + List loopItems = getAllLoopItems(); + + // Get the diagram where this loop is. + RTreeNode diagramNode = (RTreeNode)NodeUtil.getNearestParentOfType(this, RTreeNode.class); + if (diagramNode == null) + return; + + // Go through all elements on the diagram where this loop is. + Collection children = diagramNode.getNodes(); + Iterator it = children.iterator(); + while (it.hasNext()) { + IG2DNode n = it.next(); + + // Get the respective node + INode child = getNodeOfPossibleLoopComponentNode(n); + if (child instanceof ILoopComponentNode) { + ILoopComponentNode ln = (ILoopComponentNode)child; + // Get the respective element + IElement e = DiagramNodeUtil.getElement((IG2DNode)child.getParent()); + // Get the respective resource + Resource r = e.getHint(ElementHints.KEY_OBJECT); + // If the node belongs to the loop, tell it that whether the loop is selected or not. + ln.setLoopSelected(this, NodeUtil.isSelected(this, 1) && loopItems.contains(r)); + } + } + } + + /** + * Get the ILoopComponentNode under the variable, dependency, or flow. + * @param n node under which the ILoopComponentNode is sought + * @return ILoopComponentNode or null, if there is not any. + */ + private static INode getNodeOfPossibleLoopComponentNode(IG2DNode n) { + // Get all nodeIds of n's children. + Collection nodeIds = ((ParentNode)n).getNodeIds(); + + // Flows and SysdynTextNodes + for (String id : nodeIds) { + if ("text".equals(id) + || id.startsWith("flow_")) + return ((ParentNode)n).getNode(id); + } + + // Dependencies + if (n instanceof ConnectionNode) { + // See the first (and only) child of n has a DependencyNode as a child. + n = ((ConnectionNode) n).getNodes().iterator().next(); + if (n instanceof ParentNode) { + nodeIds = ((ParentNode)n).getNodeIds(); + for (String id : nodeIds) { + if (id.startsWith("edge_")) + return ((ParentNode)n).getNode(id); + } + } + } + + return null; // n was no variable, dependency, or flow + + } + + /** + * Get all variables and dependencies in the loop. + * @return A list where the items are, in unspecified order. + */ + private List getAllLoopItems() { + IElement loopElement = DiagramNodeUtil.getElement(this); + final Resource loopSymbolResource = loopElement.getHint(ElementHints.KEY_OBJECT); + List loopItems = Collections.emptyList(); + + try { + loopItems = SimanticsUI.getSession().syncRequest(new Read>(){ + + @Override + public List perform(ReadGraph graph) throws DatabaseException { + ModelingResources mod = ModelingResources.getInstance(graph); + SysdynResource sr = SysdynResource.getInstance(graph); + Resource loopComponentResource = graph.getPossibleObject(loopSymbolResource, mod.ElementToComponent); + if (loopComponentResource == null) + return Collections.emptyList(); + + Resource loopResource = graph.getPossibleObject(loopComponentResource, sr.Loop_Items); + if (loopResource == null) + return Collections.emptyList(); + + List loopItems = ListUtils.toPossibleList(graph, loopResource); + if (loopItems == null) + return Collections.emptyList(); + + ArrayList dependencyItems = new ArrayList(); + + // Add dependencies and flows. + for (int i = 0; i < loopItems.size(); ++i) { + boolean skipBackwardFlows = false; + + // Go through forward dependencies and flows + Collection forwardDependencies = graph.getObjects(loopItems.get(i), sr.Variable_isTailOf); + for (Resource dependency : forwardDependencies) { + Resource dependingVariable = graph.getSingleObject(dependency, sr.Variable_HasHead); + if (dependingVariable.equals(loopItems.get((i + 1) % loopItems.size()))) { + if (graph.isInstanceOf(dependency, sr.Flow) + && graph.isInstanceOf(loopItems.get(i), sr.Stock)) { + // Flows from stocks don't count. + continue; + } + skipBackwardFlows = true; + dependencyItems.add(graph.getSingleObject(dependency, mod.ConnectionToDiagramConnection)); + break; + } + } + + if (skipBackwardFlows) + continue; + + // Backward flows from stocks. + Collection backwardFlows = graph.getObjects(loopItems.get(i), sr.Variable_isHeadOf); + for (Resource flow : backwardFlows) { + if (graph.isInstanceOf(flow, sr.Flow)) { + Resource dependingVariable = graph.getSingleObject(flow, sr.Variable_HasTail); + if (dependingVariable.equals(loopItems.get((i + 1) % loopItems.size())) + && graph.isInstanceOf(dependingVariable, sr.Stock)) { + dependencyItems.add(graph.getSingleObject(flow, mod.ConnectionToDiagramConnection)); + break; + } + } + } + } + + // Convert variables from component to element. + for (int i = 0; i < loopItems.size(); ++i) { + loopItems.set(i, graph.getPossibleObject(loopItems.get(i), mod.ComponentToElement)); + } + // Merge the two lists. + loopItems.addAll(dependencyItems); + + return loopItems; + } + + }); + } catch (DatabaseException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + return loopItems; + } + +} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/SysdynTextNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/SysdynTextNode.java index 03301917..1d593a39 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/SysdynTextNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/SysdynTextNode.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013 Association for Decentralized Information Management in + * Copyright (c) 2013-2014 Association for Decentralized Information Management in * Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -15,6 +15,7 @@ package org.simantics.sysdyn.ui.elements; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics2D; +import java.util.HashMap; import org.simantics.diagram.elements.TextEditActivation; import org.simantics.diagram.elements.TextNode; @@ -22,6 +23,7 @@ import org.simantics.g2d.canvas.ICanvasContext; import org.simantics.g2d.element.IElement; import org.simantics.scenegraph.g2d.events.EventTypes; import org.simantics.scenegraph.g2d.events.MouseEvent.MouseDragBegin; +import org.simantics.sysdyn.ui.elements.LoopNode.ILoopComponentNode; import org.simantics.sysdyn.ui.utils.SysdynWorkbenchUtils; /** @@ -31,13 +33,18 @@ import org.simantics.sysdyn.ui.utils.SysdynWorkbenchUtils; * 1. Draw borders when hovering * 2. Support Sysdyn's diagram locking * @author Teemu Lempinen + * @author Tuomas Miettinen * */ -public class SysdynTextNode extends TextNode { +public class SysdynTextNode extends TextNode implements ILoopComponentNode { private static final long serialVersionUID = 5235077104121753251L; + private HashMap loopSelectionMap = new HashMap(); + + private boolean isLoopSelected() { + return loopSelectionMap.containsValue(true); + } - @Override public int getEventMask(){ return EventTypes.FocusLostMask | super.getEventMask(); @@ -66,8 +73,16 @@ public class SysdynTextNode extends TextNode { g.setColor(oldColor); g.setStroke(oldStroke); + } else if (isLoopSelected()) { + BasicStroke oldStroke = (BasicStroke)g.getStroke(); + Color oldColor = g.getColor(); + g.setColor(LoopNode.HIGHLIGHT_COLOR); + g.setStroke(new BasicStroke((float)(2.0*scale))); + g.draw(getBoundsInLocal()); + g.setColor(oldColor); + g.setStroke(oldStroke); + } - } public TextEditActivation activateEdit(int mouseId, IElement e, ICanvasContext ctx, boolean save) { @@ -76,4 +91,12 @@ public class SysdynTextNode extends TextNode { return super.activateEdit(mouseId, e, ctx); } + @Override + public void setLoopSelected(LoopNode loop, boolean selected) { + Boolean loopSelected = loopSelectionMap.get(loop); + if (loopSelected == null || loopSelected != selected) { + loopSelectionMap.put(loop, selected); + repaint(); + } + } } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/DependencyNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/DependencyNode.java index 33522c97..96681fcb 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/DependencyNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/DependencyNode.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 Association for Decentralized Information Management in + * Copyright (c) 2010, 2012, 2014 Association for Decentralized Information Management in * Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -24,6 +24,7 @@ import java.awt.geom.Rectangle2D; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Collection; +import java.util.HashMap; import org.simantics.diagram.elements.TextNode; import org.simantics.g2d.utils.Alignment; @@ -38,6 +39,8 @@ import org.simantics.scenegraph.g2d.nodes.ConnectionNode; import org.simantics.scenegraph.g2d.nodes.SingleElementNode; import org.simantics.scenegraph.utils.NodeUtil; import org.simantics.sysdyn.ui.editor.routing.DependencyRouter; +import org.simantics.sysdyn.ui.elements.LoopNode.ILoopComponentNode; +import org.simantics.sysdyn.ui.elements.LoopNode; import org.simantics.sysdyn.ui.elements.SysdynElementHints; import org.simantics.sysdyn.ui.utils.SysdynWorkbenchUtils; import org.simantics.utils.datastructures.Triple; @@ -48,7 +51,7 @@ import org.simantics.utils.datastructures.Triple; * @author Tuomas Miettinen * */ -public class DependencyNode extends TextNode implements ISelectionPainterNode { +public class DependencyNode extends TextNode implements ISelectionPainterNode, ILoopComponentNode { public static final String INSIDE = "Inside"; public static final String OUTSIDE = "Outside"; @@ -216,6 +219,15 @@ public class DependencyNode extends TextNode implements ISelectionPainterNode { g.fill(shapes.second); } if (delayMark) g.draw(shapes.third); + } else if (isLoopSelected()) { + g.setColor(LoopNode.HIGHLIGHT_COLOR); + if(stroke != null) g.setStroke(stroke); + g.draw(shapes.first); + if (arrowHead) { + g.draw(shapes.second); + g.fill(shapes.second); + } + if (delayMark) g.draw(shapes.third); } else { if(color != null) g.setColor(color); if(stroke != null) g.setStroke(stroke); @@ -255,7 +267,12 @@ public class DependencyNode extends TextNode implements ISelectionPainterNode { } boolean pressHit = false; + private HashMap loopSelectionMap = new HashMap(); + private boolean isLoopSelected() { + return loopSelectionMap.containsValue(true); + } + protected boolean hitTest(org.simantics.scenegraph.g2d.events.MouseEvent event, double tolerance) { if(beginBounds == null || endBounds == null) return false; Point2D localPos = NodeUtil.worldToLocal(this, event.controlPosition, new Point2D.Double()); @@ -380,4 +397,13 @@ public class DependencyNode extends TextNode implements ISelectionPainterNode { protected boolean isDragging() { return dragging; } + + @Override + public void setLoopSelected(LoopNode loop, boolean selected) { + Boolean loopSelected = loopSelectionMap.get(loop); + if (loopSelected == null || loopSelected != selected) { + loopSelectionMap.put(loop, selected); + repaint(); + } + } } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/FlowConnectionStyle.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/FlowConnectionStyle.java index 464344ae..a7476de6 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/FlowConnectionStyle.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/FlowConnectionStyle.java @@ -12,6 +12,7 @@ import org.simantics.db.exception.DatabaseException; import org.simantics.db.request.Read; import org.simantics.diagram.connection.rendering.BasicConnectionStyle; import org.simantics.sysdyn.SysdynResource; +import org.simantics.sysdyn.ui.elements.LoopNode; import org.simantics.ui.SimanticsUI; public class FlowConnectionStyle extends BasicConnectionStyle { @@ -22,6 +23,9 @@ public class FlowConnectionStyle extends BasicConnectionStyle { Stroke lineStroke; private Resource resource; + + // Is the default color overridden by the loop color + private boolean loopColorOverride = false; public static final float DEFAULT_LINE_WIDTH = 1.0f; @@ -42,8 +46,8 @@ public class FlowConnectionStyle extends BasicConnectionStyle { @Override public void drawPath(Graphics2D g, Path2D path, boolean isTransient) { - if (lineColor != null) - g.setColor(lineColor); + if (lineColor != null) // Highlight the flow if loop where the flow belongs to is selected. + g.setColor(loopColorOverride ? LoopNode.HIGHLIGHT_COLOR : lineColor); if (lineStroke != null) g.setStroke(lineStroke); @@ -81,5 +85,13 @@ public class FlowConnectionStyle extends BasicConnectionStyle { public double getDegeneratedLineLength() { return 0; } + + /** + * Set if the flow color should be overwritten with loop color + * @param loopColorOverride + */ + public void setLoopColorOverride(boolean loopColorOverride) { + this.loopColorOverride = loopColorOverride; + } } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/RouteFlowEdgeClass.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/RouteFlowEdgeClass.java index c300b646..5061e738 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/RouteFlowEdgeClass.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/RouteFlowEdgeClass.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Copyright (c) 2007, 2011, 2014 Association for Decentralized Information Management in * Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -57,11 +57,7 @@ public class RouteFlowEdgeClass extends RouteGraphConnectionClass { if (rg == null || renderer == null) { cleanup(connection); } else { - RouteFlowNode rgn = connection.getHint(KEY_RG_NODE); - if (rgn == null) { - rgn = parent.addNode(ElementUtils.generateNodeId(connection), RouteFlowNode.class); - connection.setHint(KEY_RG_NODE, rgn); - } + RouteFlowNode rgn = ElementUtils.getOrCreateNode(connection, parent, KEY_RG_NODE, "flow_" + connection.hashCode(), RouteFlowNode.class); rgn.setRouteGraph(rg); rgn.setRenderer(renderer); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/RouteFlowNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/RouteFlowNode.java index 53180969..4a75f082 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/RouteFlowNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/connections/RouteFlowNode.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 Association for Decentralized Information Management in + * Copyright (c) 2013-2014 Association for Decentralized Information Management in * Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -11,8 +11,14 @@ *******************************************************************************/ package org.simantics.sysdyn.ui.elements.connections; +import java.util.HashMap; + +import org.simantics.diagram.connection.rendering.ConnectionStyle; +import org.simantics.diagram.connection.rendering.StyledRouteGraphRenderer; import org.simantics.scenegraph.g2d.events.MouseEvent.MouseDragBegin; import org.simantics.scenegraph.g2d.nodes.connection.RouteGraphNode; +import org.simantics.sysdyn.ui.elements.LoopNode; +import org.simantics.sysdyn.ui.elements.LoopNode.ILoopComponentNode; import org.simantics.sysdyn.ui.elements.SysdynElementHints; import org.simantics.sysdyn.ui.utils.SysdynWorkbenchUtils; @@ -21,11 +27,16 @@ import org.simantics.sysdyn.ui.utils.SysdynWorkbenchUtils; * @author Tuomas Miettinen * */ -public class RouteFlowNode extends RouteGraphNode { +public class RouteFlowNode extends RouteGraphNode implements ILoopComponentNode { private static final long serialVersionUID = 2576929364910319487L; boolean isLock = false; + private HashMap loopSelectionMap = new HashMap(); + private boolean isLoopSelected() { + return loopSelectionMap.containsValue(true); + } + @Override protected boolean mouseDragged(MouseDragBegin e) { // Disable dragging if LockSketch is ON @@ -34,4 +45,28 @@ public class RouteFlowNode extends RouteGraphNode { else return super.mouseDragged(e); } + + @Override + public void setLoopSelected(LoopNode loop, boolean selected) { + Boolean loopSelected = loopSelectionMap.get(loop); + if (loopSelected == null || loopSelected != selected) { + loopSelectionMap.put(loop, selected); + + // Here the FlowConnectionStyle takes care of drawing the flow, so + // find it and tell it to change the color accordingly + if (!(renderer instanceof StyledRouteGraphRenderer)) + return; + + StyledRouteGraphRenderer renderer = (StyledRouteGraphRenderer)this.renderer; + ConnectionStyle style = renderer.getStyle(); + if (!(style instanceof FlowConnectionStyle)) + return; + + FlowConnectionStyle fcs = (FlowConnectionStyle)style; + + fcs.setLoopColorOverride(isLoopSelected()); + repaint(); + } + } + } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/LoopUtils.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/LoopUtils.java index 130ebb08..cfb10396 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/LoopUtils.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/utils/LoopUtils.java @@ -32,7 +32,7 @@ import org.simantics.sysdyn.elementaryCycles.ElementaryCyclesSearch; import org.simantics.ui.SimanticsUI; /** - * Utils for configurations + * Utils for loops * @author Tuomas Miettinen * */ @@ -313,7 +313,6 @@ public class LoopUtils { oddNumberOfNegativeCausalities = !oddNumberOfNegativeCausalities; break; } - continue; } } }