Class TextSelectionManager

java.lang.Object
org.apache.batik.swing.gvt.TextSelectionManager

public class TextSelectionManager extends Object
This class represents an object which manage GVT text nodes selection.
Version:
$Id: TextSelectionManager.java 1808001 2017-09-11 09:51:29Z ssteiner $
  • Field Details

    • TEXT_CURSOR

      public static final Cursor TEXT_CURSOR
      The cursor indicating that a text selection operation is under way.
    • textSelector

      protected ConcreteTextSelector textSelector
      The text selector.
    • component

      protected JGVTComponent component
      The associated JGVTComponent.
    • selectionOverlay

      protected Overlay selectionOverlay
      The selection overlay.
    • mouseListener

      protected TextSelectionManager.MouseListener mouseListener
      The mouse listener.
    • previousCursor

      protected Cursor previousCursor
      To store the previous cursor.
    • selectionHighlight

      protected Shape selectionHighlight
      The selection highlight.
    • textSelectionListener

      protected SelectionListener textSelectionListener
      The text selection listener.
    • selectionOverlayColor

      protected Color selectionOverlayColor
      The color of the selection overlay.
    • selectionOverlayStrokeColor

      protected Color selectionOverlayStrokeColor
      The color of the outline of the selection overlay.
    • xorMode

      protected boolean xorMode
      A flag bit that indicates whether or not the selection overlay is painted in XOR mode.
    • selection

      Object selection
      The current selection or null if there is none.
  • Constructor Details

  • Method Details

    • addSelectionListener

      public void addSelectionListener(SelectionListener sl)
      Add a selection listener to be notified when the text selection changes in the document.
    • removeSelectionListener

      public void removeSelectionListener(SelectionListener sl)
      Remove a selection listener to be notified when the text selection changes in the document.
    • setSelectionOverlayColor

      public void setSelectionOverlayColor(Color color)
      Sets the color of the selection overlay to the specified color.
      Parameters:
      color - the new color of the selection overlay
    • getSelectionOverlayColor

      public Color getSelectionOverlayColor()
      Returns the color of the selection overlay.
    • setSelectionOverlayStrokeColor

      public void setSelectionOverlayStrokeColor(Color color)
      Sets the color of the outline of the selection overlay to the specified color.
      Parameters:
      color - the new color of the outline of the selection overlay
    • getSelectionOverlayStrokeColor

      public Color getSelectionOverlayStrokeColor()
      Returns the color of the outline of the selection overlay.
    • setSelectionOverlayXORMode

      public void setSelectionOverlayXORMode(boolean state)
      Sets whether or not the selection overlay will be painted in XOR mode, depending on the specified parameter.
      Parameters:
      state - true implies the selection overlay will be in XOR mode
    • isSelectionOverlayXORMode

      public boolean isSelectionOverlayXORMode()
      Returns true if the selection overlay is painted in XOR mode, false otherwise.
    • getSelectionOverlay

      public Overlay getSelectionOverlay()
      Returns the selection overlay.
    • getSelection

      public Object getSelection()
      Returns the current text selection or null if there is none.
    • setSelection

      public void setSelection(Mark start, Mark end)
      Sets the selected text
    • clearSelection

      public void clearSelection()
      Clears the selection.
    • outset

      protected Rectangle outset(Rectangle r, int amount)
    • getHighlightBounds

      protected Rectangle getHighlightBounds()
      The highlight bounds.