Package gov.nih.mipav.view.dialogs
Class JDialogEditor
- 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.JDialogEditor
-
- 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.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
public class JDialogEditor extends JDialogBase
Simple editor using JPanelEdits. Goal for 1.1 is to make JDialogDICOMTagEditor a subclass of this.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKAction
-
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
-
-
Field Summary
Fields Modifier and Type Field Description static int
ANALYZE_AUX
DOCUMENT ME!static int
ANALYZE_AXIS_ORIENTATION
DOCUMENT ME!static int
ANALYZE_CAL
DOCUMENT ME!static int
ANALYZE_DATATYPE
DOCUMENT ME!static int
ANALYZE_DBNAME
DOCUMENT ME!static int
ANALYZE_DESCRIPTION
DOCUMENT ME!static int
ANALYZE_ORIENTATION
DOCUMENT ME!static int
ANALYZE_ORIGINATOR
DOCUMENT ME!static int
ANALYZE_VOX
DOCUMENT ME!static int
BOOLEAN
DOCUMENT ME!static int
CHAR
DOCUMENT ME!protected boolean
closedOkay
DOCUMENT ME!static int
FILE_STRING
DOCUMENT ME!static int
FLOAT_STRING
DOCUMENT ME!static int
IMAGE_ORIENTATION
DOCUMENT ME!private java.lang.String
imageFileName
DOCUMENT ME!static int
INT_STRING
DOCUMENT ME!protected java.lang.Object
key
the representative key of this object; must be unique.protected JPanelEdit[]
newValue
DOCUMENT ME!protected javax.swing.JTextField
oldValue
DOCUMENT ME!private java.lang.String
psetDesc
DOCUMENT ME!private int
row
DOCUMENT ME!private static long
serialVersionUID
Use serialVersionUID for interoperability.static int
STRING
DOCUMENT ME!static int
XML_DATE
DOCUMENT ME!static int
XML_DOB
DOCUMENT ME!static int
XML_LINKEDIMAGE
DOCUMENT ME!static int
XML_MODALITY
DOCUMENT ME!static int
XML_RACE
DOCUMENT ME!static int
XML_SETORPARAM
DOCUMENT ME!static int
XML_SEX
DOCUMENT ME!static int
XML_TIME
DOCUMENT ME!static int
XML_VALUETYPE
DOCUMENT ME!-
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, voiManager
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description JDialogEditor(java.awt.Dialog owner, java.lang.Object tag, java.lang.Object[] old, int[] editorType)
sadly, the dialog doesn't know how to figure out what editor panels to apply to the different inputs, so old values must be sent as an array of objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent ae)
DOCUMENT ME!private javax.swing.JPanel
buildOkayCancelPanel()
creates a JPanel to hold the Okay and Cancel buttons. in a FlowLayout; presets all the listeners to the buttons, the fonts and text colour.java.lang.String
getDisplayValue()
this editor's okay editable value.java.lang.String
getDisplayValueForInfo()
used when editing images associated with a project.java.lang.String
getDisplayValueForParam()
DOCUMENT ME!java.lang.String
getImageFileName()
DOCUMENT ME!java.lang.Object
getKey()
DOCUMENT ME!java.lang.String
getPSetDescription()
DOCUMENT ME!int
getRow()
DOCUMENT ME!java.util.Vector<java.lang.Object>
getValue()
panel may have many seperate fields of entry for the user to speeratetly enter some values.boolean
isDialogOkay()
check the dialog so that if all the fields are okay (have the right number of digits, etc) and there are no messages to send back to the user about correctness.JPanelEdit
makeAppropriateInputPanel(java.lang.String oldVal, int edType)
Selects the panel for a given inputted edType, filling it the given string.void
setImageFileName(java.lang.String file)
DOCUMENT ME!void
setKey(java.lang.Object tag)
DOCUMENT ME!void
setPSetDescription(java.lang.String desc)
DOCUMENT ME!void
setRow(int row)
DOCUMENT ME!void
setTable(java.util.Hashtable<?,?> ht, boolean isSet)
DOCUMENT ME!boolean
wasDialogOkay()
dialog is closed, but can its value be accepted now?-
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, windowOpened
-
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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
CHAR
public static final int CHAR
DOCUMENT ME!- See Also:
- Constant Field Values
-
STRING
public static final int STRING
DOCUMENT ME!- See Also:
- Constant Field Values
-
INT_STRING
public static final int INT_STRING
DOCUMENT ME!- See Also:
- Constant Field Values
-
FLOAT_STRING
public static final int FLOAT_STRING
DOCUMENT ME!- See Also:
- Constant Field Values
-
ANALYZE_DATATYPE
public static final int ANALYZE_DATATYPE
DOCUMENT ME!- See Also:
- Constant Field Values
-
ANALYZE_ORIENTATION
public static final int ANALYZE_ORIENTATION
DOCUMENT ME!- See Also:
- Constant Field Values
-
ANALYZE_DESCRIPTION
public static final int ANALYZE_DESCRIPTION
DOCUMENT ME!- See Also:
- Constant Field Values
-
ANALYZE_ORIGINATOR
public static final int ANALYZE_ORIGINATOR
DOCUMENT ME!- See Also:
- Constant Field Values
-
ANALYZE_AUX
public static final int ANALYZE_AUX
DOCUMENT ME!- See Also:
- Constant Field Values
-
ANALYZE_DBNAME
public static final int ANALYZE_DBNAME
DOCUMENT ME!- See Also:
- Constant Field Values
-
ANALYZE_VOX
public static final int ANALYZE_VOX
DOCUMENT ME!- See Also:
- Constant Field Values
-
ANALYZE_CAL
public static final int ANALYZE_CAL
DOCUMENT ME!- See Also:
- Constant Field Values
-
ANALYZE_AXIS_ORIENTATION
public static final int ANALYZE_AXIS_ORIENTATION
DOCUMENT ME!- See Also:
- Constant Field Values
-
IMAGE_ORIENTATION
public static final int IMAGE_ORIENTATION
DOCUMENT ME!- See Also:
- Constant Field Values
-
XML_MODALITY
public static final int XML_MODALITY
DOCUMENT ME!- See Also:
- Constant Field Values
-
XML_RACE
public static final int XML_RACE
DOCUMENT ME!- See Also:
- Constant Field Values
-
XML_DOB
public static final int XML_DOB
DOCUMENT ME!- See Also:
- Constant Field Values
-
XML_SEX
public static final int XML_SEX
DOCUMENT ME!- See Also:
- Constant Field Values
-
XML_DATE
public static final int XML_DATE
DOCUMENT ME!- See Also:
- Constant Field Values
-
XML_TIME
public static final int XML_TIME
DOCUMENT ME!- See Also:
- Constant Field Values
-
XML_VALUETYPE
public static final int XML_VALUETYPE
DOCUMENT ME!- See Also:
- Constant Field Values
-
XML_SETORPARAM
public static final int XML_SETORPARAM
DOCUMENT ME!- See Also:
- Constant Field Values
-
XML_LINKEDIMAGE
public static final int XML_LINKEDIMAGE
DOCUMENT ME!- See Also:
- Constant Field Values
-
BOOLEAN
public static final int BOOLEAN
DOCUMENT ME!- See Also:
- Constant Field Values
-
FILE_STRING
public static final int FILE_STRING
DOCUMENT ME!- See Also:
- Constant Field Values
-
closedOkay
protected boolean closedOkay
DOCUMENT ME!
-
key
protected java.lang.Object key
the representative key of this object; must be unique.
-
newValue
protected JPanelEdit[] newValue
DOCUMENT ME!
-
oldValue
protected javax.swing.JTextField oldValue
DOCUMENT ME!
-
imageFileName
private java.lang.String imageFileName
DOCUMENT ME!
-
psetDesc
private java.lang.String psetDesc
DOCUMENT ME!
-
row
private int row
DOCUMENT ME!
-
-
Constructor Detail
-
JDialogEditor
public JDialogEditor(java.awt.Dialog owner, java.lang.Object tag, java.lang.Object[] old, int[] editorType)
sadly, the dialog doesn't know how to figure out what editor panels to apply to the different inputs, so old values must be sent as an array of objects.- Parameters:
owner
- an array of Object that is the coded value for each of the values. The Old values will be printed out seperated by spaces.tag
- a unique identifier for this editor (use getKey())old
- DOCUMENT ME!editorType
- an array specifying how each of the old values are to be edited. Ie.,
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
DOCUMENT ME!- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classJDialogBase
- Parameters:
ae
- DOCUMENT ME!
-
getDisplayValue
public java.lang.String getDisplayValue()
this editor's okay editable value.all output strings are placed together, seperated by a space.
It might be required to subclass this method to have the seperator character be something else.
- Returns:
- DOCUMENT ME!
-
getDisplayValueForInfo
public java.lang.String getDisplayValueForInfo()
used when editing images associated with a project.- Returns:
- DOCUMENT ME!
-
getDisplayValueForParam
public java.lang.String getDisplayValueForParam()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getImageFileName
public java.lang.String getImageFileName()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getKey
public java.lang.Object getKey()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getPSetDescription
public java.lang.String getPSetDescription()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getRow
public int getRow()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getValue
public java.util.Vector<java.lang.Object> getValue()
panel may have many seperate fields of entry for the user to speeratetly enter some values. For instance, if the date were entered in several different fields [month] [day] [year], then the return values could be the set {01, 01, 01}, instead of {jan, 01, 2001}. The way the returns is implementation specific, but that this permits a panel to interperet data for the caller.- Returns:
- The value of the Panel which can be in any format appropriate to the type, containing as many fields as needed to represent each distinct field of entry in the panel.
- See Also:
JPanelEdit.getCodedValue()
-
isDialogOkay
public boolean isDialogOkay()
check the dialog so that if all the fields are okay (have the right number of digits, etc) and there are no messages to send back to the user about correctness.- Returns:
- boolean true if the dialog box is closing okay.
-
makeAppropriateInputPanel
public JPanelEdit makeAppropriateInputPanel(java.lang.String oldVal, int edType)
Selects the panel for a given inputted edType, filling it the given string. If the editor Type is not found, the JPanelEditDefault is returned.- Parameters:
oldVal
- The string to fill the editor wedType
- the editor panel to use- Returns:
- the apropriate JPanelEdit.
-
setImageFileName
public void setImageFileName(java.lang.String file)
DOCUMENT ME!- Parameters:
file
- DOCUMENT ME!
-
setKey
public void setKey(java.lang.Object tag)
DOCUMENT ME!- Parameters:
tag
- DOCUMENT ME!
-
setPSetDescription
public void setPSetDescription(java.lang.String desc)
DOCUMENT ME!- Parameters:
desc
- DOCUMENT ME!
-
setRow
public void setRow(int row)
DOCUMENT ME!- Parameters:
row
- DOCUMENT ME!
-
setTable
public void setTable(java.util.Hashtable<?,?> ht, boolean isSet)
DOCUMENT ME!- Parameters:
ht
- DOCUMENT ME!isSet
- DOCUMENT ME!
-
wasDialogOkay
public boolean wasDialogOkay()
dialog is closed, but can its value be accepted now?- Returns:
- DOCUMENT ME!
-
buildOkayCancelPanel
private javax.swing.JPanel buildOkayCancelPanel()
creates a JPanel to hold the Okay and Cancel buttons. in a FlowLayout; presets all the listeners to the buttons, the fonts and text colour.- Returns:
- the built and loaded JPanel.
-
-