Class Clipper



  • public abstract class Clipper
    extends Object
    This class lets you clip/intersect an arbitrary shape to a Rectangle2D.
    • Constructor Detail

      • Clipper

        public Clipper()
    • Method Detail

      • clipToRect

        public static GeneralPath clipToRect(Shape s,
                                             Rectangle2D r)
        This creates a GeneralPath representing s when clipped to r
        Parameters:
        s - a shape that you want clipped
        r - the rectangle to clip to
        Returns:
        a GeneralPath enclosing the new shape.
      • clipToRect

        public static GeneralPath clipToRect(Shape s,
                                             AffineTransform t,
                                             Rectangle2D r)
        This creates a GeneralPath representing s when clipped to r
        Parameters:
        s - a shape that you want clipped
        t - the transform to transform s by.

        This may be null, indicating that s should not be transformed.

        r - the rectangle to clip to
        Returns:
        a GeneralPath enclosing the new shape.