Class JDialogAnnotation

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

public class JDialogAnnotation extends JDialogBase implements ActionListener
Dialog for creating new/editing existing on-screen annotations. This allows writing text and choosing the font style, size and color.
Version:
1.0
Author:
Ben Link
See Also:
  • Field Details

    • serialVersionUID

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

      public static final String DEFAULT_NOTES
      Default notes section text
      See Also:
    • activeImage

      private ModelImage activeImage
      The image that contains the VOI text.
    • backgroundColorButton

      private JButton backgroundColorButton
      button to bring up the background color chooser.
    • boldBox

      private JCheckBox boldBox
      checkbox for bold style.
    • buttonPanel

      private JPanel buttonPanel
      Panel to contain the okay/cancel/help buttons.
    • colorButton

      private JButton colorButton
      button to bring up color chooser.
    • colorChooser

      private ViewJColorChooser colorChooser
      color chooser to select text color.
    • fontDescriptors

      private int fontDescriptors
      descriptors for font (BOLD, PLAIN, ITALIC).
    • fontName

      private String fontName
      name/style of the font.
    • fontSize

      private int fontSize
      size of font (int).
    • fontSizeField

      private JTextField fontSizeField
      textfield for font size (int only).
    • fontTypeBox

      private JComboBox fontTypeBox
      combobox to hold the names of all available fonts.
    • isBackground

      private boolean isBackground
      toggle between background and text color changing.
    • isRegistered

      private boolean isRegistered
      whether this is an existing or new VOIText (isRegistered = existing).
    • italicBox

      private JCheckBox italicBox
      checkbox for italic style.
    • nameField

      private JTextField nameField
      NameField that will contain the string to be displayed.
    • noteField

      private JTextArea noteField
      NoteField for providing a note about this marker. Note only displayed when clicked.
    • textVOI

      private VOI textVOI
      the VOI that contains the VOIText.
    • element

      private int element
      the VOIText element in the VOI to modify
    • useMarkerBox

      private JCheckBox useMarkerBox
      DOCUMENT ME!
    • textEditable

      private boolean textEditable
  • Constructor Details

    • JDialogAnnotation

      public JDialogAnnotation(ModelImage image, VOI textVOI, int element, boolean isRegistered, boolean modal)
      Constructs a new annotation dialog, displays it, and turns recording on.
      Parameters:
      image - Title of dialog frame
      textVOI - user interface (dialog uses main frame from UI as parent)
      isRegistered - DOCUMENT ME!
      slice - DOCUMENT ME!
    • JDialogAnnotation

      public JDialogAnnotation(ModelImage image, VOI textVOI, int element, boolean isRegistered, boolean modal, boolean editText)
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Catches action events: Okay, Cancel, Help and ChooseColor.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      event - ActionEvent
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      Watches the font descriptor checkboxes (bold/italic) and the font name (style) combo box, updates displayed font with each change.
      Specified by:
      itemStateChanged in interface ItemListener
      Overrides:
      itemStateChanged in class JDialogBase
      Parameters:
      event - ItemEvent the item change event that occured
    • getTextVOI

      public VOIText getTextVOI()
    • buildFontPanel

      private JPanel buildFontPanel()
      builds the panel that allows customization of font style/size/color.
      Returns:
      JPanel the font panel
    • init

      private void init(String title)
      Initializes the dialog box and adds the components.
      Parameters:
      title - Title of the dialog box.
    • setVariables

      protected boolean setVariables()
      makes sure the dialog is ready after (OKAY) is pressed.
      Returns:
      boolean are the dialog's variables kosher