Package infovis.tree

Examples of infovis.tree.DefaultTree


    public static void main(String[] args) {
        String fileName = "data/tree/election.tm3";
        if (args.length > 0) {
            fileName = args[0];
        }
        DefaultTree t = new DefaultTree();
        AbstractReader reader =
            TreeReaderFactory.createTreeReader(fileName, t);
        if (reader == null || !reader.load()) {
            System.err.println("cannot load " + fileName);
        }
View Full Code Here


        }
        if (inputFile == null) {
            syntax();
            System.exit(1);
        }
        final DefaultTree tree = new DefaultTree();
        System.out.println("Reading " + inputFile);
        AbstractReader reader =
            TreeReaderFactory.createTreeReader(inputFile, tree);
        TreemapVisualization visualization =
            new TreemapVisualization(tree, Strip.instance);
        if (reader != null && reader.load()) {
            System.out.println("Done.");
            for (Iterator iter = visual.keySet().iterator();
                iter.hasNext();
                ) {
                String key = (String) iter.next();
                String value = (String) visual.get(key);
                visualization.setVisualColumn(
                    key,
                    tree.getColumn(value));
            }
            final Column order = visualization.getVisualColumn("sort");
            final Column size = visualization.getVisualColumn(Visualization.VISUAL_SIZE);
            Permutation perm = visualization.getPermutation();
            perm.sort(new RowComparator() {
                public int compare(int row1, int row2) {
                    if (tree.isLeaf(row1) && tree.isLeaf(row2)) {
                        return size.compare(row1, row2);
                    }
                    else {
                        return order.compare(row1, row2);
                    }
View Full Code Here

TOP

Related Classes of infovis.tree.DefaultTree

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.