本文整理汇总了Java中prefuse.visual.VisualItem.isStartVisible方法的典型用法代码示例。如果您正苦于以下问题:Java VisualItem.isStartVisible方法的具体用法?Java VisualItem.isStartVisible怎么用?Java VisualItem.isStartVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prefuse.visual.VisualItem
的用法示例。
在下文中一共展示了VisualItem.isStartVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
* @see prefuse.action.Action#run(double)
*/
public void run(double frac) {
VisualItem lastItem = null;
Rectangle2D bounds = getLayoutBounds();
float floor = (float)
(m_horiz ? (m_top?bounds.getMaxX():bounds.getMinX())
: (m_top?bounds.getMinY():bounds.getMaxY()));
int bias = (m_horiz ? 0 : 1);
// TODO: generalize this -- we want tuplesReversed available for general sets
Iterator iter = ((Table)m_vis.getGroup(m_group)).tuplesReversed();
while ( iter.hasNext() ) {
VisualItem item = (VisualItem)iter.next();
boolean prev = item.isStartVisible();
boolean cur = item.isVisible();
if ( !prev && cur ) {
// newly visible, update contour
float[] f = (float[])item.get(m_polyField);
if ( f == null ) continue;
if ( lastItem == null ) {
// no previous items, smash values to the floor
for ( int i=0; i<f.length; i+=2 )
f[i+bias] = floor;
} else {
// previous visible item, smash values to the
// visible item's contour
float[] l = (float[])lastItem.get(m_polyField);
for ( int i=0; i<f.length/2; i+=2 )
f[i+bias] = f[f.length-2-i+bias]
= l[i+bias];
}
} else if ( prev && cur ) {
// this item was previously visible, remember it
lastItem = item;
}
}
}
示例2: garbageCollect
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
* Remove axis labels no longer being used.
*/
protected void garbageCollect(VisualTable labels) {
Iterator iter = labels.tuples();
while ( iter.hasNext() ) {
VisualItem item = (VisualItem)iter.next();
if ( !item.isStartVisible() && !item.isEndVisible() ) {
labels.removeTuple(item);
}
}
}