Package prefuse.visual

Examples of prefuse.visual.VisualItem


   
    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


     */
    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 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

     * @see prefuse.action.Action#run(double)
     */
    public void run(double frac) {
        Iterator items = m_vis.items(m_group, m_filter);
        while ( items.hasNext() ) {
            VisualItem item = (VisualItem)items.next();
            PrefuseLib.updateVisible(item, m_predicate.getBoolean(item));
        }
    }
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

        int end = start + model.getExtent();
        double total = (double)(end-start);
       
        Iterator iter = m_vis.items(m_group, m_filter);
        while ( iter.hasNext() ) {
            VisualItem item = (VisualItem)iter.next();
            int order = model.getIndex(item.get(m_field)) - start;
            set(item, (total > 0.0) ? order/total : 0.5);
        }
    }
View Full Code Here

    /**
     * @see prefuse.render.AbstractShapeRenderer#getRawShape(prefuse.visual.VisualItem)
     */
    protected Shape getRawShape(VisualItem item) {
        EdgeItem   edge = (EdgeItem)item;
        VisualItem item1 = edge.getSourceItem();
        VisualItem item2 = edge.getTargetItem();
       
        int type = m_edgeType;
       
        getAlignedPoint(m_tmpPoints[0], item1.getBounds(),
                        m_xAlign1, m_yAlign1);
        getAlignedPoint(m_tmpPoints[1], item2.getBounds(),
                        m_xAlign2, m_yAlign2);
        m_curWidth = (float)(m_width * getLineWidth(item));
       
        // create the arrow head, if needed
        EdgeItem e = (EdgeItem)item;
        if ( e.isDirected() && m_edgeArrow != Constants.EDGE_ARROW_NONE ) {
            // get starting and ending edge endpoints
            boolean forward = (m_edgeArrow == Constants.EDGE_ARROW_FORWARD);
            Point2D start = null, end = null;
            start = m_tmpPoints[forward?0:1];
            end   = m_tmpPoints[forward?1:0];
           
            // compute the intersection with the target bounding box
            VisualItem dest = forward ? e.getTargetItem() : e.getSourceItem();
            int i = GraphicsLib.intersectLineRectangle(start, end,
                    dest.getBounds(), m_isctPoints);
            if ( i > 0 ) end = m_isctPoints[0];
           
            // create the arrow head shape
            AffineTransform at = getArrowTrans(start, end, m_curWidth);
            m_curArrow = at.createTransformedShape(m_arrowHead);
View Full Code Here

        m_root = (NodeItem)tree.getRoot();
       
        // mark the items
        Iterator items = m_vis.visibleItems(m_group);
        while ( items.hasNext() ) {
            VisualItem item = (VisualItem)items.next();
            item.setDOI(Constants.MINIMUM_DOI);
            item.setExpanded(false);
        }
       
        // compute the fisheye over nodes
        Iterator iter = m_vis.items(m_sources, m_groupP);
        while ( iter.hasNext() )
            visitFocus((NodeItem)iter.next(), null);
        visitFocus(m_root, null);

        // 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);
        }
    }
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() ) {
                int efc = item.getEndFillColor();
                int esc = item.getEndStrokeColor();
                int etc = item.getEndTextColor();
                item.setStartFillColor(ColorLib.setAlpha(efc,0));
                item.setStartStrokeColor(ColorLib.setAlpha(esc,0));
                item.setStartTextColor(ColorLib.setAlpha(etc,0));
                item.setStartVisible(true);
            }
            process(item, 0.0);
        }
       
        // handle fade-out nodes
        items = m_vis.items(m_group, StartVisiblePredicate.TRUE);
        while ( items.hasNext() ) {
            VisualItem item = (VisualItem) items.next();
            if ( !item.isEndVisible() ) {
                int sfc = item.getStartFillColor();
                int ssc = item.getStartStrokeColor();
                int stc = item.getStartTextColor();
                item.setEndFillColor(ColorLib.setAlpha(sfc,0));
                item.setEndStrokeColor(ColorLib.setAlpha(ssc,0));
                item.setEndTextColor(ColorLib.setAlpha(stc,0));
                item.setVisible(true);
                process(item, 0.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();
            process(item, 1.0);
            item.setStartFillColor(item.getEndFillColor());
            item.setStartTextColor(item.getEndTextColor());
            item.setStartStrokeColor(item.getEndStrokeColor());
        }
    }
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.