Class JDialogSaveMinc

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

public class JDialogSaveMinc extends JDialogBase
Simple dialog to tell the program important information about the MINC file.
Version:
1.0 Aug 1, 2000
Author:
Neva Cherniavsky
See Also:
  • Field Details

    • serialVersionUID

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

      private JComboBox comboX
      DOCUMENT ME!
    • comboY

      private JComboBox comboY
      DOCUMENT ME!
    • comboZ

      private JComboBox comboZ
      DOCUMENT ME!
    • defaultAxisOrient

      private int[] defaultAxisOrient
      DOCUMENT ME!
    • defaultSet

      private boolean defaultSet
      DOCUMENT ME!
    • defaultXSpace

      private float defaultXSpace
      DOCUMENT ME!
    • defaultXStart

      private float defaultXStart
      Variables for holding default values. Then if the default values are used (as in, the user hit "OK" without changing any values), that option would be set in "options". This affects the way the script records.
    • defaultYSpace

      private float defaultYSpace
      DOCUMENT ME!
    • defaultYStart

      private float defaultYStart
      DOCUMENT ME!
    • defaultZSpace

      private float defaultZSpace
      DOCUMENT ME!
    • defaultZStart

      private float defaultZStart
      DOCUMENT ME!
    • defaultTSpace

      private float defaultTSpace
      DOCUMENT ME!
    • defaultTStart

      private float defaultTStart
      DOCUMENT ME!
    • fileInfo

      private FileInfoBase fileInfo
      Variables for holding and storing file information.
    • options

      private FileWriteOptions options
      DOCUMENT ME!
    • ori

      private int[] ori
      Axes orientations.
    • orient

      private int orient
      DOCUMENT ME!
    • orientLabel

      private JLabel orientLabel
      Variables for the actual GUI; not all need to be global, but just as easy. The text fields and radio buttons do need to be global.
    • xSpace

      private JTextField xSpace
      DOCUMENT ME!
    • xStart

      private JTextField xStart
      DOCUMENT ME!
    • ySpace

      private JTextField ySpace
      DOCUMENT ME!
    • yStart

      private JTextField yStart
      DOCUMENT ME!
    • zSpace

      private JTextField zSpace
      DOCUMENT ME!
    • zStart

      private JTextField zStart
      DOCUMENT ME!
    • tStart

      private JTextField tStart
    • tSpace

      private JTextField tSpace
  • Constructor Details

    • JDialogSaveMinc

      public JDialogSaveMinc(Frame theParentFrame, FileInfoBase _fileInfo, FileWriteOptions options)
      Constructs a new dialog to set necessary information for saving a MINC file.
      Parameters:
      theParentFrame - Parent frame.
      _fileInfo - File info object to get initialization info from.
      options - Storage place for the info recorded in this dialog.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Closes dialog box when the OK button is pressed and sets the information.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      event - event that triggers this function
    • getOptions

      public FileWriteOptions getOptions()
      Accessor that returns the write options set up in this dialog.
      Returns:
      The write options.
    • setOptionsDefault

      public FileWriteOptions setOptionsDefault()
      Sets up the options to the default values as determined by the file info in setSpace and returns the new options.
      Returns:
      The default options.
    • createComboBoxX

      private void createComboBoxX(GridBagLayout layout, GridBagConstraints gbc, JPanel panel)
      Creates a combo box and adds it to the panel.
      Parameters:
      layout - The layout to add the constraints to.
      gbc - The constraints for this combo box.
      panel - The panel to add the combo box to.
    • createComboBoxY

      private void createComboBoxY(GridBagLayout layout, GridBagConstraints gbc, JPanel panel)
      Creates a combo box and adds it to the panel.
      Parameters:
      layout - The layout to add the constraints to.
      gbc - The constraints for this combo box.
      panel - The panel to add the combo box to.
    • createComboBoxZ

      private void createComboBoxZ(GridBagLayout layout, GridBagConstraints gbc, JPanel panel)
      Creates a combo box and adds it to the panel.
      Parameters:
      layout - The layout to add the constraints to.
      gbc - The constraints for this combo box.
      panel - The panel to add the combo box to.
    • createLabel

      private JLabel createLabel(String title, GridBagLayout layout, GridBagConstraints gbc, JPanel panel)
      Makes a label and adds it to the panel.
      Parameters:
      title - The value of the label.
      layout - The layout to add the constraints to.
      gbc - The constraints for this label.
      panel - The panel to add the label to.
      Returns:
      DOCUMENT ME!
    • init

      private void init()
      Initializes the GUI components and puts them in the dialog, attaching necessary actions.
    • setGBC

      private GridBagConstraints setGBC(GridBagConstraints gbc, int x, int y, int w, int h)
      A helper method for adding a component using GridBagLayout, so we don't have to set up the x, y, width, and height over and over again.
      Parameters:
      gbc - The constraints to set.
      x - gridx
      y - gridy
      w - gridwidth
      h - gridheight
      Returns:
      The new grid bag constraints.
      See Also:
    • setOptions

      private void setOptions()
      Sets up the options depending on what the user entered in the dialog.
    • setSpace

      private void setSpace()
      Initializes the text fields for the dialog. MORE!
    • setTextField

      private JTextField setTextField(String initial, GridBagLayout layout, GridBagConstraints gbc, JPanel panel)
      Makes a text field and adds it to the panel.
      Parameters:
      initial - The initial string in the text field.
      layout - The layout to add the constraints to.
      gbc - The constraints for this text field.
      panel - The panel to add the text field to.
      Returns:
      The text field created.