/** * If the first argument is a Node in the referenced GraphPerspective, sets * its selected state to the value of the second argument. An event will be * fired iff the new state is different from the old state. * * @return true if an actual change was made, false otherwise */ public boolean setSelected(final Node node, final boolean newState) { boolean setChanged; if (newState == true) { // set flag to on // don't flag the node if it's not in the graph if (!graph.containsNode(node)) { return false; } setChanged = selectedNodes.add(node); if (setChanged) { fireEvent(node, true); } } else { // set flag to off // a node can't be selected unless it's in the graph setChanged = selectedNodes.remove(node); if (setChanged) { fireEvent(node, false); } } return setChanged; }
if (!graph.containsNode(node)) { continue;
Node childNode = (Node) it.next(); if (gp.containsNode(childNode, false)) { NodeView childNV = graphView.getNodeView(childNode.getRootGraphIndex());
if (!persp.containsNode(twoNodes[1])) throw new IllegalStateException("GraphPersp does not contain node"); if (persp.containsNode(root2Node)) throw new IllegalStateException("GraphPersp contains node from other"); if (persp.containsNode(nodeNotInPersp) || !persp.getRootGraph().containsNode(nodeNotInPersp)) throw new IllegalStateException("GraphPerspective contains node"); if (persp.containsNode(nodeNotInPersp, false)) throw new IllegalStateException("GraphPersp should not contain node"); if (!persp.containsNode(nodeNotInPersp, true)) throw new IllegalStateException("GraphPersp should contain node recur.");