y.view
Class HotSpotMode

java.lang.Object
  |
  +--y.view.ViewMode
        |
        +--y.view.HotSpotMode
All Implemented Interfaces:
EventListener, MouseInputListener, MouseListener, MouseMotionListener
Direct Known Subclasses:
HierarchyHotSpotMode

public class HotSpotMode
extends ViewMode

Handles hotspot drags. Causes selected nodes to change their size. when the user drags on a hot spot visible around such a node.

The mode is activated when the mouse is moved over an hotspot point. It changes the mouse-cursor according to the hotspot point. In this state the HotSpotMode is *inactive*. When the left mouse button is pressed it goes into *active* mode.


Field Summary
 
Fields inherited from class y.view.ViewMode
lastClickEvent, lastDragEvent, lastPressEvent, lastReleaseEvent, originalX, originalY, view
 
Constructor Summary
HotSpotMode()
          Instantiates a new HotSportMode.
HotSpotMode(ViewContainer vc)
          Instantiates a new HotSpotMode for a given ViewContainer
 
Method Summary
static Cursor getCursor(byte hotSpotType)
          Returns a suitable cursor for the given hotSpotType.
 void mouseDraggedLeft(double x, double y)
          Resizes selected nodes.
 void mousePressedLeft(double x, double y)
          Initiates resizing of selected nodes.
 void mouseReleasedLeft(double x, double y)
          Terminates resizing of selected nodes.
protected  void updateNodeRealizerBounds(NodeRealizer vr, double x, double y, double w, double h)
          This method will be invoked by this view mode when the current bounds of a node need to be updated.
 
Methods inherited from class y.view.ViewMode
activate, getGraph2D, getGridX, getGridY, getHitInfo, getHitInfo, getLastHitInfo, getName, init, isGrabFocusEnabled, isGridMode, mouseClicked, mouseClicked, mouseDragged, mouseDraggedMiddle, mouseDraggedRight, mouseEntered, mouseExited, mouseMoved, mouseMoved, mousePressed, mousePressedMiddle, mousePressedRight, mouseReleased, mouseReleased, mouseReleasedMiddle, mouseReleasedRight, mouseShiftPressedLeft, mouseShiftPressedMiddle, mouseShiftPressedRight, mouseShiftReleasedLeft, mouseShiftReleasedMiddle, mouseShiftReleasedRight, reactivateParent, setActiveView, setChild, setChild, setGrabFocusEnabled, setGridMode, setLastHitInfo, setName, setParent, translateX, translateY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HotSpotMode

public HotSpotMode(ViewContainer vc)
Instantiates a new HotSpotMode for a given ViewContainer


HotSpotMode

public HotSpotMode()
Instantiates a new HotSportMode.

Method Detail

mousePressedLeft

public void mousePressedLeft(double x,
                             double y)
Initiates resizing of selected nodes.

Overrides:
mousePressedLeft in class ViewMode
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)
Resizes selected nodes.

Overrides:
mouseDraggedLeft in class ViewMode
Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

updateNodeRealizerBounds

protected void updateNodeRealizerBounds(NodeRealizer vr,
                                        double x,
                                        double y,
                                        double w,
                                        double h)
This method will be invoked by this view mode when the current bounds of a node need to be updated.

Parameters:
vr - the realizer of the node whose bounds shoud change.
x - the desired x-coordinate of the node bounds.
y - the desired y-coordinate of the node bounds.
w - the desired width of the node.
h - the desired height of the node.

mouseReleasedLeft

public void mouseReleasedLeft(double x,
                              double y)
Terminates resizing of selected nodes.

Overrides:
mouseReleasedLeft in class ViewMode
Parameters:
x - the x-coordinate of the mouse event in world coordinates.
y - the y-coordinate of the mouse event in world coordinates.

getCursor

public static Cursor getCursor(byte hotSpotType)
Returns a suitable cursor for the given hotSpotType. The cursor indicates the kind of resize action that is being performed.


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

2003