ca.uvic.csr.shrimp.ScriptingBean
Interface MainViewScriptingBean


public interface MainViewScriptingBean

This is the interface of the scripting support for the MainView.

Author:
Nasir Rather

Method Summary
 void alert(java.lang.String message)
          Displays a modal dialog with no title
 void alert(java.lang.String message, java.lang.String title)
          Displays a modal dialog with a message.
 void changeZoomMode(java.lang.String newMode)
          Sets the zoom mode for the MainView.
 void clearComposites()
          Removes the composite arcs.
 void closeAllDescendents()
          Close all descendants of the selected node(s).
 void closeSelectedNodes()
          Closes the selected node(s) (hides the children if showing).
 void createComposites(java.lang.String[] arcTypes)
          Creates composite arcs for the given types.
 void filterAllArcs(boolean filter)
          Filters or unfilters all arcs from the display
 void filterAllArtifactDataTypes(boolean filter)
          Filters or unfilters all artifact types from the data.
 void filterAllNodes(boolean filter)
          Filters or unfilters all nodes from the display
 void filterAllRelationshipDataTypes(boolean filter)
          Filters or unfilters all relationship types from the data.
 void filterArcsByType(java.lang.String type, boolean filter)
          Filters or unfilters arcs of String type from the display
 void filterArtifactDataType(java.lang.String type, boolean filter)
          Filters or unfilters artifacts of a specific type from the data.
 void filterNodesByType(java.lang.String type, boolean filter)
          Filters or unfilters nodes of String type from the display.
 void filterRelationshipDataType(java.lang.String type, boolean filter)
          Filters or unfilters relationships of a specific type from the data.
 void filterSelectedNodes()
          Filter the selected node(s).
 void focusOnHome()
          Zooms back to the root node.
 void layoutChildren(java.lang.String newLayoutMode)
          Layout children of the selected node(s).
 void layoutSelected(java.lang.String newLayoutMode)
          Layout selected node(s).
 void navigateToNode(java.lang.String name)
          Causes the view to navigate to the node with the given name.
 void openAllDescendents()
          Open all descendants of the selected node(s).
 void openSelectedNodes()
          Shows the children (if any) of the selected node(s).
 void pause(long time)
          Pauses any further script operation for time ms.
 java.lang.String prompt(java.lang.String message, java.lang.String title)
          Displays a modal dialog with an input field.
 void redoAction()
          Redo the action that was previously undone.
 void refresh()
          Causes the display to refresh.
 void selectAllChildren()
          Select all the children of the selected node(s).
 void selectAllDescendents()
          Select all the descendants of the selected node(s).
 void selectConnectedNodes()
          Selects all nodes that are connected to the currently selected nodes.
 void selectInverseSiblings()
          De-selects the currently selected nodes, and selects their unselected siblings instead.
 void selectNodesByName(java.lang.String name, boolean selectAllOccurances, boolean clearPreviouslySelected, boolean exactMatch, boolean caseSensitive)
          Selects the nodes identified by name.
 void selectNodesByType(java.lang.String type, boolean clearPreviouslySelected)
          Selects all nodes of a specific type
 void selectRoots()
          Selects the root nodes.
 void setHierarchy(java.lang.String[] cprels)
          Change the child-parent relationships.
 void setLabelMode(java.lang.String mode)
          Change the display of labels.
 void showDialog(java.lang.String message)
          Displays a non-modal dialog with the given message.
 void showDialog(java.lang.String message, java.lang.String title)
          Displays a non-modal dialog with a message and title
 void takeSnapShot(boolean askForComments)
          Take a snapShot of the MainView and add it to the Filmstrip.
 void undoAction()
          Undo an action.
 void unFilterAllArtifacts()
          Unfilter all the previously filtered artifacts.
 

Method Detail

selectNodesByName

void selectNodesByName(java.lang.String name,
                       boolean selectAllOccurances,
                       boolean clearPreviouslySelected,
                       boolean exactMatch,
                       boolean caseSensitive)
Selects the nodes identified by name.

Parameters:
name - - String name of the node.
selectAllOccurances - - whether to select all occurances of nodes with this name or just the first one
clearPreviouslySelected - - boolean whether to clear previous selection.
exactMatch - Whether or not match the name exactly
caseSensitive - Whether or not to consider case in the match.

selectRoots

void selectRoots()
Selects the root nodes.


selectNodesByType

void selectNodesByType(java.lang.String type,
                       boolean clearPreviouslySelected)
Selects all nodes of a specific type

Parameters:
type - see the node filter dialog to see the available node types
clearPreviouslySelected -

selectInverseSiblings

void selectInverseSiblings()
De-selects the currently selected nodes, and selects their unselected siblings instead.


openSelectedNodes

void openSelectedNodes()
Shows the children (if any) of the selected node(s).


closeSelectedNodes

void closeSelectedNodes()
Closes the selected node(s) (hides the children if showing).


openAllDescendents

void openAllDescendents()
Open all descendants of the selected node(s).


closeAllDescendents

void closeAllDescendents()
Close all descendants of the selected node(s).


setHierarchy

void setHierarchy(java.lang.String[] cprels)
Change the child-parent relationships.

Parameters:
cprels - new child-parent relationships which defines the nested hierarchy

setLabelMode

void setLabelMode(java.lang.String mode)
Change the display of labels.

ScriptingConstants.SCALE_BY_NODE_SIZE produces the fastest drawing time

Parameters:
mode - - one of ScriptingConstants.FIXED, ScriptingConstants.SCALE_BY_NODE_SIZE, or ScriptingConstants.SCALE_BY_LEVEL

takeSnapShot

void takeSnapShot(boolean askForComments)
Take a snapShot of the MainView and add it to the Filmstrip.

Parameters:
askForComments - - whether to ask for comments.

selectAllChildren

void selectAllChildren()
Select all the children of the selected node(s).


selectAllDescendents

void selectAllDescendents()
Select all the descendants of the selected node(s).


layoutChildren

void layoutChildren(java.lang.String newLayoutMode)
Layout children of the selected node(s).

Parameters:
newLayoutMode - - String new layout mode @see ca.uvic.csr.shrimp.ScriptingConstants
See Also:
ScriptingConstants.GRID_BY_TYPE, ScriptingConstants.SPRING, ScriptingConstants.TREE_HORIZONTAL, ScriptingConstants.TREE_VERTICAL, ScriptingConstants.TREEMAP, ScriptingConstants.RADIAL

layoutSelected

void layoutSelected(java.lang.String newLayoutMode)
Layout selected node(s).

Parameters:
newLayoutMode - - String new layout mode @see ca.uvic.csr.shrimp.ScriptingConstants
See Also:
ScriptingConstants.GRID_BY_TYPE, ScriptingConstants.SPRING, ScriptingConstants.TREE_HORIZONTAL, ScriptingConstants.TREE_VERTICAL, ScriptingConstants.TREEMAP, ScriptingConstants.RADIAL

filterSelectedNodes

void filterSelectedNodes()
Filter the selected node(s).


filterAllArcs

void filterAllArcs(boolean filter)
Filters or unfilters all arcs from the display

Parameters:
filter - show or hide all arcs

filterAllNodes

void filterAllNodes(boolean filter)
Filters or unfilters all nodes from the display

Parameters:
filter - show or hide all nodes

filterArcsByType

void filterArcsByType(java.lang.String type,
                      boolean filter)
Filters or unfilters arcs of String type from the display

Parameters:
type - String type of the arcs - see the arc filter dialog for the available arc types
filter - - boolean whether to show or hide the arcs.

filterNodesByType

void filterNodesByType(java.lang.String type,
                       boolean filter)
Filters or unfilters nodes of String type from the display.

Parameters:
type - type of the nodes - see the node filter dialog for the available arc types
filter - whether to show or hide the nodes.

filterArtifactDataType

void filterArtifactDataType(java.lang.String type,
                            boolean filter)
Filters or unfilters artifacts of a specific type from the data. Nodes of the same type will be filtered or unfiltered from the display.

Parameters:
type -
filter - show or hide artifacts of the given type

filterRelationshipDataType

void filterRelationshipDataType(java.lang.String type,
                                boolean filter)
Filters or unfilters relationships of a specific type from the data. Arcs of the same type will be filtered or unfiltered from the display.

Parameters:
type -
filter - show or hide relationships of the given type

filterAllArtifactDataTypes

void filterAllArtifactDataTypes(boolean filter)
Filters or unfilters all artifact types from the data. All nodes will be filtered or unfiltered from the display.

Parameters:
filter - show or hide all artifacts

filterAllRelationshipDataTypes

void filterAllRelationshipDataTypes(boolean filter)
Filters or unfilters all relationship types from the data. All arcs will be filtered or unfiltered from the display.

Parameters:
filter - show or hide all relationships

unFilterAllArtifacts

void unFilterAllArtifacts()
Unfilter all the previously filtered artifacts.


focusOnHome

void focusOnHome()
Zooms back to the root node.


redoAction

void redoAction()
Redo the action that was previously undone.


undoAction

void undoAction()
Undo an action. NOTE: not all actions a user performs can be undone.


changeZoomMode

void changeZoomMode(java.lang.String newMode)
Sets the zoom mode for the MainView. This mode determines what happens when a user tries to zoom using the proper input (X, Z keys on the keyboard or the middle mouse button are the defaults).

Parameters:
newMode - the new zoom mode
See Also:
ScriptingConstants.ZOOM, ScriptingConstants.MAGNIFY, ScriptingConstants.FISHEYE

navigateToNode

void navigateToNode(java.lang.String name)
Causes the view to navigate to the node with the given name. If there are multiple nodes in the display with the same name, the first one found will be used.

Parameters:
name - the name of the node to navigate to

showDialog

void showDialog(java.lang.String message)
Displays a non-modal dialog with the given message.

Parameters:
message - the message to display

showDialog

void showDialog(java.lang.String message,
                java.lang.String title)
Displays a non-modal dialog with a message and title

Parameters:
message - the message to display
title - title for the dialog

alert

void alert(java.lang.String message)
Displays a modal dialog with no title

Parameters:
message - the message to display

alert

void alert(java.lang.String message,
           java.lang.String title)
Displays a modal dialog with a message.

Parameters:
message - - String new message to display
title - - String the title of the dialog

prompt

java.lang.String prompt(java.lang.String message,
                        java.lang.String title)
Displays a modal dialog with an input field.

Parameters:
message - the message to display
title - the title of the dialog
Returns:
the value the user typed

pause

void pause(long time)
Pauses any further script operation for time ms.

Parameters:
time - the time in ms.

refresh

void refresh()
Causes the display to refresh.


selectConnectedNodes

void selectConnectedNodes()
Selects all nodes that are connected to the currently selected nodes.


createComposites

void createComposites(java.lang.String[] arcTypes)
Creates composite arcs for the given types.

Parameters:
arcTypes -

clearComposites

void clearComposites()
Removes the composite arcs.