/** * 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; }
@Override public Dimension getDimension(Document document) { UserAgent agent = new UserAgentAdapter(); DocumentLoader loader = new DocumentLoader(agent); BridgeContext context = new BridgeContext(agent, loader); context.setDynamic(true); GVTBuilder builder = new GVTBuilder(); Rectangle2D primitiveBounds = builder.build(context, document).getPrimitiveBounds(); return new Dimension((float)primitiveBounds.getWidth(), (float)primitiveBounds.getHeight()); } }
Rectangle2D bounds2D = node.getPrimitiveBounds(); if (bounds2D == null) bounds2D = new Rectangle2D.Float(0,0,1,1); if (!usePrimitivePaint) {
Rectangle2D bounds2D = node.getPrimitiveBounds(); if (bounds2D == null) bounds2D = new Rectangle2D.Float(0,0,1,1); if (!usePrimitivePaint) {
Rectangle2D bounds2D = node.getPrimitiveBounds(); if (bounds2D == null) bounds2D = new Rectangle2D.Float(0,0,1,1); if (!usePrimitivePaint) {
public Rectangle getBounds(GraphicsNode rootGN) { Rectangle2D r2d; switch (this) { case sensitive: r2d = rootGN.getSensitiveBounds(); break; case geometry: r2d = rootGN.getGeometryBounds(); break; case primitive: r2d = rootGN.getPrimitiveBounds(); break; case all: default: r2d = rootGN.getBounds(); break; } return r2d.getBounds(); }
public Rectangle getBounds(GraphicsNode rootGN) { Rectangle2D r2d; switch (this) { case sensitive: r2d = rootGN.getSensitiveBounds(); break; case geometry: r2d = rootGN.getGeometryBounds(); break; case primitive: r2d = rootGN.getPrimitiveBounds(); break; case all: default: r2d = rootGN.getBounds(); break; } return r2d.getBounds(); }
return (Rectangle2D)gn.getPrimitiveBounds().clone(); r2d = addBounds(cgn, child, r2d); } else { Rectangle2D gnb = gn.getPrimitiveBounds(); if (gnb != null) r2d.add(gnb);
return (Rectangle2D)gn.getPrimitiveBounds().clone(); r2d = addBounds(cgn, child, r2d); } else { Rectangle2D gnb = gn.getPrimitiveBounds(); if (gnb != null) r2d.add(gnb);
return (Rectangle2D)gn.getPrimitiveBounds().clone(); r2d = addBounds(cgn, child, r2d); } else { Rectangle2D gnb = gn.getPrimitiveBounds(); if (gnb != null) r2d.add(gnb);