Package prefuse.action.layout

Examples of prefuse.action.layout.CollapsedSubtreeLayout


       
        // create the tree layout action
        RadialTreeLayout treeLayout = new RadialTreeLayout(tree);
        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 ForceDirectedLayout(tree, true));
View Full Code Here


        // create the GRAPH layout action
        NodeLinkTreeLayout treeLayout = new NodeLinkTreeLayout( GRAPH, orientation, 40, 0, 8 );
        treeLayout.setLayoutAnchor( new Point2D.Double( 25, 300 ) );
        m_vis.putAction( LAYOUT_ACTION, treeLayout );

        CollapsedSubtreeLayout subLayout = new CollapsedSubtreeLayout( GRAPH, orientation );
        m_vis.putAction( SUB_LAYOUT_ACTION, subLayout );

        // create the filtering and layout
        ActionList filter = new ActionList();
        filter.add( new ExtendedFisheyeTreeFilter( GRAPH, 2 ) );
        filter.add( new FontAction( GRAPH_NODES, FontLib.getFont( "Tahoma", 14 ) ) );
        filter.add( treeLayout );
        filter.add( subLayout );
        filter.add( textColor );
        filter.add( nodeColor );
        filter.add( edgeColor );
        filter.add( usesColor );
        filter.add( usesArrow );
        m_vis.putAction( FILTER_ACTION, filter );

        // animated transition
        AutoPanAction autoPan = new AutoPanAction();
        ActionList animate = new ActionList( 750 );
        animate.setPacingFunction( new SlowInSlowOutPacer() );
        animate.add( autoPan );
        animate.add( new QualityControlAnimator() );
        animate.add( new VisibilityAnimator( GRAPH ) );
        animate.add( new LocationAnimator( GRAPH_NODES ) );
        animate.add( new ColorAnimator( GRAPH_NODES ) );
        animate.add( new RepaintAction() );
        m_vis.putAction( ANIMATE_ACTION, animate );
        m_vis.alwaysRunAfter( FILTER_ACTION, ANIMATE_ACTION );

        m_vis.putAction( AUTO_ZOOM_ACTION, new AutoZoomAction() );

        // initialize the display
        setItemSorter( new TreeDepthItemSorter() );
        addControlListener( new ZoomToFitControl() );
        addControlListener( new ZoomControl() );
        addControlListener( new WheelZoomControl() );
        addControlListener( new PanControl() );
        addControlListener( new FocusControl( 1, FILTER_ACTION ) );
        addControlListener( new ItemSelectionControl() );

        // set orientation
        nodeRenderer.setHorizontalAlignment( Constants.LEFT );
        edgeRenderer.setHorizontalAlignment1( Constants.RIGHT );
        edgeRenderer.setHorizontalAlignment2( Constants.LEFT );
        edgeRenderer.setVerticalAlignment1( Constants.CENTER );
        edgeRenderer.setVerticalAlignment2( Constants.CENTER );
        usesRenderer.setHorizontalAlignment1( Constants.CENTER );
        usesRenderer.setHorizontalAlignment2( Constants.CENTER );
        usesRenderer.setVerticalAlignment1( Constants.BOTTOM );
        usesRenderer.setVerticalAlignment2( Constants.CENTER );
        NodeLinkTreeLayout rtl = (NodeLinkTreeLayout) m_vis.getAction( LAYOUT_ACTION );
        CollapsedSubtreeLayout stl = (CollapsedSubtreeLayout) m_vis.getAction( SUB_LAYOUT_ACTION );
        rtl.setOrientation( orientation );
        stl.setOrientation( orientation );
    }
View Full Code Here

        NodeLinkTreeLayout treeLayout = new NodeLinkTreeLayout(tree,
                m_orientation, 50, 0, 8);
        treeLayout.setLayoutAnchor(new Point2D.Double(25,300));
        m_vis.putAction("treeLayout", treeLayout);
       
        CollapsedSubtreeLayout subLayout =
            new CollapsedSubtreeLayout(tree, m_orientation);
        m_vis.putAction("subLayout", subLayout);
       
        AutoPanAction autoPan = new AutoPanAction();
       
        // create the filtering and layout
View Full Code Here

    // ------------------------------------------------------------------------
   
    public void setOrientation(int orientation) {
        NodeLinkTreeLayout rtl
            = (NodeLinkTreeLayout)m_vis.getAction("treeLayout");
        CollapsedSubtreeLayout stl
            = (CollapsedSubtreeLayout)m_vis.getAction("subLayout");
        switch ( orientation ) {
        case Constants.ORIENT_LEFT_RIGHT:
            m_nodeRenderer.setHorizontalAlignment(Constants.LEFT);
            m_edgeRenderer.setHorizontalAlignment1(Constants.RIGHT);
            m_edgeRenderer.setHorizontalAlignment2(Constants.LEFT);
            m_edgeRenderer.setVerticalAlignment1(Constants.CENTER);
            m_edgeRenderer.setVerticalAlignment2(Constants.CENTER);
            break;
        case Constants.ORIENT_RIGHT_LEFT:
            m_nodeRenderer.setHorizontalAlignment(Constants.RIGHT);
            m_edgeRenderer.setHorizontalAlignment1(Constants.LEFT);
            m_edgeRenderer.setHorizontalAlignment2(Constants.RIGHT);
            m_edgeRenderer.setVerticalAlignment1(Constants.CENTER);
            m_edgeRenderer.setVerticalAlignment2(Constants.CENTER);
            break;
        case Constants.ORIENT_TOP_BOTTOM:
            m_nodeRenderer.setHorizontalAlignment(Constants.CENTER);
            m_edgeRenderer.setHorizontalAlignment1(Constants.CENTER);
            m_edgeRenderer.setHorizontalAlignment2(Constants.CENTER);
            m_edgeRenderer.setVerticalAlignment1(Constants.BOTTOM);
            m_edgeRenderer.setVerticalAlignment2(Constants.TOP);
            break;
        case Constants.ORIENT_BOTTOM_TOP:
            m_nodeRenderer.setHorizontalAlignment(Constants.CENTER);
            m_edgeRenderer.setHorizontalAlignment1(Constants.CENTER);
            m_edgeRenderer.setHorizontalAlignment2(Constants.CENTER);
            m_edgeRenderer.setVerticalAlignment1(Constants.TOP);
            m_edgeRenderer.setVerticalAlignment2(Constants.BOTTOM);
            break;
        default:
            throw new IllegalArgumentException(
                "Unrecognized orientation value: "+orientation);
        }
        m_orientation = orientation;
        rtl.setOrientation(orientation);
        stl.setOrientation(orientation);
    }
View Full Code Here

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

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

TOP

Related Classes of prefuse.action.layout.CollapsedSubtreeLayout

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.