Package prefuse.visual

Examples of prefuse.visual.VisualItem


            // set uses_edges always visible
            Iterator items = m_vis.items( GRAPH_EDGES );
            while( items.hasNext() )
            {
                VisualItem item = (VisualItem) items.next();
                if( item.getBoolean( USES_EDGES ) )
                {
                    PrefuseLib.updateVisible( item, true );
                }
            }
        }
View Full Code Here


        {
            Iterator iter = m_vis.items( m_group );
            while( iter.hasNext() )
            {
                DecoratorItem item = (DecoratorItem) iter.next();
                VisualItem node = item.getDecoratedItem();
                Rectangle2D bounds = node.getBounds();
                setX( item, node, bounds.getX() + StackedLayout.INSET );
                setY( item, node, bounds.getY() + StackedLayout.INSET + 12 );
            }
        }
View Full Code Here

            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
                    ( (JViewport) container ).scrollRectToVisible( vi.getBounds().getBounds() );
                }
            }
        }
View Full Code Here

        if( object == null )
        {
            return;
        }

        VisualItem item = null;

        Iterator iter = m_vis.items( GRAPH_NODES );
        while( iter.hasNext() )
        {
            VisualItem tItem = (VisualItem) iter.next();
            Object tObj = tItem.get( USER_OBJECT );
            if( tObj.equals( object ) )
            {
                item = tItem;
                break;
            }
View Full Code Here

                    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
            {
                m_cur.setLocation( m_start.getX() + frac * ( m_end.getX() - m_start.getX() ),
                                   m_start.getY() + frac * ( m_end.getY() - m_start.getY() ) );
View Full Code Here

        public void mouseMoved(MouseEvent e) {
            synchronized ( m_vis ) {
                boolean earlyReturn = false;
                //check if we've gone over any item
                VisualItem vi = findItem(e.getPoint());
                if ( activeItem != null && activeItem != vi ) {
                    if ( validityCheck() )
                        fireItemExited(activeItem, e);
                    earlyReturn = true;
                }
View Full Code Here

     */
    public void run(double frac) {
        // mark the items
        Iterator items = m_vis.visibleItems(m_group);
        while ( items.hasNext() ) {
            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();
            int d = m_bfs.getDepth(item);
            PrefuseLib.updateVisible(item, true);
            item.setDOI(-d);
            item.setExpanded(d < m_distance);
        }
       
        // mark unreached items
        items = m_vis.visibleItems(m_group);
        while ( items.hasNext() ) {
            VisualItem item = (VisualItem)items.next();
            if ( item.getDOI() == Constants.MINIMUM_DOI ) {
                PrefuseLib.updateVisible(item, false);
                item.setExpanded(false);
            }
        }
    }
View Full Code Here

   
    private void setup() {
        // handle fade-in nodes
        Iterator items = m_vis.visibleItems(m_group);
        while ( items.hasNext() ) {
            VisualItem item = (VisualItem) items.next();
            if ( !item.isStartVisible() ) {
                item.setStartFillColor(
                        ColorLib.setAlpha(item.getEndFillColor(),0));
                item.setStartStrokeColor(
                        ColorLib.setAlpha(item.getEndStrokeColor(),0));
                item.setStartTextColor(
                        ColorLib.setAlpha(item.getEndTextColor(),0));
            }
        }
       
        // handle fade-out nodes
        items = m_vis.items(m_group, StartVisiblePredicate.TRUE);
        while ( items.hasNext() ) {
            VisualItem item = (VisualItem) items.next();
            if ( !item.isEndVisible() ) {
                // fade-out case
                item.setVisible(true);
                item.setEndFillColor(
                        ColorLib.setAlpha(item.getStartFillColor(),0));
                item.setEndStrokeColor(
                        ColorLib.setAlpha(item.getStartStrokeColor(),0));
                item.setEndTextColor(
                        ColorLib.setAlpha(item.getStartTextColor(),0));
            }
        }
    }
View Full Code Here

   
    private void finish() {
        // set faded-out nodes to permanently invisible
        Iterator items = m_vis.items(m_group, StartVisiblePredicate.TRUE);
        while ( items.hasNext() ) {
            VisualItem item = (VisualItem) items.next();
            if ( !item.isEndVisible() ) {
                item.setVisible(false);
                item.setStartVisible(false);
            }
        }
       
        // set faded-in nodes to permanently visible
        items = m_vis.visibleItems(m_group);
        while ( items.hasNext() ) {
            VisualItem item = (VisualItem) items.next();
            if ( !item.isStartVisible() ) {
                item.setStartVisible(true);
                item.setStartFillColor(item.getEndFillColor());
                item.setStartTextColor(item.getEndTextColor());
                item.setStartStrokeColor(item.getEndStrokeColor());
            }
        }
    }
View Full Code Here

            m_dist[1] = ((Number)m_model.getHighValue()).doubleValue();
        }
       
        Iterator iter = m_vis.items(m_group, m_filter);
        while ( iter.hasNext() ) {
            VisualItem item = (VisualItem)iter.next();
            double v = item.getDouble(m_field);
            double f = MathLib.interp(m_scale, v, m_dist);
            set(item, f);
        }
    }
View Full Code Here

TOP

Related Classes of prefuse.visual.VisualItem

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.