Class JDialogRunScriptView

java.lang.Object
gov.nih.mipav.view.dialogs.JDialogRunScriptView
All Implemented Interfaces:
ActionListener, EventListener, ListSelectionListener

public class JDialogRunScriptView extends Object implements ActionListener, ListSelectionListener
Version:
0.1 May 24, 2006
Author:
Nathan Pollack -- Contractor (SSAI)
See Also:
  • Field Details

    • PLACEHOLDER_STR

      private static final String PLACEHOLDER_STR
      Used for XML tag for an image placeholder.
      See Also:
    • IMAGE_STR

      private static final String IMAGE_STR
      Used for XML tag for an image.
      See Also:
    • SCRIPTNODE

      private static final int SCRIPTNODE
      Script node type (Script)... only one and is only child of root
      See Also:
    • IMAGEPLACEHOLDERNODE

      private static final int IMAGEPLACEHOLDERNODE
      Image placeholder node type never created nor deleted by user.
      See Also:
    • IMAGENODE

      private static final int IMAGENODE
      Image node type, falls under an imageplaceholder node, created and deleted by user.
      See Also:
    • VOINODE

      private static final int VOINODE
      VOI node type, begins with VOI_EMPTY string and must be set if present before running of the script.
      See Also:
    • ROOTNODE

      private static final int ROOTNODE
      Root node type.
      See Also:
    • IMAGE_DROP

      private static final int IMAGE_DROP
      DOCUMENT ME!
      See Also:
    • VOI_DROP

      private static final int VOI_DROP
      DOCUMENT ME!
      See Also:
    • VOI_EMPTY

      private static final String VOI_EMPTY
      DOCUMENT ME!
      See Also:
    • centralBuffer

      private int centralBuffer
      DOCUMENT ME!
    • contentPane

      private Container contentPane
      DOCUMENT ME!
    • controller

      private JDialogRunScriptController controller
      DOCUMENT ME!
    • dropSource

      private int dropSource
      DOCUMENT ME!
    • emptyVector

      private Vector<Object> emptyVector
      DOCUMENT ME!
    • frame

      private JFrame frame
      DOCUMENT ME!
    • frame_size

      private Dimension frame_size
      DOCUMENT ME!
    • imageList

      private JList imageList
      DOCUMENT ME!
    • layout

      private SpringLayout layout
      DOCUMENT ME!
    • popupListener

      private JDialogRunScriptView.PopupListener popupListener
      Listener to be added/removed depending on selection status
    • model

      private JDialogRunScriptModel model
      DOCUMENT ME!
    • root

      private ScriptTreeNode root
      DOCUMENT ME!
    • scroll_size

      private Dimension scroll_size
      DOCUMENT ME!
    • selectedListIndicies

      private int[] selectedListIndicies
      DOCUMENT ME!
    • tree

      private JTree tree
      DOCUMENT ME!
    • tree_size

      private Dimension tree_size
      private Dimension initial_frame_size = new Dimension(725,800);.
    • treeScroll

      private JScrollPane treeScroll
      DOCUMENT ME!
    • voiList

      private JList voiList
      Keep a reference to the VOI List to turn on and off if multiple images are selected.
    • scriptNodeChildCount

      private int scriptNodeChildCount
      child count for script node
  • Constructor Details

  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent e)
      DOCUMENT ME!
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      e - DOCUMENT ME!
    • valueChanged

      public void valueChanged(ListSelectionEvent e)
      Specified by:
      valueChanged in interface ListSelectionListener
    • createScriptTree

      public void createScriptTree(Document savedScript)
      DOCUMENT ME!
      Parameters:
      savedScript - DOCUMENT ME!
    • createScriptTree

      public void createScriptTree(String[] imagePlaceHolders, String[] imageLabels, String[] imageActions, int[] numberofVOIs)
      DOCUMENT ME!
      Parameters:
      imagePlaceHolders - DOCUMENT ME!
      imageLabels - DOCUMENT ME!
      imageActions - DOCUMENT ME!
      numberofVOIs - DOCUMENT ME!
    • fillImagesVOIs

      public void fillImagesVOIs(Vector<Vector<String>> imageHolder, Vector<Vector<String>> voiHolder)
      Gets the list of images selected by the user in this dialog. Should be in the order that the images are used in the script.
      Parameters:
      imageHolder - DOCUMENT ME!
      voiHolder - DOCUMENT ME!
    • getComponentByName

      public JComponent getComponentByName(String name)
      DOCUMENT ME!
      Parameters:
      name - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getFrame

      public JFrame getFrame()
      ***************************************************************************************************** Various util type functions.********************************************************************************************* ********
      Returns:
      DOCUMENT ME!
    • getImageList

      public JList getImageList()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getTreeRoot

      public ScriptTreeNode getTreeRoot()
      Method to return tree root.
      Returns:
      DOCUMENT ME!
    • getVOIList

      public JList getVOIList()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getScriptNodeChildCount

      public int getScriptNodeChildCount()
      Returns the number of child nodes the script node has
      Returns:
    • update

      public void update()
      DOCUMENT ME!
    • isTreeReadyForScriptExecution

      protected boolean isTreeReadyForScriptExecution()
      Checks tree to see that all place holders have been replaced with actual images and VOIs if not, it prompts the user with a warning message, and highlights the first node that still contains a placeholer.
      Returns:
      True if all of the image and voi placeholders in all script executors have had images/vois assigned to them, false otherwise.
    • populateModel

      private static DefaultListModel populateModel(Object[] contents)
      Scroll List Code.
      Parameters:
      contents - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • addButton

      private void addButton(String buttonName)
      ***************************************************************************************************** Creating buttons.*****************************************************************************************************
      Parameters:
      buttonName - DOCUMENT ME!
    • addLabel

      private void addLabel(String labelName)
      ***************************************************************************************************** Creating labels.*****************************************************************************************************
      Parameters:
      labelName - DOCUMENT ME!
    • addScrollList

      private void addScrollList(String name)
      DOCUMENT ME!
      Parameters:
      name - DOCUMENT ME!
    • changeSize

      private void changeSize()
      DOCUMENT ME!
    • createFrame

      private void createFrame()
      Creates the JFrame.
    • displayView

      private void displayView()
      DOCUMENT ME!
    • expandAll

      private void expandAll(JTree tree, boolean expand)
      DOCUMENT ME!
      Parameters:
      tree - DOCUMENT ME!
      expand - DOCUMENT ME!
    • expandAll

      private void expandAll(JTree tree, TreePath parent, boolean expand)
      DOCUMENT ME!
      Parameters:
      tree - DOCUMENT ME!
      parent - DOCUMENT ME!
      expand - DOCUMENT ME!
    • populateScriptTree

      private ScriptTreeNode populateScriptTree(String[] imagePlaceHolders, String[] imageLabels, String[] imageActions, int[] numberofVOIs)
      DOCUMENT ME!
      Parameters:
      imagePlaceHolders - DOCUMENT ME!
      imageLabels - DOCUMENT ME!
      imageActions - DOCUMENT ME!
      numberofVOIs - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • restoreSavedExecuter

      private ScriptTreeNode restoreSavedExecuter(Node executer)
      Called when a script is loaded from disk.
      Parameters:
      executer - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • setLayoutConstraints

      private void setLayoutConstraints(Component component)
      DOCUMENT ME!
      Parameters:
      component - DOCUMENT ME!
    • setSprings

      private void setSprings(Component component, Component northAnchor, Component westAnchor, int northSpring, int westSprint)
      ***************************************************************************************************** Setting layout constraints.********************************************************************************************** *******
      Parameters:
      component - DOCUMENT ME!
      northAnchor - DOCUMENT ME!
      westAnchor - DOCUMENT ME!
      northSpring - DOCUMENT ME!
      westSprint - DOCUMENT ME!
    • updateNode

      private void updateNode(ScriptTreeNode node, String text)
      ***************************************************************************************************** Methods to handle tree behavior********************************************************************************************* ******** updateNode, called when a node text needs to be changed.
      Parameters:
      node - DOCUMENT ME!
      text - DOCUMENT ME!