Class AbstractOptionPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, OptionPane
Direct Known Subclasses:
AddonsOptionsPane, LoadSaveOptionsPane, OverviewOptionPane, ParameterOptionPane, ShortcutsOptionPane, ToolBarOptionPane

public abstract class AbstractOptionPane
extends JPanel
implements OptionPane
The default implementation of the option pane interface. It lays out components in a vertical fashion.
Version:
$Revision: 1.6 $
See Also:
Serialized Form
  • Method Details

    • getOptionDialogComponent

      public JComponent getOptionDialogComponent()
      Returns the component that should be displayed for this option pane. Because this class implements component, it simply returns this.
      Specified by:
      getOptionDialogComponent in interface OptionPane
      Returns:
      DOCUMENT ME!
    • getName

      public String getName()
      Returns the internal name of the option pane.
      Specified by:
      getName in interface OptionPane
      Overrides:
      getName in class Component
      Returns:
      the internal name of the option pane.
    • addComponent

      public void addComponent​(String label, Component component)
      Adds the given label and component to the option pane. Components are added in vertical fashion, one per row. The label is displayed to the left of the component.
      Parameters:
      label - the label.
      component - the component.
    • addComponent

      public void addComponent​(Component component)
      Adds the given component to the option pane. Components are added in vertical fashion., one per row.
      Parameters:
      component - the component.
    • addComponent

      public void addComponent​(Component component, int anchor)
      Adds a component according to an anchor. This allows for more flexible placement of Components over the pane. However, there are still general constraints taking place, because of the orientation, here horizontal, and display area.

      If the provided anchor argument doesn't match a GridBagConstraints Anchor value, then the component is simply not added.

      Parameters:
      component - the component
      anchor - GridBagConstraints anchor value
    • addSeparator

      public void addSeparator​(String label)
      Adds a separator to the option pane.
      Parameters:
      label - the separator label.
    • init

      public void init​(JComponent comp)
      This method is called every time this option pane is displayed. The AbstractOptionPane class uses this to create the option pane's GUI only when needed.
      Specified by:
      init in interface OptionPane
    • save

      public void save​(JComponent options)
      Description copied from interface: OptionPane
      Called when the options dialog's "ok" button is clicked. This should save any properties being edited in this option pane.
      Specified by:
      save in interface OptionPane
    • save

      public void save()
      Called when the options dialog's "ok" button is clicked. This should save any properties being edited in this option pane.