Search this API

y.view
Class ViewMode

java.lang.Object
  extended by y.view.ViewMode
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, javax.swing.event.MouseInputListener
Direct Known Subclasses:
AbstractSelectionBoxMode, AutoDragViewMode, CellEditorMode, CreateChildEdgeMode, CreateEdgeMode, EditMode, HotSpotMode, InteractiveViewMode, MagnifierViewMode, MouseInputMode, MoveLabelMode, MoveNodePortMode, MovePortMode, MoveSelectionMode, MoveViewPortMode, NavigationMode, OrthogonalMoveBendsMode, PopupMode, TooltipMode

public class ViewMode
extends java.lang.Object
implements javax.swing.event.MouseInputListener

This class handles events coming from a Graph2DView. Events are mouse events like mouse button pressed, mouse button released, etc. on a certain position in the view. Depending on the event, a method of the view mode is invoked with coordinates of the mouse pointer as argument. The coordinates are world coordinates. If the view is in grid mode, these coordinates are always grid coordinates.

A ViewMode can have a child, in this case all events are delegated to the child.

 

Field Summary
static java.lang.String ACTIVE_PROPERTY
          Property name constant used for PropertyChangeEvent.getPropertyName().
static java.lang.String ACTIVE_VIEW_PROPERTY
          Property name constant used for PropertyChangeEvent.getPropertyName().
static java.lang.String CHILD_MODE_PROPERTY
          Property name constant used for PropertyChangeEvent.getPropertyName().
static java.lang.String EDITING_PROPERTY
          Property name constant used for PropertyChangeEvent.getPropertyName().
static java.lang.String GRAB_FOCUS_ENABLED_PROPERTY
          Property name constant used for PropertyChangeEvent.getPropertyName().
protected  java.awt.event.MouseEvent lastClickEvent
          Stores last mouse event received via mouseClicked(MouseEvent)
protected  java.awt.event.MouseEvent lastDragEvent
          Stores last mouse event received via mouseDragged(MouseEvent)
protected  java.awt.event.MouseEvent lastMoveEvent
          Stores last mouse event received via mouseMoved(java.awt.event.MouseEvent)
protected  java.awt.event.MouseEvent lastPressEvent
          Stores last mouse event received via mousePressed(MouseEvent)
protected  java.awt.event.MouseEvent lastReleaseEvent
          Stores last mouse event received via mouseReleased(MouseEvent)
static java.lang.String MODIFIER_MASK_PROPERTY
          Property name constant used for PropertyChangeEvent.getPropertyName().
static java.lang.String NAME_PROPERTY
          Property name constant used for PropertyChangeEvent.getPropertyName().
protected  int originalX
          Original view x-coordinate received with the last mouse event.
protected  int originalY
          Original view y-coordinate received with the last mouse event.
static java.lang.String PARENT_MODE_PROPERTY
          Property name constant used for PropertyChangeEvent.getPropertyName().
protected  Graph2DView view
          The view this mode operates on.
 
Constructor Summary
ViewMode()
          Creates a new ViewMode
ViewMode(ViewContainer vc)
          Creates a new ViewMode which is bound to a given ViewContainer
 
Method Summary
 void activate(boolean b)
          Invoked when the Mode is activated/deactivated from the ViewControl or via the setChild() and reactivateParent operations This behaves like a bound property using ACTIVE_PROPERTY as the property name.
 void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Adds a PropertyChangeListener to the list of registered listeners.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener pcl)
          Adds a PropertyChangeListener for the given property to the list of registered listeners.
 void cancelEditing()
          This can be used to cleanly exit an edit that is currently in progress.
protected  void deactivateChild(ViewMode childMode)
          This is a callback method, to deactivate old child modi.
protected  void firePropertyChange(java.lang.String name, boolean oldValue, boolean newValue)
          Helper method for subclasses to indicate a property change.
protected  void firePropertyChange(java.lang.String name, int oldValue, int newValue)
          Helper method for subclasses to indicate a property change.
protected  void firePropertyChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
          Helper method for subclasses to indicate a property change.
 ViewMode getChild()
          Returns the current child ViewMode or null if this mode has no child.
protected  Graph2D getGraph2D()
          Returns the Graph2D displayed in the view this mode belongs to.
protected  double getGridX(double x)
          Translates a given X-Coordinate to the next X grid line coordinate.
protected  double getGridY(double y)
          Translates a given X-Coordinate to the next X grid line coordinate.
protected  HitInfo getHitInfo(double x, double y)
          Query which object is located at position (x,y) in world coordinate space.
protected  HitInfo getHitInfo(java.awt.event.MouseEvent ev)
          Query which object is located at position (x,y) in the view.
 java.awt.event.MouseEvent getLastClickEvent()
          Returns the last mouse clicked event that has been recorded by the view mode.
 java.awt.event.MouseEvent getLastDragEvent()
          Returns the last mouse dragged event that has been recorded by the view mode.
protected  HitInfo getLastHitInfo()
          Returns the most current HitInfo object that has been set/was returned by getHitInfo(double, double).
 java.awt.event.MouseEvent getLastMoveEvent()
          Returns the last mouse moved event that has been recorded by the view mode.
 java.awt.event.MouseEvent getLastPressEvent()
          Returns the last mouse pressed event that has been recorded by the view mode.
 java.awt.event.MouseEvent getLastReleaseEvent()
          Returns the last mouse released event that has been recorded by the view mode.
 int getModifierMask()
          Gets the current modifierMask.
 java.lang.String getName()
          Get the name of this mode
 ViewMode getParent()
          Returns the current parent ViewMode or null if this mode has no parent.
 void init()
          This method is called in a child mode when it gets installed in another mode.
 boolean isActive()
          Returns whether this Mode has been activate(boolean)d previously.
 boolean isEditing()
          Determines whether the mode is currently "editing".
 boolean isGrabFocusEnabled()
          Returns whether or not the UI focus should be grabbed by the Graph2DView associated with this mode, when pressing the mouse button.
 boolean isGridMode()
          Query if grid mode is active.
protected  boolean isModifierPressed(java.awt.event.MouseEvent me)
          This method determines whether at the creation time of the given MouseEvent the modifier key was pressed.
 void mouseClicked(double x, double y)
          Called when the mouse was clicked
 void mouseClicked(java.awt.event.MouseEvent e)
          A mouse button get clicked
 void mouseDragged(java.awt.event.MouseEvent e)
          The mouse gets dragged
 void mouseDraggedLeft(double x, double y)
          Called when the mouse was dragged with the left button down.
 void mouseDraggedMiddle(double x, double y)
          Called when the mouse was dragged with the middle button down.
 void mouseDraggedRight(double x, double y)
          Called when the mouse was dragged with the right button down.
 void mouseEntered(java.awt.event.MouseEvent e)
          The mouse enters the viewer component.
 void mouseExited(java.awt.event.MouseEvent e)
          The mouse leaves the viewer component.
 void mouseMoved(double x, double y)
          Called when the mouse was moved
 void mouseMoved(java.awt.event.MouseEvent e)
          The Mouse gets moved.
 void mousePressed(java.awt.event.MouseEvent e)
          A mouse button gets pressed.
 void mousePressedLeft(double x, double y)
          Called when the left mouse button was pressed.
 void mousePressedMiddle(double x, double y)
          Called when the middle mouse button was pressed.
 void mousePressedRight(double x, double y)
          Called when the right mouse button was pressed.
 void mouseReleased(double x, double y)
          Called when a mouse button was released.
 void mouseReleased(java.awt.event.MouseEvent e)
          A mouse button get released
 void mouseReleasedLeft(double x, double y)
          Called when the left mouse button was released.
 void mouseReleasedMiddle(double x, double y)
          Called when the middle mouse button was released.
 void mouseReleasedRight(double x, double y)
          Called when the right mouse button was released
 void mouseShiftPressedLeft(double x, double y)
          Called when the left mouse button was pressed with shift key down.
 void mouseShiftPressedMiddle(double x, double y)
          Called when the middle mouse button was pressed with shift key down.
 void mouseShiftPressedRight(double x, double y)
          Called when the right mouse button was pressed with shift key down.
 void mouseShiftReleasedLeft(double x, double y)
          Called when the left mouse button was released with shift key down.
 void mouseShiftReleasedMiddle(double x, double y)
          Called when the middle mouse button was released with shift key down NOTE: this implementation calls mouseReleasedMiddle(double, double)!
 void mouseShiftReleasedRight(double x, double y)
          Called when the right mouse button was released with shift key down.
 void reactivateParent()
          The parent of this ViewMode is reactivated and this ViewMode is deactivated.
 void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Removes a PropertyChangeListener from the list of registered listeners.
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener pcl)
          Removes a PropertyChangeListener for a given property from the list of registered listeners.
 void setActiveView(Graph2DView view)
          Sets the active view this mode operates on.
 void setChild(ViewMode child, java.awt.event.MouseEvent pressEvent, java.awt.event.MouseEvent dragEvent)
          Sets a child mode for this mode.
 void setChild(ViewMode child, java.awt.event.MouseEvent pressEvent, java.awt.event.MouseEvent dragEvent, java.awt.event.MouseEvent releaseEvent)
          Sets a child mode for this mode.
protected  void setEditing(boolean editing)
          Used by subclasses to update the current state.
 void setGrabFocusEnabled(boolean enabled)
          Whether or not the UI focus should be grabbed by the Graph2DView associated with this mode, when pressing the mouse button.
 void setGridMode(boolean mode)
          Enable/Disable grid mode of the Graph2DView.
 void setLastHitInfo(HitInfo hInfo)
          Sets the given HitInfo as the most current HitInfo object, which is referred to as "last hit info."
 void setModifierMask(int modifierMask)
          Sets the current modifierMask.
 void setName(java.lang.String s)
          Set the name of this mode, important for resource handling.
 void setParent(ViewMode l)
          Sets the parent mode of a child mode.
protected  double translateX(int x)
          Returns the world coordinate value of the given x view coordinate value.
protected  double translateY(int y)
          Returns the world coordinate value of the given y view coordinate value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIVE_PROPERTY

public static final java.lang.String ACTIVE_PROPERTY
Property name constant used for PropertyChangeEvent.getPropertyName(). This property is used if activate(boolean) is called

See Also:
Constant Field Values

CHILD_MODE_PROPERTY

public static final java.lang.String CHILD_MODE_PROPERTY
Property name constant used for PropertyChangeEvent.getPropertyName(). This property is used if setChild(ViewMode, MouseEvent, MouseEvent, MouseEvent) is called.

See Also:
Constant Field Values

ACTIVE_VIEW_PROPERTY

public static final java.lang.String ACTIVE_VIEW_PROPERTY
Property name constant used for PropertyChangeEvent.getPropertyName(). This property is used if setActiveView(Graph2DView) is called.

See Also:
Constant Field Values

GRAB_FOCUS_ENABLED_PROPERTY

public static final java.lang.String GRAB_FOCUS_ENABLED_PROPERTY
Property name constant used for PropertyChangeEvent.getPropertyName(). This property is used if setGrabFocusEnabled(boolean) is called.

See Also:
Constant Field Values

PARENT_MODE_PROPERTY

public static final java.lang.String PARENT_MODE_PROPERTY
Property name constant used for PropertyChangeEvent.getPropertyName(). This property is used if setParent(ViewMode) is called

See Also:
Constant Field Values

NAME_PROPERTY

public static final java.lang.String NAME_PROPERTY
Property name constant used for PropertyChangeEvent.getPropertyName(). This property is used if setName(String) is called

See Also:
Constant Field Values

MODIFIER_MASK_PROPERTY

public static final java.lang.String MODIFIER_MASK_PROPERTY
Property name constant used for PropertyChangeEvent.getPropertyName(). This property is used if setModifierMask(int) is called

See Also:
Constant Field Values

EDITING_PROPERTY

public static final java.lang.String EDITING_PROPERTY
Property name constant used for PropertyChangeEvent.getPropertyName(). This property is used if setEditing(boolean) is called

See Also:
Constant Field Values

view

protected Graph2DView view
The view this mode operates on.


originalX

protected int originalX
Original view x-coordinate received with the last mouse event.


originalY

protected int originalY
Original view y-coordinate received with the last mouse event.


lastPressEvent

protected java.awt.event.MouseEvent lastPressEvent
Stores last mouse event received via mousePressed(MouseEvent)


lastDragEvent

protected java.awt.event.MouseEvent lastDragEvent
Stores last mouse event received via mouseDragged(MouseEvent)


lastMoveEvent

protected java.awt.event.MouseEvent lastMoveEvent
Stores last mouse event received via mouseMoved(java.awt.event.MouseEvent)


lastReleaseEvent

protected java.awt.event.MouseEvent lastReleaseEvent
Stores last mouse event received via mouseReleased(MouseEvent)


lastClickEvent

protected java.awt.event.MouseEvent lastClickEvent
Stores last mouse event received via mouseClicked(MouseEvent)

Constructor Detail

ViewMode

public ViewMode()
Creates a new ViewMode


ViewMode

public ViewMode(ViewContainer vc)
Creates a new ViewMode which is bound to a given ViewContainer

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
Adds a PropertyChangeListener to the list of registered listeners.


addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener pcl)
Adds a PropertyChangeListener for the given property to the list of registered listeners.


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
Removes a PropertyChangeListener from the list of registered listeners.


removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener pcl)
Removes a PropertyChangeListener for a given property from the list of registered listeners.


firePropertyChange

protected void firePropertyChange(java.lang.String name,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)
Helper method for subclasses to indicate a property change.


firePropertyChange

protected void firePropertyChange(java.lang.String name,
                                  boolean oldValue,
                                  boolean newValue)
Helper method for subclasses to indicate a property change.


firePropertyChange

protected void firePropertyChange(java.lang.String name,
                                  int oldValue,
                                  int newValue)
Helper method for subclasses to indicate a property change.


isEditing

public boolean isEditing()
Determines whether the mode is currently "editing". Interpretation of this flag depends on the exact implementation. Usually this flag should be set if the editMode cannot simply be deactivated without interrupting the user's current input.
Subclasses are encouraged to keep this flag always up to date.

Returns:
whether this mode is currently editing something
See Also:
setEditing(boolean), cancelEditing()

setEditing

protected void setEditing(boolean editing)
Used by subclasses to update the current state. This is a bound property using EDITING_PROPERTY as the property name.

Parameters:
editing - the new editing state
See Also:
isEditing(), cancelEditing()

cancelEditing

public void cancelEditing()
                   throws java.lang.UnsupportedOperationException
This can be used to cleanly exit an edit that is currently in progress.
The implementation and interpretation of "canceling" is left to subclasses. This implementation does nothing but calls setEditing(false) if isEditing() returns true

Throws:
java.lang.UnsupportedOperationException - if the editing cannot be canceled for any reason.

setActiveView

public void setActiveView(Graph2DView view)
Sets the active view this mode operates on. This method is typically called whenever a ViewContainer changes it's current view. This is a bound property using ACTIVE_VIEW_PROPERTY as the property name.


activate

public void activate(boolean b)
Invoked when the Mode is activated/deactivated from the ViewControl or via the setChild() and reactivateParent operations This behaves like a bound property using ACTIVE_PROPERTY as the property name.

Parameters:
b - set true when mode was activated false otherwise

isActive

public boolean isActive()
Returns whether this Mode has been activate(boolean)d previously.


setGridMode

public void setGridMode(boolean mode)
Enable/Disable grid mode of the Graph2DView. This call is a convenience method that delegates the actual request to the Graph2DView.


isGridMode

public boolean isGridMode()
Query if grid mode is active. This call is a convenience method that delegates the actual request to the Graph2DView.


setGrabFocusEnabled

public void setGrabFocusEnabled(boolean enabled)
Whether or not the UI focus should be grabbed by the Graph2DView associated with this mode, when pressing the mouse button.

By default this property is set to true. This is a bound property using GRAB_FOCUS_ENABLED_PROPERTY as the property name.


isGrabFocusEnabled

public boolean isGrabFocusEnabled()
Returns whether or not the UI focus should be grabbed by the Graph2DView associated with this mode, when pressing the mouse button.


setChild

public void setChild(ViewMode child,
                     java.awt.event.MouseEvent pressEvent,
                     java.awt.event.MouseEvent dragEvent)
Sets a child mode for this mode. All mouse events will be delegated this child mode until the child calls reactivateParent(). After the child mode is installed it will receive the given press and drag events before any other mouse events. Only non-null events will be delegated.


setChild

public void setChild(ViewMode child,
                     java.awt.event.MouseEvent pressEvent,
                     java.awt.event.MouseEvent dragEvent,
                     java.awt.event.MouseEvent releaseEvent)
Sets a child mode for this mode. All mouse events will be delegated this child mode until the child calls reactivateParent(). After the child mode is installed it will receive the given press, drag and release events before any other mouse events. Only non-null events will be delegated.
Prior to that the child mode will be informed about the active view, its new parent, the last HitInfo, and will be activated.
If null is passed as the child or the child calls its reactivateParent() method, the previously installed child will be deactivated and have its parent set to null. This behaves like a bound property using CHILD_MODE_PROPERTY as the property name.


deactivateChild

protected void deactivateChild(ViewMode childMode)
This is a callback method, to deactivate old child modi.

Parameters:
childMode - The child mode to deactivate

init

public void init()
This method is called in a child mode when it gets installed in another mode.

See Also:
setChild(ViewMode,MouseEvent,MouseEvent)

reactivateParent

public void reactivateParent()
The parent of this ViewMode is reactivated and this ViewMode is deactivated.


setParent

public void setParent(ViewMode l)
Sets the parent mode of a child mode. This is a bound property using PARENT_MODE_PROPERTY as the property name.


getParent

public ViewMode getParent()
Returns the current parent ViewMode or null if this mode has no parent.

Returns:
the current parent mode or null
See Also:
reactivateParent(), setChild(ViewMode, java.awt.event.MouseEvent, java.awt.event.MouseEvent, java.awt.event.MouseEvent)

getChild

public ViewMode getChild()
Returns the current child ViewMode or null if this mode has no child.

Returns:
the current child mode or null
See Also:
getParent(), setChild(ViewMode, java.awt.event.MouseEvent, java.awt.event.MouseEvent, java.awt.event.MouseEvent)

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
A mouse button gets pressed.

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
A mouse button get released

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
A mouse button get clicked

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
The mouse gets dragged

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
The Mouse gets moved. Delegates to mouseMoved(double,double).

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
The mouse enters the viewer component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
The mouse leaves the viewer component.

Specified by:
mouseExited in interface java.awt.event.MouseListener

getGridX

protected double getGridX(double x)
Translates a given X-Coordinate to the next X grid line coordinate.


getGridY

protected double getGridY(double y)
Translates a given X-Coordinate to the next X grid line coordinate.


getGraph2D

protected Graph2D getGraph2D()
Returns the Graph2D displayed in the view this mode belongs to.


translateX

protected double translateX(int x)
Returns the world coordinate value of the given x view coordinate value.


translateY

protected double translateY(int y)
Returns the world coordinate value of the given y view coordinate value.


setName

public void setName(java.lang.String s)
Set the name of this mode, important for resource handling. This is a bound property using NAME_PROPERTY as the property name.


getName

public java.lang.String getName()
Get the name of this mode


getHitInfo

protected HitInfo getHitInfo(java.awt.event.MouseEvent ev)
Query which object is located at position (x,y) in the view. The coordinates of the given MouseEvent are translated to world coordinates, then the result of getHitInfo(double, double) is returned.


getHitInfo

protected HitInfo getHitInfo(double x,
                             double y)
Query which object is located at position (x,y) in world coordinate space.

Note that prior to returning the HitInfo, it is set as the most current HitInfo object. See setLastHitInfo(HitInfo).

Parameters:
x - x world coordinate
y - y world coordinate
Returns:
A HitInfo object that holds the first graph element that was hit at the given world coordinate.
See Also:
createHitInfo(double,double,boolean)

getLastHitInfo

protected HitInfo getLastHitInfo()
Returns the most current HitInfo object that has been set/was returned by getHitInfo(double, double). See also setLastHitInfo(HitInfo).


setLastHitInfo

public void setLastHitInfo(HitInfo hInfo)
Sets the given HitInfo as the most current HitInfo object, which is referred to as "last hit info." The last hit info is returned by getLastHitInfo().


mousePressedLeft

public void mousePressedLeft(double x,
                             double y)
Called when the left mouse button was pressed.

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseShiftPressedLeft

public void mouseShiftPressedLeft(double x,
                                  double y)
Called when the left mouse button was pressed with shift key down. NOTE: this implementation calls mousePressedLeft(double, double)!

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseShiftPressedRight

public void mouseShiftPressedRight(double x,
                                   double y)
Called when the right mouse button was pressed with shift key down. NOTE: this implementation calls mousePressedRight(double, double)!

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseShiftPressedMiddle

public void mouseShiftPressedMiddle(double x,
                                    double y)
Called when the middle mouse button was pressed with shift key down. NOTE: this implementation calls mousePressedMiddle(double, double)!

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mousePressedMiddle

public void mousePressedMiddle(double x,
                               double y)
Called when the middle mouse button was pressed.

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mousePressedRight

public void mousePressedRight(double x,
                              double y)
Called when the right mouse button was pressed.

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseReleased

public void mouseReleased(double x,
                          double y)
Called when a mouse button was released.

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseReleasedLeft

public void mouseReleasedLeft(double x,
                              double y)
Called when the left mouse button was released.

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseShiftReleasedLeft

public void mouseShiftReleasedLeft(double x,
                                   double y)
Called when the left mouse button was released with shift key down. NOTE: this implementation calls mouseReleasedLeft(double, double)!

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseShiftReleasedRight

public void mouseShiftReleasedRight(double x,
                                    double y)
Called when the right mouse button was released with shift key down. NOTE: this implementation calls mouseReleasedRight(double, double)!

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseReleasedMiddle

public void mouseReleasedMiddle(double x,
                                double y)
Called when the middle mouse button was released.

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseShiftReleasedMiddle

public void mouseShiftReleasedMiddle(double x,
                                     double y)
Called when the middle mouse button was released with shift key down NOTE: this implementation calls mouseReleasedMiddle(double, double)!

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseReleasedRight

public void mouseReleasedRight(double x,
                               double y)
Called when the right mouse button was released

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseDraggedLeft

public void mouseDraggedLeft(double x,
                             double y)
Called when the mouse was dragged with the left button down.

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseDraggedMiddle

public void mouseDraggedMiddle(double x,
                               double y)
Called when the mouse was dragged with the middle button down.

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseDraggedRight

public void mouseDraggedRight(double x,
                              double y)
Called when the mouse was dragged with the right button down.

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseClicked

public void mouseClicked(double x,
                         double y)
Called when the mouse was clicked

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

mouseMoved

public void mouseMoved(double x,
                       double y)
Called when the mouse was moved

Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

isModifierPressed

protected boolean isModifierPressed(java.awt.event.MouseEvent me)
This method determines whether at the creation time of the given MouseEvent the modifier key was pressed. This implementation checks whether any of the bits in the modifierMask property of this class are set in the MouseEvents modifiers property. Subclasses may override this method to provide a more sophisticated implementation.

See Also:
setModifierMask(int), getModifierMask()

getModifierMask

public int getModifierMask()
Gets the current modifierMask. A modifier is assumed to be activated if (mouseEvent.getModifier() & modifierMask) != 0. The default is MouseEvent.SHIFT_MASK.

Returns:
the current modifier mask

setModifierMask

public void setModifierMask(int modifierMask)
Sets the current modifierMask. A modifier is assumed to be activated if (mouseEvent.getModifier() & modifierMask) != 0. Valid values are the static fields in the MouseEvent class.

Parameters:
modifierMask - the new modifier mask that will be used to determine whether the "shift" variants of the callback methods should be used.

getLastPressEvent

public java.awt.event.MouseEvent getLastPressEvent()
Returns the last mouse pressed event that has been recorded by the view mode.

Returns:
the last mouse pressed event that has been recorded by the view mode.

getLastDragEvent

public java.awt.event.MouseEvent getLastDragEvent()
Returns the last mouse dragged event that has been recorded by the view mode.

Returns:
the last mouse dragged event that has been recorded by the view mode.

getLastMoveEvent

public java.awt.event.MouseEvent getLastMoveEvent()
Returns the last mouse moved event that has been recorded by the view mode.

Returns:
the last mouse moved event that has been recorded by the view mode.

getLastReleaseEvent

public java.awt.event.MouseEvent getLastReleaseEvent()
Returns the last mouse released event that has been recorded by the view mode.

Returns:
the last mouse released event that has been recorded by the view mode.

getLastClickEvent

public java.awt.event.MouseEvent getLastClickEvent()
Returns the last mouse clicked event that has been recorded by the view mode.

Returns:
the last mouse clicked event that has been recorded by the view mode.

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.