public class GraphEnvironment extends MffEnvironment
Modifier and Type | Field and Description |
---|---|
static int |
MODE_ASYNCHRONOUS |
static int |
MODE_SYNCHRONOUS |
Constructor and Description |
---|
GraphEnvironment()
Create a new GraphEnvironment with default components.
|
GraphEnvironment(FrameManager frameManager,
GraphReader reader)
Create a new GraphEnvironment with a custom FrameManager and GraphReader.
|
Modifier and Type | Method and Description |
---|---|
int |
addGraph(FilterGraph graph)
Add a graph to the environment.
|
void |
addReferences(Object... references)
Add graph references to resolve during graph reading.
|
FilterGraph |
getGraph(int graphId)
Access a specific graph of this environment given a graph ID (previously returned from
loadGraph() or addGraph()).
|
GraphReader |
getGraphReader()
Returns the used graph reader.
|
GraphRunner |
getRunner(int graphId,
int executionMode)
Get a GraphRunner instance for the graph with the specified ID.
|
int |
loadGraph(Context context,
int resourceId)
Loads a graph file from the specified resource and adds it to this environment.
|
activateGLEnvironment, createGLEnvironment, deactivateGLEnvironment, getContext, setGLEnvironment
public static final int MODE_ASYNCHRONOUS
public static final int MODE_SYNCHRONOUS
public GraphEnvironment()
public GraphEnvironment(FrameManager frameManager, GraphReader reader)
frameManager
- The FrameManager to use, or null to auto-create one.reader
- The GraphReader to use for graph loading, or null to auto-create one.
Note, that the reader will not be created until it is required. Pass
null if you will not load any graph files.public GraphReader getGraphReader()
public void addReferences(Object... references)
references
- An alternating argument list of keys (Strings) and values.public int loadGraph(Context context, int resourceId)
context
- The context in which to read the resource.resourceId
- The ID of the graph resource to load.public int addGraph(FilterGraph graph)
graph
- The graph to add to the environment.public FilterGraph getGraph(int graphId)
graphId
- The ID of the graph to get.public GraphRunner getRunner(int graphId, int executionMode)
graphId
- The ID of the graph to get.executionMode
- The mode of graph execution. Currently this can be either
MODE_SYNCHRONOUS or MODE_ASYNCHRONOUS.