/** * Returns the parent of the current <code>GraphicsNode</code>. If the * current graphics node has no parent, returns null and retains * the current node. */ public GraphicsNode parentGraphicsNode() { // Don't ascend above treeRoot. if (currentNode == treeRoot) return null; GraphicsNode result = currentNode.getParent(); if (result != null) { currentNode = result; } return result; }
/** * Returns the parent of the current <code>GraphicsNode</code>. If the * current graphics node has no parent, returns null and retains * the current node. */ public GraphicsNode parentGraphicsNode() { // Don't ascend above treeRoot. if (currentNode == treeRoot) return null; GraphicsNode result = currentNode.getParent(); if (result != null) { currentNode = result; } return result; }
/** * Returns the parent of the current <code>GraphicsNode</code>. If the * current graphics node has no parent, returns null and retains * the current node. */ public GraphicsNode parentGraphicsNode() { // Don't ascend above treeRoot. if (currentNode == treeRoot) return null; GraphicsNode result = currentNode.getParent(); if (result != null) { currentNode = result; } return result; }
/** * Returns the index in this children list of the last occurence of the * specified graphics node, or -1 if the list does not contain this graphics * node. * * @param node the graphics node to search for */ public int lastIndexOf(Object node) { if (node == null || !(node instanceof GraphicsNode)) { return -1; } if (((GraphicsNode) node).getParent() == this) { for (int i = count-1; i >= 0; i--) { if (node == children[i]) { return i; } } } return -1; }
protected static GraphicsNode getPreviousSibling(GraphicsNode node) { CompositeGraphicsNode parent = node.getParent(); if (parent == null) { return null; } List children = parent.getChildren(); if (children == null) { return null; } int index = children.indexOf(node); if (index-1 >= 0) { return (GraphicsNode)children.get(index-1); } else { return null; } }
protected static GraphicsNode getPreviousSibling(GraphicsNode node) { CompositeGraphicsNode parent = node.getParent(); if (parent == null) { return null; } List children = parent.getChildren(); if (children == null) { return null; } int index = children.indexOf(node); if (index-1 >= 0) { return (GraphicsNode)children.get(index-1); } else { return null; } }
protected static GraphicsNode getPreviousSibling(GraphicsNode node) { CompositeGraphicsNode parent = node.getParent(); if (parent == null) { return null; } List children = parent.getChildren(); if (children == null) { return null; } int index = children.indexOf(node); if (index-1 >= 0) { return (GraphicsNode)children.get(index-1); } else { return null; } }
protected static GraphicsNode getNextSibling(GraphicsNode node) { CompositeGraphicsNode parent = node.getParent(); if (parent == null) { return null; } List children = parent.getChildren(); if (children == null) { return null; } int index = children.indexOf(node); if (index+1 < children.size()) { return (GraphicsNode)children.get(index+1); } else { return null; } } }
protected static GraphicsNode getNextSibling(GraphicsNode node) { CompositeGraphicsNode parent = node.getParent(); if (parent == null) { return null; } List children = parent.getChildren(); if (children == null) { return null; } int index = children.indexOf(node); if (index+1 < children.size()) { return (GraphicsNode)children.get(index+1); } else { return null; } } }
protected static GraphicsNode getNextSibling(GraphicsNode node) { CompositeGraphicsNode parent = node.getParent(); if (parent == null) { return null; } List children = parent.getChildren(); if (children == null) { return null; } int index = children.indexOf(node); if (index+1 < children.size()) { return (GraphicsNode)children.get(index+1); } else { return null; } } }
/** * Invoked when a bindable element's binding has changed. */ public void handleBindingEvent(Element bindableElement, Element shadowTree) { CompositeGraphicsNode gn = node.getParent(); gn.remove(node); disposeTree(e); handleElementAdded(gn, e.getParentNode(), e); }
/** * Invoked when a bindable element's binding has changed. */ public void handleBindingEvent(Element bindableElement, Element shadowTree) { CompositeGraphicsNode gn = node.getParent(); gn.remove(node); disposeTree(e); handleElementAdded(gn, e.getParentNode(), e); }
/** * Invoked when a bindable element's binding has changed. */ public void handleBindingEvent(Element bindableElement, Element shadowTree) { CompositeGraphicsNode gn = node.getParent(); gn.remove(node); disposeTree(e); handleElementAdded(gn, e.getParentNode(), e); }
protected GraphicsNode getPreviousGraphicsNode(GraphicsNode node) { if (node == null) { return null; } // The previous of root is null if (node == treeRoot) { return null; } GraphicsNode n = getPreviousSibling(node); // Go to the parent of a first child if (n == null) { return node.getParent(); } // Go to the last child of child... GraphicsNode t; while ((t = getLastChild(n)) != null) { n = t; } return n; }
/** * Returns the concatenated transform of this node. That is, this * node's transform preconcatenated with it's parent's transforms. */ public AffineTransform getGlobalTransform(){ AffineTransform ctm = new AffineTransform(); GraphicsNode node = this; while (node != null) { if(node.getTransform() != null){ ctm.preConcatenate(node.getTransform()); } node = node.getParent(); } return ctm; }
/** * Returns the concatenated transform of this node. That is, this * node's transform preconcatenated with it's parent's transforms. */ public AffineTransform getGlobalTransform(){ AffineTransform ctm = new AffineTransform(); GraphicsNode node = this; while (node != null) { if(node.getTransform() != null){ ctm.preConcatenate(node.getTransform()); } node = node.getParent(); } return ctm; }
/** * Returns the concatenated transform of this node. That is, this * node's transform preconcatenated with it's parent's transforms. */ public AffineTransform getGlobalTransform(){ AffineTransform ctm = new AffineTransform(); GraphicsNode node = this; while (node != null) { if(node.getTransform() != null){ ctm.preConcatenate(node.getTransform()); } node = node.getParent(); } return ctm; }
/** * Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired. */ public void handleDOMNodeRemovedEvent(MutationEvent evt) { Node parent = e.getParentNode(); if (parent instanceof SVGOMElement) { SVGContext bridge = ((SVGOMElement) parent).getSVGContext(); if (bridge instanceof SVGSwitchElementBridge) { ((SVGSwitchElementBridge) bridge).handleChildElementRemoved(e); return; } } CompositeGraphicsNode gn = node.getParent(); gn.remove(node); disposeTree(e); }
/** * Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired. */ public void handleDOMNodeRemovedEvent(MutationEvent evt) { Node parent = e.getParentNode(); if (parent instanceof SVGOMElement) { SVGContext bridge = ((SVGOMElement) parent).getSVGContext(); if (bridge instanceof SVGSwitchElementBridge) { ((SVGSwitchElementBridge) bridge).handleChildElementRemoved(e); return; } } CompositeGraphicsNode gn = node.getParent(); gn.remove(node); disposeTree(e); }
/** * Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired. */ public void handleDOMNodeRemovedEvent(MutationEvent evt) { Node parent = e.getParentNode(); if (parent instanceof SVGOMElement) { SVGContext bridge = ((SVGOMElement) parent).getSVGContext(); if (bridge instanceof SVGSwitchElementBridge) { ((SVGSwitchElementBridge) bridge).handleChildElementRemoved(e); return; } } CompositeGraphicsNode gn = node.getParent(); gn.remove(node); disposeTree(e); }