Class SubregionVectorImage

  • All Implemented Interfaces:
    VectorImage

    public class SubregionVectorImage
    extends AbstractVectorImage
    A vector image that consists of a rectangular region within another vector image.
    Since:
    3.0
    Author:
    Chris Jennings
    • Constructor Detail

      • SubregionVectorImage

        public SubregionVectorImage​(AbstractVectorImage sourceImage,
                                    double x,
                                    double y,
                                    double width,
                                    double height)
        Creates a new vector image that consists of a rectangular subregion of a source vector image.
        Parameters:
        sourceImage - the image that this image is a subimage of
        x - the x-offset of the upper-left corner of the subregion
        y - the y-offset of the upper-left corner of the subregion
        width - the width of the subregion
        height - the height of the subregion
      • SubregionVectorImage

        public SubregionVectorImage​(AbstractVectorImage sourceImage,
                                    java.awt.geom.Rectangle2D subregion)
        Creates a new vector image that consists of a rectangular subregion of a source vector image.
        Parameters:
        sourceImage - the image that this image is a subimage of
        subregion - a rectangle that defines the region of the source image covered by this image
    • Method Detail

      • getSourceImage

        public AbstractVectorImage getSourceImage()
        Returns the source image that this image is a subregion of.
        Returns:
        the source image used to create this subimage
      • render

        protected void render​(java.awt.Graphics2D g)
        Description copied from class: AbstractVectorImage
        Renders the vector image into the specified graphics context. The upper left corner of the image should be at (-tx, -ty) and cover an area with width AbstractVectorImage.iw and height AbstractVectorImage.ih. Any changes to the state of the graphics context (stroke, paint, clip, etc.) must be restored before the method returns.
        Specified by:
        render in class AbstractVectorImage
        Parameters:
        g - the graphics context to render the image into