prefuse.controls
Class AnchorUpdateControl

java.lang.Object
  extended by prefuse.controls.ControlAdapter
      extended by prefuse.controls.AnchorUpdateControl
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener, Control

public class AnchorUpdateControl
extends ControlAdapter

Follows the mouse cursor, updating the anchor parameter for any number of layout instances to match the current cursor position. Will also run a given activity in response to cursor updates.

Author:
jeffrey heer

Field Summary
 
Fields inherited from interface prefuse.controls.Control
LEFT_MOUSE_BUTTON, MIDDLE_MOUSE_BUTTON, RIGHT_MOUSE_BUTTON
 
Constructor Summary
AnchorUpdateControl(Layout layout)
          Create a new AnchorUpdateControl.
AnchorUpdateControl(Layout[] layout, java.lang.String action)
          Create a new AnchorUpdateControl.
AnchorUpdateControl(Layout[] layout, java.lang.String action, boolean overItem)
          Create a new AnchorUpdateControl.
AnchorUpdateControl(Layout layout, java.lang.String action)
          Create a new AnchorUpdateControl.
AnchorUpdateControl(Layout layout, java.lang.String action, boolean overItem)
          Create a new AnchorUpdateControl.
 
Method Summary
 void itemDragged(VisualItem item, java.awt.event.MouseEvent e)
          Invoked when a mouse button is pressed on a VisualItem and then dragged.
 void itemMoved(VisualItem item, java.awt.event.MouseEvent e)
          Invoked when the mouse cursor has been moved onto a VisualItem but no buttons have been pushed.
 void mouseDragged(java.awt.event.MouseEvent e)
          Invoked when a mouse button is pressed on the Display (but NOT a VisualItem) and then dragged.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits the Display.
 void mouseMoved(java.awt.event.MouseEvent e)
          Invoked when the mouse cursor has been moved on the Display (but NOT a VisualItem) and no buttons have been pushed.
 void moveEvent(java.awt.event.MouseEvent e)
          Registers a mouse move event, updating the anchor point for all registered layout instances.
 
Methods inherited from class prefuse.controls.ControlAdapter
isEnabled, itemClicked, itemEntered, itemExited, itemKeyPressed, itemKeyReleased, itemKeyTyped, itemPressed, itemReleased, itemWheelMoved, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mousePressed, mouseReleased, mouseWheelMoved, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnchorUpdateControl

public AnchorUpdateControl(Layout layout)
Create a new AnchorUpdateControl.

Parameters:
layout - the layout for which to update the anchor point

AnchorUpdateControl

public AnchorUpdateControl(Layout layout,
                           java.lang.String action)
Create a new AnchorUpdateControl.

Parameters:
layout - the layout for which to update the anchor point
action - the name of an action to run upon anchor updates

AnchorUpdateControl

public AnchorUpdateControl(Layout layout,
                           java.lang.String action,
                           boolean overItem)
Create a new AnchorUpdateControl.

Parameters:
layout - the layout for which to update the anchor point
action - the name of an action to run upon anchor updates
overItem - indicates if anchor update events should be processed while the mouse cursor is hovered over a VisualItem.

AnchorUpdateControl

public AnchorUpdateControl(Layout[] layout,
                           java.lang.String action)
Create a new AnchorUpdateControl.

Parameters:
layout - the layouts for which to update the anchor point
action - the name of an action to run upon anchor updates

AnchorUpdateControl

public AnchorUpdateControl(Layout[] layout,
                           java.lang.String action,
                           boolean overItem)
Create a new AnchorUpdateControl.

Parameters:
layout - the layouts for which to update the anchor point
action - the name of an action to run upon anchor updates
overItem - indicates if anchor update events should be processed while the mouse cursor is hovered over a VisualItem.
Method Detail

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Description copied from interface: Control
Invoked when the mouse exits the Display.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Specified by:
mouseExited in interface Control
Overrides:
mouseExited in class ControlAdapter
See Also:
MouseListener.mouseExited(java.awt.event.MouseEvent)

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Description copied from interface: Control
Invoked when the mouse cursor has been moved on the Display (but NOT a VisualItem) and no buttons have been pushed.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Specified by:
mouseMoved in interface Control
Overrides:
mouseMoved in class ControlAdapter
See Also:
MouseMotionListener.mouseMoved(java.awt.event.MouseEvent)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Description copied from interface: Control
Invoked when a mouse button is pressed on the Display (but NOT a VisualItem) and then dragged.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Specified by:
mouseDragged in interface Control
Overrides:
mouseDragged in class ControlAdapter
See Also:
MouseMotionListener.mouseDragged(java.awt.event.MouseEvent)

itemDragged

public void itemDragged(VisualItem item,
                        java.awt.event.MouseEvent e)
Description copied from interface: Control
Invoked when a mouse button is pressed on a VisualItem and then dragged.

Specified by:
itemDragged in interface Control
Overrides:
itemDragged in class ControlAdapter
See Also:
Control.itemDragged(prefuse.visual.VisualItem, java.awt.event.MouseEvent)

itemMoved

public void itemMoved(VisualItem item,
                      java.awt.event.MouseEvent e)
Description copied from interface: Control
Invoked when the mouse cursor has been moved onto a VisualItem but no buttons have been pushed.

Specified by:
itemMoved in interface Control
Overrides:
itemMoved in class ControlAdapter
See Also:
Control.itemMoved(prefuse.visual.VisualItem, java.awt.event.MouseEvent)

moveEvent

public void moveEvent(java.awt.event.MouseEvent e)
Registers a mouse move event, updating the anchor point for all registered layout instances.

Parameters:
e - the MouseEvent


Copyright © 2007 Regents of the University of California