Package prefuse.data.expression

Examples of prefuse.data.expression.Predicate


        usesRenderer.setHorizontalAlignment1( Constants.CENTER );
        usesRenderer.setHorizontalAlignment2( Constants.CENTER );
        usesRenderer.setVerticalAlignment1( Constants.BOTTOM );
        usesRenderer.setVerticalAlignment2( Constants.TOP );

        Predicate usesPredicate = (Predicate) ExpressionParser.parse( "ingroup('graph.edges') AND [" + USES_EDGES + "]==true", true );

        // set up the renderers - one for nodes and one for LABELS
        DefaultRendererFactory rf = new DefaultRendererFactory();
        rf.add( new InGroupPredicate( GRAPH_NODES ), new NodeRenderer() );
        rf.add( new InGroupPredicate( LABELS ), labelRenderer );
View Full Code Here


    {
        // add the GRAPH to the visualization
        m_vis.add( GRAPH, graph );

        // hide edges
        Predicate edgesPredicate = (Predicate) ExpressionParser.parse( "ingroup('graph.edges') AND [" + USES_EDGES + "]==false", true );
        m_vis.setVisible( GRAPH_EDGES, edgesPredicate, false );

        m_vis.setInteractive( GRAPH_EDGES, null, false );

        // make node interactive
        m_vis.setInteractive( GRAPH_NODES, null, true );

        // add LABELS to the visualization
        Predicate labelP = (Predicate) ExpressionParser.parse( "VISIBLE()" );
        m_vis.addDecorators( LABELS, GRAPH_NODES, labelP, LABEL_SCHEMA );

        run();
    }
View Full Code Here

        nodeRenderer.setHorizontalAlignment( Constants.LEFT );
        nodeRenderer.setRoundedCorner( 8, 8 );
        edgeRenderer = new EdgeRenderer( Constants.EDGE_TYPE_CURVE );
        usesRenderer = new EdgeRenderer( Constants.EDGE_TYPE_CURVE, Constants.EDGE_ARROW_FORWARD );

        Predicate edgesPredicate = (Predicate) ExpressionParser.parse( "ingroup('graph.edges') AND [" + USES_EDGES + "]==false", true );
        Predicate usesPredicate = (Predicate) ExpressionParser.parse( "ingroup('graph.edges') AND [" + USES_EDGES + "]==true", true );

        DefaultRendererFactory rf = new DefaultRendererFactory( nodeRenderer );
        rf.add( edgesPredicate, edgeRenderer );
        rf.add( usesPredicate, usesRenderer );
        m_vis.setRendererFactory( rf );
View Full Code Here

     * @param predicate a String in the prefuse expression language. This
     *  String will be parsed to create a corresponding Predicate instance.
     * @param r the Renderer to return if an item matches the Predicate
     */
    public void add(String predicate, Renderer r) {
        Predicate p = (Predicate)ExpressionParser.parse(predicate);
        add(p, r);
    }
View Full Code Here

     * If the parse fails or does not result in a
     * {@link prefuse.data.expression.Predicate} instance, an exception will
     * be thrown.
     */
    public void setPredicate(String expr) {
        Predicate p = (Predicate)ExpressionParser.parse(expr, true);
        setPredicate(p);
    }
View Full Code Here

       
        IfExpression prev = null;
        Expression expr = m_head;
        while ( expr instanceof IfExpression ) {
            IfExpression ifex = (IfExpression)expr;
            Predicate test = (Predicate)ifex.getTestPredicate();
            if ( p.equals(test) ) {
                Expression elseex = ifex.getElseExpression();
                ifex.setElseExpression(new ObjectLiteral(null));
                if ( prev != null ) {
                    prev.setElseExpression(elseex);
View Full Code Here

     * @param font the font
     * @throws RuntimeException if the expression does not parse correctly or
     * does not result in a Predicate instance.
     */
    public void add(String expr, Font font) {
        Predicate p = (Predicate)ExpressionParser.parse(expr);
        super.add(p, font);      
    }
View Full Code Here

     * @param f the delegate FontAction to use
     * @throws RuntimeException if the expression does not parse correctly or
     * does not result in a Predicate instance.
     */
    public void add(String expr, FontAction f) {
        Predicate p = (Predicate)ExpressionParser.parse(expr);
        super.add(p, f);
    }
View Full Code Here

     * @param size the size value
     * @throws RuntimeException if the expression does not parse correctly or
     * does not result in a Predicate instance.
     */
    public void add(String expr, double size) {
        Predicate p = (Predicate)ExpressionParser.parse(expr);
        add(p, size);      
    }
View Full Code Here

     * @param f the delegate SizeAction to use
     * @throws RuntimeException if the expression does not parse correctly or
     * does not result in a Predicate instance.
     */
    public void add(String expr, SizeAction f) {
        Predicate p = (Predicate)ExpressionParser.parse(expr);
        super.add(p, f);
    }
View Full Code Here

TOP

Related Classes of prefuse.data.expression.Predicate

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.