prefuse.controls
Class ZoomControl

java.lang.Object
  extended by prefuse.controls.ControlAdapter
      extended by prefuse.controls.AbstractZoomControl
          extended by prefuse.controls.ZoomControl
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 ZoomControl
extends AbstractZoomControl

Zooms the display, changing the scale of the viewable region. By default, zooming is achieved by pressing the right mouse button on the background of the visualization and dragging the mouse up or down. Moving the mouse up zooms out the display around the spot the mouse was originally pressed. Moving the mouse down similarly zooms in the display, making items larger.

Author:
jeffrey heer

Field Summary
 
Fields inherited from class prefuse.controls.AbstractZoomControl
DEFAULT_MAX_SCALE, DEFAULT_MIN_SCALE, m_maxScale, m_minScale, m_zoomOverItem, MAX_ZOOM, MIN_ZOOM, NO_ZOOM, ZOOM
 
Fields inherited from interface prefuse.controls.Control
LEFT_MOUSE_BUTTON, MIDDLE_MOUSE_BUTTON, RIGHT_MOUSE_BUTTON
 
Constructor Summary
ZoomControl()
          Create a new zoom control.
ZoomControl(int mouseButton)
          Create a new zoom control.
 
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 itemPressed(VisualItem item, java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on a VisualItem.
 void itemReleased(VisualItem item, java.awt.event.MouseEvent e)
          Invoked when a mouse button has been released on a VisualItem.
 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 mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on the Display but NOT on a VisualItem.
 void mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been released on the Display but NOT on a VisualItem.
 
Methods inherited from class prefuse.controls.AbstractZoomControl
getMaxScale, getMinScale, isZoomOverItem, setMaxScale, setMinScale, setZoomOverItem, zoom
 
Methods inherited from class prefuse.controls.ControlAdapter
isEnabled, itemClicked, itemEntered, itemExited, itemKeyPressed, itemKeyReleased, itemKeyTyped, itemMoved, itemWheelMoved, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZoomControl

public ZoomControl()
Create a new zoom control.


ZoomControl

public ZoomControl(int mouseButton)
Create a new zoom control.

Parameters:
mouseButton - the mouse button that should initiate a zoom. One of Control.LEFT_MOUSE_BUTTON, Control.MIDDLE_MOUSE_BUTTON, or Control.RIGHT_MOUSE_BUTTON.
Method Detail

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Description copied from interface: Control
Invoked when a mouse button has been pressed on the Display but NOT on a VisualItem.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Specified by:
mousePressed in interface Control
Overrides:
mousePressed in class ControlAdapter
See Also:
MouseListener.mousePressed(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)

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Description copied from interface: Control
Invoked when a mouse button has been released on the Display but NOT on a VisualItem.

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

itemPressed

public void itemPressed(VisualItem item,
                        java.awt.event.MouseEvent e)
Description copied from interface: Control
Invoked when a mouse button has been pressed on a VisualItem.

Specified by:
itemPressed in interface Control
Overrides:
itemPressed in class ControlAdapter
See Also:
Control.itemPressed(prefuse.visual.VisualItem, 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)

itemReleased

public void itemReleased(VisualItem item,
                         java.awt.event.MouseEvent e)
Description copied from interface: Control
Invoked when a mouse button has been released on a VisualItem.

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


Copyright © 2007 Regents of the University of California