Package org.apache.batik.gvt

Examples of org.apache.batik.gvt.ShapePainter


        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) {
View Full Code Here


        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;
        }
View Full Code Here

     * Invoked when the geometry of an graphical element has changed.
     */
    protected  void handleGeometryChanged() {
        super.handleGeometryChanged();
        ShapeNode shapeNode = (ShapeNode)node;
        ShapePainter painter =
            PaintServer.convertFillAndStroke(e, shapeNode, ctx);
        shapeNode.setShapePainter(createShapePainter(ctx, e, shapeNode));
    }
View Full Code Here

        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;
        }
View Full Code Here

     * @param shapeNode the shape node that is interested in its shape painter
     */
    protected ShapePainter createShapePainter(BridgeContext ctx,
                                              Element e,
                                              ShapeNode shapeNode) {
        ShapePainter fillAndStroke;
        fillAndStroke = createFillStrokePainter(ctx, e, shapeNode);

        ShapePainter markerPainter = createMarkerPainter(ctx, e, shapeNode);

        Shape shape = shapeNode.getShape();
        ShapePainter painter;

        if (markerPainter != null) {
            if (fillAndStroke != null) {
                CompositeShapePainter cp = new CompositeShapePainter(shape);
                cp.addShapePainter(fillAndStroke);
View Full Code Here

        // 'stroke-linecap'
        // 'stroke-linejoin'
        // 'stroke-miterlimit'
        // 'stroke-dasharray'
        // 'stroke-dashoffset'
        ShapePainter fillAndStroke
            = super.createShapePainter(ctx, e, shapeNode);

        // marker-start
        // marker-mid
        // marker-end
        ShapePainter markerPainter =
            PaintServer.convertMarkers(e, shapeNode, ctx);

        Shape shape = shapeNode.getShape();
        ShapePainter painter;

        if (markerPainter != null) {
            if (fillAndStroke != null) {
                CompositeShapePainter cp = new CompositeShapePainter(shape);
                cp.addShapePainter(fillAndStroke);
View Full Code Here

     * @param shapeNode the shape node that is interested in its shape painter
     */
    protected ShapePainter createShapePainter(BridgeContext ctx,
                                              Element e,
                                              ShapeNode shapeNode) {
        ShapePainter fillAndStroke;
        fillAndStroke = createFillStrokePainter(ctx, e, shapeNode);

        ShapePainter markerPainter = createMarkerPainter(ctx, e, shapeNode);

        Shape shape = shapeNode.getShape();
        ShapePainter painter;

        if (markerPainter != null) {
            if (fillAndStroke != null) {
                CompositeShapePainter cp = new CompositeShapePainter(shape);
                cp.addShapePainter(fillAndStroke);
View Full Code Here

                Shape shape = app.getShape();
                Shape transformedShape = scaleTransform.createTransformedShape(shape);
                shapeNode.setShape(transformedShape);

                // set up the painter for the d part of the glyph
                ShapePainter painter = PaintServer.convertFillAndStroke(
                                      textElement, shapeNode, ctx);
                shapeNode.setShapePainter(painter);

                glyphContentNode.add(shapeNode);
            }
View Full Code Here

        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;
        }
View Full Code Here

                    = scaleTransform.createTransformedShape(shape);

                shapeNode.setShape(transformedShape);

                // set up the painter for the d part of the glyph
                ShapePainter painter = PaintServer.convertFillAndStroke(
                                      textElement, shapeNode, ctx);
                shapeNode.setShapePainter(painter);

                glyphContentNode.add(shapeNode);
            }
View Full Code Here

TOP

Related Classes of org.apache.batik.gvt.ShapePainter

Copyright © 2018 www.massapicom. 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.