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 classTo implement a GraphicsNodeMouseListener.protected classThe selection overlay.protected classTo implements a selection listener. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JGVTComponentThe associated JGVTComponent.protected TextSelectionManager.MouseListenerThe mouse listener.protected CursorTo store the previous cursor.protected ShapeThe selection highlight.protected OverlayThe selection overlay.protected ColorThe color of the selection overlay.protected ColorThe color of the outline of the selection overlay.static final CursorThe cursor indicating that a text selection operation is under way.protected SelectionListenerThe text selection listener.protected ConcreteTextSelectorThe text selector.protected booleanA 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 TypeMethodDescriptionvoidAdd a selection listener to be notified when the text selection changes in the document.voidClears the selection.protected RectangleThe 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.booleanReturns true if the selection overlay is painted in XOR mode, false otherwise.protected RectanglevoidRemove a selection listener to be notified when the text selection changes in the document.voidsetSelection(Mark start, Mark end) Sets the selected textvoidsetSelectionOverlayColor(Color color) Sets the color of the selection overlay to the specified color.voidSets the color of the outline of the selection overlay to the specified color.voidsetSelectionOverlayXORMode(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
-
clearSelection
public void clearSelection()Clears the selection. -
outset
-
getHighlightBounds
The highlight bounds.
-