Search in sources :

Example 6 with VisualManager

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();
    }
}
Also used : VisualManager(au.gov.asd.tac.constellation.utilities.visual.VisualManager) WritableGraph(au.gov.asd.tac.constellation.graph.WritableGraph)

Example 7 with VisualManager

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) {
        }
    }
}
Also used : VisualManager(au.gov.asd.tac.constellation.utilities.visual.VisualManager) VisualChangeBuilder(au.gov.asd.tac.constellation.utilities.visual.VisualChangeBuilder) GLVisualProcessor(au.gov.asd.tac.constellation.visual.opengl.renderer.GLVisualProcessor) ArrayList(java.util.ArrayList) VisualAccess(au.gov.asd.tac.constellation.utilities.visual.VisualAccess) VisualChange(au.gov.asd.tac.constellation.utilities.visual.VisualChange)

Aggregations

VisualManager (au.gov.asd.tac.constellation.utilities.visual.VisualManager)7 Graph (au.gov.asd.tac.constellation.graph.Graph)3 GraphNode (au.gov.asd.tac.constellation.graph.node.GraphNode)3 ReadableGraph (au.gov.asd.tac.constellation.graph.ReadableGraph)2 WritableGraph (au.gov.asd.tac.constellation.graph.WritableGraph)2 GraphChangeListener (au.gov.asd.tac.constellation.graph.monitor.GraphChangeListener)2 GraphVisualAccess (au.gov.asd.tac.constellation.graph.visual.framework.GraphVisualAccess)2 VisualChangeBuilder (au.gov.asd.tac.constellation.utilities.visual.VisualChangeBuilder)2 GLVisualProcessor (au.gov.asd.tac.constellation.visual.opengl.renderer.GLVisualProcessor)2 BufferedImage (java.awt.image.BufferedImage)2 IOException (java.io.IOException)2 Semaphore (java.util.concurrent.Semaphore)2 GraphElementType (au.gov.asd.tac.constellation.graph.GraphElementType)1 StoreGraph (au.gov.asd.tac.constellation.graph.StoreGraph)1 GraphVisualManagerFactory (au.gov.asd.tac.constellation.graph.interaction.framework.GraphVisualManagerFactory)1 DualGraph (au.gov.asd.tac.constellation.graph.locking.DualGraph)1 Blaze (au.gov.asd.tac.constellation.graph.schema.visual.attribute.objects.Blaze)1 ConnectionMode (au.gov.asd.tac.constellation.graph.schema.visual.attribute.objects.ConnectionMode)1 VisualConcept (au.gov.asd.tac.constellation.graph.schema.visual.concept.VisualConcept)1 DeveloperPreferenceKeys (au.gov.asd.tac.constellation.preferences.DeveloperPreferenceKeys)1