本文整理汇总了Java中prefuse.visual.VisualItem.isVisible方法的典型用法代码示例。如果您正苦于以下问题:Java VisualItem.isVisible方法的具体用法?Java VisualItem.isVisible怎么用?Java VisualItem.isVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prefuse.visual.VisualItem
的用法示例。
在下文中一共展示了VisualItem.isVisible方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
public void run(double frac) {
Iterator iter = m_vis.items(m_group);
int count = 0;
while ( iter.hasNext() ) {
DecoratorItem item = (DecoratorItem)iter.next();
VisualItem node = item.getDecoratedItem();
if (node.isVisible()) {
item.setVisible(true);
count++;
Rectangle2D bounds = node.getBounds();
setX(item, null, bounds.getCenterX());
setY(item, null, bounds.getCenterY());
} else {
item.setVisible(false);
}
}
}
示例2: 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;
}
}
}
示例3: run
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
* @see prefuse.action.Action#run(double)
*/
public void run(double frac) {
bounds = getLayoutBounds();
Arrays.fill(baseline, 0);
// get the orientation specifics sorted out
float min = (float)(m_horiz?bounds.getMaxY() :bounds.getMinX());
float hgt = (float)(m_horiz?bounds.getWidth():bounds.getHeight());
int xbias = (m_horiz ? 1 : 0);
int ybias = (m_horiz ? 0 : 1);
int mult = m_top ? 1 : -1;
float inc = (float) (m_horiz ? (bounds.getMinY()-bounds.getMaxY())
: (bounds.getMaxX()-bounds.getMinX()));
inc /= columns.length-1;
int len = columns.length;
// perform first walk to compute max values
double maxValue = getPeaks();
float b = (float)(m_horiz ? (m_top?bounds.getMinX():bounds.getMaxX())
: (m_top?bounds.getMinY():bounds.getMaxY()));
Arrays.fill(baseline, b);
m_model.setValueRange(0, maxValue, 0, maxValue);
// perform second walk to compute polygon layout
Table t = (Table)m_vis.getGroup(m_group);
Iterator iter = t.tuplesReversed();
while ( iter.hasNext() ) {
VisualItem item = (VisualItem)iter.next();
if ( !item.isVisible() ) continue;
float height = 0;
for ( int i=len; --i >= 0; ) {
poly[2*(len-1-i)+xbias] = min + i*inc;
poly[2*(len-1-i)+ybias] = (float)baseline[i];
}
for ( int i=0; i<columns.length; ++i ) {
int base = 2*(len+i);
double value = item.getDouble(columns[i]);
baseline[i] += mult * hgt *
MathLib.linearInterp(value,0,peaks[i]);
poly[base+xbias] = min + i*inc;
poly[base+ybias] = (float)baseline[i];
height = Math.max(height,
Math.abs(poly[2*(len-1-i)+ybias]-poly[base+ybias]));
}
if ( height < m_threshold ) {
item.setVisible(false);
}
setX(item, null, 0);
setY(item, null, 0);
setPolygon(item, poly);
}
}