Package prefuse.data.tuple

Examples of prefuse.data.tuple.TupleSet


        // the PolarLocationAnimator should read this set and act accordingly
        m_vis.addFocusGroup(linear, new DefaultTupleSet());
        m_vis.getGroup(Visualization.FOCUS_ITEMS).addTupleSetListener(
            new TupleSetListener() {
                public void tupleSetChanged(TupleSet t, Tuple[] add, Tuple[] rem) {
                    TupleSet linearInterp = m_vis.getGroup(linear);
                    if ( add.length < 1 ) return; linearInterp.clear();
                    for ( Node n = (Node)add[0]; n!=null; n=n.getParent() )
                        linearInterp.addTuple(n);
                }
            }
        );
       
        //==== Create a highlight group for adding borders based on citation count
View Full Code Here


        public TreeRootAction(String graphGroup) {
            super(graphGroup);
        }
        public void run(double frac) {
           
            TupleSet focus = m_vis.getGroup(Visualization.FOCUS_ITEMS);
            if ( focus==null || focus.getTupleCount() == 0 ) return;
           
            Graph g = (Graph)m_vis.getGroup(m_group);
            Node f = null;
            Iterator tuples = focus.tuples();
            while (tuples.hasNext() && !g.containsTuple(f=(Node)tuples.next()))
            {
                f = null;
            }
            if ( f == null ) return;
View Full Code Here

        public NodeSpreadAction(String group) {
            super(group);
        }
        public void run(double frac)
        {
            TupleSet allNodes = m_vis.getGroup(treeNodes);
            Iterator it = allNodes.tuples();
            int mover = 1;
            while(it.hasNext())
            {
                //=== Get the node's tuple
                Tuple node = (Node)it.next();
View Full Code Here

            {
                stackedLayout.zoom( depth );
                relayout = true;
            }

            TupleSet ts = m_vis.getFocusGroup( Visualization.FOCUS_ITEMS );
            ts.setTuple( item );
            if( relayout )
            {
                run();
            }
            else
View Full Code Here

            {
                y = 0;
            }
            pan( x, y );

            TupleSet ts = m_vis.getFocusGroup( Visualization.FOCUS_ITEMS );
            if( ts.getTupleCount() != 0 )
            {
                // get the first selected item and pan center it
                VisualItem vi = (VisualItem) ts.tuples().next();

                //update scrollbar position
                if( container instanceof JViewport )
                {
                    // TODO there is a bug on Swing scrollRectToVisible
View Full Code Here

            }
        }

        if( item != null )
        {
            TupleSet ts = m_vis.getFocusGroup( Visualization.FOCUS_ITEMS );
            ts.setTuple( item );
            m_vis.run( FILTER_ACTION );
        }
    }
View Full Code Here

        private final int m_bias = 150;

        @Override
        public void run( double frac )
        {
            TupleSet ts = m_vis.getFocusGroup( Visualization.FOCUS_ITEMS );
            if( ts.getTupleCount() == 0 )
            {
                return;
            }

            if( frac == 0.0 )
            {
                int xbias, ybias = 0;

                xbias = m_bias;
                switch( orientation )
                {
                    case Constants.ORIENT_LEFT_RIGHT:

                        break;
                    case Constants.ORIENT_RIGHT_LEFT:
                        xbias = -m_bias;
                        break;
                    case Constants.ORIENT_TOP_BOTTOM:
                        ybias = m_bias;
                        break;
                    case Constants.ORIENT_BOTTOM_TOP:
                        ybias = -m_bias;
                        break;
                }

                VisualItem vi = (VisualItem) ts.tuples().next();
                m_cur.setLocation( getWidth() / 2, getHeight() / 2 );
                getAbsoluteCoordinate( m_cur, m_start );
                m_end.setLocation( vi.getX() + xbias, vi.getY() + ybias );
            }
            else
View Full Code Here

            VisualItem item = (VisualItem)items.next();
            item.setDOI(Constants.MINIMUM_DOI);
        }
       
        // set up the graph traversal
        TupleSet src = m_vis.getGroup(m_sources);
        Iterator srcs = new FilterIterator(src.tuples(), m_groupP);
        m_bfs.init(srcs, m_distance, Constants.NODE_AND_EDGE_TRAVERSAL);
       
        // traverse the graph
        while ( m_bfs.hasNext() ) {
            VisualItem item = (VisualItem)m_bfs.next();
View Full Code Here

   
    /**
     * @see prefuse.action.EncoderAction#setup()
     */
    protected void setup() {
        TupleSet ts = m_vis.getGroup(m_group);
       
        // cache the scale value in case it gets changed due to error
        m_tempScale = m_scale;
       
        if ( m_inferBounds ) {
            if ( m_scale == Constants.QUANTILE_SCALE && m_bins > 0 ) {
                double[] values =
                    DataLib.toDoubleArray(ts.tuples(), m_dataField);
                m_dist = MathLib.quantiles(m_bins, values);
            } else {
                // check for non-binned quantile scale error
                if ( m_scale == Constants.QUANTILE_SCALE ) {
                    Logger.getLogger(getClass().getName()).warning(
View Full Code Here

   
    /**
     * @see prefuse.action.Action#run(double)
     */
    public void run(double frac) {
        TupleSet ts = m_vis.getGroup(m_group);
        setMinMax();
       
        switch ( getDataType(ts) ) {
        case Constants.NUMERICAL:
            numericalLayout(ts);
View Full Code Here

TOP

Related Classes of prefuse.data.tuple.TupleSet

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.