|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttemplates.presentation.MouseInterpreter
public class MouseInterpreter
Processes the mouse actions of the user when manipulating a
TemplateEditableCanvas. This is a non-exhaustive list of supported
mouse actions:
TemplateEditableCanvas| Field Summary | |
|---|---|
protected TemplateEditableCanvas |
canvas
The canvas with which the user interacts. |
protected Entity |
connectorOrigin
The entity where the new connector originates when the user starts drawing a new connector. |
protected TemplateDiagram |
diagram
The template diagram in displayed in the canvas. |
protected boolean |
draggedSelection
Information about whether the dragging operation was performed to drag the current selection. |
protected java.awt.Point |
lastDragLocation
The last recorded location of the mouse cursor while the user was dragging. |
protected java.awt.Point |
mouseDownAt
The location of the mouse cursor when the mouse button was depressed last. |
protected DiagramElement |
mouseDownOn
The diagram element under the mouse cursor when the mouse button was depressed last. |
| Constructor Summary | |
|---|---|
MouseInterpreter(TemplateEditableCanvas canvas)
Construct a new mouse interpreter for the given canvas. |
|
| Method Summary | |
|---|---|
protected void |
cancelConnector()
Cancel the drawing of a new connector (e.g., when the user does not finish drawing the connector before engaging in a different activity). |
void |
mouseClicked(java.awt.event.MouseEvent arg0)
|
void |
mouseDragged(java.awt.event.MouseEvent arg0)
|
void |
mouseEntered(java.awt.event.MouseEvent arg0)
Do nothing. |
void |
mouseExited(java.awt.event.MouseEvent arg0)
Do nothing. |
void |
mouseMoved(java.awt.event.MouseEvent arg0)
|
void |
mousePopupTrigger(java.awt.event.MouseEvent arg0)
Show the context (right-click) pop-up menu for the diagram element under the mouse cursor. |
void |
mousePressed(java.awt.event.MouseEvent arg0)
|
void |
mouseReleased(java.awt.event.MouseEvent arg0)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TemplateEditableCanvas canvas
protected TemplateDiagram diagram
protected java.awt.Point mouseDownAt
protected DiagramElement mouseDownOn
null in case there is no such
element.
protected java.awt.Point lastDragLocation
protected boolean draggedSelection
true if the user dragged the
current selection, set to false otherwise.
protected Entity connectorOrigin
| Constructor Detail |
|---|
public MouseInterpreter(TemplateEditableCanvas canvas)
canvas - the canvas for with which the user will interact| Method Detail |
|---|
public void mouseClicked(java.awt.event.MouseEvent arg0)
mouseClicked in interface java.awt.event.MouseListenerpublic void mousePopupTrigger(java.awt.event.MouseEvent arg0)
arg0 - the description of the mouse eventpublic void mouseEntered(java.awt.event.MouseEvent arg0)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent arg0)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent arg0)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent arg0)
mouseReleased in interface java.awt.event.MouseListenerprotected void cancelConnector()
public void mouseDragged(java.awt.event.MouseEvent arg0)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent arg0)
mouseMoved in interface java.awt.event.MouseMotionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||