Class TextSelection

    • Field Detail

      • pagepanel

        protected final PagePanel pagepanel
      • TYPE_BLOCK

        public static final int TYPE_BLOCK
        A type of highlight which will highlight the selected text using a solid block of (usually translucent) color
        See Also:
        Constant Field Values
      • TYPE_UNDERLINE

        public static final int TYPE_UNDERLINE
        A type of highlight which will highlight the selected text using a single underline.
        Since:
        2.11.4
        See Also:
        Constant Field Values
      • TYPE_DOUBLEUNDERLINE

        public static final int TYPE_DOUBLEUNDERLINE
        A type of highlight which will highlight the selected text using a double underline.
        Since:
        2.11.4
        See Also:
        Constant Field Values
      • TYPE_OUTLINE

        public static final int TYPE_OUTLINE
        A type of highlight which will outline the selected text.
        Since:
        2.11.4
        See Also:
        Constant Field Values
      • TYPE_STRIKEOUT

        public static final int TYPE_STRIKEOUT
        A type of highlight which will strike-out the selected text.
        Since:
        2.11.4
        See Also:
        Constant Field Values
      • TYPE_DOUBLESTRIKEOUT

        public static final int TYPE_DOUBLESTRIKEOUT
        A type of highlight which will strike-out the selected text with a double line
        Since:
        2.11.4
        See Also:
        Constant Field Values
    • Constructor Detail

      • TextSelection

        public TextSelection​(PagePanel panel,
                             int type,
                             Paint color,
                             Stroke stroke,
                             float margin)
    • Method Detail

      • isGlassPane

        public boolean isGlassPane()
        Return true if this panel should be treated as a GlassPane. By default this is the case, in which case the cursor will not be modified just because this panel is visible.
        Since:
        2.11.25
      • contains

        public boolean contains​(int x,
                                int y)
        Overrides:
        contains in class JComponent
      • getRangeList

        protected abstract TextSelection.RangeList getRangeList()
        Return the RangeList that will be highlighted by this TextTool
      • drawHighlight

        public void drawHighlight​(int type,
                                  Paint color,
                                  Stroke stroke,
                                  Graphics2D g,
                                  Shape shape)
        Draw a highlight of a certain type onto the specified graphics.
        Parameters:
        type - the shape type
        color - the Color
        g - the Graphics Object
        shape - for Outline or Block, any shape. For underline types, a GeneralPath of the form (x1,y1, x1,y2, x2,y2, x2,y1)