Class ZoomRegion

java.lang.Object
uk.ac.starlink.topcat.plot.ZoomRegion
Direct Known Subclasses:
AxisZoomRegion, CentreZoomRegion, XYZoomRegion

public abstract class ZoomRegion extends Object
Defines a region for use with a Zoomer object.
Since:
28 Mar 2006
Author:
Mark Taylor
See Also:
  • Constructor Details

    • ZoomRegion

      public ZoomRegion()
  • Method Details

    • setTarget

      public void setTarget(Rectangle target)
      Sets the target region. This is the region within which the mouse must be clicked and dragged in order to generate a zoom event.
      Parameters:
      target - target region
    • getTarget

      public Rectangle getTarget()
      Returns the target region. This is the region within which the mouse must be clicked and dragged in order to generate a zoom event.
      Returns:
      target region
    • setDisplay

      public void setDisplay(Rectangle display)
      Sets the display region. This is the region used to provide visual feedback to the user during a drag gesture.
      Parameters:
      display - display region
    • getDisplay

      public Rectangle getDisplay()
      Returns the display region. This is the region used to display visual feedback to the user during a drag gesture.
      Returns:
      display region
    • setCursor

      public void setCursor(Cursor cursor)
      Sets a custom cursor for use in the target region.
      Parameters:
      cursor - custom cursor
    • getCursor

      public Cursor getCursor()
      Returns the custom cursor for use in the target region.
      Returns:
      custom cursor
    • createDrag

      public abstract ZoomDrag createDrag(Component comp, Point start)
      Returns a new ZoomDrag object appropriate for this region.
      Parameters:
      comp - component on which the drag is taking place
      start - start point for the drag
      Returns:
      new drag object
    • zoomed

      public abstract void zoomed(double[][] bounds)
      Callback which will be invoked when a zoom invoked on this region has been completed successfully. Elements of the parameter array are two-element arrays giving (lower, upper) bounds in one or more dimensions, according to the type of region. The units should normally be dimensionless: a range of (0,1) indicates the same range as is currently contained by the display region. Bounds may be larger or smaller than the (1,0) interval.
      Parameters:
      bounds - array of (lower, upper) zoom bounds