Examples of ShapeNode


Examples of org.apache.batik.gvt.ShapeNode

     * @param ctx the bridge context to use
     * @param e the element that describes the graphics node to build
     * @return a graphics node that represents the specified element
     */
    public GraphicsNode createGraphicsNode(BridgeContext ctx, Element e) {
        ShapeNode shapeNode = (ShapeNode)super.createGraphicsNode(ctx, e);
  if (shapeNode == null) {
      return null;
  }
        // delegates to subclasses the shape construction
        buildShape(ctx, e, shapeNode);
        if (shapeNode.getShape() == null) {
      return null; // Disable the rendering if something bad happens
        }
        // 'shape-rendering' and 'color-rendering'
        Map shapeHints = CSSUtilities.convertShapeRendering(e);
        Map colorHints = CSSUtilities.convertColorRendering(e);
        if (shapeHints != null || colorHints != null) {
            RenderingHints hints;
            if (shapeHints == null) {
                hints = new RenderingHints(colorHints);
            } else if (colorHints == null) {
                hints = new RenderingHints(shapeHints);
            } else {
                hints = new RenderingHints(shapeHints);
                hints.putAll(colorHints);
            }
            shapeNode.setRenderingHints(hints);
        }
        return shapeNode;
    }
View Full Code Here

Examples of org.apache.batik.gvt.ShapeNode

    /**
     * Creates a <tt>ShapeNode</tt>.
     */
    protected GraphicsNode instantiateGraphicsNode() {
        return new ShapeNode();
    }
View Full Code Here

Examples of org.apache.batik.gvt.ShapeNode

        // push 'this' as the current BridgeUpdateHandler for subbridges
        if (ctx.isDynamic()) {
            ctx.pushBridgeUpdateHandler(this);
        }

        ShapeNode shapeNode = (ShapeNode)node;
        shapeNode.setShapePainter(createShapePainter(ctx, e, shapeNode));

        // 'this' is no more the current BridgeUpdateHandler
        if (ctx.isDynamic()) {
            ctx.popBridgeUpdateHandler();
        }
View Full Code Here

Examples of org.apache.batik.gvt.ShapeNode

    public void bridgeUpdateCompleted(BridgeUpdateEvent evt) {
        //        System.out.println(">>> ("+e.getLocalName()+" "+node+") update completed "+ evt.getHandlerKey());
        switch(evt.getHandlerKey()) {
        case PaintServer.KEY_FILL: {
            Paint paint = (Paint)evt.getNewValue();
            ShapeNode shapeNode = (ShapeNode)node;
            Shape shape = shapeNode.getShape();
            ShapePainter painter = shapeNode.getShapePainter();
            if (painter instanceof FillShapePainter) {
                FillShapePainter fp = (FillShapePainter)painter;
                fp.setPaint(paint);
                shapeNode.setShapePainter(fp);
            } else if (painter instanceof CompositeShapePainter) {
                CompositeShapePainter cp = (CompositeShapePainter)painter;
                FillShapePainter fp = (FillShapePainter)cp.getShapePainter(0);
                fp.setPaint(paint);
                shapeNode.setShapePainter(cp);
            }
            break;
        } case PaintServer.KEY_STROKE: {
              Paint paint = (Paint)evt.getNewValue();
              ShapeNode shapeNode = (ShapeNode)node;
              Shape shape = shapeNode.getShape();
              ShapePainter painter = shapeNode.getShapePainter();
              if (painter instanceof StrokeShapePainter) {
                  StrokeShapePainter sp = (StrokeShapePainter)painter;
                  sp.setPaint(paint);
                  shapeNode.setShapePainter(sp);
              } else if (painter instanceof CompositeShapePainter) {
                  CompositeShapePainter cp = (CompositeShapePainter)painter;
                  StrokeShapePainter sp =
                      (StrokeShapePainter)cp.getShapePainter(1);
                  sp.setPaint(paint);
                shapeNode.setShapePainter(cp);
              }
              break;
          }
        }
        //        System.out.println("<<< ("+e.getLocalName()+" "+node+") update completed "+ evt.getHandlerKey());
View Full Code Here

Examples of org.apache.batik.gvt.ShapeNode

     * @param ctx the bridge context to use
     * @param e the element that describes the graphics node to build
     * @return a graphics node that represents the specified element
     */
    public GraphicsNode createGraphicsNode(BridgeContext ctx, Element e) {
        ShapeNode shapeNode = (ShapeNode)super.createGraphicsNode(ctx, e);
  if (shapeNode == null) {
      return null;
  }
        // delegates to subclasses the shape construction
        buildShape(ctx, e, shapeNode);
        if (shapeNode.getShape() == null) {
      return null; // Disable the rendering if something bad happens
        }
        // 'shape-rendering' and 'color-rendering'
        RenderingHints hints = CSSUtilities.convertShapeRendering(e, null);
        hints = CSSUtilities.convertColorRendering(e, hints);
        if (hints != null) {
            shapeNode.setRenderingHints(hints);
        }
        return shapeNode;
    }
View Full Code Here

Examples of org.apache.batik.gvt.ShapeNode

    /**
     * Creates a <tt>ShapeNode</tt>.
     */
    protected GraphicsNode instantiateGraphicsNode() {
        return new ShapeNode();
    }
View Full Code Here

Examples of org.apache.batik.gvt.ShapeNode

     * @param node the graphics node to build
     */
    public void buildGraphicsNode(BridgeContext ctx,
                                  Element e,
                                  GraphicsNode node) {
        ShapeNode shapeNode = (ShapeNode)node;
        shapeNode.setShapePainter(createShapePainter(ctx, e, shapeNode));
        super.buildGraphicsNode(ctx, e, node);
    }
View Full Code Here

Examples of org.apache.batik.gvt.ShapeNode

        case SVGCSSEngine.STROKE_MITERLIMIT_INDEX:
        case SVGCSSEngine.STROKE_DASHARRAY_INDEX:
        case SVGCSSEngine.STROKE_DASHOFFSET_INDEX: {
            if (!hasNewShapePainter) {
                hasNewShapePainter = true;
                ShapeNode shapeNode = (ShapeNode)node;
                ShapePainter painter =
                    PaintServer.convertFillAndStroke(e, shapeNode, ctx);
                shapeNode.setShapePainter(createShapePainter(ctx, e, shapeNode));
            }
            break;
        }
        case SVGCSSEngine.SHAPE_RENDERING_INDEX: {
            RenderingHints hints = node.getRenderingHints();
View Full Code Here

Examples of org.apache.batik.gvt.ShapeNode

            }
            path.setWindingRule(wr);
            Shape outline = Tx.createTransformedShape(path);

            // apply the 'clip-path' of the current clipPath's child
            ShapeNode outlineNode = new ShapeNode();
            outlineNode.setShape(outline);
            ClipRable clip = CSSUtilities.convertClipPath(child,
                                                          outlineNode,
                                                          ctx);
            if (clip != null) {
                Area area = new Area(outline);
                area.subtract(new Area(clip.getClipPath()));
                outline = area;
            }
            clipPath.add(new Area(outline));
        }
        if (!hasChildren) {
            return null; // empty clipPath
        }

        // construct the shape node that represents the clipPath
        ShapeNode clipPathNode = new ShapeNode();
        clipPathNode.setShape(clipPath);

        // apply the 'clip-path' of the clipPath element (already in user space)
        ClipRable clipElementClipPath =
            CSSUtilities.convertClipPath(clipElement, clipPathNode, ctx);
        if (clipElementClipPath != null) {
View Full Code Here

Examples of org.apache.batik.gvt.ShapeNode

     * @param ctx the bridge context to use
     * @param e the element that describes the graphics node to build
     * @return a graphics node that represents the specified element
     */
    public GraphicsNode createGraphicsNode(BridgeContext ctx, Element e) {
        ShapeNode shapeNode = (ShapeNode)super.createGraphicsNode(ctx, e);
  if (shapeNode == null) {
      return null;
  }
        // delegates to subclasses the shape construction
        buildShape(ctx, e, shapeNode);
        if (shapeNode.getShape() == null) {
      return null; // Disable the rendering if something bad happens
        }
        // 'shape-rendering' and 'color-rendering'
        RenderingHints hints = CSSUtilities.convertShapeRendering(e, null);
        hints = CSSUtilities.convertColorRendering(e, hints);
        if (hints != null) {
            shapeNode.setRenderingHints(hints);
        }
        return shapeNode;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.