net.imagej.patcher
Class HeadlessGenericDialog

java.lang.Object
  extended by net.imagej.patcher.HeadlessGenericDialog

public class HeadlessGenericDialog
extends Object

Rump implementation of a pseudo dialog intended to stand in for the GenericDialog in headless mode.

Author:
Johannes Schindelin

Field Summary
protected  List<Boolean> checkboxes
           
protected  int checkboxIndex
           
protected  int choiceIndex
           
protected  List<Integer> choiceIndices
           
protected  List<String> choices
           
protected  String errorMessage
           
protected  boolean invalidNumber
           
protected  int numberfieldIndex
           
protected  List<Double> numbers
           
protected  int radioButtonIndex
           
protected  List<String> radioButtons
           
protected  int stringfieldIndex
           
protected  List<String> strings
           
protected  String textArea1
           
protected  String textArea2
           
protected  int textAreaIndex
           
 
Constructor Summary
HeadlessGenericDialog()
           
 
Method Summary
 void accessTextFields()
           
 void addCheckbox(String label, boolean defaultValue)
           
 void addCheckboxGroup(int rows, int columns, String[] labels, boolean[] defaultValues)
           
 void addCheckboxGroup(int rows, int columns, String[] labels, boolean[] defaultValues, String[] headings)
           
 void addChoice(String label, String[] items, String defaultItem)
           
 void addDialogListener(DialogListener dl)
           
 void addHelp(String url)
           
 void addMessage(String text)
           
 void addMessage(String text, Font font)
           
 void addMessage(String text, Font font, Color color)
           
 void addNumericField(String label, double defaultValue, int digits)
           
 void addNumericField(String label, double defaultValue, int digits, int columns, String units)
           
 void addPanel(Panel panel)
           
 void addPanel(Panel panel, int contraints, Insets insets)
           
 void addPreviewCheckbox(PlugInFilterRunner pfr)
           
 void addPreviewCheckbox(PlugInFilterRunner pfr, String label)
           
 void addRadioButtonGroup(String label, String[] items, int rows, int columns, String defaultItem)
          Adds a radio button group.
 void addSlider(String label, double minValue, double maxValue, double defaultValue)
           
 void addStringField(String label, String defaultText)
           
 void addStringField(String label, String defaultText, int columns)
           
 void addTextAreas(String text1, String text2, int rows, int columns)
           
 void centerDialog(boolean b)
           
 void dispose()
           
 void enableYesNoCancel()
           
 void enableYesNoCancel(String yesLabel, String noLabel)
           
 void focusGained(FocusEvent e)
           
 void focusLost(FocusEvent e)
           
 Button[] getButtons()
           
 Vector<?> getCheckboxes()
           
 Vector<?> getChoices()
           
 String getErrorMessage()
           
 Insets getInsets()
           
 Component getMessage()
           
 boolean getNextBoolean()
           
 String getNextChoice()
           
 int getNextChoiceIndex()
           
 double getNextNumber()
           
 String getNextRadioButton()
          Returns the selected item in the next radio button group.
 String getNextString()
          Returns the contents of the next text field.
 String getNextText()
           
 Vector<?> getNumericFields()
           
 Checkbox getPreviewCheckbox()
           
 List<String> getRadioButtonGroups()
           
 Vector<?> getSliders()
           
 Vector<?> getStringFields()
           
 TextArea getTextArea1()
           
 TextArea getTextArea2()
           
 void hideCancelButton()
           
 boolean invalidNumber()
           
 boolean isPreviewActive()
           
 void previewRunning(boolean isRunning)
           
 void setEchoChar(char echoChar)
           
 void setHelpLabel(String label)
           
 void setInsets(int top, int left, int bottom)
           
 void setLocation(int x, int y)
           
 void setOKLabel(String label)
           
 void setSmartRecording(boolean smartRecording)
           
protected  void setup()
           
 void showDialog()
           
 void showHelp()
           
 boolean wasCanceled()
           
 boolean wasOKed()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numbers

protected List<Double> numbers

strings

protected List<String> strings

checkboxes

protected List<Boolean> checkboxes

choices

protected List<String> choices

choiceIndices

protected List<Integer> choiceIndices

textArea1

protected String textArea1

textArea2

protected String textArea2

radioButtons

protected List<String> radioButtons

numberfieldIndex

protected int numberfieldIndex

stringfieldIndex

protected int stringfieldIndex

checkboxIndex

protected int checkboxIndex

choiceIndex

protected int choiceIndex

textAreaIndex

protected int textAreaIndex

radioButtonIndex

protected int radioButtonIndex

invalidNumber

protected boolean invalidNumber

errorMessage

protected String errorMessage
Constructor Detail

HeadlessGenericDialog

public HeadlessGenericDialog()
Method Detail

addCheckbox

public void addCheckbox(String label,
                        boolean defaultValue)

addCheckboxGroup

public void addCheckboxGroup(int rows,
                             int columns,
                             String[] labels,
                             boolean[] defaultValues)

addCheckboxGroup

public void addCheckboxGroup(int rows,
                             int columns,
                             String[] labels,
                             boolean[] defaultValues,
                             String[] headings)

addChoice

public void addChoice(String label,
                      String[] items,
                      String defaultItem)

addNumericField

public void addNumericField(String label,
                            double defaultValue,
                            int digits)

addNumericField

public void addNumericField(String label,
                            double defaultValue,
                            int digits,
                            int columns,
                            String units)

addSlider

public void addSlider(String label,
                      double minValue,
                      double maxValue,
                      double defaultValue)

addStringField

public void addStringField(String label,
                           String defaultText)

addStringField

public void addStringField(String label,
                           String defaultText,
                           int columns)

addTextAreas

public void addTextAreas(String text1,
                         String text2,
                         int rows,
                         int columns)

getNextBoolean

public boolean getNextBoolean()

getNextChoice

public String getNextChoice()

getNextChoiceIndex

public int getNextChoiceIndex()

getNextNumber

public double getNextNumber()

getNextString

public String getNextString()
Returns the contents of the next text field.


getNextText

public String getNextText()

addRadioButtonGroup

public void addRadioButtonGroup(String label,
                                String[] items,
                                int rows,
                                int columns,
                                String defaultItem)
Adds a radio button group.


getRadioButtonGroups

public List<String> getRadioButtonGroups()

getNextRadioButton

public String getNextRadioButton()
Returns the selected item in the next radio button group.


invalidNumber

public boolean invalidNumber()

showDialog

public void showDialog()

wasCanceled

public boolean wasCanceled()

wasOKed

public boolean wasOKed()

dispose

public void dispose()

addDialogListener

public void addDialogListener(DialogListener dl)

addHelp

public void addHelp(String url)

addMessage

public void addMessage(String text)

addMessage

public void addMessage(String text,
                       Font font)

addMessage

public void addMessage(String text,
                       Font font,
                       Color color)

addPanel

public void addPanel(Panel panel)

addPanel

public void addPanel(Panel panel,
                     int contraints,
                     Insets insets)

addPreviewCheckbox

public void addPreviewCheckbox(PlugInFilterRunner pfr)

addPreviewCheckbox

public void addPreviewCheckbox(PlugInFilterRunner pfr,
                               String label)

centerDialog

public void centerDialog(boolean b)

setSmartRecording

public void setSmartRecording(boolean smartRecording)

enableYesNoCancel

public void enableYesNoCancel()

enableYesNoCancel

public void enableYesNoCancel(String yesLabel,
                              String noLabel)

focusGained

public void focusGained(FocusEvent e)

focusLost

public void focusLost(FocusEvent e)

getButtons

public Button[] getButtons()

getCheckboxes

public Vector<?> getCheckboxes()

getChoices

public Vector<?> getChoices()

getErrorMessage

public String getErrorMessage()

getInsets

public Insets getInsets()

getMessage

public Component getMessage()

getNumericFields

public Vector<?> getNumericFields()

getPreviewCheckbox

public Checkbox getPreviewCheckbox()

getSliders

public Vector<?> getSliders()

getStringFields

public Vector<?> getStringFields()

getTextArea1

public TextArea getTextArea1()

getTextArea2

public TextArea getTextArea2()

hideCancelButton

public void hideCancelButton()

previewRunning

public void previewRunning(boolean isRunning)

setEchoChar

public void setEchoChar(char echoChar)

setHelpLabel

public void setHelpLabel(String label)

setInsets

public void setInsets(int top,
                      int left,
                      int bottom)

setOKLabel

public void setOKLabel(String label)

setup

protected void setup()

accessTextFields

public void accessTextFields()

showHelp

public void showHelp()

setLocation

public void setLocation(int x,
                        int y)

isPreviewActive

public boolean isPreviewActive()


Copyright © 2009–2014 ImageJ. All rights reserved.