Package prefuse.action

Examples of prefuse.action.ActionList


        FontAction fonts = new FontAction(treeNodes,
                FontLib.getFont("Tahoma", 10));
        fonts.add("ingroup('_focus_')", FontLib.getFont("Tahoma", 11));
       
        // recolor
        ActionList recolor = new ActionList();
        recolor.add(nodeColor);
        recolor.add(textColor);
        m_vis.putAction("recolor", recolor);
       
        // repaint
        ActionList repaint = new ActionList();
        repaint.add(recolor);
        repaint.add(new RepaintAction());
        m_vis.putAction("repaint", repaint);
       
        // animate paint change
        ActionList animatePaint = new ActionList(400);
        animatePaint.add(new ColorAnimator(treeNodes));
        animatePaint.add(new RepaintAction());
        m_vis.putAction("animatePaint", animatePaint);
       
        // create the tree layout action
        RadialTreeLayout treeLayout = new RadialTreeLayout(tree);
        //treeLayout.setAngularBounds(-Math.PI/2, Math.PI);
        m_vis.putAction("treeLayout", treeLayout);
       
        CollapsedSubtreeLayout subLayout = new CollapsedSubtreeLayout(tree);
        m_vis.putAction("subLayout", subLayout);
       
        // create the filtering and layout
        ActionList filter = new ActionList();
        filter.add(new TreeRootAction(tree));
        filter.add(fonts);
        filter.add(treeLayout);
        filter.add(subLayout);
        filter.add(textColor);
        filter.add(nodeColor);
        filter.add(edgeColor);
        m_vis.putAction("filter", filter);
       
        // animated transition
        ActionList animate = new ActionList(1250);
        animate.setPacingFunction(new SlowInSlowOutPacer());
        animate.add(new QualityControlAnimator());
        animate.add(new VisibilityAnimator(tree));
        animate.add(new PolarLocationAnimator(treeNodes, linear));
        animate.add(new ColorAnimator(treeNodes));
        animate.add(new RepaintAction());
        m_vis.putAction("animate", animate);
        m_vis.alwaysRunAfter("filter", "animate");
       
        // ------------------------------------------------
       
View Full Code Here


        nodeRenderer.setVerticalPadding(0);
        nodeRenderer.setMaxImageDimensions(100,100);
       
        m_vis.setRendererFactory(new DefaultRendererFactory(nodeRenderer));
       
        ActionList init = new ActionList();
        init.add(new RandomLayout());
        init.add(new DataMountainSizeAction());
        m_vis.putAction("init", init);
       
        ActionList update = new ActionList();
        update.add(new DataMountainSizeAction());
        update.add(new ColorAction("data", VisualItem.STROKECOLOR) {
            public int getColor(VisualItem item) {
                return ColorLib.rgb((item.isHover() ? 255 : 0), 0, 0);
            }
        });
        update.add(new RepaintAction());
        m_vis.putAction("update", update);

        // we run this to make sure the forces are stabilized
        ActionList preforce = new ActionList(1000);
        preforce.add(new DataMountainForceLayout(true));
        m_vis.putAction("preforce", preforce);

        // this will cause docs to move out of the way when dragging
        final ForceDirectedLayout fl = new DataMountainForceLayout(false);
        ActivityListener fReset = new ActivityAdapter() {
            public void activityCancelled(Activity a) {
                fl.reset();
             }
        };
        ActionList forces = new ActionList(Activity.INFINITY);
        forces.add(fl);
        forces.add(update);
        forces.addActivityListener(fReset);
        m_vis.putAction("forces", forces);
       
        setSize(640,450);
        setDamageRedraw(false); // disable due to Java2D image clipping errors
        setBorder(BorderFactory.createEmptyBorder(30,20,5,20));
View Full Code Here

        // border colors
        final ColorAction borderColor = new BorderColorAction(treeNodes);
        final ColorAction fillColor = new FillColorAction(treeNodes);
       
        // color settings
        ActionList colors = new ActionList();
        colors.add(fillColor);
        colors.add(borderColor);
        m_vis.putAction("colors", colors);
       
        // animate paint change
        ActionList animatePaint = new ActionList(400);
        animatePaint.add(new ColorAnimator(treeNodes));
        animatePaint.add(new RepaintAction());
        m_vis.putAction("animatePaint", animatePaint);
       
        // create the single filtering and layout action list
        ActionList layout = new ActionList();
        layout.add(new SquarifiedTreeMapLayout(tree));
        layout.add(new LabelLayout(labels));
        layout.add(colors);
        layout.add(new RepaintAction());
        m_vis.putAction("layout", layout);
       
        // initialize our display
        setSize(700,600);
        setItemSorter(new TreeDepthItemSorter());
View Full Code Here

        };
        ColorAction aFill = new DataColorAction(AGGR, "id",
                Constants.NOMINAL, VisualItem.FILLCOLOR, palette);
       
        // bundle the color actions
        ActionList colors = new ActionList();
        colors.add(nStroke);
        colors.add(nFill);
        colors.add(nEdges);
        colors.add(aStroke);
        colors.add(aFill);
       
        // now create the main layout routine
        ActionList layout = new ActionList(Activity.INFINITY);
        layout.add(colors);
        layout.add(new ForceDirectedLayout(GRAPH, true));
        layout.add(new AggregateLayout(AGGR));
        layout.add(new RepaintAction());
        m_vis.putAction("layout", layout);
       
        // set up the display
        setSize(500,500);
        pan(250, 250);
View Full Code Here

        FontAction fonts = new FontAction(Constants.TREE_NODES,
                                          FontLib.getFont("Tahoma", 12));
        fonts.add("ingroup('_focus_')", FontLib.getFont("Tahoma", 13));

        // recolor
        ActionList recolor = new ActionList();
        //recolor.add(new NodeColorAction());
        recolor.add(textColor);
        recolor.add(nodeStroke);
        recolor.add(nodeFill);
        vis.putAction("recolor", recolor);

        // repaint
        ActionList repaint = new ActionList();
        repaint.add(recolor);
        repaint.add(new RepaintAction());
        vis.putAction("repaint", repaint);

        // animate paint change
        ActionList animatePaint = new ActionList(400);
        animatePaint.add(new ColorAnimator(Constants.TREE_NODES));
        animatePaint.add(new RepaintAction());
        vis.putAction("animatePaint", animatePaint);

        //TreeLayout graphLayout = new RadialTreeLayout(Constants.TREE);
        graphLayout =
            new NodeLinkTreeLayout(Constants.TREE, orientation, 48, 12, 16);

        // create the tree layout action
        CollapsedSubtreeLayout subLayout = new CollapsedSubtreeLayout(Constants.TREE);
        vis.putAction("subLayout", subLayout);
        ActionList layout = new ActionList(Activity.INFINITY);       
        layout.add(graphLayout);
        layout.add(subLayout);
        layout.add(new LabelPositionLayout(Constants.NODE_DECORATORS));
        vis.putAction("graphLayout", layout);

        ActionList treeRoot = new ActionList();
        treeRoot.add(new TreeRootAction(Constants.TREE));
        vis.putAction("treeRoot", treeRoot);

        // create the filtering and layout
        ActionList filter = new ActionList();
        filter.add(treeRoot);
        filter.add(fonts);
        filter.add(layout);
        filter.add(edgeColor);
        filter.add(recolor);
        vis.putAction("filter", filter);

        // animated transition
        ActionList animate = new ActionList(1000);
        animate.setPacingFunction(new SlowInSlowOutPacer());
        animate.add(new QualityControlAnimator());
        animate.add(new VisibilityAnimator(Constants.TREE));
        animate.add(new PolarLocationAnimator(Constants.TREE_NODES,
                                              Constants.LINEAR));
        animate.add(new ColorAnimator(Constants.TREE_NODES));
        animate.add(new RepaintAction());
        vis.putAction("animate", animate);
        vis.alwaysRunAfter("filter", "animate");

        // initialize the display
        setSize(500, 500);
View Full Code Here

TOP

Related Classes of prefuse.action.ActionList

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.