Search this API

y.view
Class MoveLabelMode.MoveLabelEvent

java.lang.Object
  extended by java.util.EventObject
      extended by y.view.MoveLabelMode.MoveLabelEvent
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
MoveLabelMode

public static class MoveLabelMode.MoveLabelEvent
extends java.util.EventObject

An event that indicates that a label has been moved to a new location.

See Also:
Serialized Form
 
Your browser does not support SVG content.

Constructor Summary
MoveLabelMode.MoveLabelEvent(MoveLabelMode source, YLabel label, int modifiers, double x, double y, boolean snappingEnabled)
          Initializes a new move event.
 
Method Summary
 YLabel getLabel()
          Returns the label that should be moved.
 int getModifiers()
          Returns the extended modifier mask for this event.
 MoveLabelMode getMoveLabelMode()
          Returns the event's source move label mode.
 double getX()
          Returns the x-coordinate of the event in the world coordinates of the view that is associated to the event's source move label mode.
 double getY()
          Returns the y-coordinate of the event in the world coordinates of the view that is associated to the event's source move label mode.
 boolean isSnappingEnabled()
          Determines whether or not the label movement should allow for snapping.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MoveLabelMode.MoveLabelEvent

public MoveLabelMode.MoveLabelEvent(MoveLabelMode source,
                                    YLabel label,
                                    int modifiers,
                                    double x,
                                    double y,
                                    boolean snappingEnabled)
Initializes a new move event.

Parameters:
source - the MoveLabelMode instance that emitted the event.
label - the label that is moved.
modifiers - the extended modifier mask of the triggering mouse event.
x - the x-coordinate of the event in the world coordinates of the view that is associated to the event's source move label mode.
y - the y-coordinate of the event in the world coordinates of the view that is associated to the event's source move label mode.
snappingEnabled - true if the triggering mouse event allowed for snapping; false otherwise.
See Also:
getModifiers(), getX(), getY(), MoveLabelMode.isDisableSnappingModifierPressed(java.awt.event.MouseEvent)
Method Detail

getMoveLabelMode

public MoveLabelMode getMoveLabelMode()
Returns the event's source move label mode. I.e. the mode that issued the event in response to a mouse event.

Returns:
the event's source move label mode.

getLabel

public YLabel getLabel()
Returns the label that should be moved.

Returns:
the label that should be moved.

getModifiers

public int getModifiers()
Returns the extended modifier mask for this event.

Returns:
the extended modifier mask for this event.
See Also:
InputEvent.getModifiersEx()

getX

public double getX()
Returns the x-coordinate of the event in the world coordinates of the view that is associated to the event's source move label mode.

Returns:
the x-coordinate of the event in world coordinates.

getY

public double getY()
Returns the y-coordinate of the event in the world coordinates of the view that is associated to the event's source move label mode.

Returns:
the y-coordinate of the event in world coordinates.

isSnappingEnabled

public boolean isSnappingEnabled()
Determines whether or not the label movement should allow for snapping.

Returns:
true if the event should allow for snapping; false otherwise.

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