Class Zoomer

  • All Implemented Interfaces:
    java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener, javax.swing.event.MouseInputListener

    public class Zoomer
    extends javax.swing.event.MouseInputAdapter
    Mouse listener which can manufacture zoom requests on the basis of mouse gestures. The zones over which mouse gestures are gathered from and over which graphical feedback is given is defined by a list of ZoomRegion objects held by instances of this class.

    To use an instance of this class, you must install it as both a MouseListener and a MouseMotionListener on the relevant component.

    Since:
    28 Mar 2006
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      Zoomer()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<ZoomRegion> getRegions()
      Returns the list of ZoomRegion objects which defines the behaviour of this object.
      void mouseDragged​(java.awt.event.MouseEvent evt)  
      void mouseMoved​(java.awt.event.MouseEvent evt)  
      void mousePressed​(java.awt.event.MouseEvent evt)  
      void mouseReleased​(java.awt.event.MouseEvent evt)  
      void setCursorComponent​(java.awt.Component comp)
      Sest the component, if any, over which this object should modify the cursor over.
      void setRegions​(java.util.List<ZoomRegion> regionList)
      Sets the list of ZoomRegion objects which defines the behaviour of this object.
      • Methods inherited from class java.awt.event.MouseAdapter

        mouseClicked, mouseEntered, mouseExited, mouseWheelMoved
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.awt.event.MouseListener

        mouseClicked, mouseEntered, mouseExited
    • Constructor Detail

      • Zoomer

        public Zoomer()
        Constructor.
    • Method Detail

      • getRegions

        public java.util.List<ZoomRegion> getRegions()
        Returns the list of ZoomRegion objects which defines the behaviour of this object.
        Returns:
        zoom region list
      • setRegions

        public void setRegions​(java.util.List<ZoomRegion> regionList)
        Sets the list of ZoomRegion objects which defines the behaviour of this object.
        Parameters:
        regionList - list of zoom regions
      • setCursorComponent

        public void setCursorComponent​(java.awt.Component comp)
        Sest the component, if any, over which this object should modify the cursor over. The cursor will be altered to indicate when the mouse is in an active zoom target region.
        Parameters:
        comp - component over which the cursor can be changed
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent evt)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Overrides:
        mousePressed in class java.awt.event.MouseAdapter
      • mouseMoved

        public void mouseMoved​(java.awt.event.MouseEvent evt)
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseMoved in class java.awt.event.MouseAdapter
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent evt)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseDragged in class java.awt.event.MouseAdapter
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent evt)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Overrides:
        mouseReleased in class java.awt.event.MouseAdapter