Package sc.fiji.snt
Class SciViewSNT
java.lang.Object
sc.fiji.snt.SciViewSNT
Bridges SNT to
SciView, allowing Trees to be rendered as scenery objects- Author:
- Kyle Harrington, Tiago Ferreira
-
Constructor Summary
ConstructorsConstructorDescriptionSciViewSNT(org.scijava.Context context) Instantiates a new SciViewSNT instance.SciViewSNT(SNT snt) SciViewSNT(sc.iview.SciView sciView) Instantiates SciViewSNT from an existing SciView instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a tree to the associated SciView instance.sc.iview.SciViewGets the SciView instance currently in use.graphics.scenery.NodegetTreeAsSceneryNode(Tree tree) Gets the specified Tree as a Scenery Node.static voidbooleanremoveTree(Tree tree) Removes the specified Tree.voidsetSciView(sc.iview.SciView sciView) Sets the SciView to be used.boolean(Re)loads the current list of Paths in the Path Manager list.
-
Constructor Details
-
SciViewSNT
Instantiates a new SciViewSNT instance.- Parameters:
context- the SciJava application context providing the services required by the class- Throws:
NoClassDefFoundError- if SciView/scenery are not availableorg.scijava.NullContextException- If context is null
-
SciViewSNT
public SciViewSNT(sc.iview.SciView sciView) Instantiates SciViewSNT from an existing SciView instance.- Parameters:
sciView- the SciView instance to be associated with this SciViewSNT instance- Throws:
NullPointerException- If sciView is null
-
SciViewSNT
- Throws:
NoClassDefFoundError
-
-
Method Details
-
getSciView
public sc.iview.SciView getSciView()Gets the SciView instance currently in use.- Returns:
- the SciView instance. It is never null: A new instance is created if none has been specified
-
setSciView
public void setSciView(sc.iview.SciView sciView) Sets the SciView to be used.- Parameters:
sciView- the SciView instance. Null allowed.
-
addTree
Adds a tree to the associated SciView instance. A new SciView instance is automatically instantiated ifsetSciView(SciView)has not been called.- Parameters:
tree- theTreeto be added. The Tree's label will be used as identifier. It is expected to be unique when rendering multiple Trees, if not (or no label exists) a unique label will be generated.- See Also:
-
getTreeAsSceneryNode
Gets the specified Tree as a Scenery Node.- Parameters:
tree- the tree previously added to SciView usingaddTree(Tree)- Returns:
- the scenery Node
-
removeTree
Removes the specified Tree.- Parameters:
tree- the tree previously added to SciView usingaddTree(Tree)- Returns:
- true, if tree was successfully removed.
- See Also:
-
syncPathManagerList
public boolean syncPathManagerList()(Re)loads the current list of Paths in the Path Manager list.- Returns:
- true, if Path Manager list is not empty and synchronization was successful
- Throws:
IllegalArgumentException- if SNT is not running
-
main
- Throws:
InterruptedException
-