Class JDialogListSaveSelection

  • All Implemented Interfaces:
    DialogDefaultsInterface, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    Direct Known Subclasses:
    JDialogDicom2XMLSelection

    public class JDialogListSaveSelection
    extends JDialogBase
    implements java.awt.event.ActionListener, java.beans.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:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  JDialogListSaveSelection.JPanelListSelection
      A type of JPanelListController which spefically defines the left-direction buttons to be disabled and the delete button to be enabled.
      class  JDialogListSaveSelection.TagComparator
      DOCUMENT ME!
      • Nested classes/interfaces inherited from class javax.swing.JDialog

        javax.swing.JDialog.AccessibleJDialog
      • Nested classes/interfaces inherited from class java.awt.Dialog

        java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Constructor Summary

      Constructors 
      Constructor Description
      JDialogListSaveSelection()
      Creates a non-modal dialog, initializes the layout (@see initializeLayout) and registers the PropertyChangeListeners to connect the lists with the file structure.
      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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)
      Invoked when an action occurs.
      private javax.swing.JPanel buildSelectedListing()
      creates the visual display in which to list all selected directories in the directory tree.
      private javax.swing.JPanel buildSourceListingPanel()
      Creates the panel holding the directory tree.
      protected javax.swing.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.
      protected void cancelAction()
      Calls setVisible(false) to close the dialog.
      protected javax.swing.JComponent createButtonComponent()
      Creates a display of the buttons (eg, OK, CANCEL, HELP) for the dialog.
      protected javax.swing.JComponent createFileSelectorComponent()
      Creates the basic layout of the file selectors to be used in the dialog.
      protected javax.swing.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.
      protected javax.swing.JList getSelectedList()
      Accessor to the list used to display the selected list.
      protected javax.swing.JList getSourceList()
      Accessor to the list used to display the Source.
      protected void initializeLayout()
      Creates the basic layout and adds it to the content pane.
      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.
      protected void populateLists()
      permits control over what items go in which lists.
      void propertyChange​(java.beans.PropertyChangeEvent evt)
      This method gets called when a bound property is changed.
      protected void propertyChangeInSelectA()
      Here to allow subclasses to select the action to occur when a property change occurs in the select A panel.
      protected void propertyChangeInSelectB()
      Here to allow subclasses to select the action to occur when a property change occurs in the select B panel.
      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.
      protected void saveListB()
      Method to save the items in List B.
      • Methods inherited from class javax.swing.JDialog

        addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Dialog

        addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • 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"
      • selectedList

        private javax.swing.JList selectedList
        List of selected VOIs.
      • sourceList

        private javax.swing.JList sourceList
        List of available VOIs.
    • Constructor Detail

      • 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 Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.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 java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
        Parameters:
        e - The action event for the dialog.
      • propertyChange

        public void propertyChange​(java.beans.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 java.beans.PropertyChangeListener
        Parameters:
        evt - A PropertyChangeEvent object describing the event source and the property that has changed.
        See Also:
        propertyChangeInSelectA(), propertyChangeInSelectB()
      • buildSourcePanel

        protected javax.swing.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 javax.swing.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:
        JDialogBase.buildButtons()
      • createFileSelectorComponent

        protected javax.swing.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:
        JPanelFileSelection, initializeLayout(), registerChanges()
      • createListComponent

        protected javax.swing.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:
        JPanelListController, JPanelListController.createListControllerDisplay, initializeLayout()
      • getSelectedList

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

        protected javax.swing.JList getSourceList()
        Accessor to the list used to display the Source.
        Returns:
        DOCUMENT ME!
      • 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:
        selectFileA, selectFileB
      • 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 javax.swing.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 javax.swing.JPanel buildSourceListingPanel()
        Creates the panel holding the directory tree.
        Parameters:
        sourceVector - DOCUMENT ME!
        Returns:
        Panel.