Class JDialogFileInfoXML

  • 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 JDialogFileInfoXML
    extends JDialogBase
    implements java.awt.event.ActionListener
    This class shows the dialog which conatains the file-info header information as used in the FileInfoBase class.

    it builds two tables, and any row can be made editable when supplied with the appropriate editor to use. Entries that are edited okay, reports updates to file info.

    It merely brings up a JDalogEditor when "edit" button is clicked.

    17 January 2002: Right now, this class is set up to handle only FileInfoAnalyze edits. This is because the

    Version:
    0.2
    Author:
    parsonsd;
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  JDialogFileInfoXML.PSetDisplay
      Class to hold one table, model, & label per parameter set There can be infinite parameter sets, and the sets are deletable, so each set display must be stored in a hashtable for easy access/deletion.
      class  JDialogFileInfoXML.SurfaceDisplay
      Class to hold one table, model, & label per parameter set There can be infinite parameter sets, and the sets are deletable, so each set display must be stored in a hashtable for easy access/deletion.
      • 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
      JDialogFileInfoXML​(java.awt.Frame parent, java.lang.String title, ModelImage img)
      Creates a new JDialogFileInfoXML object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String accessPrimaryData​(java.lang.String name)
      permits the caller to get a value out of the primary table by using the name given to the fileInfo.
      void actionPerformed​(java.awt.event.ActionEvent e)
      closes the dialog when the user clicks close.
      void appendInvestigatorData​(java.lang.String name, java.lang.String value, int[] editor)
      appends an editable row to the end of the investigators table.
      void appendParameter​(java.lang.String setDesc, java.lang.String paramName, java.lang.String paramDesc, java.lang.String valueType, java.lang.String value, java.lang.String date, java.lang.String time)
      appends an editable row with the given parameter data to the proper set display table.
      void appendPrimaryData​(java.lang.String name, java.lang.String value)
      appends a non editable row to the end of the primary table.
      void appendPrimaryData​(java.lang.String name, java.lang.String value, int[] editor)
      appends a row to the end of the primary info table. assigns this name/value pair to be editable and adds the fileinfo to listen for this name.
      void appendScanData​(java.lang.String name, java.lang.String value, int[] editor)
      appends an editable row to the end of the scan information table.
      void appendSubjectData​(java.lang.String name, java.lang.String value, int[] editor)
      appends an editable row to the end of the subject information table.
      void appendTagData​(java.lang.String tag, java.lang.String name, java.lang.String value, int[] editor)
      appends an editable row to the end of the tag table.
      private boolean bringToFront​(java.lang.String tagKey, java.util.Hashtable<java.lang.String,​JDialogEditor> model)
      checks whether or not the dialog exists; if it does, it brings the dialog to front.
      void displayAboutInfo​(FileInfoImageXML fileInfo)
      makes the display frame. builds the layout.
      void keyTyped​(java.awt.event.KeyEvent ke)
      DOCUMENT ME!
      protected java.lang.String[] separateValues​(java.lang.String incoming)
      Divides space separate strings into an array of strings.
      private static void sort​(ViewTableModel model, int col, boolean reverse)
      Sort the tag column or name column of the table model.
      • 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
      • addParam

        private final javax.swing.JMenuItem addParam
        menu item for adding parameter.
      • addSet

        private javax.swing.JButton addSet
        button for adding sets.
      • addSurface

        private javax.swing.JButton addSurface
        button for adding surfaces.
      • edit

        private javax.swing.JButton edit
        edit button.
      • expandTags

        private javax.swing.JButton expandTags
        expand dicom tags button.
      • isExpanded

        private boolean isExpanded
        are the dicom tags expanded *
      • editorDialogTable

        private java.util.Hashtable<?,​JDialogEditor> editorDialogTable
        hashtable to store editor dialogs associated with the table.
      • image

        private final ModelImage image
        model image associated with the FileInfo.
      • investigatorModel

        private ViewTableModel investigatorModel
        model associated with investigator information.
      • tagModel

        private ViewTableModel tagModel
        model associated with tag information.
      • investigatorTable

        private javax.swing.JTable investigatorTable
        investigator information table.
      • tagTable

        private javax.swing.JTable tagTable
      • masterScrollPane

        private javax.swing.JScrollPane masterScrollPane
        master scroll pane in which to display all information.
      • numSets

        private int numSets
        counter for number of sets within file info.
      • parameterColumnNames

        private final java.lang.String[] parameterColumnNames
        array of strings for parameter column names.
      • primaryModel

        private ViewTableModel primaryModel
        model associated with primary image information.
      • primaryTable

        private javax.swing.JTable primaryTable
        primary image information table.
      • primaryTypeHolder

        private final java.util.Hashtable<java.lang.Integer,​java.util.Vector<java.lang.Integer>> primaryTypeHolder
        Type holds the type of editor, editor holds the actual editor dialog.
      • primaryEditorHolder

        private final java.util.Hashtable<java.lang.Integer,​JDialogEditor> primaryEditorHolder
      • subjectTypeHolder

        private java.util.Hashtable<java.lang.Integer,​java.util.Vector<java.lang.Integer>> subjectTypeHolder
      • subjectEditorHolder

        private java.util.Hashtable<java.lang.Integer,​JDialogEditor> subjectEditorHolder
      • scanTypeHolder

        private java.util.Hashtable<java.lang.Integer,​java.util.Vector<java.lang.Integer>> scanTypeHolder
      • scanEditorHolder

        private java.util.Hashtable<java.lang.Integer,​JDialogEditor> scanEditorHolder
      • investigatorTypeHolder

        private java.util.Hashtable<java.lang.Integer,​java.util.Vector<java.lang.Integer>> investigatorTypeHolder
      • investigatorEditorHolder

        private java.util.Hashtable<java.lang.Integer,​JDialogEditor> investigatorEditorHolder
      • tagTypeHolder

        private java.util.Hashtable<java.lang.Integer,​java.util.Vector<java.lang.Integer>> tagTypeHolder
      • removeParam

        private javax.swing.JButton removeParam
        button for removing parameters.
      • removeSurface

        private javax.swing.JButton removeSurface
        button for removing surfaces.
      • scanModel

        private ViewTableModel scanModel
        model associated with scan information.
      • scanTable

        private javax.swing.JTable scanTable
        scan infomation table.
      • scrollingBox

        private javax.swing.Box scrollingBox
        Box to hold table information.
      • tagLabel

        private javax.swing.JLabel tagLabel
      • setDescforAddParam

        private java.lang.String setDescforAddParam
        string holding set description when adding a parameter.
      • setHashtable

        private final java.util.Hashtable<java.lang.String,​JDialogFileInfoXML.PSetDisplay> setHashtable
        hash table holding set information.
      • subjectModel

        private ViewTableModel subjectModel
        model associated with subject information.
      • subjectTable

        private javax.swing.JTable subjectTable
        subject information table.
      • surfaceColumnNames

        private final java.lang.String[] surfaceColumnNames
        array of strings for surface column names.
    • Constructor Detail

      • JDialogFileInfoXML

        public JDialogFileInfoXML​(java.awt.Frame parent,
                                  java.lang.String title,
                                  ModelImage img)
        Creates a new JDialogFileInfoXML object.
        Parameters:
        parent - Frame
        title - String
        img - ModelImage
    • Method Detail

      • accessPrimaryData

        public java.lang.String accessPrimaryData​(java.lang.String name)
        permits the caller to get a value out of the primary table by using the name given to the fileInfo.
        Parameters:
        name - DOCUMENT ME!
        Returns:
        the value returned is the first value which keys to this name; any other instances of the name will be ignored. Null is returned if the name cannot be found
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        closes the dialog when the user clicks close.

        Creates editor dialogs to allow changing the value-field of a tag when user clicks "Edit Tag" button. This implmentation supports virtually any number of tag editors, bringing forward any previously opened editor. Most processing occurs when this class hears an editor window close;

        will alert any open window (frame) to set title as that information may have changed.

        to make this more FileInfoBase friendly, add a public static void stateChanged(Vector) to FileInfoBase. Then remove the references to the cast. Otherwise, using the editors with other varieties of FileInfo will throw ClassCastExceptions. Also suggest that a distinct datatype (other than Vector) be created to handle the special needs.

        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
        Parameters:
        e - event that triggered this action
      • appendInvestigatorData

        public void appendInvestigatorData​(java.lang.String name,
                                           java.lang.String value,
                                           int[] editor)
        appends an editable row to the end of the investigators table.
        Parameters:
        name - DOCUMENT ME!
        value - DOCUMENT ME!
        editor - - list of editor types for editing this row
      • appendTagData

        public void appendTagData​(java.lang.String tag,
                                  java.lang.String name,
                                  java.lang.String value,
                                  int[] editor)
        appends an editable row to the end of the tag table.
        Parameters:
        name - DOCUMENT ME!
        value - DOCUMENT ME!
        date -
        editor - - list of editor types for editing this row
      • appendParameter

        public void appendParameter​(java.lang.String setDesc,
                                    java.lang.String paramName,
                                    java.lang.String paramDesc,
                                    java.lang.String valueType,
                                    java.lang.String value,
                                    java.lang.String date,
                                    java.lang.String time)
        appends an editable row with the given parameter data to the proper set display table.
        Parameters:
        setDesc - String
        paramName - String
        paramDesc - String
        valueType - String
        value - String
        date - String
        time - String
      • appendPrimaryData

        public void appendPrimaryData​(java.lang.String name,
                                      java.lang.String value)
        appends a non editable row to the end of the primary table.
        Parameters:
        name - - file info parameter (ie., dimensions, extents, &c).
        value - - value assigned to a fileinfo parameter
      • appendPrimaryData

        public void appendPrimaryData​(java.lang.String name,
                                      java.lang.String value,
                                      int[] editor)
        appends a row to the end of the primary info table. assigns this name/value pair to be editable and adds the fileinfo to listen for this name.
        Parameters:
        name - file info parameter (ie., dimensions, extents, &c).
        value - value assigned to a fileinfo parameter
        editor - The value of editor is the editor interface to be used. Eg., a JPanelEditDefault. Specified by
        • JDialogFileInfo#IntString
        • JDialogFileInfo#FloatString
        • JDialogFileInfo#AnalyzeDataType
        • JDialogFileInfo#AnalyzeDescription
        • JDialogFileInfo#AnalyzeOrientation
      • appendScanData

        public void appendScanData​(java.lang.String name,
                                   java.lang.String value,
                                   int[] editor)
        appends an editable row to the end of the scan information table.
        Parameters:
        name - DOCUMENT ME!
        value - DOCUMENT ME!
        editor - - list of editor types for editing this row
      • appendSubjectData

        public void appendSubjectData​(java.lang.String name,
                                      java.lang.String value,
                                      int[] editor)
        appends an editable row to the end of the subject information table.
        Parameters:
        name - DOCUMENT ME!
        value - DOCUMENT ME!
        editor - - list of editor types for editing this row
      • displayAboutInfo

        public void displayAboutInfo​(FileInfoImageXML fileInfo)
        makes the display frame. builds the layout.
        Parameters:
        fileInfo - DOCUMENT ME!
      • keyTyped

        public void keyTyped​(java.awt.event.KeyEvent ke)
        DOCUMENT ME!
        Parameters:
        ke - DOCUMENT ME!
      • separateValues

        protected java.lang.String[] separateValues​(java.lang.String incoming)
        Divides space separate strings into an array of strings.
        Parameters:
        incoming - string
        Returns:
        array of separated strings
      • sort

        private static void sort​(ViewTableModel model,
                                 int col,
                                 boolean reverse)
        Sort the tag column or name column of the table model. If reverse is true, sorts in reverse order.
        Parameters:
        model - the table model to sort on
        col - column to sort on
        reverse - whether or not to sort in reverse order.
      • bringToFront

        private boolean bringToFront​(java.lang.String tagKey,
                                     java.util.Hashtable<java.lang.String,​JDialogEditor> model)
        checks whether or not the dialog exists; if it does, it brings the dialog to front.
        Parameters:
        tagKey - the tag's Key. Used to dtermine if this tag already has an editor associated with it.
        model - DOCUMENT ME!
        Returns:
        true if both a tag with the tagkey existed in the list and the associated dialog was brought to front.