Class JDialogFileInfoXML

All Implemented Interfaces:
DialogDefaultsInterface, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class JDialogFileInfoXML extends JDialogBase implements 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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • addParam

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

      private JButton addSet
      button for adding sets.
    • addSurface

      private JButton addSurface
      button for adding surfaces.
    • edit

      private JButton edit
      edit button.
    • expandTags

      private JButton expandTags
      expand dicom tags button.
    • isExpanded

      private boolean isExpanded
      are the dicom tags expanded *
    • editorDialogTable

      private Hashtable<?,JDialogEditor> editorDialogTable
      hashtable to store editor dialogs associated with the table.
    • fileinfo

      private FileInfoImageXML fileinfo
      file info xml to be displayed.
    • 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 JTable investigatorTable
      investigator information table.
    • tagTable

      private JTable tagTable
    • masterScrollPane

      private 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 String[] parameterColumnNames
      array of strings for parameter column names.
    • primaryModel

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

      private JTable primaryTable
      primary image information table.
    • primaryTypeHolder

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

      private final Hashtable<Integer,JDialogEditor> primaryEditorHolder
    • subjectTypeHolder

      private Hashtable<Integer,Vector<Integer>> subjectTypeHolder
    • subjectEditorHolder

      private Hashtable<Integer,JDialogEditor> subjectEditorHolder
    • scanTypeHolder

      private Hashtable<Integer,Vector<Integer>> scanTypeHolder
    • scanEditorHolder

      private Hashtable<Integer,JDialogEditor> scanEditorHolder
    • investigatorTypeHolder

      private Hashtable<Integer,Vector<Integer>> investigatorTypeHolder
    • investigatorEditorHolder

      private Hashtable<Integer,JDialogEditor> investigatorEditorHolder
    • tagTypeHolder

      private Hashtable<Integer,Vector<Integer>> tagTypeHolder
    • removeParam

      private JButton removeParam
      button for removing parameters.
    • removeSurface

      private JButton removeSurface
      button for removing surfaces.
    • scanModel

      private ViewTableModel scanModel
      model associated with scan information.
    • scanTable

      private JTable scanTable
      scan infomation table.
    • scrollingBox

      private Box scrollingBox
      Box to hold table information.
    • tagLabel

      private JLabel tagLabel
    • sorter

      private TableSorter sorter
    • setDescforAddParam

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

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

      private ViewTableModel subjectModel
      model associated with subject information.
    • subjectTable

      private JTable subjectTable
      subject information table.
    • surfaceColumnNames

      private final String[] surfaceColumnNames
      array of strings for surface column names.
    • surfaces

      private final JDialogFileInfoXML.SurfaceDisplay surfaces
      for displaying surfaces.
  • Constructor Details

    • JDialogFileInfoXML

      public JDialogFileInfoXML(Frame parent, String title, ModelImage img)
      Creates a new JDialogFileInfoXML object.
      Parameters:
      parent - Frame
      title - String
      img - ModelImage
  • Method Details

    • accessPrimaryData

      public String accessPrimaryData(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(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 ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      e - event that triggered this action
    • appendInvestigatorData

      public void appendInvestigatorData(String name, 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(String tag, String name, String value, int[] editor)
      appends an editable row to the end of the tag table.
      Parameters:
      name - DOCUMENT ME!
      value - DOCUMENT ME!
      editor - - list of editor types for editing this row
      date -
    • appendParameter

      public void appendParameter(String setDesc, String paramName, String paramDesc, String valueType, String value, String date, 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(String name, String value)
      appends a non editable row to the end of the primary table.
      Parameters:
      name - - file info parameter (ie., dimensions, extents, invalid input: '&c').
      value - - value assigned to a fileinfo parameter
    • appendPrimaryData

      public void appendPrimaryData(String name, 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, invalid input: '&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(String name, 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(String name, 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(KeyEvent ke)
      DOCUMENT ME!
      Parameters:
      ke - DOCUMENT ME!
    • separateValues

      protected String[] separateValues(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(String tagKey, Hashtable<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.