Package gov.nih.mipav.view.dialogs
Class JDialogListSaveSelection
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
gov.nih.mipav.view.dialogs.JDialogBase
gov.nih.mipav.view.dialogs.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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA type of JPanelListController which spefically defines the left-direction buttons to be disabled and the delete button to be enabled.classDOCUMENT ME!Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKActionNested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JListList of selected VOIs.protected JPanelFileSelectionIndicates the source file for list A.protected JPanelFileSelectionIndicates the source file for list B.Allows the user to modify listB based on either the file provided in selectFileA or selectFileB.private static final longUse serialVersionUID for interoperability.private JListList of available VOIs.Fields inherited from class gov.nih.mipav.view.dialogs.JDialogBase
applyButton, bar, cancelButton, cancelFlag, closeButton, HELP, helpButton, mainDialogPanel, NEW, OKButton, parentFrame, progressBar, REPLACE, runInSeparateThread, runningScriptFlag, runQuiet, serif12, serif12B, voiManagerFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptionvoidInvoked when an action occurs.private JPanelcreates the visual display in which to list all selected directories in the directory tree.private JPanelCreates the panel holding the directory tree.protected JPanelCreates the source panel which consists of the directory line, the browse button, and a check box approving the anonymize in sub-directories.protected voidCallssetVisible(false)to close the dialog.protected JComponentCreates a display of the buttons (eg, OK, CANCEL, HELP) for the dialog.protected JComponentCreates the basic layout of the file selectors to be used in the dialog.protected JComponentCreates the List Controller, and its associated lists, links them, and builds a horizontal display for all three using the defaultJPanelListController.createListControllerDisplay(JPanelListController)method.protected JListAccessor to the list used to display the selected list.protected JListAccessor to the list used to display the Source.protected voidCreates the basic layout and adds it to the content pane.protected voidokAction()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 voidpermits control over what items go in which lists.voidThis method gets called when a bound property is changed.protected voidHere to allow subclasses to select the action to occur when a property change occurs in the select A panel.protected voidHere to allow subclasses to select the action to occur when a property change occurs in the select B panel.protected voidConnects 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 voidMethod to save the items in List B.Methods inherited from class gov.nih.mipav.view.dialogs.JDialogBase
buildApplyButton, buildButtons, buildCancelButton, buildCancelButton, buildCloseButton, buildHelpButton, buildImageComboBox, buildOKButton, buildOKButton, buildOKCancelButtons, buildTitledBorder, buildTitledBorder, createLabel, createProgressBar, createProgressBar, createTextField, focusGained, focusLost, getDialogName, isCancelled, isQuietRunning, isRunInSeparateThread, isScriptRunning, itemStateChanged, loadDefaults, loadDefaults, makeImageName, makeString, openNewFrame, saveDefaults, saveDefaults, setLeftHandSystem, setQuietRunning, setScriptRunning, setSeparateThread, setVisible, setVisible, setVisibleMenuBar, setVisibleStandard, setVOIManager, setWCSystem, testParameter, testParameterMin, updateFFTFileInfo, updateFileInfo, updateFileInfoOtherModality, updateFileInfoStatic, updateFileInfoStatic, updateFileTypeInfo, updateFileTypeInfo, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpenedMethods 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, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods 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, toFrontMethods 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, validateTreeMethods 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
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
selectFileA
Indicates the source file for list A. The Default property name given to this file selector is "SelectFileA" -
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
List of selected VOIs. -
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 callingpopulateLists(). -
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 iftrue, and non-modal iffalse.
-
-
Method Details
-
actionPerformed
Invoked when an action occurs. Responds to the action command "ok" and the action command "cancel". When the action command "ok" occurs method callsokAction. Dismisses dialog when the action command "Cancel" occurs.- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJDialogBase- Parameters:
e- The action event for the dialog.
-
propertyChange
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,propertyChangeInSelectAandpropertyChangeInSelectB.- Specified by:
propertyChangein interfacePropertyChangeListener- Parameters:
evt- A PropertyChangeEvent object describing the event source and the property that has changed.- See Also:
-
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()CallssetVisible(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
Creates a display of the buttons (eg, OK, CANCEL, HELP) for the dialog. This method currently returns the panel generated byJDialogBase.buildButtons().Override this method to create custom designs.
- Returns:
- The panel of buttons for the dialog, as in JDialogBase.buildButtons()
- See Also:
-
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 inregisterChanges.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
Creates the List Controller, and its associated lists, links them, and builds a horizontal display for all three using the defaultJPanelListController.createListControllerDisplay(JPanelListController)method.Override this method to create custom designs.
- Returns:
- JComponent which contains a displayable JPanelListController.
- See Also:
-
getSelectedList
Accessor to the list used to display the selected list.- Returns:
- DOCUMENT ME!
-
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
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
Creates the panel holding the directory tree.- Parameters:
sourceVector- DOCUMENT ME!- Returns:
- Panel.
-