use of au.gov.asd.tac.constellation.graph.node.GraphNode in project constellation by constellation-app.
the class SetGraph method callService.
@Override
public void callService(final PluginParameters parameters, InputStream in, OutputStream out) throws IOException {
final String graphId = parameters.getStringValue(GRAPH_ID_PARAMETER_ID);
final GraphNode graphNode = GraphNode.getGraphNode(graphId);
if (graphNode != null) {
try {
SwingUtilities.invokeAndWait(() -> graphNode.getTopComponent().requestActive());
} catch (final InterruptedException ex) {
Thread.currentThread().interrupt();
throw new RestServiceException(ex);
} catch (final InvocationTargetException ex) {
throw new RestServiceException(ex);
}
} else {
throw new RestServiceException(HTTP_UNPROCESSABLE_ENTITY, "No graph with id " + graphId);
}
}
Aggregations