Class TransformedShape

    • Field Detail

      • shape

        public Shape shape
        The wrapped shape.
    • Constructor Detail

      • TransformedShape

        public TransformedShape()
        Construct a transformed shape initialized to the identity transform.
      • TransformedShape

        public TransformedShape​(Shape shape,
                                AffineTransform at)
        Construct a transformed shape
    • Method Detail

      • getMatrix

        public void getMatrix​(float[] matrix,
                              int offset)
        Returns the 6 coefficients values.
      • setTransform

        public void setTransform​(float[] matrix,
                                 int offset)
        Set the transform from a flat matrix.
        Parameters:
        matrix - The flat matrix.
        offset - The index of the first element to use in matrix.
      • setTransform

        public void setTransform​(double[] matrix)
        Set the transform from a flat matrix.
        Parameters:
        matrix - The flat matrix.
      • scale

        public void scale​(double s)
        Apply a uniform scale.
      • contains

        public boolean contains​(double x,
                                double y)
        Tests if the specified coordinates are inside the boundary of the Shape.
        Specified by:
        contains in interface Shape
      • contains

        public boolean contains​(Point2D p)
        Tests if a specified Point2D is inside the boundary of the Shape.
        Specified by:
        contains in interface Shape
      • contains

        public boolean contains​(double x,
                                double y,
                                double width,
                                double height)
        Tests if the interior of the Shape entirely contains the specified rectangular area.
        Specified by:
        contains in interface Shape
      • contains

        public boolean contains​(Rectangle2D r)
        Tests if the interior of the Shape entirely contains the specified Rectangle2D. This method might conservatively return false.
        Specified by:
        contains in interface Shape
      • intersects

        public boolean intersects​(double x,
                                  double y,
                                  double width,
                                  double height)
        Tests if the interior of the Shape intersects the interior of a specified rectangular area.
        Specified by:
        intersects in interface Shape
      • intersects

        public boolean intersects​(Rectangle2D r)
        Tests if the interior of the Shape intersects the interior of a specified Rectangle2D. This method might conservatively return true.
        Specified by:
        intersects in interface Shape
      • getBounds2D

        public Rectangle2D getBounds2D()
        Returns a high precision and more accurate bounding box of the Shape than the getBounds method.
        Specified by:
        getBounds2D in interface Shape
      • getPathIterator

        public PathIterator getPathIterator​(AffineTransform at)
        Returns an iterator object that iterates along the Shape boundary and provides access to the geometry of the Shape outline.
        Specified by:
        getPathIterator in interface Shape
      • getPathIterator

        public PathIterator getPathIterator​(AffineTransform at,
                                            double flatness)
        Returns an iterator object that iterates along the Shape boundary and provides access to a flattened view of the Shape outline geometry.
        Specified by:
        getPathIterator in interface Shape