Package org.apache.batik.bridge
Class ConcreteTextSelector
- java.lang.Object
-
- org.apache.batik.bridge.ConcreteTextSelector
-
- All Implemented Interfaces:
java.util.EventListener
,GraphicsNodeChangeListener
,GraphicsNodeKeyListener
,GraphicsNodeMouseListener
,Selector
public class ConcreteTextSelector extends java.lang.Object implements Selector
A simple implementation of GraphicsNodeMouseListener for text selection.- Version:
- $Id: ConcreteTextSelector.java 1808888 2017-09-19 14:22:11Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList
listeners
private GraphicsNode
selectionNode
private RootGraphicsNode
selectionNodeRoot
-
Constructor Summary
Constructors Constructor Description ConcreteTextSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSelectionListener(SelectionListener l)
Add a SelectionListener to this Selector's notification list.void
changeCompleted(GraphicsNodeChangeEvent gnce)
Invoked when a change on a graphics node has completedvoid
changeStarted(GraphicsNodeChangeEvent gnce)
Invoked when a change has started on a graphics node, but before any changes occure in the graphics node it's self.protected void
checkSelectGesture(GraphicsNodeEvent evt)
void
clearSelection()
void
dispatchSelectionEvent(SelectionEvent e)
Reports whether the current selection contains any objects.java.lang.Object
getSelection()
Get the contents of the current selection buffer.private boolean
isDeselectGesture(GraphicsNodeEvent evt)
boolean
isEmpty()
Reports whether the current selection contains any objects.private boolean
isSelectAllGesture(GraphicsNodeEvent evt)
private boolean
isSelectContinueGesture(GraphicsNodeEvent evt)
private boolean
isSelectEndGesture(GraphicsNodeEvent evt)
private boolean
isSelectStartGesture(GraphicsNodeEvent evt)
void
keyPressed(GraphicsNodeKeyEvent evt)
Invoked when a key has been pressed.void
keyReleased(GraphicsNodeKeyEvent evt)
Invoked when a key has been released.void
keyTyped(GraphicsNodeKeyEvent evt)
Invoked when a key has been typed.void
mouseClicked(GraphicsNodeMouseEvent evt)
Invoked when the mouse has been clicked on a graphics node.void
mouseDragged(GraphicsNodeMouseEvent evt)
Invoked when a mouse button is pressed on a graphics node and then dragged.void
mouseEntered(GraphicsNodeMouseEvent evt)
Invoked when the mouse enters a graphics node.void
mouseExited(GraphicsNodeMouseEvent evt)
Invoked when the mouse exits a graphics node.void
mouseMoved(GraphicsNodeMouseEvent evt)
Invoked when the mouse button has been moved on a node.void
mousePressed(GraphicsNodeMouseEvent evt)
Invoked when a mouse button has been pressed on a graphics node.void
mouseReleased(GraphicsNodeMouseEvent evt)
Invoked when a mouse button has been released on a graphics node.void
removeSelectionListener(SelectionListener l)
Remove a SelectionListener from this Selector's notification list.private void
report(GraphicsNodeEvent evt, java.lang.String message)
void
setSelection(Mark begin, Mark end)
-
-
-
Field Detail
-
listeners
private java.util.ArrayList listeners
-
selectionNode
private GraphicsNode selectionNode
-
selectionNodeRoot
private RootGraphicsNode selectionNodeRoot
-
-
Method Detail
-
mouseClicked
public void mouseClicked(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListener
Invoked when the mouse has been clicked on a graphics node.- Specified by:
mouseClicked
in interfaceGraphicsNodeMouseListener
- Parameters:
evt
- the graphics node mouse event
-
mouseDragged
public void mouseDragged(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListener
Invoked when a mouse button is pressed on a graphics node and then dragged.- Specified by:
mouseDragged
in interfaceGraphicsNodeMouseListener
- Parameters:
evt
- the graphics node mouse event
-
mouseEntered
public void mouseEntered(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListener
Invoked when the mouse enters a graphics node.- Specified by:
mouseEntered
in interfaceGraphicsNodeMouseListener
- Parameters:
evt
- the graphics node mouse event
-
mouseExited
public void mouseExited(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListener
Invoked when the mouse exits a graphics node.- Specified by:
mouseExited
in interfaceGraphicsNodeMouseListener
- Parameters:
evt
- the graphics node mouse event
-
mouseMoved
public void mouseMoved(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListener
Invoked when the mouse button has been moved on a node.- Specified by:
mouseMoved
in interfaceGraphicsNodeMouseListener
- Parameters:
evt
- the graphics node mouse event
-
mousePressed
public void mousePressed(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListener
Invoked when a mouse button has been pressed on a graphics node.- Specified by:
mousePressed
in interfaceGraphicsNodeMouseListener
- Parameters:
evt
- the graphics node mouse event
-
mouseReleased
public void mouseReleased(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListener
Invoked when a mouse button has been released on a graphics node.- Specified by:
mouseReleased
in interfaceGraphicsNodeMouseListener
- Parameters:
evt
- the graphics node mouse event
-
keyPressed
public void keyPressed(GraphicsNodeKeyEvent evt)
Description copied from interface:GraphicsNodeKeyListener
Invoked when a key has been pressed.- Specified by:
keyPressed
in interfaceGraphicsNodeKeyListener
- Parameters:
evt
- the graphics node key event
-
keyReleased
public void keyReleased(GraphicsNodeKeyEvent evt)
Description copied from interface:GraphicsNodeKeyListener
Invoked when a key has been released.- Specified by:
keyReleased
in interfaceGraphicsNodeKeyListener
- Parameters:
evt
- the graphics node key event
-
keyTyped
public void keyTyped(GraphicsNodeKeyEvent evt)
Description copied from interface:GraphicsNodeKeyListener
Invoked when a key has been typed.- Specified by:
keyTyped
in interfaceGraphicsNodeKeyListener
- Parameters:
evt
- the graphics node key event
-
changeStarted
public void changeStarted(GraphicsNodeChangeEvent gnce)
Description copied from interface:GraphicsNodeChangeListener
Invoked when a change has started on a graphics node, but before any changes occure in the graphics node it's self.- Specified by:
changeStarted
in interfaceGraphicsNodeChangeListener
- Parameters:
gnce
- the graphics node change event
-
changeCompleted
public void changeCompleted(GraphicsNodeChangeEvent gnce)
Description copied from interface:GraphicsNodeChangeListener
Invoked when a change on a graphics node has completed- Specified by:
changeCompleted
in interfaceGraphicsNodeChangeListener
- Parameters:
gnce
- the graphics node change event
-
clearSelection
public void clearSelection()
-
checkSelectGesture
protected void checkSelectGesture(GraphicsNodeEvent evt)
-
isDeselectGesture
private boolean isDeselectGesture(GraphicsNodeEvent evt)
-
isSelectStartGesture
private boolean isSelectStartGesture(GraphicsNodeEvent evt)
-
isSelectEndGesture
private boolean isSelectEndGesture(GraphicsNodeEvent evt)
-
isSelectContinueGesture
private boolean isSelectContinueGesture(GraphicsNodeEvent evt)
-
isSelectAllGesture
private boolean isSelectAllGesture(GraphicsNodeEvent evt)
-
getSelection
public java.lang.Object getSelection()
Description copied from interface:Selector
Get the contents of the current selection buffer.- Specified by:
getSelection
in interfaceSelector
-
isEmpty
public boolean isEmpty()
Reports whether the current selection contains any objects.
-
dispatchSelectionEvent
public void dispatchSelectionEvent(SelectionEvent e)
Reports whether the current selection contains any objects.
-
addSelectionListener
public void addSelectionListener(SelectionListener l)
Add a SelectionListener to this Selector's notification list.- Specified by:
addSelectionListener
in interfaceSelector
- Parameters:
l
- the SelectionListener to add.
-
removeSelectionListener
public void removeSelectionListener(SelectionListener l)
Remove a SelectionListener from this Selector's notification list.- Specified by:
removeSelectionListener
in interfaceSelector
- Parameters:
l
- the SelectionListener to be removed.
-
report
private void report(GraphicsNodeEvent evt, java.lang.String message)
-
-