コード例 #1
0
 @Test
 public void layoutHorizontalTreeViaAttribute() {
   GraphWidget graph = parse("graph Sample{rankdir=LR;1;}"); // $NON-NLS-1$
   Assert.assertNotNull("Created graph must not be null", graph); // $NON-NLS-1$
   Assert.assertEquals(TreeLayoutAlgorithm.class, graph.getLayoutAlgorithm().getClass());
   Assert.assertEquals(
       TreeLayoutAlgorithm.LEFT_RIGHT,
       ((TreeLayoutAlgorithm) (graph.getLayoutAlgorithm())).getDirection());
 }
コード例 #2
0
 @Test
 public void layoutTree() {
   GraphWidget graph = parse("graph Sample{graph[layout=dot];1;}"); // $NON-NLS-1$
   Assert.assertNotNull("Created graph must not be null", graph); // $NON-NLS-1$
   Assert.assertEquals(TreeLayoutAlgorithm.class, graph.getLayoutAlgorithm().getClass());
 }