Difference between revisions of "Custom Atlas Smart Views"

From AtlasWiki
Jump to: navigation, search
(Created page with "Atlas allows you to create and contribute user defined scripts to the Smart View. The example script Supertype Hierarchy is included in the [http://cdn.ensoftcorp.com/atlas_do...")
 
(API changed)
 
Line 5: Line 5:
 
A custom script can be created by creating a java class that implements the com.ensoftcorp.atlas.java.ui.scripts.selections.AtlasSmartViewScript interface and implementing the following methods:
 
A custom script can be created by creating a java class that implements the com.ensoftcorp.atlas.java.ui.scripts.selections.AtlasSmartViewScript interface and implementing the following methods:
 
* Return the result Q encapsulated in a StyledResult object.<br/>
 
* Return the result Q encapsulated in a StyledResult object.<br/>
: <code>public StyledResult selectionChanged(SelectionInput input)</code>
+
: <code>public StyledResult selectionChanged(IAtlasSelectionEvent input)</code>
 
* Script title that will show up in the menu
 
* Script title that will show up in the menu
 
: <code>public String getTitle()</code>
 
: <code>public String getTitle()</code>

Latest revision as of 11:03, 31 October 2014

Atlas allows you to create and contribute user defined scripts to the Smart View. The example script Supertype Hierarchy is included in the Example Shell project. To create a custom script, you need to create a script and then register it in Atlas.

Creating the script

A custom script can be created by creating a java class that implements the com.ensoftcorp.atlas.java.ui.scripts.selections.AtlasSmartViewScript interface and implementing the following methods:

  • Return the result Q encapsulated in a StyledResult object.
public StyledResult selectionChanged(IAtlasSelectionEvent input)
  • Script title that will show up in the menu
public String getTitle()
  • Script will only listen for selections on the Node tags selected
public String[] getSupportedNodeTags()
  • Script will only listen for selections on the Edge tags selected
public String[] getSupportedEdgeTags()

Registering the script

The fully qualified name of the class with the script should be included in a text file named selectionScripts.atlas in the root of the scala project, one script per line.

For example, if a script is created in Hierarchy.java which is in com.ensoftcorp.atlas.java.example.script package, then the selectionScript.atlas should have the following on a single line: com.ensoftcorp.atlas.java.example.script.Hierarchy