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.ArrayListlistenersprivate GraphicsNodeselectionNodeprivate RootGraphicsNodeselectionNodeRoot
-
Constructor Summary
Constructors Constructor Description ConcreteTextSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSelectionListener(SelectionListener l)Add a SelectionListener to this Selector's notification list.voidchangeCompleted(GraphicsNodeChangeEvent gnce)Invoked when a change on a graphics node has completedvoidchangeStarted(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 voidcheckSelectGesture(GraphicsNodeEvent evt)voidclearSelection()voiddispatchSelectionEvent(SelectionEvent e)Reports whether the current selection contains any objects.java.lang.ObjectgetSelection()Get the contents of the current selection buffer.private booleanisDeselectGesture(GraphicsNodeEvent evt)booleanisEmpty()Reports whether the current selection contains any objects.private booleanisSelectAllGesture(GraphicsNodeEvent evt)private booleanisSelectContinueGesture(GraphicsNodeEvent evt)private booleanisSelectEndGesture(GraphicsNodeEvent evt)private booleanisSelectStartGesture(GraphicsNodeEvent evt)voidkeyPressed(GraphicsNodeKeyEvent evt)Invoked when a key has been pressed.voidkeyReleased(GraphicsNodeKeyEvent evt)Invoked when a key has been released.voidkeyTyped(GraphicsNodeKeyEvent evt)Invoked when a key has been typed.voidmouseClicked(GraphicsNodeMouseEvent evt)Invoked when the mouse has been clicked on a graphics node.voidmouseDragged(GraphicsNodeMouseEvent evt)Invoked when a mouse button is pressed on a graphics node and then dragged.voidmouseEntered(GraphicsNodeMouseEvent evt)Invoked when the mouse enters a graphics node.voidmouseExited(GraphicsNodeMouseEvent evt)Invoked when the mouse exits a graphics node.voidmouseMoved(GraphicsNodeMouseEvent evt)Invoked when the mouse button has been moved on a node.voidmousePressed(GraphicsNodeMouseEvent evt)Invoked when a mouse button has been pressed on a graphics node.voidmouseReleased(GraphicsNodeMouseEvent evt)Invoked when a mouse button has been released on a graphics node.voidremoveSelectionListener(SelectionListener l)Remove a SelectionListener from this Selector's notification list.private voidreport(GraphicsNodeEvent evt, java.lang.String message)voidsetSelection(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:GraphicsNodeMouseListenerInvoked when the mouse has been clicked on a graphics node.- Specified by:
mouseClickedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mouseDragged
public void mouseDragged(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListenerInvoked when a mouse button is pressed on a graphics node and then dragged.- Specified by:
mouseDraggedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mouseEntered
public void mouseEntered(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListenerInvoked when the mouse enters a graphics node.- Specified by:
mouseEnteredin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mouseExited
public void mouseExited(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListenerInvoked when the mouse exits a graphics node.- Specified by:
mouseExitedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mouseMoved
public void mouseMoved(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListenerInvoked when the mouse button has been moved on a node.- Specified by:
mouseMovedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mousePressed
public void mousePressed(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListenerInvoked when a mouse button has been pressed on a graphics node.- Specified by:
mousePressedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
mouseReleased
public void mouseReleased(GraphicsNodeMouseEvent evt)
Description copied from interface:GraphicsNodeMouseListenerInvoked when a mouse button has been released on a graphics node.- Specified by:
mouseReleasedin interfaceGraphicsNodeMouseListener- Parameters:
evt- the graphics node mouse event
-
keyPressed
public void keyPressed(GraphicsNodeKeyEvent evt)
Description copied from interface:GraphicsNodeKeyListenerInvoked when a key has been pressed.- Specified by:
keyPressedin interfaceGraphicsNodeKeyListener- Parameters:
evt- the graphics node key event
-
keyReleased
public void keyReleased(GraphicsNodeKeyEvent evt)
Description copied from interface:GraphicsNodeKeyListenerInvoked when a key has been released.- Specified by:
keyReleasedin interfaceGraphicsNodeKeyListener- Parameters:
evt- the graphics node key event
-
keyTyped
public void keyTyped(GraphicsNodeKeyEvent evt)
Description copied from interface:GraphicsNodeKeyListenerInvoked when a key has been typed.- Specified by:
keyTypedin interfaceGraphicsNodeKeyListener- Parameters:
evt- the graphics node key event
-
changeStarted
public void changeStarted(GraphicsNodeChangeEvent gnce)
Description copied from interface:GraphicsNodeChangeListenerInvoked when a change has started on a graphics node, but before any changes occure in the graphics node it's self.- Specified by:
changeStartedin interfaceGraphicsNodeChangeListener- Parameters:
gnce- the graphics node change event
-
changeCompleted
public void changeCompleted(GraphicsNodeChangeEvent gnce)
Description copied from interface:GraphicsNodeChangeListenerInvoked when a change on a graphics node has completed- Specified by:
changeCompletedin 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:SelectorGet the contents of the current selection buffer.- Specified by:
getSelectionin 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:
addSelectionListenerin interfaceSelector- Parameters:
l- the SelectionListener to add.
-
removeSelectionListener
public void removeSelectionListener(SelectionListener l)
Remove a SelectionListener from this Selector's notification list.- Specified by:
removeSelectionListenerin interfaceSelector- Parameters:
l- the SelectionListener to be removed.
-
report
private void report(GraphicsNodeEvent evt, java.lang.String message)
-
-