Class 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 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
      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 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
      • 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_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
      • 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 interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
        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 w
        edType - 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.