public void setGraphNodeStyle(GraphNodeStyle style) { if ((style != null) && (this.nodeStyle != style)) { GraphNodeStyle oldStyle = this.nodeStyle; this.nodeStyle = style; // now update the styles on all nodes Collection<GraphNode> nodes = model.getAllNodes(); for (GraphNode node : nodes) { node.setNodeStyle(this.nodeStyle); } firePropertyChange(GRAPH_NODE_STYLE_PROPERTY, oldStyle, this.nodeStyle); } }
protected void addGraphNode(GraphNode node) { // copy the default node style into the node if ((getGraphNodeStyle() != null) && !getGraphNodeStyle().equals(node.getNodeStyle())) { node.setNodeStyle(getGraphNodeStyle()); } // add the node to the canvas if (node instanceof PNode) { addNode((PNode) node); } }