Package ij.gui

Class PlotContentsDialog

  • All Implemented Interfaces:
    DialogListener

    public class PlotContentsDialog
    extends Object
    implements DialogListener
    This class implements the Plot Window's Data>"Add from Plot", "Add form Table", "Add Fit" and "More>Contents Style" dialogs
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ADD_FIT
      Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
      static int ADD_FROM_ARRAYS
      Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
      static int ADD_FROM_PLOT
      Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
      static int ADD_FROM_TABLE
      Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
      static int ERROR
      Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
      static int STYLE
      Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
    • Field Detail

      • ERROR

        public static final int ERROR
        Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
        See Also:
        Constant Field Values
      • STYLE

        public static final int STYLE
        Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
        See Also:
        Constant Field Values
      • ADD_FROM_PLOT

        public static final int ADD_FROM_PLOT
        Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
        See Also:
        Constant Field Values
      • ADD_FROM_TABLE

        public static final int ADD_FROM_TABLE
        Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
        See Also:
        Constant Field Values
      • ADD_FROM_ARRAYS

        public static final int ADD_FROM_ARRAYS
        Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
        See Also:
        Constant Field Values
      • ADD_FIT

        public static final int ADD_FIT
        Types of dialog (ERROR suppresses the dialog after an invalid call of a constructor)
        See Also:
        Constant Field Values
    • Constructor Detail

      • PlotContentsDialog

        public PlotContentsDialog​(Plot plot,
                                  int dialogType)
        Prepares a new PlotContentsDialog for an existing plot. Use showDialog thereafter.
        Parameters:
        dialogType - may be STYLE (contents style), ADD_FROM_PLOT (add object from other plot), ADD_FROM_TABLE, and ADD_FIT
      • PlotContentsDialog

        public PlotContentsDialog​(String title,
                                  ResultsTable rt)
        Prepares a new PlotContentsDialog for creating a new plot using data from a ResultsTable. Use showDialog thereafter.
      • PlotContentsDialog

        public PlotContentsDialog​(String title,
                                  String[] headings,
                                  String[] defaultHeadings,
                                  ArrayList<float[]> data)
        Prepares a new PlotContentsDialog for creating a new plot using float[] arrays as data. Each 'data' array in the ArrayList must have a corresponding element in the 'headings' array. 'defaultHeadings' may contain the headings of the items selected initially for x, y, x error and y error, respectively. 'defaultHeadings' and each of its entries may be null, and the array may have any length.
      • PlotContentsDialog

        public PlotContentsDialog​(Plot plot,
                                  String[] headings,
                                  String[] defaultHeadings,
                                  ArrayList<float[]> data)
        Prepares a new PlotContentsDialog for adding data from float[] arrays to a plot. Each 'data' array in the ArrayList must have a corresponding element in the 'headings' array. 'defaultHeadings' may contain the headings of the items selected initially for x, y, x error and y error, respectively. 'defaultHeadings' and each of its entries may be null, and the array may have any length.
    • Method Detail

      • noErrorBars

        public void noErrorBars()
        Avoids showing a selection for the error bars; must be called before showDialog.
      • showDialog

        public void showDialog​(Frame parent)
        Shows the dialog, with a given parent Frame (may be null)
      • dialogItemChanged

        public boolean dialogItemChanged​(GenericDialog gd,
                                         AWTEvent e)
        Description copied from interface: DialogListener
        This method is invoked by a Generic Dialog if any of the inputs have changed (CANCEL does not trigger it; OK and running the dialog from a macro only trigger the first DialogListener added to a GenericDialog).
        Specified by:
        dialogItemChanged in interface DialogListener
        Parameters:
        gd - A reference to the GenericDialog.
        e - The event that has been generated by the user action in the dialog. Note that e is null if the dialogItemChanged method is called after the user has pressed the OK button or if the GenericDialog has read its parameters from a macro.
        Returns:
        Should be true if the dialog input is valid. False disables the OK button and preview (if any).
      • tableWindowExists

        public static boolean tableWindowExists()
        Returns whether there is at least one table that can be used for "Add from Table"