AffineTransform transform = node.getTransform(); if (result != null && transform != null && !transform.isIdentity()) { result = new TransformedShape(result, transform);
public Shape getOutline() { if (oShape != null) return oShape; oShape = pcn.getOutline(); AffineTransform tr = pcn.getTransform(); if (tr != null) oShape = tr.createTransformedShape(oShape); return oShape; } protected void invalidateGeometryCache() {
public Shape getOutline() { if (oShape != null) return oShape; oShape = pcn.getOutline(); AffineTransform tr = pcn.getTransform(); if (tr != null) oShape = tr.createTransformedShape(oShape); return oShape; } protected void invalidateGeometryCache() {
public Shape getOutline() { if (oShape != null) return oShape; oShape = pcn.getOutline(); AffineTransform tr = pcn.getTransform(); if (tr != null) oShape = tr.createTransformedShape(oShape); return oShape; } protected void invalidateGeometryCache() {
/** * 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; }
/** * Returns the bounds of this Rable in the user coordinate system. */ public Rectangle2D getBounds2D(){ if (usePrimitivePaint){ Rectangle2D primitiveBounds = node.getPrimitiveBounds(); if(primitiveBounds == null) return new Rectangle2D.Double(0, 0, 0, 0); return (Rectangle2D)(primitiveBounds.clone()); } // When not using Primitive paint we return out bounds in our // parent's user space. This makes sense since this is the // space that we will draw our selves into (since paint unlike // primitivePaint incorporates the transform from our user // space to our parents user space). Rectangle2D bounds = node.getBounds(); if(bounds == null){ return new Rectangle2D.Double(0, 0, 0, 0); } AffineTransform at = node.getTransform(); if (at != null){ bounds = at.createTransformedShape(bounds).getBounds2D(); } return bounds; }
/** * Returns the bounds of this Rable in the user coordinate system. */ public Rectangle2D getBounds2D(){ if (usePrimitivePaint){ Rectangle2D primitiveBounds = node.getPrimitiveBounds(); if(primitiveBounds == null) return new Rectangle2D.Double(0, 0, 0, 0); return (Rectangle2D)(primitiveBounds.clone()); } // When not using Primitive paint we return out bounds in our // parent's user space. This makes sense since this is the // space that we will draw our selves into (since paint unlike // primitivePaint incorporates the transform from our user // space to our parents user space). Rectangle2D bounds = node.getBounds(); if(bounds == null){ return new Rectangle2D.Double(0, 0, 0, 0); } AffineTransform at = node.getTransform(); if (at != null){ bounds = at.createTransformedShape(bounds).getBounds2D(); } return bounds; }
/** * Returns the bounds of this Rable in the user coordinate system. */ public Rectangle2D getBounds2D(){ if (usePrimitivePaint){ Rectangle2D primitiveBounds = node.getPrimitiveBounds(); if(primitiveBounds == null) return new Rectangle2D.Double(0, 0, 0, 0); return (Rectangle2D)(primitiveBounds.clone()); } // When not using Primitive paint we return out bounds in our // parent's user space. This makes sense since this is the // space that we will draw our selves into (since paint unlike // primitivePaint incorporates the transform from our user // space to our parents user space). Rectangle2D bounds = node.getBounds(); if(bounds == null){ return new Rectangle2D.Double(0, 0, 0, 0); } AffineTransform at = node.getTransform(); if (at != null){ bounds = at.createTransformedShape(bounds).getBounds2D(); } return bounds; }
/** * Returns the outline of this node. */ public Shape getOutline() { if (outline != null) return outline; outline = new GeneralPath(); for (int i = 0; i < count; i++) { Shape childOutline = children[i].getOutline(); if (childOutline != null) { AffineTransform tr = children[i].getTransform(); if (tr != null) { ((GeneralPath)outline).append(tr.createTransformedShape(childOutline), false); } else { ((GeneralPath)outline).append(childOutline, false); } } } return outline; }
/** * Returns the outline of this node. */ public Shape getOutline() { if (outline != null) return outline; outline = new GeneralPath(); for (int i = 0; i < count; i++) { Shape childOutline = children[i].getOutline(); if (childOutline != null) { AffineTransform tr = children[i].getTransform(); if (tr != null) { ((GeneralPath)outline).append(tr.createTransformedShape(childOutline), false); } else { ((GeneralPath)outline).append(childOutline, false); } } } return outline; }
/** * Returns the outline of this node. */ public Shape getOutline() { if (outline != null) return outline; outline = new GeneralPath(); for (int i = 0; i < count; i++) { Shape childOutline = children[i].getOutline(); if (childOutline != null) { AffineTransform tr = children[i].getTransform(); if (tr != null) { ((GeneralPath)outline).append(tr.createTransformedShape(childOutline), false); } else { ((GeneralPath)outline).append(childOutline, false); } } } return outline; }
protected void gatherRegionInfo(BridgeContext ctx, Element rgn, float verticalAlign, List regions) { boolean isStatic = !ctx.isDynamic(); for (Node n = getFirstChild(rgn); n != null; n = getNextSibling(n)) { if (n.getNodeType() != Node.ELEMENT_NODE) { continue; } GraphicsNode gn = isStatic ? (GraphicsNode) flowRegionNodes.get(n) : ctx.getGraphicsNode(n); Shape s = gn.getOutline(); if (s == null) { continue; } AffineTransform at = gn.getTransform(); if (at != null) { s = at.createTransformedShape(s); } regions.add(new RegionInfo(s, verticalAlign)); } }
/** * Returns the transformation matrix from current user units * (i.e., after application of the transform attribute, if any) to * the viewport coordinate system for the nearestViewportElement. */ public AffineTransform getCTM() { GraphicsNode gn = node; AffineTransform ctm = new AffineTransform(); Element elt = e; while (elt != null) { if (elt instanceof SVGFitToViewBox) { AffineTransform at; if (gn instanceof CanvasGraphicsNode) { at = ((CanvasGraphicsNode)gn).getViewingTransform(); } else { at = gn.getTransform(); } if (at != null) { ctm.preConcatenate(at); } break; } AffineTransform at = gn.getTransform(); if (at != null) ctm.preConcatenate(at); elt = SVGCSSEngine.getParentCSSStylableElement(elt); gn = gn.getParent(); } return ctm; }
protected void gatherRegionInfo(BridgeContext ctx, Element rgn, float verticalAlign, List regions) { boolean isStatic = !ctx.isDynamic(); for (Node n = getFirstChild(rgn); n != null; n = getNextSibling(n)) { if (n.getNodeType() != Node.ELEMENT_NODE) { continue; } GraphicsNode gn = isStatic ? (GraphicsNode) flowRegionNodes.get(n) : ctx.getGraphicsNode(n); Shape s = gn.getOutline(); if (s == null) { continue; } AffineTransform at = gn.getTransform(); if (at != null) { s = at.createTransformedShape(s); } regions.add(new RegionInfo(s, verticalAlign)); } }
AffineTransform at = gn.getTransform(); if (at != null) cr2d = at.createTransformedShape(cr2d).getBounds2D();
AffineTransform at = gn.getTransform(); if (at != null) cr2d = at.createTransformedShape(cr2d).getBounds2D();
/** * Returns the transformation matrix from current user units * (i.e., after application of the transform attribute, if any) to * the viewport coordinate system for the nearestViewportElement. */ public AffineTransform getCTM() { GraphicsNode gn = node; AffineTransform ctm = new AffineTransform(); Element elt = e; while (elt != null) { if (elt instanceof SVGFitToViewBox) { AffineTransform at; if (gn instanceof CanvasGraphicsNode) { at = ((CanvasGraphicsNode)gn).getViewingTransform(); } else { at = gn.getTransform(); } if (at != null) { ctm.preConcatenate(at); } break; } AffineTransform at = gn.getTransform(); if (at != null) ctm.preConcatenate(at); elt = SVGCSSEngine.getParentCSSStylableElement(elt); gn = gn.getParent(); } return ctm; }
protected void gatherRegionInfo(BridgeContext ctx, Element rgn, float verticalAlign, List regions) { boolean isStatic = !ctx.isDynamic(); for (Node n = getFirstChild(rgn); n != null; n = getNextSibling(n)) { if (n.getNodeType() != Node.ELEMENT_NODE) { continue; } GraphicsNode gn = isStatic ? (GraphicsNode) flowRegionNodes.get(n) : ctx.getGraphicsNode(n); Shape s = gn.getOutline(); if (s == null) { continue; } AffineTransform at = gn.getTransform(); if (at != null) { s = at.createTransformedShape(s); } regions.add(new RegionInfo(s, verticalAlign)); } }