Package ij.gui

Class PlotWindow

All Implemented Interfaces:
RoiListener, ImageListener, ClipboardOwner, ActionListener, FocusListener, ItemListener, MouseWheelListener, WindowListener, WindowStateListener, ImageObserver, MenuContainer, Serializable, Runnable, EventListener, Accessible

This class implements the Analyze/Plot Profile command.
Author:
Michael Schmid, Wayne Rasband
See Also:
  • Field Details

    • CIRCLE

      public static final int CIRCLE
      Display points using a circle 5 pixels in diameter.
      See Also:
    • X

      public static final int X
      Display points using an X-shaped mark.
      See Also:
    • BOX

      public static final int BOX
      Display points using an box-shaped mark.
      See Also:
    • TRIANGLE

      public static final int TRIANGLE
      Display points using an tiangular mark.
      See Also:
    • CROSS

      public static final int CROSS
      Display points using an cross-shaped mark.
      See Also:
    • LINE

      public static final int LINE
      Connect points with solid lines.
      See Also:
    • saveXValues

      public static boolean saveXValues
      Write first X column when listing or saving.
    • autoClose

      public static boolean autoClose
      Automatically close window after saving values. To set, use Edit/Options/Plots.
    • listValues

      public static boolean listValues
      Display the XY coordinates in a separate window. To set, use Edit/Options/Plots.
    • interpolate

      public static boolean interpolate
      Interpolate line profiles. To set, use Edit/Options/Plots.
    • plotWidth

      public static int plotWidth
      The width of the plot (without frame) in pixels.
    • plotHeight

      public static int plotHeight
      The height of the plot in pixels.
    • fontSize

      public static int fontSize
      The plot text size, can be overridden by Plot.setFont, Plot.setFontSize, Plot.setXLabelFont etc.
    • noGridLines

      public static boolean noGridLines
      Have axes with no grid lines. If both noGridLines and noTicks are true, only min&max value of the axes are given
    • noTicks

      public static boolean noTicks
      Have axes with no ticks. If both noGridLines and noTicks are true, only min&max value of the axes are given
  • Constructor Details

    • PlotWindow

      public PlotWindow(String title, String xLabel, String yLabel, float[] xValues, float[] yValues)
      Deprecated.
      replaced by the Plot class.
    • PlotWindow

      public PlotWindow(String title, String xLabel, String yLabel, double[] xValues, double[] yValues)
      Deprecated.
      replaced by the Plot class.
  • Method Details

    • setLimits

      public void setLimits(double xMin, double xMax, double yMin, double yMax)
      Sets the x-axis and y-axis range. Must be called before the plot is displayed.
    • addPoints

      public void addPoints(float[] x, float[] y, int shape)
      Adds a set of points to the plot or adds a curve if shape is set to LINE. Must be called before the plot is displayed. Note that there are more options available by using the methods of the Plot class instead.
      Parameters:
      x - the x-coodinates
      y - the y-coodinates
      shape - Plot.CIRCLE, X, BOX, TRIANGLE, CROSS, LINE etc.
    • addPoints

      public void addPoints(double[] x, double[] y, int shape)
      Adds a set of points to the plot using double arrays. Must be called before the plot is displayed. Note that there are more options available by using the methods of the Plot class instead.
    • addErrorBars

      public void addErrorBars(float[] errorBars)
      Adds vertical error bars to the plot. Must be called before the plot is displayed. Note that there are more options available by using the methods of the Plot class instead.
    • addLabel

      public void addLabel(double x, double y, String label)
      Draws a label. Must be called before the plot is displayed. Note that there are more options available by using the methods of the Plot class instead.
    • setColor

      public void setColor(Color c)
      Changes the drawing color. The frame and labels are always drawn in black. Must be called before the plot is displayed. Note that there are more options available by using the methods of the Plot class instead.
    • setLineWidth

      public void setLineWidth(int lineWidth)
      Changes the line width. Must be called before the plot is displayed. Note that there are more options available by using the methods of the Plot class instead.
    • changeFont

      public void changeFont(Font font)
      Changes the font. Must be called before the plot is displayed. Note that there are more options available by using the methods of the Plot class instead.
    • draw

      public void draw()
      Displays the plot.
    • dispose

      public void dispose()
      Releases the resources used by this PlotWindow
      Overrides:
      dispose in class Window
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Called if user has activated a button or popup menu item
      Specified by:
      actionPerformed in interface ActionListener
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Called if the user activates/deactivates a CheckboxMenuItem
      Specified by:
      itemStateChanged in interface ItemListener
    • mouseMoved

      public void mouseMoved(int x, int y)
      Updates the X and Y values when the mouse is moved and, if appropriate, shows/hides the overlay with the triangular buttons for changing the axis range limits Overrides mouseMoved() in ImageWindow.
      Overrides:
      mouseMoved in class ImageWindow
      See Also:
    • mouseWheelMoved

      public void mouseWheelMoved(MouseWheelEvent e)
      Mouse wheel: zooms when shift or ctrl is pressed, scrolls in x if space bar down, in y otherwise.
      Specified by:
      mouseWheelMoved in interface MouseWheelListener
      Overrides:
      mouseWheelMoved in class ImageWindow
    • getResultsTable

      public ResultsTable getResultsTable()
      Returns the plot values as a ResultsTable.
    • lostOwnership

      public void lostOwnership(Clipboard clipboard, Transferable contents)
      Specified by:
      lostOwnership in interface ClipboardOwner
    • getXValues

      public float[] getXValues()
    • getYValues

      public float[] getYValues()
    • drawPlot

      public void drawPlot(Plot plot)
      Draws a new plot in this window.
    • savePreferences

      public static void savePreferences(Properties prefs)
      Called once when ImageJ quits.
    • roiModified

      public void roiModified(ImagePlus img, int id)
      For live plots, update the plot if the ROI of the source image changes
      Specified by:
      roiModified in interface RoiListener
    • imageOpened

      public void imageOpened(ImagePlus imp)
      Specified by:
      imageOpened in interface ImageListener
    • imageUpdated

      public void imageUpdated(ImagePlus imp)
      For live plots, this method is called if the source image content is changed
      Specified by:
      imageUpdated in interface ImageListener
    • imageClosed

      public void imageClosed(ImagePlus imp)
      Specified by:
      imageClosed in interface ImageListener
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • getPlot

      public Plot getPlot()
      Returns the Plot associated with this PlotWindow.
    • freeze

      public static void freeze()
      Freezes the active plot window.