public void ungroupCluster(Cluster cluster) { GraphModel gm = Lookup.getDefault().lookup(GraphController.class).getModel(); if (gm != null) { HierarchicalGraph graph = gm.getHierarchicalGraphVisible(); graph.ungroupNodes(cluster.getMetaNode()); cluster.setMetaNode(null); } }
public void refine(HierarchicalGraph graph) { double r = 10; int count = 0; int refined = 0; for (Node node : graph.getTopNodes().toArray()) { count++; if (graph.getChildrenCount(node) == 2) { refined++; float x = node.getNodeData().x(); float y = node.getNodeData().y(); for (Node child : graph.getChildren(node)) { double t = Math.random(); child.getNodeData().setX((float) (x + r * Math.cos(t))); child.getNodeData().setY((float) (y + r * Math.sin(t))); } graph.ungroupNodes(node); } } // System.out.println("COUNT = " + count); // System.out.println("REFINED = " + refined); }