Search in sources :

Example 6 with DrawFlags

use of au.gov.asd.tac.constellation.utilities.visual.DrawFlags in project constellation by constellation-app.

the class GraphVisualAccessNGTest method testGetDrawFlagsAttributeAdded.

/**
 * Test of getDrawFlags method when attribute is added, of class
 * GraphVisualAccess.
 *
 * @throws InterruptedException
 */
@Test
public void testGetDrawFlagsAttributeAdded() throws InterruptedException {
    System.out.println("getDrawFlagsAttributeAdded");
    final WritableGraph wg = graph.getWritableGraph("Graph Visual Access", true);
    try {
        final int graphDrawFlagsAttribute = VisualConcept.GraphAttribute.DRAW_FLAGS.ensure(wg);
        wg.setObjectValue(graphDrawFlagsAttribute, 0, new DrawFlags(DrawFlags.NODE_LABELS));
    } finally {
        wg.commit();
    }
    final GraphVisualAccess instance = new GraphVisualAccess(graph);
    instance.beginUpdate();
    instance.updateInternally();
    final DrawFlags flags = instance.getDrawFlags();
    instance.endUpdate();
    assertEquals(flags.getFlags(), 4);
}
Also used : WritableGraph(au.gov.asd.tac.constellation.graph.WritableGraph) DrawFlags(au.gov.asd.tac.constellation.utilities.visual.DrawFlags) Test(org.testng.annotations.Test)

Aggregations

DrawFlags (au.gov.asd.tac.constellation.utilities.visual.DrawFlags)6 Test (org.testng.annotations.Test)5 ReadableGraph (au.gov.asd.tac.constellation.graph.ReadableGraph)1 WritableGraph (au.gov.asd.tac.constellation.graph.WritableGraph)1 ConnectionMode (au.gov.asd.tac.constellation.graph.schema.visual.attribute.objects.ConnectionMode)1