public void render(Graphics2D g) throws SVGException { beginLayer(g); //AffineTransform oldXform = g.getTransform(); AffineTransform oldXform = g.getTransform(); g.transform(refXform); if (href == null || !(href instanceof RenderableElement)) return; RenderableElement rendEle = (RenderableElement)href; rendEle.pushParentContext(this); rendEle.render(g); rendEle.popParentContext(); g.setTransform(oldXform); finishLayer(g); }
public Rectangle2D getBoundingBox() throws SVGException { if (href instanceof ShapeElement) { ShapeElement shapeEle = (ShapeElement)href; shapeEle.pushParentContext(this); Rectangle2D bounds = shapeEle.getBoundingBox(); shapeEle.popParentContext(); bounds = refXform.createTransformedShape(bounds).getBounds2D(); bounds = boundsToParent(bounds); return bounds; } return null; }
protected void build() throws SVGException { super.build(); StyleAttribute sty = new StyleAttribute(); if (getPres(sty.setName("x"))) x = sty.getFloatValueWithUnits(); if (getPres(sty.setName("y"))) y = sty.getFloatValueWithUnits(); if (getPres(sty.setName("width"))) width = sty.getFloatValueWithUnits(); if (getPres(sty.setName("height"))) height = sty.getFloatValueWithUnits(); if (getPres(sty.setName("xlink:href"))) { URI src = sty.getURIValue(getXMLBase()); href = diagram.getUniverse().getElement(src); } //Determine use offset/scale refXform = new AffineTransform(); refXform.translate(this.x, this.y); }
public Shape getShape() { if (href instanceof ShapeElement) { Shape shape = ((ShapeElement)href).getShape(); shape = refXform.createTransformedShape(shape); shape = shapeToParent(shape); return shape; } return null; }
public Shape getShape() { SVGElement ref = diagram.getUniverse().getElement(href); if (ref instanceof ShapeElement) { Shape shape = ((ShapeElement) ref).getShape(); shape = refXform.createTransformedShape(shape); shape = shapeToParent(shape); return shape; } return null; }
public void render(Graphics2D g) throws SVGException { beginLayer(g); //AffineTransform oldXform = g.getTransform(); AffineTransform oldXform = g.getTransform(); g.transform(refXform); SVGElement ref = diagram.getUniverse().getElement(href); if (ref == null || !(ref instanceof RenderableElement)) { return; } RenderableElement rendEle = (RenderableElement) ref; rendEle.pushParentContext(this); rendEle.render(g); rendEle.popParentContext(); g.setTransform(oldXform); finishLayer(g); }
@Override public Shape getShape() { SVGElement ref = diagram.getUniverse().getElement(href); if (ref instanceof ShapeElement) { Shape shape = ((ShapeElement) ref).getShape(); shape = refXform.createTransformedShape(shape); shape = shapeToParent(shape); return shape; } return null; }
public Rectangle2D getBoundingBox() throws SVGException { SVGElement ref = diagram.getUniverse().getElement(href); if (ref instanceof ShapeElement) { ShapeElement shapeEle = (ShapeElement) ref; shapeEle.pushParentContext(this); Rectangle2D bounds = shapeEle.getBoundingBox(); shapeEle.popParentContext(); bounds = refXform.createTransformedShape(bounds).getBounds2D(); bounds = boundsToParent(bounds); return bounds; } return null; }
boolean shapeChange = false; if (getPres(sty.setName("x"))) if (getPres(sty.setName("y"))) if (getPres(sty.setName("width"))) if (getPres(sty.setName("height"))) if (getPres(sty.setName("xlink:href"))) URI src = sty.getURIValue(getXMLBase()); SVGElement newVal = diagram.getUniverse().getElement(src); if (newVal != href) build();
@Override public void render(Graphics2D g) throws SVGException { beginLayer(g); //AffineTransform oldXform = g.getTransform(); AffineTransform oldXform = g.getTransform(); g.transform(refXform); SVGElement ref = diagram.getUniverse().getElement(href); if (ref == null || !(ref instanceof RenderableElement)) { return; } RenderableElement rendEle = (RenderableElement)ref; rendEle.pushParentContext(this); rendEle.render(g); rendEle.popParentContext(); g.setTransform(oldXform); finishLayer(g); }
@Override public Shape getShape() { SVGElement ref = diagram.getUniverse().getElement(href); if (ref instanceof ShapeElement) { Shape shape = ((ShapeElement) ref).getShape(); shape = refXform.createTransformedShape(shape); shape = shapeToParent(shape); return shape; } return null; }
@Override public Rectangle2D getBoundingBox() throws SVGException { SVGElement ref = diagram.getUniverse().getElement(href); if (ref instanceof ShapeElement) { ShapeElement shapeEle = (ShapeElement) ref; shapeEle.pushParentContext(this); Rectangle2D bounds = shapeEle.getBoundingBox(); shapeEle.popParentContext(); bounds = refXform.createTransformedShape(bounds).getBounds2D(); bounds = boundsToParent(bounds); return bounds; } return null; }
@Override public void render(Graphics2D g) throws SVGException { beginLayer(g); //AffineTransform oldXform = g.getTransform(); AffineTransform oldXform = g.getTransform(); g.transform(refXform); SVGElement ref = diagram.getUniverse().getElement(href); if (ref == null || !(ref instanceof RenderableElement)) { return; } RenderableElement rendEle = (RenderableElement)ref; rendEle.pushParentContext(this); rendEle.render(g); rendEle.popParentContext(); g.setTransform(oldXform); finishLayer(g); }
@Override public Rectangle2D getBoundingBox() throws SVGException { SVGElement ref = diagram.getUniverse().getElement(href); if (ref instanceof ShapeElement) { ShapeElement shapeEle = (ShapeElement) ref; shapeEle.pushParentContext(this); Rectangle2D bounds = shapeEle.getBoundingBox(); shapeEle.popParentContext(); bounds = refXform.createTransformedShape(bounds).getBounds2D(); bounds = boundsToParent(bounds); return bounds; } return null; }