use of au.gov.asd.tac.constellation.utilities.visual.VisualManager in project constellation by constellation-app.
the class Animation method run.
private void run(final Graph graph) {
if (GraphNode.getGraphNode(graph) != null) {
final VisualManager manager = GraphNode.getGraphNode(graph).getVisualManager();
animationThread = new Thread(() -> {
WritableGraph wg;
while (true) {
try {
wg = graph.getWritableGraph(getName(), isSignificant());
break;
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
try {
editGraph(manager, wg);
} finally {
wg.commit();
}
});
animationThread.setName("Animation");
animationThread.start();
}
}
use of au.gov.asd.tac.constellation.utilities.visual.VisualManager in project constellation by constellation-app.
the class GLVisualProcessorTester method main.
public static void main(String[] args) {
final GLVisualProcessorDemo demo = new GLVisualProcessorDemo();
final VisualAccess access = new DummyVisualAccess();
final GLVisualProcessor processor = new GLVisualProcessor();
final VisualManager visualManager = new VisualManager(access, processor);
processor.startVisualising(visualManager);
demo.runDemo(processor, visualManager);
final List<VisualChange> changeSet = new ArrayList<>();
changeSet.add(new VisualChangeBuilder(VisualProperty.VERTICES_REBUILD).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.CONNECTIONS_REBUILD).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.BACKGROUND_COLOR).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.HIGHLIGHT_COLOUR).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.CONNECTIONS_OPACITY).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.BLAZE_SIZE).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.DRAW_FLAGS).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.CAMERA).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.TOP_LABELS_REBUILD).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.BOTTOM_LABELS_REBUILD).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.CONNECTION_LABELS_REBUILD).build());
visualManager.addMultiChangeOperation(changeSet);
try {
Thread.sleep(3000);
} catch (InterruptedException ex) {
}
for (int i = 0; i < 10; i++) {
((DummyVisualAccess) access).zoomOut();
visualManager.addSingleChangeOperation(new VisualChangeBuilder(VisualProperty.CAMERA).build());
try {
Thread.sleep(250);
} catch (InterruptedException ex) {
}
}
}
Aggregations