Package gov.nih.mipav.view.dialogs
Class JDialogRunScriptView
java.lang.Object
gov.nih.mipav.view.dialogs.JDialogRunScriptView
- All Implemented Interfaces:
ActionListener,EventListener,ListSelectionListener
- Version:
- 0.1 May 24, 2006
- Author:
- Nathan Pollack -- Contractor (SSAI)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classTransfer handler used for dragging the images and vois into the tree.private classDOCUMENT ME!private classDOCUMENT ME!private classClass used to handle the dragging/dropping of images/vois into the script tree.private classprivate classDOCUMENT ME!private classDOCUMENT ME!private class***************************************************************************************************** Inner classes to follow************************************************************************************************ ***** protected class ModelImageForScripting{ ModelImage modelImage; ModelImageForScripting(ModelImage modelImage){ this.modelImage = modelImage; } public ModelImage getModelImage(){ return this.modelImage; } public String toString(){ return modelImage.getImageName(); } }. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intDOCUMENT ME!private ContainerDOCUMENT ME!private JDialogRunScriptControllerDOCUMENT ME!private intDOCUMENT ME!DOCUMENT ME!private JFrameDOCUMENT ME!private DimensionDOCUMENT ME!private static final intDOCUMENT ME!private static final StringUsed for XML tag for an image.private JListDOCUMENT ME!private static final intImage node type, falls under an imageplaceholder node, created and deleted by user.private static final intImage placeholder node type never created nor deleted by user.private SpringLayoutDOCUMENT ME!private JDialogRunScriptModelDOCUMENT ME!private static final StringUsed for XML tag for an image placeholder.private JPopupMenuMenu for setting raw infoListener to be added/removed depending on selection statusprivate ScriptTreeNodeDOCUMENT ME!private static final intRoot node type.private static final intScript node type (Script)... only one and is only child of rootprivate intchild count for script nodeprivate DimensionDOCUMENT ME!private int[]DOCUMENT ME!private JTreeDOCUMENT ME!private Dimensionprivate Dimension initial_frame_size = new Dimension(725,800);.private JScrollPaneDOCUMENT ME!private static final intDOCUMENT ME!private static final StringDOCUMENT ME!private JListKeep a reference to the VOI List to turn on and off if multiple images are selected.private static final intVOI node type, begins with VOI_EMPTY string and must be set if present before running of the script. -
Constructor Summary
ConstructorsConstructorDescriptionJDialogRunScriptView(JDialogRunScriptController controller, JDialogRunScriptModel model) Creates a new JDialogRunScriptView object. -
Method Summary
Modifier and TypeMethodDescriptionvoidDOCUMENT ME!private void***************************************************************************************************** Creating buttonsprivate void***************************************************************************************************** Creating labelsprivate voidaddScrollList(String name) DOCUMENT ME!private voidDOCUMENT ME!private voidCreates the JFrame.voidcreateScriptTree(String[] imagePlaceHolders, String[] imageLabels, String[] imageActions, int[] numberofVOIs) DOCUMENT ME!voidcreateScriptTree(Document savedScript) DOCUMENT ME!private voidDOCUMENT ME!private voidDOCUMENT ME!private voidDOCUMENT ME!voidGets the list of images selected by the user in this dialog.getComponentByName(String name) DOCUMENT ME!getFrame()***************************************************************************************************** Various util type functions.********************************************************************************************* ********DOCUMENT ME!intReturns the number of child nodes the script node hasMethod to return tree root.DOCUMENT ME!protected booleanChecks 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.private static DefaultListModelpopulateModel(Object[] contents) Scroll List Code.private ScriptTreeNodepopulateScriptTree(String[] imagePlaceHolders, String[] imageLabels, String[] imageActions, int[] numberofVOIs) DOCUMENT ME!private ScriptTreeNoderestoreSavedExecuter(Node executer) Called when a script is loaded from disk.private voidsetLayoutConstraints(Component component) DOCUMENT ME!private voidsetSprings(Component component, Component northAnchor, Component westAnchor, int northSpring, int westSprint) ***************************************************************************************************** Setting layout constraints.********************************************************************************************** *******voidupdate()DOCUMENT ME!private voidupdateNode(ScriptTreeNode node, String text) ***************************************************************************************************** Methods to handle tree behavior********************************************************************************************* ******** updateNode, called when a node text needs to be changed.void
-
Field Details
-
PLACEHOLDER_STR
Used for XML tag for an image placeholder.- See Also:
-
IMAGE_STR
Used for XML tag for an image.- See Also:
-
SCRIPTNODE
private static final int SCRIPTNODEScript node type (Script)... only one and is only child of root- See Also:
-
IMAGEPLACEHOLDERNODE
private static final int IMAGEPLACEHOLDERNODEImage placeholder node type never created nor deleted by user.- See Also:
-
IMAGENODE
private static final int IMAGENODEImage node type, falls under an imageplaceholder node, created and deleted by user.- See Also:
-
VOINODE
private static final int VOINODEVOI 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 ROOTNODERoot node type.- See Also:
-
IMAGE_DROP
private static final int IMAGE_DROPDOCUMENT ME!- See Also:
-
VOI_DROP
private static final int VOI_DROPDOCUMENT ME!- See Also:
-
VOI_EMPTY
DOCUMENT ME!- See Also:
-
centralBuffer
private int centralBufferDOCUMENT ME! -
contentPane
DOCUMENT ME! -
controller
DOCUMENT ME! -
dropSource
private int dropSourceDOCUMENT ME! -
emptyVector
DOCUMENT ME! -
frame
DOCUMENT ME! -
frame_size
DOCUMENT ME! -
imageList
DOCUMENT ME! -
layout
DOCUMENT ME! -
popup
Menu for setting raw info -
popupListener
Listener to be added/removed depending on selection status -
model
DOCUMENT ME! -
root
DOCUMENT ME! -
scroll_size
DOCUMENT ME! -
selectedListIndicies
private int[] selectedListIndiciesDOCUMENT ME! -
tree
DOCUMENT ME! -
tree_size
private Dimension initial_frame_size = new Dimension(725,800);. -
treeScroll
DOCUMENT ME! -
voiList
Keep a reference to the VOI List to turn on and off if multiple images are selected. -
scriptNodeChildCount
private int scriptNodeChildCountchild count for script node
-
-
Constructor Details
-
JDialogRunScriptView
Creates a new JDialogRunScriptView object.- Parameters:
controller- DOCUMENT ME!model- DOCUMENT ME!
-
-
Method Details
-
actionPerformed
DOCUMENT ME!- Specified by:
actionPerformedin interfaceActionListener- Parameters:
e- DOCUMENT ME!
-
valueChanged
- Specified by:
valueChangedin interfaceListSelectionListener
-
createScriptTree
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
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
DOCUMENT ME!- Parameters:
name- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getFrame
***************************************************************************************************** Various util type functions.********************************************************************************************* ********- Returns:
- DOCUMENT ME!
-
getImageList
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getTreeRoot
Method to return tree root.- Returns:
- DOCUMENT ME!
-
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:
Trueif all of the image and voi placeholders in all script executors have had images/vois assigned to them,falseotherwise.
-
populateModel
Scroll List Code.- Parameters:
contents- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
addButton
***************************************************************************************************** Creating buttons.*****************************************************************************************************- Parameters:
buttonName- DOCUMENT ME!
-
addLabel
***************************************************************************************************** Creating labels.*****************************************************************************************************- Parameters:
labelName- DOCUMENT ME!
-
addScrollList
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
DOCUMENT ME!- Parameters:
tree- DOCUMENT ME!expand- DOCUMENT ME!
-
expandAll
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
Called when a script is loaded from disk.- Parameters:
executer- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
setLayoutConstraints
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
***************************************************************************************************** Methods to handle tree behavior********************************************************************************************* ******** updateNode, called when a node text needs to be changed.- Parameters:
node- DOCUMENT ME!text- DOCUMENT ME!
-