本文整理汇总了Java中prefuse.visual.VisualItem.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java VisualItem.setVisible方法的具体用法?Java VisualItem.setVisible怎么用?Java VisualItem.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prefuse.visual.VisualItem
的用法示例。
在下文中一共展示了VisualItem.setVisible方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
@Override
public void run(double frac) {
// TODO Auto-generated method stub
Rectangle2D b = getLayoutBounds();
double bx = b.getMinX(), by = b.getMinY();
double w = b.getWidth(), h = b.getHeight();
TupleSet ts = m_vis.getGroup(m_group);
Iterator<?> iter = ts.tuples();
// layout grid contents
while ( iter.hasNext() ) {
VisualItem item = (VisualItem)iter.next();
item.setVisible(true);
int i = getIndex(item);
double radius = Math.sqrt((double)i) * 25.0;
double angle = Math.sqrt((double)i) * Math.PI;
double x = bx + w/2 + (radius * Math.sin(angle));
double y = by + h/2 + (radius * Math.cos(angle));
setX(item,null,x);
setY(item,null,y);
}
}
示例2: run
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
@Override
public void run(double frac) {
// TODO Auto-generated method stub
initialize();
TupleSet ts = m_vis.getGroup(m_group);
Iterator<?> iter;
if (m_filter != null)
iter = ts.tuples();
else
iter = ts.tuples(m_filter);
// layout grid contents
while ( iter.hasNext() ) {
VisualItem item = (VisualItem)iter.next();
// layout items only once
if(layedOutObjects.add(item) == false)
continue;
item.setVisible(true);
// TODO: find the ip address somewhere in the linked tuples
InetAddress ip_address = (InetAddress)item.get(Data.ADDRESS);
//System.out.println(ip_address);
//int ip_hash = ip_address.hashCode();
//double distance = (double) ip_hash / (double)Integer.MAX_VALUE * total_length;
double distance = hashIP(ip_address.getHostAddress());
double y = getY(distance);
double x = getX(distance,y);
//System.out.println("Distance, X, Y: "+distance+", "+x+", "+y);
setX(item,null,x);
setY(item,null,y);
}
}
示例3: setVisible
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
* Sets the visbility status for all items in a given data group matching
* a given filter predicate.
* @param group the visual data group name
* @param p the filter predicate determining which items to modify
* @param value the visibility value to set
*/
public void setVisible(String group, Predicate p, boolean value) {
Iterator<VisualItem> items = items(group, p);
while ( items.hasNext() ) {
VisualItem item = items.next();
item.setVisible(value);
}
}
示例4: reset
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
* Reset an axis label VisualItem
*/
protected void reset(VisualItem item) {
item.setVisible(false);
item.setEndVisible(false);
item.setStartStrokeColor(item.getStrokeColor());
item.revertToDefault(VisualItem.STROKECOLOR);
item.revertToDefault(VisualItem.ENDSTROKECOLOR);
item.setStartTextColor(item.getTextColor());
item.revertToDefault(VisualItem.TEXTCOLOR);
item.revertToDefault(VisualItem.ENDTEXTCOLOR);
item.setStartFillColor(item.getFillColor());
item.revertToDefault(VisualItem.FILLCOLOR);
item.revertToDefault(VisualItem.ENDFILLCOLOR);
}
示例5: 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);
}
}
示例6: updateVisible
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
* Update the visibility of an item. The current visibility will become the
* new starting visibility, while the given visibility value will become
* the new current and ending visibility.
* @param item the VisualItem to update
* @param val the visibility value to set
*/
public static void updateVisible(VisualItem item, boolean val) {
item.setStartVisible(item.isVisible());
item.setVisible(val);
item.setEndVisible(val);
}