public class GraphanaAccess
extends java.lang.Object
Constructor and Description |
---|
GraphanaAccess()
Creates a new instance and initializes Graphana including default operations, libraries and visualizers.
|
GraphanaAccess(UserInterface userInterface)
Creates an instance and initializes Graphana
|
GraphanaAccess(UserInterface userInterface,
GraphanaScriptSystemInterface scriptSystem)
Creates an instance and initializes Graphana
|
GraphanaAccess(UserInterface userInterface,
GraphanaScriptSystemInterface scriptSystem,
boolean includeBasicFunctionSet,
boolean includeStdLibraries,
boolean includeStdVisualizers)
Creates an instance and initializes Graphana
|
Modifier and Type | Method and Description |
---|---|
ExecutionResult<?> |
execute(java.lang.String statement)
Parses and executes the given statement.
|
boolean |
executeBool(java.lang.String statement)
Parses and executes the given statement and assumes the return value to be of type Boolean.
|
float |
executeFloat(java.lang.String statement)
Parses and executes the given statement and assumes the return value to be of type Float.
|
int |
executeInt(java.lang.String statement)
Parses and executes the given statement and assumes the return value to be of type Integer.
|
java.lang.String |
executeString(java.lang.String statement)
Parses and executes the given statement and assumes the return value to be of type String.
|
GraphLibrary<?,?> |
getGraph()
Returns the graph which is currently set in the main control.
|
ExecutionError |
getLastError()
Returns the last error that occurred.
|
MainControl |
getMainControl()
Returns the main control of Graphana which enables lower level access.
|
UserInterface |
getUserInterface()
Returns the programs user interface.
|
void |
registerOperation(Operation operation)
Registers the given operation.
|
void |
registerOperations(OperationGroup operations)
Registers all operations of the given group.
|
void |
setGraph(edu.uci.ics.jung.graph.Graph<?,?> jungGraph)
Converts the given JUNG2 graph and sets it as the current graph.
|
void |
setGraph(GraphLibrary<?,?> graph)
Sets the given graph as the current graph.
|
void |
setJGraphGraph(org.jgrapht.Graph<?,?> jGraphTGraph)
Converts the given JGraphT graph and sets it as the current graph.
|
void |
setVariable(java.lang.String identifier,
boolean value)
Sets the Graphana variable with the given identifier to the given boolean value.
|
void |
setVariable(java.lang.String identifier,
ExecutionResult<?> value)
Sets the Graphana variable with the given identifier to the given value.
|
void |
setVariable(java.lang.String identifier,
float value)
Sets the Graphana variable with the given identifier to the given float value.
|
void |
setVariable(java.lang.String identifier,
int value)
Sets the Graphana variable with the given identifier to the given integer value.
|
void |
setVariable(java.lang.String identifier,
java.lang.String value)
Sets the Graphana variable with the given identifier to the given string value.
|
public GraphanaAccess(UserInterface userInterface, GraphanaScriptSystemInterface scriptSystem, boolean includeBasicFunctionSet, boolean includeStdLibraries, boolean includeStdVisualizers)
userInterface
- the user interface to use. Can be nullscriptSystem
- the script system to useincludeBasicFunctionSet
- if true, then all default operations will be registeredincludeStdLibraries
- if true, then all default graph libraries will be registeredincludeStdVisualizers
- if true, then all default graph visiualizers will be registeredpublic GraphanaAccess(UserInterface userInterface, GraphanaScriptSystemInterface scriptSystem)
userInterface
- the user interface to use. Can be nullscriptSystem
- the script system to usepublic GraphanaAccess(UserInterface userInterface)
userInterface
- the user interface to use. Can be nullpublic GraphanaAccess()
public void setGraph(GraphLibrary<?,?> graph)
graph
- The new current graph.public void setJGraphGraph(org.jgrapht.Graph<?,?> jGraphTGraph)
jGraphTGraph
- a JGraphT graph instance.public ExecutionResult<?> execute(java.lang.String statement)
statement
- the statement to parse.public MainControl getMainControl()
public UserInterface getUserInterface()
public void setVariable(java.lang.String identifier, ExecutionResult<?> value)
identifier
- the identifer of the variable to set.value
- the new value of the variable.public void setVariable(java.lang.String identifier, int value)
identifier
- the identifer of the variable to set.value
- the new value of the variable.public void setVariable(java.lang.String identifier, float value)
identifier
- the identifer of the variable to set.value
- the new value of the variable.public void setVariable(java.lang.String identifier, java.lang.String value)
identifier
- the identifer of the variable to set.value
- the new value of the variable.public void setVariable(java.lang.String identifier, boolean value)
identifier
- the identifer of the variable to set.value
- the new value of the variable.public void registerOperation(Operation operation)
operation
- the operation instance to register.public void registerOperations(OperationGroup operations)
operations
- the operation group containing the operations to register.public int executeInt(java.lang.String statement)
statement
- the statement to execute.public float executeFloat(java.lang.String statement)
statement
- the statement to execute.public boolean executeBool(java.lang.String statement)
statement
- the statement to execute.public java.lang.String executeString(java.lang.String statement)
statement
- the statement to execute.public ExecutionError getLastError()
public GraphLibrary<?,?> getGraph()
public void setGraph(edu.uci.ics.jung.graph.Graph<?,?> jungGraph)
jungGraph
- a JUNG2 graph instance.