Class SelectionInteractor
- java.lang.Object
-
- com.bc.ceres.swing.figure.AbstractInteractor
-
- com.bc.ceres.swing.figure.ViewportInteractor
-
- com.bc.ceres.swing.figure.FigureEditorInteractor
-
- com.bc.ceres.swing.figure.interactions.SelectionInteractor
-
- All Implemented Interfaces:
Interactor
,KeyListener
,MouseListener
,MouseMotionListener
,EventListener
public class SelectionInteractor extends FigureEditorInteractor
Interactor for selecting and moving figures and figure points.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SelectionInteractor.MoveHandleTool
protected class
SelectionInteractor.MoveSelectionTool
protected class
SelectionInteractor.SelectPointTool
protected class
SelectionInteractor.SelectRectangleTool
protected static interface
SelectionInteractor.Tool
-
Field Summary
Fields Modifier and Type Field Description protected boolean
canceled
protected Point
referencePoint
-
Constructor Summary
Constructors Constructor Description SelectionInteractor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelInteraction(InputEvent event)
protected SelectionInteractor.MoveHandleTool
createMoveHandleTool()
protected SelectionInteractor.MoveSelectionTool
createMoveSelectionTool()
protected SelectionInteractor.SelectPointTool
createSelectPointTool()
protected SelectionInteractor.SelectRectangleTool
createSelectRectangleTool()
protected boolean
isMouseOverSelection(MouseEvent event)
void
keyPressed(KeyEvent event)
Invoked when a key has been pressed.void
keyReleased(KeyEvent event)
Invoked when a key has been released.void
mouseDragged(MouseEvent event)
Invoked when a mouse button is pressed on a component and then dragged.void
mouseMoved(MouseEvent event)
Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.void
mousePressed(MouseEvent event)
Invoked when a mouse button has been pressed on a component.void
mouseReleased(MouseEvent event)
Invoked when a mouse button has been released on a component.-
Methods inherited from class com.bc.ceres.swing.figure.FigureEditorInteractor
getFigureEditor, getViewport
-
Methods inherited from class com.bc.ceres.swing.figure.ViewportInteractor
getModelToViewTransform, getViewToModelTransform, toModelPoint, toModelPoint, toModelShape
-
Methods inherited from class com.bc.ceres.swing.figure.AbstractInteractor
activate, addListener, deactivate, getCursor, getListeners, isActive, isLeftMouseButtonDown, isMultiButton1Click, isSingleButton1Click, keyTyped, mouseClicked, mouseEntered, mouseExited, removeListener, startInteraction, stopInteraction
-
-
-
-
Field Detail
-
canceled
protected boolean canceled
-
referencePoint
protected Point referencePoint
-
-
Method Detail
-
cancelInteraction
public void cancelInteraction(InputEvent event)
- Overrides:
cancelInteraction
in classAbstractInteractor
-
mousePressed
public void mousePressed(MouseEvent event)
Description copied from class:AbstractInteractor
Invoked when a mouse button has been pressed on a component.The default implementation does nothing.
- Specified by:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classAbstractInteractor
- Parameters:
event
- The mouse event.
-
mouseDragged
public void mouseDragged(MouseEvent event)
Description copied from class:AbstractInteractor
Invoked when a mouse button is pressed on a component and then dragged.MOUSE_DRAGGED
events will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).Due to platform-dependent Drag&Drop implementations,
MOUSE_DRAGGED
events may not be delivered during a native Drag&Drop operation.The default implementation does nothing.
- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Overrides:
mouseDragged
in classAbstractInteractor
- Parameters:
event
- The mouse event.
-
mouseReleased
public void mouseReleased(MouseEvent event)
Description copied from class:AbstractInteractor
Invoked when a mouse button has been released on a component.The default implementation does nothing.
- Specified by:
mouseReleased
in interfaceMouseListener
- Overrides:
mouseReleased
in classAbstractInteractor
- Parameters:
event
- The mouse event.
-
mouseMoved
public void mouseMoved(MouseEvent event)
Description copied from class:AbstractInteractor
Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.The default implementation does nothing.
- Specified by:
mouseMoved
in interfaceMouseMotionListener
- Overrides:
mouseMoved
in classAbstractInteractor
- Parameters:
event
- The mouse event.
-
keyPressed
public void keyPressed(KeyEvent event)
Description copied from class:AbstractInteractor
Invoked when a key has been pressed. See the class description forKeyEvent
for a definition of a key pressed event.The default implementation does nothing.
- Specified by:
keyPressed
in interfaceKeyListener
- Overrides:
keyPressed
in classAbstractInteractor
- Parameters:
event
- The key event.
-
keyReleased
public void keyReleased(KeyEvent event)
Description copied from class:AbstractInteractor
Invoked when a key has been released. See the class description forKeyEvent
for a definition of a key released event.The default implementation does nothing.
- Specified by:
keyReleased
in interfaceKeyListener
- Overrides:
keyReleased
in classAbstractInteractor
- Parameters:
event
- The key event.
-
createSelectPointTool
protected SelectionInteractor.SelectPointTool createSelectPointTool()
-
createSelectRectangleTool
protected SelectionInteractor.SelectRectangleTool createSelectRectangleTool()
-
createMoveSelectionTool
protected SelectionInteractor.MoveSelectionTool createMoveSelectionTool()
-
createMoveHandleTool
protected SelectionInteractor.MoveHandleTool createMoveHandleTool()
-
isMouseOverSelection
protected boolean isMouseOverSelection(MouseEvent event)
-
-