use of au.gov.asd.tac.constellation.graph.schema.Schema in project constellation by constellation-app.
the class GetGraph method callService.
@Override
public void callService(final PluginParameters parameters, final InputStream in, final OutputStream out) throws IOException {
final Graph graph = GraphManager.getDefault().getActiveGraph();
final ObjectMapper mapper = new ObjectMapper();
final ObjectNode root = mapper.createObjectNode();
String name = null;
String schemaName = null;
final String id = graph != null ? graph.getId() : null;
if (graph != null) {
name = GraphNode.getGraphNode(id).getDisplayName();
final Schema schema = graph.getSchema();
if (schema != null) {
schemaName = schema.getFactory().getName();
}
}
root.put("id", id);
root.put("name", name);
root.put("schema", schemaName);
mapper.writeValue(out, root);
}
use of au.gov.asd.tac.constellation.graph.schema.Schema in project constellation by constellation-app.
the class AddModeWelcomePlugin method run.
/**
* This method describes what action should be taken when the link is
* clicked on the Welcome Page
*/
@Override
public void run() {
final Schema schema = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).createSchema();
final StoreGraph sg = new StoreGraph(schema);
schema.newGraph(sg);
final int drawModeAttribute = VisualConcept.GraphAttribute.DRAWING_MODE.ensure(sg);
sg.setBooleanValue(drawModeAttribute, 0, true);
final Graph dualGraph = new DualGraph(sg, false);
final String graphName = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).getLabel().trim().toLowerCase();
GraphOpener.getDefault().openGraph(dualGraph, graphName);
}
use of au.gov.asd.tac.constellation.graph.schema.Schema in project constellation by constellation-app.
the class SelectionModeWelcomePlugin method run.
/**
* This method describes what action should be taken when the link is
* clicked on the Welcome Page
*/
@Override
public void run() {
final Schema schema = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).createSchema();
final StoreGraph sg = new StoreGraph(schema);
schema.newGraph(sg);
final Graph dualGraph = new DualGraph(sg, false);
final String graphName = SchemaFactoryUtilities.getSchemaFactory(AnalyticSchemaFactory.ANALYTIC_SCHEMA_ID).getLabel().trim().toLowerCase();
GraphOpener.getDefault().openGraph(dualGraph, graphName);
}
use of au.gov.asd.tac.constellation.graph.schema.Schema in project constellation by constellation-app.
the class SelectBlazesPluginNGTest method setUpMethod.
@BeforeMethod
public void setUpMethod() {
// create an analytic graph
final Schema schema = SchemaFactoryUtilities.getDefaultSchemaFactory().createSchema();
graph = new StoreGraph(schema);
}
Aggregations