- java.lang.Object
-
- ij.gui.PlotContentsDialog
-
- All Implemented Interfaces:
DialogListener
public class PlotContentsDialog extends java.lang.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)
-
Constructor Summary
Constructors Constructor Description PlotContentsDialog(Plot plot, int dialogType)
Prepares a new PlotContentsDialog for an existing plot.PlotContentsDialog(Plot plot, java.lang.String[] headings, java.lang.String[] defaultHeadings, java.util.ArrayList<float[]> data)
Prepares a new PlotContentsDialog for adding data from float[] arrays to a plot.PlotContentsDialog(java.lang.String title, ResultsTable rt)
Prepares a new PlotContentsDialog for creating a new plot using data from a ResultsTable.PlotContentsDialog(java.lang.String title, java.lang.String[] headings, java.lang.String[] defaultHeadings, java.util.ArrayList<float[]> data)
Prepares a new PlotContentsDialog for creating a new plot using float[] arrays as data.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
dialogItemChanged(GenericDialog gd, java.awt.AWTEvent e)
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).void
noErrorBars()
Avoids showing a selection for the error bars; must be called before showDialog.void
showDialog(java.awt.Frame parent)
Shows the dialog, with a given parent Frame (may be null)static boolean
tableWindowExists()
Returns whether there is at least one table that can be used for "Add from Table"
-
-
-
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(java.lang.String title, ResultsTable rt)
Prepares a new PlotContentsDialog for creating a new plot using data from a ResultsTable. Use showDialog thereafter.
-
PlotContentsDialog
public PlotContentsDialog(java.lang.String title, java.lang.String[] headings, java.lang.String[] defaultHeadings, java.util.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, java.lang.String[] headings, java.lang.String[] defaultHeadings, java.util.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(java.awt.Frame parent)
Shows the dialog, with a given parent Frame (may be null)
-
dialogItemChanged
public boolean dialogItemChanged(GenericDialog gd, java.awt.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 interfaceDialogListener
- Parameters:
gd
- A reference to the GenericDialog.e
- The event that has been generated by the user action in the dialog. Note thate
isnull
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"
-
-