Squiz Matrix
4.12.2
|
Public Member Functions | |
GenericDialog (String title) | |
GenericDialog (String title, ij.ImageJ parent) | |
GenericDialog (String title, JApplet parent) | |
void | addNumericField (String label, double defaultValue, int digits) |
void | addNumericField (String label, double defaultValue, int digits, int columns, String units) |
void | addStringField (String label, String defaultText) |
void | addStringField (String label, String defaultText, int columns) |
void | addCheckbox (String label, boolean defaultValue) |
void | addCheckboxGroup (int rows, int columns, String[] labels, boolean[] defaultValues) |
void | addChoice (String label, String[] items, String defaultItem) |
void | addMessage (String text) |
void | addTextAreas (String text1, String text2, int rows, int columns) |
void | addSlider (String label, double minValue, double maxValue, double defaultValue) |
void | addPanel (Panel panel) |
void | addPanel (Panel panel, int contraints, Insets insets) |
boolean | wasCanceled () |
double | getNextNumber () |
boolean | invalidNumber () |
String | getErrorMessage () |
String | getNextString () |
boolean | getNextBoolean () |
String | getNextChoice () |
int | getNextChoiceIndex () |
String | getNextText () |
void | showDialog () |
Vector | getNumericFields () |
Vector | getStringFields () |
Vector | getCheckboxes () |
Vector | getChoices () |
Vector | getSliders () |
TextArea | getTextArea1 () |
TextArea | getTextArea2 () |
void | actionPerformed (ActionEvent e) |
void | textValueChanged (TextEvent e) |
void | itemStateChanged (ItemEvent e) |
void | focusGained (FocusEvent e) |
void | focusLost (FocusEvent e) |
void | keyPressed (KeyEvent e) |
void | keyReleased (KeyEvent e) |
void | keyTyped (KeyEvent e) |
Insets | getInsets () |
synchronized void | adjustmentValueChanged (AdjustmentEvent e) |
void | paint (Graphics g) |
Protected Member Functions | |
Double | getValue (String theText) |
void | setup () |
Protected Attributes | |
Vector | numberField |
TextArea | textArea1 |
Vector | defaultValues |
Component | theLabel |
This class is a customizable modal dialog box. Here is an example GenericDialog with one string field and two numeric fields:
public class Generic_Dialog_Example implements PlugIn { static String title="Example"; static int width=512,height=512; public void run(String arg) { GenericDialog gd = new GenericDialog("New Image"); gd.addStringField("Title: ", title); gd.addNumericField("Width: ", width, 0); gd.addNumericField("Height: ", height, 0); gd.showDialog(); if (gd.wasCanceled()) return; title = gd.getNextString(); width = (int)gd.getNextNumber(); height = (int)gd.getNextNumber(); IJ.run("New...", "name="+title+" type='8-bit Unsigned' width="+width+" height="+height); } }
Definition at line 33 of file GenericDialog.java.
|
inline |
Creates a new GenericDialog with the specified title. Uses the current image image window as the parent frame or the ImageJ frame if no image windows are open. Dialog parameters are recorded by ImageJ's command recorder but this requires that the first word of each label be unique.
Definition at line 57 of file GenericDialog.java.
|
inline |
Creates a new GenericDialog using the specified title and parent frame.
Definition at line 74 of file GenericDialog.java.
|
inline |
Adds a checkbox.
label | the label |
defaultValue | the initial state |
Definition at line 209 of file GenericDialog.java.
|
inline |
Adds a group of checkboxs using a grid layout.
rows | the number of rows |
columns | the number of columns |
labels | the labels |
defaultValues | the initial states |
Definition at line 235 of file GenericDialog.java.
|
inline |
Adds a popup menu.
label | the label |
items | the menu items |
defaultItem | the menu item initially selected |
Definition at line 272 of file GenericDialog.java.
|
inline |
Adds a message consisting of one or more lines of text.
Definition at line 299 of file GenericDialog.java.
|
inline |
Adds a numeric field. The first word of the label must be unique or command recording will not work.
label | the label |
defaultValue | value to be initially displayed |
digits | number of digits to right of decimal point |
Definition at line 92 of file GenericDialog.java.
|
inline |
Adds a numeric field. The first word of the label must be unique or command recording will not work.
label | the label |
defaultValue | value to be initially displayed |
digits | number of digits to right of decimal point |
columns | width of field in characters |
units | a string displayed to the right of the field |
Definition at line 104 of file GenericDialog.java.
|
inline |
Adds a Panel to the dialog.
Definition at line 420 of file GenericDialog.java.
|
inline |
Adds a Panel to the dialog with custom contraint and insets. The defaults are GridBagConstraints.WEST (left justified) and "new Insets(5, 0, 0, 0)" (5 pixels of padding at the top).
Definition at line 427 of file GenericDialog.java.
|
inline |
Adds an 8 column text field.
label | the label |
defaultText | the text initially displayed |
Definition at line 169 of file GenericDialog.java.
|
inline |
Adds a text field.
label | the label |
defaultText | text initially displayed |
columns | width of the text field |
Definition at line 178 of file GenericDialog.java.
|
inline |
Adds one or two (side by side) text areas.
text1 | initial contents of the first text area |
text2 | initial contents of the second text area or null |
rows | the number of rows |
rows | the number of columns |
Definition at line 320 of file GenericDialog.java.
|
inline |
Returns the Vector containing the Checkboxes.
Definition at line 636 of file GenericDialog.java.
|
inline |
Returns the Vector containing the Choices.
Definition at line 641 of file GenericDialog.java.
|
inline |
Returns an error message if getNextNumber was unable to convert a string into a number, otherwise, returns null.
Definition at line 512 of file GenericDialog.java.
|
inline |
Returns the state of the next checkbox.
Definition at line 530 of file GenericDialog.java.
|
inline |
Returns the selected item in the next popup menu.
Definition at line 542 of file GenericDialog.java.
|
inline |
Returns the index of the selected item in the next popup menu.
Definition at line 554 of file GenericDialog.java.
|
inline |
Returns the contents of the next numeric field.
Definition at line 443 of file GenericDialog.java.
|
inline |
Returns the contents of the next text field.
Definition at line 517 of file GenericDialog.java.
|
inline |
Returns the contents of the next text area.
Definition at line 566 of file GenericDialog.java.
|
inline |
Returns the Vector containing the numeric TextFields.
Definition at line 626 of file GenericDialog.java.
|
inline |
Returns the sliders (Scrollbars).
Definition at line 646 of file GenericDialog.java.
|
inline |
Returns the Vector containing the string TextFields.
Definition at line 631 of file GenericDialog.java.
|
inline |
Returns a reference to textArea1.
Definition at line 651 of file GenericDialog.java.
|
inline |
Returns a reference to textArea2.
Definition at line 656 of file GenericDialog.java.
|
inline |
Returns true if one or more of the numeric fields contained an invalid number. Must be called after one or more calls to getNextNumber().
Definition at line 504 of file GenericDialog.java.
|
inline |
Displays this dialog box.
Definition at line 586 of file GenericDialog.java.
|
inline |
Returns true if the user clicks on "Cancel".
Definition at line 438 of file GenericDialog.java.