当前位置: 首页>>代码示例>>Java>>正文


Java TupleSet.getTupleCount方法代码示例

本文整理汇总了Java中prefuse.data.tuple.TupleSet.getTupleCount方法的典型用法代码示例。如果您正苦于以下问题:Java TupleSet.getTupleCount方法的具体用法?Java TupleSet.getTupleCount怎么用?Java TupleSet.getTupleCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在prefuse.data.tuple.TupleSet的用法示例。


在下文中一共展示了TupleSet.getTupleCount方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getComparator

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
/**
 * Generates a Comparator to be used for sorting tuples drawn from
 * the given tuple set.
 * @param ts the TupleSet whose Tuples are to be sorted
 * @return a Comparator instance for sorting tuples from the given
 * set using the sorting criteria given in this specification
 */
public Comparator<Tuple> getComparator(TupleSet ts) {
    // get the schema, so we can lookup column value types        
    Schema s = null;
    if ( ts instanceof Table ) {
        // for Tables, we can get this directly
    	s = ((Table)ts).getSchema();
    } else {
    	// if non-table tuple set is empty, we punt
    	if ( ts.getTupleCount() == 0 )
    		return new NullComparator<Tuple>();
    	// otherwise, use the schema of the first tuple in the set
        s = ((Tuple)ts.tuples().next()).getSchema();
    }
    // create the comparator
    CompositeComparator<Tuple> cc = new CompositeComparator<Tuple>(m_fields.length);
    for ( int i=0; i<m_fields.length; ++i ) {
        cc.add(new TupleComparator(m_fields[i], s.getColumnType(m_fields[i]), m_ascend[i]));
    }
    return cc;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:28,代码来源:Sort.java

示例2: run

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
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;
	g.getSpanningTree(f);
}
 
开发者ID:jdepend,项目名称:cooper,代码行数:17,代码来源:GraphJDepend.java

示例3: run

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
public void run(double frac) {
    TupleSet ts = m_vis.getFocusGroup(Visualization.FOCUS_ITEMS);
    if ( ts.getTupleCount() == 0 )
        return;
    
    if ( this.start ) {
    	this.start = false;
        int xbias=0, ybias=0;
        switch ( m_orientation ) {
        case Constants.ORIENT_LEFT_RIGHT:
            xbias = m_bias;
            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 {
        m_cur.setLocation(m_start.getX() + frac*(m_end.getX()-m_start.getX()),
                          m_start.getY() + frac*(m_end.getY()-m_start.getY()));
        panToAbs(m_cur);
    }
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:34,代码来源:CommonTreeView.java

示例4: run

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
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;
    g.getSpanningTree(f);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:15,代码来源:RadialGraphView.java

示例5: getInt

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
/**
 * @see prefuse.data.expression.Expression#getInt(prefuse.data.Tuple)
 */
public int getInt(Tuple t) {
    String group = getGroup(t);
    if ( group == null ) { return -1; }
    TupleSet ts = ((VisualItem)t).getVisualization().getGroup(group);
    return ( ts==null ? 0 : ts.getTupleCount() );
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:10,代码来源:GroupSizeFunction.java

示例6: analyzeGraphGrid

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
/**
 * Analyzes a set of nodes to try and determine grid dimensions. Currently
 * looks for the edge count on a node to drop to 2 to determine the end of
 * a row.
 * @param ts TupleSet ts a set of nodes to analyze. Contained tuples
 * <b>must</b> implement be Node instances.
 * @return a two-element int array with the row and column lengths
 */
public static int[] analyzeGraphGrid(TupleSet ts) {
    // TODO: more robust grid analysis?
    int m, n;
    Iterator iter = ts.tuples(); iter.next();
    for ( n=2; iter.hasNext(); n++ ) {
        Node nd = (Node)iter.next();
        if ( nd.getDegree() == 2 )
            break;
    }
    m = ts.getTupleCount() / n;
    return new int[] {m,n};
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:21,代码来源:GridLayout.java

示例7: run

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
/**
 * @see prefuse.action.Action#run(double)
 */
public void run(double frac) {
    TupleSet ts = m_vis.getGroup(m_group); 
    
    int nn = ts.getTupleCount();
    
    Rectangle2D r = getLayoutBounds();  
    double height = r.getHeight();
    double width = r.getWidth();
    double cx = r.getCenterX();
    double cy = r.getCenterY();

    double radius = m_radius;
    if (radius <= 0) {
        radius = 0.45 * (height < width ? height : width);
    }

    Iterator items = ts.tuples();
    for (int i=0; items.hasNext(); i++) {
        VisualItem n = (VisualItem)items.next();
        double angle = (2*Math.PI*i) / nn;
        double x = Math.cos(angle)*radius + cx;
        double y = Math.sin(angle)*radius + cy;
        setX(n, null, x);
        setY(n, null, y);
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:30,代码来源:CircleLayout.java

示例8: run

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
public void run(double frac) {
    TupleSet ts = m_vis.getFocusGroup(Visualization.FOCUS_ITEMS);
    if ( ts.getTupleCount() == 0 )
        return;

    if ( frac == 0.0 ) {
        int xbias=0, ybias=0;
        switch ( m_orientation ) {
            case Constants.ORIENT_LEFT_RIGHT:
                xbias = m_bias;
                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 {
        m_cur.setLocation(m_start.getX() + frac*(m_end.getX()-m_start.getX()),
                m_start.getY() + frac*(m_end.getY()-m_start.getY()));
        panToAbs(m_cur);
    }
}
 
开发者ID:laas,项目名称:fape,代码行数:33,代码来源:TreeView.java

示例9: run

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
public void run(double frac) {
    TupleSet ts = m_vis.getFocusGroup(Visualization.FOCUS_ITEMS);
    if ( ts.getTupleCount() == 0 )
        return;
    
    if ( frac == 0.0 ) {
        int xbias=0, ybias=0;
        switch ( m_orientation ) {
        case Constants.ORIENT_LEFT_RIGHT:
            xbias = m_bias;
            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 {
        m_cur.setLocation(m_start.getX() + frac*(m_end.getX()-m_start.getX()),
                          m_start.getY() + frac*(m_end.getY()-m_start.getY()));
        panToAbs(m_cur);
    }
}
 
开发者ID:tsungtingkuo,项目名称:refinement,代码行数:33,代码来源:ACMTreeView.java

示例10: run

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
public void run(double frac) {
	TupleSet ts = m_vis.getFocusGroup(Visualization.FOCUS_ITEMS);
	if (ts.getTupleCount() == 0)
		return;

	if (frac == 0.0) {
		int xbias = 0, ybias = 0;
		switch (m_orientation) {
		case Constants.ORIENT_LEFT_RIGHT:
			xbias = m_bias;
			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 {
		m_cur.setLocation(m_start.getX() + frac * (m_end.getX() - m_start.getX()), m_start.getY() + frac
				* (m_end.getY() - m_start.getY()));
		panToAbs(m_cur);
	}
}
 
开发者ID:jdepend,项目名称:cooper,代码行数:33,代码来源:TreeGraphUtil.java

示例11: run

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
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;
    g.getSpanningTree(f);
}
 
开发者ID:CoEIA,项目名称:DEM,代码行数:15,代码来源:RadialGraphView.java

示例12: run

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
@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
    {
        m_cur.setLocation( m_start.getX() + frac * ( m_end.getX() - m_start.getX() ),
                           m_start.getY() + frac * ( m_end.getY() - m_start.getY() ) );
        panToAbs( m_cur );
    }
}
 
开发者ID:apache,项目名称:polygene-java,代码行数:43,代码来源:TreeGraphDisplay.java

示例13: size

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
/**
 * Get the size of the given visual data group.
 * @param group the visual data group
 * @return the size (number of tuples) of the group
 */
public int size(String group) {
    TupleSet tset = getGroup(group);
    return ( tset==null ? 0 : tset.getTupleCount() );
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:10,代码来源:Visualization.java


注:本文中的prefuse.data.tuple.TupleSet.getTupleCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。