Package java.awt.geom

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


              }
              if (outlinePaint != null) {
                  g2.setPaint(outlinePaint);
                  g2.draw(path);
              }
              path.transform(AffineTransform.getTranslateInstance(-x, -y));
        }

        public int getIconWidth() {
            return width;
        }
View Full Code Here


        final int height = shape.getBounds().height;
        final GeneralPath path = new GeneralPath(shape);
        return new Icon() {
            public void paintIcon(Component c, Graphics g, int x, int y) {
                Graphics2D g2 = (Graphics2D) g;
                path.transform(AffineTransform.getTranslateInstance(x, y));
                if (fill) {
                    g2.fill(path);
                }
                if (outline) {
                    g2.draw(path);
View Full Code Here

                    g2.fill(path);
                }
                if (outline) {
                    g2.draw(path);
                }
                path.transform(AffineTransform.getTranslateInstance(-x, -y));
            }

            public int getIconWidth() {
                return width;
            }
View Full Code Here

        breaker.createAllSegments();

        GeneralPath outline = breaker.getOutline();

        if (outline != null && xform != null) {
            outline.transform(xform);
        }

        return outline;
    }
View Full Code Here

            // get the resize ratio
            double resize = (iconSize - 9)
                / (bounds.getWidth() > bounds.getHeight() ? bounds
                    .getWidth() : bounds.getHeight()) ;
            // resize graphics
            shape.transform(AffineTransform.getTranslateInstance(
                    -shape.getBounds().getCenterX(),
                    -shape.getBounds().getCenterY()));
           
            shape.transform(AffineTransform.getScaleInstance(resize, resize));
            // now move it to centre of the icon
View Full Code Here

            // resize graphics
            shape.transform(AffineTransform.getTranslateInstance(
                    -shape.getBounds().getCenterX(),
                    -shape.getBounds().getCenterY()));
           
            shape.transform(AffineTransform.getScaleInstance(resize, resize));
            // now move it to centre of the icon
            shape.transform(
                AffineTransform.getTranslateInstance(iconSize / 2, iconSize  / 2));               
           
            Graphics2D g2d = (Graphics2D) g;
View Full Code Here

                    -shape.getBounds().getCenterX(),
                    -shape.getBounds().getCenterY()));
           
            shape.transform(AffineTransform.getScaleInstance(resize, resize));
            // now move it to centre of the icon
            shape.transform(
                AffineTransform.getTranslateInstance(iconSize / 2, iconSize  / 2));               
           
            Graphics2D g2d = (Graphics2D) g;
            g2d.setColor(Color.white);
            g2d.fill(getBounds());
View Full Code Here

          // get the resize ratio
          double resize = (iconSize - 9)
              / (bounds.getWidth() > bounds.getHeight() ? bounds
                  .getWidth() : bounds.getHeight());
          // resize graphics
          shape.transform(AffineTransform.getTranslateInstance(-shape
              .getBounds().getCenterX(), -shape.getBounds()
              .getCenterY()));
 
          shape.transform(AffineTransform
              .getScaleInstance(resize, resize));
View Full Code Here

          // resize graphics
          shape.transform(AffineTransform.getTranslateInstance(-shape
              .getBounds().getCenterX(), -shape.getBounds()
              .getCenterY()));
 
          shape.transform(AffineTransform
              .getScaleInstance(resize, resize));
          // now move it to centre of the icon
          shape.transform(AffineTransform.getTranslateInstance(
              iconSize / 2, iconSize / 2));
 
View Full Code Here

              .getCenterY()));
 
          shape.transform(AffineTransform
              .getScaleInstance(resize, resize));
          // now move it to centre of the icon
          shape.transform(AffineTransform.getTranslateInstance(
              iconSize / 2, iconSize / 2));
 
          Graphics2D g2d = (Graphics2D) g;
          g2d.setColor(Color.white);
          g2d.fill(getBounds());
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.