lt.monarch.chart.plugins
Class TouchZoomer

java.lang.Object
  extended by lt.monarch.chart.plugins.AbstractChartPlugin<AbstractChart<?,?>>
      extended by lt.monarch.chart.plugins.TouchZoomer
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.util.EventListener, ChartPlugin<AbstractChart<?,?>>, GestureListener, MultitouchListener

public class TouchZoomer
extends AbstractChartPlugin<AbstractChart<?,?>>
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, GestureListener, MultitouchListener

See Also:
Serialized Form

Nested Class Summary
Modifier and Type Class and Description
static class TouchZoomer.ZoomLevel
           
 
Constructor Summary
Constructor and Description
TouchZoomer(AbstractAxisMapper xMapper, AbstractAxisMapper[] yMappers, TouchZoomer.ZoomLevel[] zoomLevels, boolean snap)
           
TouchZoomer(AbstractAxisMapper xMapper, AbstractAxisMapper yMapper, TouchZoomer.ZoomLevel[] zoomLevels, boolean snap)
           
TouchZoomer(Axis2D axisX, Axis2D axisY, TouchZoomer.ZoomLevel[] zoomLevels, boolean snap)
           
 
Method Summary
Modifier and Type Method and Description
 void activate()
          Activates the plug-in.
 void deactivate()
          Deactivates the plug-in.
 void gesture(GestureEvent e)
           
 double getAnimationLength()
          Gets snap animation length.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void paint(AbstractGraphics g)
          Does nothing- must be overridden in extending classes.
 void setAnimationLength(double animationLength)
          Sets snapping animation length.
 void zoom(MultitouchEvent e)
           
 void zoomBegin(MultitouchEvent e)
           
 void zoomEnd(MultitouchEvent e)
           
 
Methods inherited from class lt.monarch.chart.plugins.AbstractChartPlugin
adjustChart, chart, getChart, install, isActivated, uninstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TouchZoomer

public TouchZoomer(Axis2D axisX,
                   Axis2D axisY,
                   TouchZoomer.ZoomLevel[] zoomLevels,
                   boolean snap)
Parameters:
axisX - x axis object
axisY - y axis object
zoomLevels - zoom levels to snap to
snap - snap to provided zoom levels

TouchZoomer

public TouchZoomer(AbstractAxisMapper xMapper,
                   AbstractAxisMapper yMapper,
                   TouchZoomer.ZoomLevel[] zoomLevels,
                   boolean snap)
Parameters:
xMapper - x axis mapper object
yMapper - y axis mapper object
zoomLevels - zoom levels to snap to
snap - snap to provided zoom levels

TouchZoomer

public TouchZoomer(AbstractAxisMapper xMapper,
                   AbstractAxisMapper[] yMappers,
                   TouchZoomer.ZoomLevel[] zoomLevels,
                   boolean snap)
Parameters:
xMapper - x axis mapper object
yMappers - y axis mapper object array
zoomLevels - zoom levels to snap to
snap - snap to provided zoom levels
Method Detail

setAnimationLength

public void setAnimationLength(double animationLength)
Sets snapping animation length.

Parameters:
snimationLength - snap animation length in ms.

getAnimationLength

public double getAnimationLength()
Gets snap animation length.

Returns:
snap animation length in ms.

activate

public void activate()
Activates the plug-in.

Specified by:
activate in class AbstractChartPlugin<AbstractChart<?,?>>

deactivate

public void deactivate()
Deactivates the plug-in.

Specified by:
deactivate in class AbstractChartPlugin<AbstractChart<?,?>>

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - the mouse event

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
e - the mouse event

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e - the mouse event

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - the mouse event

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - the mouse event

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
e - the mouse event

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
e - the mouse event

gesture

public void gesture(GestureEvent e)
Specified by:
gesture in interface GestureListener
Parameters:
e - the gesture event

zoom

public void zoom(MultitouchEvent e)
Specified by:
zoom in interface MultitouchListener
Parameters:
e - the multitouch event

zoomBegin

public void zoomBegin(MultitouchEvent e)
Specified by:
zoomBegin in interface MultitouchListener
Parameters:
e - the multitouch event

zoomEnd

public void zoomEnd(MultitouchEvent e)
Specified by:
zoomEnd in interface MultitouchListener
Parameters:
e - the multitouch event

paint

public void paint(AbstractGraphics g)
Description copied from class: AbstractChartPlugin
Does nothing- must be overridden in extending classes.

Specified by:
paint in interface ChartPlugin<AbstractChart<?,?>>
Overrides:
paint in class AbstractChartPlugin<AbstractChart<?,?>>
Parameters:
g - the Graphics context in which to paint zoom frame
See Also:
ChartPlugin.paint(lt.monarch.chart.engine.AbstractGraphics)