本文整理汇总了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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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() );
}
示例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};
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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 );
}
}
示例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() );
}