Class ParameterPanel

All Implemented Interfaces:
ParameterPanelHandler, ImageObserver, MenuContainer, Serializable, Accessible

@PublicApi public class ParameterPanel extends JPanel implements ParameterPanelHandler
A configurable implementation of the plugin specific parameter setting panel. The panel has a n-row 2-column GridLayout, displaying each GUI parameter setter element in a single row with a preceeding display label. The panel is initialized by an array of ParameterTab objects which store data read from the XML configuration.
Since:
Marvin 4.0, 02/28/2005
See Also:
  • Field Details

    • items

      protected chemaxon.marvin.plugin.gui.ParameterItem[] items
  • Constructor Details

    • ParameterPanel

      public ParameterPanel(ParameterTab pane, ParameterTab[] tabs)
      Constructor.
      Parameters:
      pane - the main parameter pane
      tabs - the parameter tab data array
    • ParameterPanel

      public ParameterPanel(ParameterTab pane, ParameterTab[] tabs, chemaxon.marvin.plugin.gui.ParameterItem[] items)
      Constructor.
      Parameters:
      pane - the main parameter pane
      tabs - the parameter tab data array
  • Method Details

    • getComponent

      public Component getComponent()
      Returns the parameter panel component. This can be the object implementing this interface, in which case simply return this.
      Specified by:
      getComponent in interface ParameterPanelHandler
      Returns:
      the parameter panel component
    • getParameters

      public void getParameters(Properties params)
      Returns the plugin parameters. These can be stored parameters if the panel is not showing, but should be the currently visible parameter settings if the component is showing. Only the enabled parameter items are included.
      Specified by:
      getParameters in interface ParameterPanelHandler
      Parameters:
      params - is the properties object to be filled with the plugin parameters
    • getStoredParameters

      public void getStoredParameters(Properties params)
      Returns the stored parameters. All parameter items are included (also disabled).
      Specified by:
      getStoredParameters in interface ParameterPanelHandler
      Parameters:
      params - is the properties object to be filled with the plugin parameters
    • saveParameters

      public void saveParameters()
      Saves parameters from parameter panel. Should store the current settings in order to restore them later in reloadParameters(). (Called when "OK" is pressed: GUI -> INNER STORE)
      Specified by:
      saveParameters in interface ParameterPanelHandler
    • reloadParameters

      public void reloadParameters()
      Reloads previously stored parameters to parameter panel. (Called when "Cancel" is pressed: INNER STORE -> GUI)
      Specified by:
      reloadParameters in interface ParameterPanelHandler
    • restoreDefaultParameters

      public void restoreDefaultParameters()
      Restores default parameters to parameter panel. (Called when "Restore Defaults" is pressed: DEFAULTS -> GUI)
      Specified by:
      restoreDefaultParameters in interface ParameterPanelHandler
    • verifyParameters

      public boolean verifyParameters()
      Verifies parameters on the parameter panel. (E.g. checks if a textfield declared to be of type "Double" contains a string convertable to a double.)
      Specified by:
      verifyParameters in interface ParameterPanelHandler
      Returns:
      true if parameter setting is accepted, false otherwise
    • isOkActionEnabled

      public boolean isOkActionEnabled()
      Description copied from interface: ParameterPanelHandler
      Returns true if "OK" button is enabled.
      Specified by:
      isOkActionEnabled in interface ParameterPanelHandler
      Returns:
      true if "OK" button is enabled