Class AbstractRegionSelector

    • Constructor Detail

      • AbstractRegionSelector

        protected AbstractRegionSelector​(java.lang.String name)
    • Method Detail

      • setRegionShape

        public void setRegionShape​(java.awt.Shape shape)

        Set the region that is being selected with this operation. Any shape can be specified, but if the shape is a rectangle then it has extended functionality: the width or height of the rectangle can be 0 (to select a line or point), or Float.NaN to allow stretching in that dimension. So, for example, to allow the selection of a Rectangle of any size, pass in new Rectangle2D.Float(0, 0, Float.NaN, Float.NaN) (this is also the default value).

        The specified shape is in PDF coordinates, and they will be clipped to the dimensions of the page. The "x" and "y" values of the shape are ignored.

        Since:
        2.24.1
      • createRubberBoxComponent

        protected javax.swing.JComponent createRubberBoxComponent()
        Create the JComponent that it used to display the "rubber box". If you need to display some custom appearance when overriding this class, this method should be overridden.
        Since:
        2.11.7
      • paintRubberBandComponent

        public void paintRubberBandComponent​(javax.swing.JComponent component,
                                             java.awt.Graphics2D g)
        Paint the component while the "rubber band" box is being stretched. This method may be overriden if something is to be painted inside the box during this time.
        Parameters:
        component - the "rubber band" box being drawn
        g - the Graphic2D object to draw on.
      • action

        public void action​(PagePanel panel,
                           java.awt.geom.Point2D start,
                           java.awt.geom.Point2D end)
        Called when an area of the PDF has been selected.
        Parameters:
        panel - the PagePanel the selection was made on.
        start - the start point of the selection, in PDF-units
        end - the end point of the selection, in PDF-units