public class GSGraphManager extends Object
Modifier and Type | Method and Description |
---|---|
<G extends GraphModel<?,?>> |
addGraphListener(G graph,
GraphListener<G> listener) |
void |
close(Graph graph)
Remove all the server side association to the graph
|
<G extends GraphModel<?,?>> |
fireGraphChange(G graph,
GraphChangeType type,
Object data) |
Set |
getAllGraphs()
Return the list of registered graphs
|
Collection<GraphFactory> |
getGraphFactories() |
Graph |
getGraphFromPath(String path)
Return the graph associated to the given file path, if it exists
|
String |
getGraphPath(Graph graph)
Return the path of the file the graph has been loaded from or saved to (if it exists)
|
ServiceClassInfo[] |
getGraphsInfo() |
String |
getGraphType() |
static GSGraphManager |
getInstance() |
RegulatoryGraph |
getNewGraph()
Create a new (RegulatoryGraph)
|
<C extends Graph> |
getNewGraph(Class<C> graph_class)
Create a new default graph of the given class
|
<C extends Graph> |
getNewGraph(Class<C> graph_class,
Object... args) |
Class |
getParserClass(String graph_type)
Search for the factory managing the given graph type and return the corresponding parser
|
Graph |
open(File file) |
Graph |
open(Set set,
File file) |
Graph |
open(String file_path)
Retrieve the Graph stored in the file at the given file path
|
void |
registerGraph(Graph graph)
register a graph without associated file path
|
<G extends Graph<?,?>> |
registerGraph(G graph,
String file_path)
Memorize the link between the graph and the path of the file the graph has been loaded from or saved to
|
<G extends GraphModel<?,?>> |
removeGraphListener(G graph,
GraphListener<G> listener) |
public String getGraphType()
public static GSGraphManager getInstance()
public RegulatoryGraph getNewGraph()
public <C extends Graph> C getNewGraph(Class<C> graph_class)
graph_class
- the class of the graph to instantiatepublic Collection<GraphFactory> getGraphFactories()
public <C extends Graph> C getNewGraph(Class<C> graph_class, Object... args)
graph_class
- args
- public Class getParserClass(String graph_type)
graph_type
- the type of the graphpublic void registerGraph(Graph graph)
graph
- the graphpublic <G extends Graph<?,?>> void registerGraph(G graph, String file_path)
graph
- the graphfile_path
- the path of the file the graph has been loaded from or saved topublic Set getAllGraphs()
public <G extends GraphModel<?,?>> void addGraphListener(G graph, GraphListener<G> listener)
public <G extends GraphModel<?,?>> void removeGraphListener(G graph, GraphListener<G> listener)
public <G extends GraphModel<?,?>> void fireGraphChange(G graph, GraphChangeType type, Object data)
public String getGraphPath(Graph graph)
graph
- public Graph getGraphFromPath(String path)
path
- the file path associated to the desired graphpublic Graph open(String file_path) throws GsException
file_path
- the file path of the graph fileGsException
public Graph open(File file) throws GsException
file
- the File containing the graph to openGsException
public Graph open(Set set, File file) throws GsException
file
- the File containing the graph to openGsException
public void close(Graph graph)
graph
- the graph to closepublic ServiceClassInfo[] getGraphsInfo()
Copyright © 2005–2020. All rights reserved.