Class SingleOrMultipleInputImageSelectionPanel

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.xinapse.image.SingleOrMultipleInputImageSelectionPanel
All Implemented Interfaces:
PreferencesSettable, ImageObserver, MenuContainer, Serializable, Accessible

public class SingleOrMultipleInputImageSelectionPanel extends JPanel implements PreferencesSettable
A JPanel for selecting a single or multiple input images, depending on a user-selection.
See Also:
  • Constructor Details

    • SingleOrMultipleInputImageSelectionPanel

      public SingleOrMultipleInputImageSelectionPanel(MessageShower messageShower, String prefsNodeName)
      Creates a new SingleOrMultipleInputImageSelectionPanel with messages going to the MessageShower.
      Parameters:
      messageShower - the MessageShower that will receive messages.
      prefsNodeName - the Preferences node name that will be used to set the initial state.
  • Method Details

    • getInputImages

      public ReadableImage[] getInputImages() throws InvalidArgumentException
      Returns the input images set in this SingleOrMultipleInputImageSelectionPanel.
      Returns:
      the input images set in this SingleOrMultipleInputImageSelectionPanel.
      Throws:
      InvalidArgumentException - if the image(s) have not been set, or if the input image(s) cannot be opened.
    • isSingleInputImage

      public boolean isSingleInputImage()
      Returns whether configured with a single input image.
      Returns:
      true if configured for a single input image; false if configured for multiple input images.
    • setInputImageConfiguration

      public void setInputImageConfiguration(Boolean isSingleInputImage)
      Sets the configuration to have a single input image. Simulates the user clicking the appropriate buttons to set the configuration.
      Parameters:
      isSingleInputImage - if null, does nothing to the single/multiple input image configuration.
      • If Boolean.TRUE, sets a single input image configuration.
      • If Boolean.FALSE, sets a multiple input images configuration.
    • setDefaults

      public void setDefaults()
      Description copied from interface: PreferencesSettable
      Set the default values.
      Specified by:
      setDefaults in interface PreferencesSettable
    • savePreferences

      public void savePreferences(Preferences prefs)
      Description copied from interface: PreferencesSettable
      Save the current settings to the user Preferences at the given node name.
      Specified by:
      savePreferences in interface PreferencesSettable
      Parameters:
      prefs - the Preferences to which the current settings will be saved.
    • clearFiles

      public void clearFiles()
      Clears the currently-set files names, so that the file names are un-initialised.
    • showError

      public void showError(String errorMessage)
      Description copied from interface: PreferencesSettable
      Show an error message (in case the current settings are invalid).
      Specified by:
      showError in interface PreferencesSettable
      Parameters:
      errorMessage - the message to show.
    • setEnabled

      public void setEnabled(boolean b)
      Overrides:
      setEnabled in class JComponent