public class TextSelectionManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
TextSelectionManager.MouseListener
To implement a GraphicsNodeMouseListener.
|
protected class |
TextSelectionManager.SelectionOverlay
The selection overlay.
|
protected class |
TextSelectionManager.TextSelectionListener
To implements a selection listener.
|
Modifier and Type | Field and Description |
---|---|
protected JGVTComponent |
component
The associated JGVTComponent.
|
protected TextSelectionManager.MouseListener |
mouseListener
The mouse listener.
|
protected java.awt.Cursor |
previousCursor
To store the previous cursor.
|
protected java.awt.Shape |
selectionHighlight
The selection highlight.
|
protected Overlay |
selectionOverlay
The selection overlay.
|
protected java.awt.Color |
selectionOverlayColor
The color of the selection overlay.
|
protected java.awt.Color |
selectionOverlayStrokeColor
The color of the outline of the selection overlay.
|
static java.awt.Cursor |
TEXT_CURSOR
The cursor indicating that a text selection operation is under way.
|
protected SelectionListener |
textSelectionListener
The text selection listener.
|
protected ConcreteTextSelector |
textSelector
The text selector.
|
protected boolean |
xorMode
A flag bit that indicates whether or not the selection overlay is
painted in XOR mode.
|
Constructor and Description |
---|
TextSelectionManager(JGVTComponent comp,
EventDispatcher ed)
Creates a new TextSelectionManager.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionListener(SelectionListener sl)
Add a selection listener to be notified when the
text selection changes in the document.
|
void |
clearSelection()
Clears the selection.
|
protected java.awt.Rectangle |
getHighlightBounds()
The highlight bounds.
|
java.lang.Object |
getSelection()
Returns the current text selection or null if there is none.
|
Overlay |
getSelectionOverlay()
Returns the selection overlay.
|
java.awt.Color |
getSelectionOverlayColor()
Returns the color of the selection overlay.
|
java.awt.Color |
getSelectionOverlayStrokeColor()
Returns the color of the outline of the selection overlay.
|
boolean |
isSelectionOverlayXORMode()
Returns true if the selection overlay is painted in XOR mode, false
otherwise.
|
protected java.awt.Rectangle |
outset(java.awt.Rectangle r,
int amount) |
void |
removeSelectionListener(SelectionListener sl)
Remove a selection listener to be notified when the
text selection changes in the document.
|
void |
setSelection(Mark start,
Mark end)
Sets the selected text
|
void |
setSelectionOverlayColor(java.awt.Color color)
Sets the color of the selection overlay to the specified color.
|
void |
setSelectionOverlayStrokeColor(java.awt.Color color)
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.
|
public static final java.awt.Cursor TEXT_CURSOR
protected ConcreteTextSelector textSelector
protected JGVTComponent component
protected Overlay selectionOverlay
protected TextSelectionManager.MouseListener mouseListener
protected java.awt.Cursor previousCursor
protected java.awt.Shape selectionHighlight
protected SelectionListener textSelectionListener
protected java.awt.Color selectionOverlayColor
protected java.awt.Color selectionOverlayStrokeColor
protected boolean xorMode
public TextSelectionManager(JGVTComponent comp, EventDispatcher ed)
public void addSelectionListener(SelectionListener sl)
public void removeSelectionListener(SelectionListener sl)
public void setSelectionOverlayColor(java.awt.Color color)
color
- the new color of the selection overlaypublic java.awt.Color getSelectionOverlayColor()
public void setSelectionOverlayStrokeColor(java.awt.Color color)
color
- the new color of the outline of the selection overlaypublic java.awt.Color getSelectionOverlayStrokeColor()
public void setSelectionOverlayXORMode(boolean state)
state
- true implies the selection overlay will be in XOR modepublic boolean isSelectionOverlayXORMode()
public Overlay getSelectionOverlay()
public java.lang.Object getSelection()
public void clearSelection()
protected java.awt.Rectangle outset(java.awt.Rectangle r, int amount)
protected java.awt.Rectangle getHighlightBounds()
Copyright © 2022 Apache Software Foundation. All Rights Reserved.