protected void removeMarks() { Iterator<? extends Node> nodes = graph.getNodeIterator(); while (nodes.hasNext()) { Node node = nodes.next(); if (countAttribute == null) node.removeAttribute(countAttribute); } }
/** * Enable (or disable by passing null for countAttribute) an optional * attribute that will be assigned to each node. The value of this attribute * will be an integer different for each computed component. * * @param countAttribute * The name of the attribute to put on each node (pass null to * disable this feature). */ public void setCountAttribute(String countAttribute) { if (this.countAttribute != null && graph != null) { for (Node n : graph) { n.removeAttribute(countAttribute); } } this.countAttribute = countAttribute; publish(countAttribute); }
/** * Removes the attributes used to store internal solution data in the nodes * of the graph. Use this method to free memory. Solution access methods * must not be used after calling this method. */ @Override public void clear() { super.clear(); for (Node node : graph) { Data data = node.getAttribute(resultAttribute); if (data != null) { data.fn = null; data.edgeFromParent = null; } node.removeAttribute(resultAttribute); } }
/** * Removes the attributes used to store internal solution data in the nodes * of the graph. Use this method to free memory. Solution access methods * must not be used after calling this method. */ @Override public void clear() { super.clear(); for (Node node : graph) { Data data = node.getAttribute(resultAttribute); if (data != null) { data.fn = null; data.edgeFromParent = null; } node.removeAttribute(resultAttribute); } }
public void nodeAttributeRemoved(String sourceId, long timeId, String nodeId, String attribute) { if (sinkTime.isNewEvent(sourceId, timeId)) { Node node = g.getNode(nodeId); if (node != null) { sendNodeAttributeRemoved(sourceId, timeId, nodeId, attribute); passYourWay = true; try { node.removeAttribute(attribute); } finally { passYourWay = false; } } } }
public void nodeAttributeRemoved(String sourceId, long timeId, String nodeId, String attribute) { if (sinkTime.isNewEvent(sourceId, timeId)) { Node node = g.getNode(nodeId); if (node != null) { sendNodeAttributeRemoved(sourceId, timeId, nodeId, attribute); passYourWay = true; try { node.removeAttribute(attribute); } finally { passYourWay = false; } } } }
protected void publishPositions() { for (Node n : internalGraph) { if (n.hasAttribute("changed")) { n.removeAttribute("changed"); sendNodeAttributeChanged(sourceId, n.getId(), "xyz", null, new double[] { n.getNumber("x"), n.getNumber("y"), 0 }); } } }
protected void publishPositions() { for (Node n : internalGraph) { if (n.hasAttribute("changed")) { n.removeAttribute("changed"); sendNodeAttributeChanged(sourceId, n.getId(), "xyz", null, new double[] { n.getNumber("x"), n.getNumber("y"), 0 }); } } }
protected void mouseButtonPress(MouseEvent event) { view.requestFocus(); // Unselect all. if (!event.isShiftDown()) { if (types.contains(InteractiveElement.NODE)) { for (Node node : graph) { if (node.hasAttribute("ui.selected")) node.removeAttribute("ui.selected"); } } if (types.contains(InteractiveElement.SPRITE)) { for (GraphicSprite sprite : graph.spriteSet()) { if (sprite.hasAttribute("ui.selected")) sprite.removeAttribute("ui.selected"); } } if (types.contains(InteractiveElement.EDGE)) { for (Edge edge : graph.getEdgeSet()) { if (edge.hasAttribute("ui.selected")) edge.removeAttribute("ui.selected"); } } } }
protected void mouseButtonPress(MouseEvent event) { view.requestFocus(); // Unselect all. if (!event.isShiftDown()) { for (Node node : graph) { if (node.hasAttribute("ui.selected")) node.removeAttribute("ui.selected"); } for (GraphicSprite sprite : graph.spriteSet()) { if (sprite.hasAttribute("ui.selected")) sprite.removeAttribute("ui.selected"); } } }
/** * Set the name of the attribute used to store the number of passes of each * entity on each edge or node. * * @param name * A string giving the passes name. */ public void setPassesAttribute(String name) { if (context.graph != null) { for (Edge e : context.graph.getEachEdge()) { e.addAttribute(name, e.getNumber(context.passesAttribute)); e.removeAttribute(context.passesAttribute); } for (Node n : context.graph) { n.addAttribute(name, n.getNumber(context.passesAttribute)); n.removeAttribute(context.passesAttribute); } } context.passesAttribute = name; }
/** * Set the name of the attribute used to store the number of passes of each * entity on each edge or node. * * @param name * A string giving the passes name. */ public void setPassesAttribute(String name) { if (context.graph != null) { for (Edge e : context.graph.getEachEdge()) { e.addAttribute(name, e.getNumber(context.passesAttribute)); e.removeAttribute(context.passesAttribute); } for (Node n : context.graph) { n.addAttribute(name, n.getNumber(context.passesAttribute)); n.removeAttribute(context.passesAttribute); } } context.passesAttribute = name; }