Package java.awt.geom

Examples of java.awt.geom.GeneralPath.createTransformedShape()


                    transform.translate(bounds2D.getCenterX(), bounds2D.getCenterY());
                    double min = Math.min(bounds2D.getWidth(), bounds2D.getHeight());
                    double scale = (min + epsilon) / min;
                    transform.scale(scale, scale);
                    transform.translate(-bounds2D.getCenterX(), -bounds2D.getCenterY());
                    halfDoorPath = path.createTransformedShape(transform);
                    break;
                  }
                }
              }               
             
View Full Code Here


        if ((rotate != null) && (angle != 0)) {
            /// we have rotation huston, please spin me
            getTransform().setToRotation(angle, rotate.getX(), rotate.getY());
            s1 = shape1.createTransformedShape(transform);
            s2 = shape2.createTransformedShape(transform);
            s3 = shape3.createTransformedShape(transform);
        }


        if (getHighlightPaint() != null) {
            g2.setPaint(getHighlightPaint());
View Full Code Here

            // draw five gray concentric gridlines
            g2.translate(centerX, centerY);
            g2.setPaint(gridLinePaint);
            g2.setStroke(gridLineStroke);
            for (int i = 5;   i > 0;   i--) {
                Shape scaledGrid = gridShape.createTransformedShape
                    (AffineTransform.getScaleInstance(i / 5.0, i/5.0));
                g2.draw(scaledGrid);
            }

            // get the color for the plot shape.
View Full Code Here

            // draw five gray concentric gridlines
            g2.translate(centerX, centerY);
            g2.setPaint(gridLinePaint);
            g2.setStroke(gridLineStroke);
            for (int i = 5;   i > 0;   i--) {
                Shape scaledGrid = gridShape.createTransformedShape
                    (AffineTransform.getScaleInstance(i / 5.0, i/5.0));
                g2.draw(scaledGrid);
            }

            // get the color for the plot shape.
View Full Code Here

        if ((rotate != null) && (angle != 0)) {
            /// we have rotation huston, please spin me
            getTransform().setToRotation(angle, rotate.getX(), rotate.getY());
            s1 = shape1.createTransformedShape(transform);
            s2 = shape2.createTransformedShape(transform);
            s3 = shape3.createTransformedShape(transform);
        }


        if (getHighlightPaint() != null) {
            g2.setPaint(getHighlightPaint());
View Full Code Here

    public static Shape generatePolygon(int sides, int outsideRadius, int insideRadius, boolean normalize) {
        Shape shape = generatePolygon(sides,outsideRadius,insideRadius);
        if(normalize) {
            Rectangle2D bounds = shape.getBounds2D();
            GeneralPath path = new GeneralPath(shape);
            shape = path.createTransformedShape(
                    AffineTransform.getTranslateInstance(-bounds.getX(), -bounds.getY()));
        }
        return shape;
    }
   
View Full Code Here

        Shape[] shapes = new Shape[count];
        for (int i = 0; i < count; i++) {

            // get transformed glyph shape
            GeneralPath path = (GeneralPath) glyphs.getGlyphOutline(i);
            shapes[i] = path.createTransformedShape(transform);
        }
        return shapes;

    }
View Full Code Here

    protected Shape getBarShadowBounds(double x,double y){
    //if (state!=BAR_MOVE) return null;
    GraphicNode node=(GraphicNode)selected;
      GeneralPath shape=getShape(node);
      return shape.createTransformedShape(AffineTransform.getTranslateInstance(x-x0,y-y0));
    }

    protected GeneralPath getShape(GraphicNode node){
      return ((NetworkRenderer)((NetworkUI)ui).getGraphRenderer()).getShape(node);
    }
View Full Code Here

        if (shape instanceof GeneralPath) {
            final GeneralPath path = (GeneralPath) shape;
            if (overwrite) {
                path.transform(transform);
            } else {
                shape = path.createTransformedShape(transform);
            }
        } else if (shape instanceof Area) {
            final Area area = (Area) shape;
            if (overwrite) {
                area.transform(transform);
View Full Code Here

        if ((rotate != null) && (angle != 0)) {
            /// we have rotation huston, please spin me
            getTransform().setToRotation(angle, rotate.getX(), rotate.getY());
            s1 = shape1.createTransformedShape(transform);
            s2 = shape2.createTransformedShape(transform);
            s3 = shape3.createTransformedShape(transform);
        }


        if (getHighlightPaint() != null) {
            g2.setPaint(getHighlightPaint());
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.