Package prefuse.action.assignment

Examples of prefuse.action.assignment.ColorAction


        rf.add(new InGroupPredicate(treeNodes), new NodeRenderer());
        rf.add(new InGroupPredicate(labels), new LabelRenderer(label));
        m_vis.setRendererFactory(rf);
                      
        // 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);
View Full Code Here


        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());
View Full Code Here

        drf.add("ingroup('aggregates')", polyR);
        m_vis.setRendererFactory(drf);
       
        // set up the visual operators
        // first set up all the color actions
        ColorAction nStroke = new ColorAction(NODES, VisualItem.STROKECOLOR);
        nStroke.setDefaultColor(ColorLib.gray(100));
        nStroke.add("_hover", ColorLib.gray(50));
       
        ColorAction nFill = new ColorAction(NODES, VisualItem.FILLCOLOR);
        nFill.setDefaultColor(ColorLib.gray(255));
        nFill.add("_hover", ColorLib.gray(200));
       
        ColorAction nEdges = new ColorAction(EDGES, VisualItem.STROKECOLOR);
        nEdges.setDefaultColor(ColorLib.gray(100));
       
        ColorAction aStroke = new ColorAction(AGGR, VisualItem.STROKECOLOR);
        aStroke.setDefaultColor(ColorLib.gray(200));
        aStroke.add("_hover", ColorLib.rgb(255,100,100));
       
        int[] palette = new int[] {
            ColorLib.rgba(255,200,200,150),
            ColorLib.rgba(200,255,200,150),
            ColorLib.rgba(200,200,255,150)
        };
        ColorAction aFill = new DataColorAction(AGGR, "id",
                Constants.NOMINAL, VisualItem.FILLCOLOR, palette);
       
        // bundle the color actions
        ActionList colors = new ActionList();
        colors.add(nStroke);
View Full Code Here

        vis.addDecorators(Constants.NODE_DECORATORS,
                          Constants.TREE_NODES,
                          DECORATOR_SCHEMA);

        // -- set up processing actions --
        ColorAction nodeStroke = new ColorAction(Constants.TREE_NODES,
                                                 VisualItem.STROKECOLOR);
        nodeStroke.setDefaultColor(ColorManager.BORDER_COLOR_RGB);
        nodeStroke.add("_hover", ColorManager.BORDER_COLOR_RGB);

        Predicate noServiceItemFilter =
            ExpressionParser.predicate("state=="+Constants.ACTIVE_NO_SERVICE_ITEM);
        //nodeStroke.add(noServiceItemFilter,
        //               ColorManager.NO_SERVICE_ITEM_BORDER_COLOR_RGB);

        ColorAction nodeFill = new ColorAction(Constants.TREE_NODES,
                                               VisualItem.FILLCOLOR);
        nodeFill.add("_hover", ColorManager.HOVER_COLOR_RGB);

        /* Color predicates */
        nodeFill.add(rootFilter, ColorManager.ROOT_COLOR_RGB);
        //Predicate okayFilter =
        //    ExpressionParser.predicate(Constants.STATE+"=="+Constants.ACTIVE+" || " +
        //                               Constants.STATE+"=="+Constants.ACTIVE_NO_SERVICE_ITEM);
        Predicate okayFilter =
            ExpressionParser.predicate(Constants.STATE+"=="+Constants.ACTIVE);
        nodeFill.add(okayFilter,
                     ColorLib.color(colorManager.getOkayColor()));

        Predicate emptyFilter =
            ExpressionParser.predicate(Constants.STATE+"=="+Constants.EMPTY);
        nodeFill.add(emptyFilter, ColorManager.EMPTY_COLOR_RGB);

        Predicate ambiguousFilter =
            ExpressionParser.predicate(Constants.STATE+"=="+Constants.WARNING);
        nodeFill.add(ambiguousFilter,
                     ColorLib.color(colorManager.getWarningColor()));
        nodeFill.add(noServiceItemFilter,
                     ColorLib.color(colorManager.getWarningColor()));       
        Predicate failureFilter =
            ExpressionParser.predicate(Constants.STATE+"=="+Constants.FAILED);
        nodeFill.add(failureFilter,
                     ColorLib.color(colorManager.getFailureColor()));

        colorManager.setColorAction(nodeFill);
        colorManager.setAmbiguousFilter(ambiguousFilter);
        colorManager.setFailureFilter(failureFilter);
        colorManager.setOkayFilter(okayFilter);
        colorManager.setNoServiceItemFilter(noServiceItemFilter);

        //ItemAction nodeColor = new NodeColorAction(TREE_NODES);
        ItemAction textColor = new TextColorAction(Constants.TREE_NODES);

        vis.putAction("textColor", textColor);

        ItemAction edgeColor = new ColorAction(Constants.TREE_EDGES,
                                               VisualItem.STROKECOLOR,
                                               ColorManager.EDGE_COLOR_RGB);

        FontAction fonts = new FontAction(Constants.TREE_NODES,
                                          FontLib.getFont("Tahoma", 12));
View Full Code Here

TOP

Related Classes of prefuse.action.assignment.ColorAction

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.