Package org.apache.batik.swing.gvt
Class TextSelectionManager
java.lang.Object
org.apache.batik.swing.gvt.TextSelectionManager
This class represents an object which manage GVT text nodes selection.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
To implement a GraphicsNodeMouseListener.protected class
The selection overlay.protected class
To implements a selection listener. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JGVTComponent
The associated JGVTComponent.protected TextSelectionManager.MouseListener
The mouse listener.protected Cursor
To store the previous cursor.protected Shape
The selection highlight.protected Overlay
The selection overlay.protected Color
The color of the selection overlay.protected Color
The color of the outline of the selection overlay.static final Cursor
The cursor indicating that a text selection operation is under way.protected SelectionListener
The text selection listener.protected ConcreteTextSelector
The text selector.protected boolean
A flag bit that indicates whether or not the selection overlay is painted in XOR mode. -
Constructor Summary
ConstructorsConstructorDescriptionTextSelectionManager
(JGVTComponent comp, EventDispatcher ed) Creates a new TextSelectionManager. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a selection listener to be notified when the text selection changes in the document.void
Clears the selection.protected Rectangle
The highlight bounds.Returns the current text selection or null if there is none.Returns the selection overlay.Returns the color of the selection overlay.Returns the color of the outline of the selection overlay.boolean
Returns true if the selection overlay is painted in XOR mode, false otherwise.protected Rectangle
void
Remove a selection listener to be notified when the text selection changes in the document.void
setSelection
(Mark start, Mark end) Sets the selected textvoid
setSelectionOverlayColor
(Color color) Sets the color of the selection overlay to the specified color.void
Sets the color of the outline of the selection overlay to the specified color.void
setSelectionOverlayXORMode
(boolean state) Sets whether or not the selection overlay will be painted in XOR mode, depending on the specified parameter.
-
Field Details
-
TEXT_CURSOR
The cursor indicating that a text selection operation is under way. -
textSelector
The text selector. -
component
The associated JGVTComponent. -
selectionOverlay
The selection overlay. -
mouseListener
The mouse listener. -
previousCursor
To store the previous cursor. -
selectionHighlight
The selection highlight. -
textSelectionListener
The text selection listener. -
selectionOverlayColor
The color of the selection overlay. -
selectionOverlayStrokeColor
The color of the outline of the selection overlay. -
xorMode
protected boolean xorModeA flag bit that indicates whether or not the selection overlay is painted in XOR mode.
-
-
Constructor Details
-
TextSelectionManager
Creates a new TextSelectionManager.
-
-
Method Details
-
addSelectionListener
Add a selection listener to be notified when the text selection changes in the document. -
removeSelectionListener
Remove a selection listener to be notified when the text selection changes in the document. -
setSelectionOverlayColor
Sets the color of the selection overlay to the specified color.- Parameters:
color
- the new color of the selection overlay
-
getSelectionOverlayColor
Returns the color of the selection overlay. -
setSelectionOverlayStrokeColor
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
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
Returns the selection overlay. -
getSelection
Returns the current text selection or null if there is none. -
setSelection
Sets the selected text -
clearSelection
public void clearSelection()Clears the selection. -
outset
-
getHighlightBounds
The highlight bounds.
-