Class OptionsDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener
Direct Known Subclasses:
OptionsEditorDialog

public class OptionsDialog extends JPanel implements ChangeListener
Generic options dialog. Once the dialog is created content can be added to it with addContent
Author:
Nick Collier
See Also:
  • Field Details

    • DIALOG_WIDTH

      public static int DIALOG_WIDTH
    • DIALOG_HEIGHT

      public static int DIALOG_HEIGHT
    • dialog

      protected JDialog dialog
  • Constructor Details

    • OptionsDialog

      public OptionsDialog()
  • Method Details

    • addContent

      public void addContent(String name, Icon icon, OptionsDialogContent content)
      Adds the specified content as an option in this dialog.
      Parameters:
      name - the name of the content to display
      icon - the icon
      content - the content
    • isCanceled

      public boolean isCanceled()
      Returns:
      true if the dialog was canceled, otherwise false.
    • ok

      protected void ok()
    • apply

      protected void apply()
    • cancel

      protected void cancel()
    • stateChanged

      public void stateChanged(ChangeEvent evt)
      Specified by:
      stateChanged in interface ChangeListener
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Invoked when one of the option buttons is clicked.
      Parameters:
      e -
    • displayInit

      protected void displayInit(Component parent)
      Initializes the dialog for display. This sets the layout, packs() it and so forth.
      Parameters:
      parent -
    • showDialog

      public void showDialog(JFrame parent, String title)
    • showDialog

      public void showDialog(JDialog parent, String title)