Class JDialogListSaveSelection

All Implemented Interfaces:
DialogDefaultsInterface, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
JDialogDicom2XMLSelection

public class JDialogListSaveSelection extends JDialogBase implements ActionListener, PropertyChangeListener
A basic dialog to read and parse the two options files, display the options in the files, and allow file action between the two. One or both of the files can be displayed, or hide one selector to prevent it from being changed.
Author:
parsonsd
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • selectFileA

      protected JPanelFileSelection selectFileA
      Indicates the source file for list A. The Default property name given to this file selector is "SelectFileA"
    • selectFileB

      protected JPanelFileSelection selectFileB
      Indicates the source file for list B. The Default property name given to this file selector is "SelectFileB"
    • selector

      Allows the user to modify listB based on either the file provided in selectFileA or selectFileB.
    • selectedList

      private JList selectedList
      List of selected VOIs.
    • sourceList

      private JList sourceList
      List of available VOIs.
  • Constructor Details

    • JDialogListSaveSelection

      public JDialogListSaveSelection()
      Creates a non-modal dialog, initializes the layout (@see initializeLayout) and registers the PropertyChangeListeners to connect the lists with the file structure. The lists are left to be populated by the child class calling populateLists().
    • JDialogListSaveSelection

      public JDialogListSaveSelection(boolean modal)
      Creates a dialog with the given modality, and will initialize the layout and register changes, but it will not populate the lists.
      Parameters:
      modal - Creates a dialog which is modal if true, and non-modal if false.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Invoked when an action occurs. Responds to the action command "ok" and the action command "cancel". When the action command "ok" occurs method calls okAction. Dismisses dialog when the action command "Cancel" occurs.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      e - The action event for the dialog.
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      This method gets called when a bound property is changed. Responds to changes in the property "SelectFileA" and "SelectFileB", by calling the appropriatly named method; namely, propertyChangeInSelectA and propertyChangeInSelectB.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      evt - A PropertyChangeEvent object describing the event source and the property that has changed.
      See Also:
    • buildSourcePanel

      protected JPanel buildSourcePanel()
      Creates the source panel which consists of the directory line, the browse button, and a check box approving the anonymize in sub-directories.
      Parameters:
      sourceList - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • cancelAction

      protected void cancelAction()
      Calls setVisible(false) to close the dialog. When an cancel action occurs, it calls this method, which is included for subclasses to cause independant actions, without needing to over-ride the action handler.
    • createButtonComponent

      protected JComponent createButtonComponent()
      Creates a display of the buttons (eg, OK, CANCEL, HELP) for the dialog. This method currently returns the panel generated by JDialogBase.buildButtons().

      Override this method to create custom designs.

      Returns:
      The panel of buttons for the dialog, as in JDialogBase.buildButtons()
      See Also:
    • createFileSelectorComponent

      protected JComponent createFileSelectorComponent()
      Creates the basic layout of the file selectors to be used in the dialog. Here, both file selectors (JPanelFileSelection) are created and sit on top of each other. Although this is where the file selector is created, the property name is added in registerChanges.

      Override this method to create custom designs (eg, assume a particular file and leave out the selector).

      Returns:
      JComponent which contains the file selectors so that they may be displayed.
      See Also:
    • createListComponent

      protected JComponent createListComponent()
      Creates the List Controller, and its associated lists, links them, and builds a horizontal display for all three using the default JPanelListController.createListControllerDisplay(JPanelListController) method.

      Override this method to create custom designs.

      Returns:
      JComponent which contains a displayable JPanelListController.
      See Also:
    • getSelectedList

      protected JList getSelectedList()
      Accessor to the list used to display the selected list.
      Returns:
      DOCUMENT ME!
    • getSourceList

      protected JList getSourceList()
      Accessor to the list used to display the Source.
      Returns:
      DOCUMENT ME!
    • initializeLayout

      protected void initializeLayout()
      Creates the basic layout and adds it to the content pane. The layout of the content pane here places a panel for selectors at the top, the JPanelListController is below both, with the buttons at the bottom.
      See Also:
    • okAction

      protected void okAction()
      When an OK action occurs, it calls this method, which is included for subclasses to cause independant actions, without needing to over-ride the action handler.
    • populateLists

      protected void populateLists()
      permits control over what items go in which lists. Use getSelectedList() and getSourceList() to apply these changes. Add items to preset the lists, and use the list controller and the property change listeners to control list items afterward.
    • propertyChangeInSelectA

      protected void propertyChangeInSelectA()
      Here to allow subclasses to select the action to occur when a property change occurs in the select A panel.
    • propertyChangeInSelectB

      protected void propertyChangeInSelectB()
      Here to allow subclasses to select the action to occur when a property change occurs in the select B panel.
    • registerChanges

      protected void registerChanges()
      Connects the file selection of each file selection panel to the appropriate list and ensures that it has the correct property name. if a list doesn't exist (if a subclass calls this method, when it didn't get created), the action will be ignored.
      See Also:
    • saveListB

      protected void saveListB()
      Method to save the items in List B. This is called by the OKAY button, so it may be implementation dependant.
    • buildSelectedListing

      private JPanel buildSelectedListing()
      creates the visual display in which to list all selected directories in the directory tree. The panel is 240 pixels wide though that is supposed to be the minimum size
      Returns:
      the panel which is to hold the list of selected items
    • buildSourceListingPanel

      private JPanel buildSourceListingPanel()
      Creates the panel holding the directory tree.
      Parameters:
      sourceVector - DOCUMENT ME!
      Returns:
      Panel.