Package ij.gui

Class PlotCanvas

All Implemented Interfaces:
MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, Cloneable, EventListener, Accessible

public class PlotCanvas
extends ImageCanvas
This subclass of ImageCanvas has special provisions for plots: - Zooming: sets the plot range - Scrolling: moves data area This behavior is suppressed if the plot is frozen
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • setPlot

      public void setPlot​(Plot plot)
      Tells the PlotCanvas which plot to use for zooming etc. Call this immediately after construction
    • getPlot

      public Plot getPlot()
      Returns the Plot displayed in this canvas
    • isFrozen

      public boolean isFrozen()
      Whether the plot is frozen, i.e. its ImageProcessor can not be changed
    • zoom

      public void zoom​(String arg)
      Zoom operations that are handled by ij.plugin.Zoom
    • zoomIn

      public void zoomIn​(int sx, int sy)
      Zooms in by modifying the plot range; sx and sy are screen coordinates
      Overrides:
      zoomIn in class ImageCanvas
    • zoomOut

      public void zoomOut​(int sx, int sy)
      Zooms out by modifying the plot range; sx and sy are screen coordinates
      Overrides:
      zoomOut in class ImageCanvas
    • unzoom

      public void unzoom()
      Implements the Image/Zoom/Original Scale command. Sets the original range of the x, y axes (unless the plot is frozen)
      Overrides:
      unzoom in class ImageCanvas
    • zoom100Percent

      public void zoom100Percent()
      Implements the Image/Zoom/View 100% command: Sets the original frame size as specified in Edit/Options/Plots (unless the plot is frozen)
      Overrides:
      zoom100Percent in class ImageCanvas
    • fitToWindow

      public void fitToWindow()
      Resizes the plot (unless frozen) to fit the window
      Overrides:
      fitToWindow in class ImageCanvas
    • setMagnification

      public void setMagnification​(double magnification)
      The image of a PlotCanvas is always shown at 100% magnification unless the plot is frozen
      Overrides:
      setMagnification in class ImageCanvas
    • setSourceRect

      public void setSourceRect​(Rectangle r)
      Scrolling a PlotCanvas is updating the plot, not viewing part of the plot, unless the plot is frozen
      Overrides:
      setSourceRect in class ImageCanvas
    • setupScroll

      protected void setupScroll​(int ox, int oy)
      overrides ImageCanvas.setupScroll; if plot is not frozen, scrolling modifies the plot data range
      Overrides:
      setupScroll in class ImageCanvas
    • scroll

      protected void scroll​(int sx, int sy)
      overrides ImageCanvas.scroll; if plot is not frozen, scrolling modifies the plot data range
      Overrides:
      scroll in class ImageCanvas
    • mouseExited

      public void mouseExited​(MouseEvent e)
      overrides ImageCanvas.mouseExited; removes 'range' arrows
      Specified by:
      mouseExited in interface MouseListener
      Overrides:
      mouseExited in class ImageCanvas
    • mousePressed

      public void mousePressed​(MouseEvent e)
      overrides ImageCanvas.mousePressed: no further processing of clicks on 'range' arrows
      Specified by:
      mousePressed in interface MouseListener
      Overrides:
      mousePressed in class ImageCanvas
    • mouseReleased

      public void mouseReleased​(MouseEvent e)
      Overrides ImageCanvas.mouseReleased, handles clicks on 'range' arrows
      Specified by:
      mouseReleased in interface MouseListener
      Overrides:
      mouseReleased in class ImageCanvas