org.apache.batik.swing.gvt
Class TextSelectionManager

java.lang.Object
  |
  +--org.apache.batik.swing.gvt.TextSelectionManager

public class TextSelectionManager
extends java.lang.Object

This class represents an object which manage GVT text nodes selection.


Inner Class Summary
protected  class TextSelectionManager.MouseListener
          To implement a GraphicsNodeMouseListener.
protected  class TextSelectionManager.SelectionOverlay
          The selection overlay.
protected  class TextSelectionManager.TextSelectionListener
          To implements a selection listener.
 
Field Summary
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 Summary
TextSelectionManager(JGVTComponent comp, AWTEventDispatcher ed)
          Creates a new TextSelectionManager.
 
Method Summary
 void clearSelection()
          Clears the selection.
protected  java.awt.Rectangle getHighlightBounds()
          The highlight bounds.
 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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT_CURSOR

public static final java.awt.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 java.awt.Cursor previousCursor
To store the previous cursor.

selectionHighlight

protected java.awt.Shape selectionHighlight
The selection highlight.

textSelectionListener

protected SelectionListener textSelectionListener
The text selection listener.

selectionOverlayColor

protected java.awt.Color selectionOverlayColor
The color of the selection overlay.

selectionOverlayStrokeColor

protected java.awt.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.
Constructor Detail

TextSelectionManager

public TextSelectionManager(JGVTComponent comp,
                            AWTEventDispatcher ed)
Creates a new TextSelectionManager.
Method Detail

setSelectionOverlayColor

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

getSelectionOverlayColor

public java.awt.Color getSelectionOverlayColor()
Returns the color of the selection overlay.

setSelectionOverlayStrokeColor

public void setSelectionOverlayStrokeColor(java.awt.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 java.awt.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.

setSelection

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

clearSelection

public void clearSelection()
Clears the selection.

outset

protected java.awt.Rectangle outset(java.awt.Rectangle r,
                                    int amount)

getHighlightBounds

protected java.awt.Rectangle getHighlightBounds()
The highlight bounds.


Copyright © 2002 Apache Software Foundation. All Rights Reserved.