本文整理了Java中prefuse.Visualization.items()
方法的一些代码示例,展示了Visualization.items()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Visualization.items()
方法的具体详情如下:
包路径:prefuse.Visualization
类名称:Visualization
方法名:items
[英]Get an iterator over all items, visible or not.
[中]在所有项目上获取迭代器,无论是否可见。
代码示例来源:origin: de.sciss/prefuse-core
/**
* Get an iterator over all items, visible or not.
* @return an iterator over all items, visible or not.
*/
public Iterator items() {
return items((Predicate)null);
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* Get an iterator over all visible items.
* @return an iterator over all visible items.
*/
public Iterator visibleItems() {
return items(VisiblePredicate.TRUE);
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* Get an iterator over all visible items in the specified group.
* @param group the visual data group name
* @return an iterator over all visible items in the specified group
*/
public Iterator visibleItems(String group) {
return items(group, VisiblePredicate.TRUE);
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* Get an iterator over all items in the specified group.
* @param group the visual data group name
* @return an iterator over all items in the specified group.
*/
public Iterator items(String group) {
return items(group, (Predicate)null);
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* Invalidate the bounds of all VisualItems in the given group. This
* will cause the bounds to be recomputed for all items upon the next
* redraw.
* @param group the visual data group to invalidate
*/
public void invalidate(String group) {
Iterator items = items(group, ValidatedPredicate.TRUE);
while ( items.hasNext() ) {
VisualItem item = (VisualItem)items.next();
item.setValidated(false);
}
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* Sets the interactivity 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 interactivity value to set
*/
public void setInteractive(String group, Predicate p, boolean value) {
Iterator items = items(group, p);
while ( items.hasNext() ) {
VisualItem item = (VisualItem)items.next();
item.setInteractive(value);
}
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* Sets the visibility 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 items = items(group, p);
while ( items.hasNext() ) {
VisualItem item = (VisualItem)items.next();
item.setVisible(value);
}
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* Set a data field value 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 field the data field / column name to set
* @param val the value to set
*/
public void setValue(String group, Predicate p, String field, Object val) {
Iterator items = items(group, p);
while ( items.hasNext() ) {
VisualItem item = (VisualItem)items.next();
item.set(field, val);
}
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* @see prefuse.action.Action#run(double)
*/
public void run(double frac) {
Iterator items = m_vis.items(m_group, m_filter);
while ( items.hasNext() ) {
VisualItem item = (VisualItem)items.next();
PrefuseLib.updateVisible(item, m_predicate.getBoolean(item));
}
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* @see prefuse.action.Action#run(double)
*/
public void run(double frac) {
Iterator items = getVisualization().items(m_group, m_predicate);
while ( items.hasNext() ) {
process((VisualItem)items.next(), frac);
}
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* Get an iterator over all items in the given group which match the given
* Predicate filter.
* @param group the visual data group to iterate over
* @param filter a Predicate indicating which items should be included in
* the iteration.
* @return a filtered iterator over VisualItems
*/
public Iterator items(String group, Predicate filter) {
if ( ALL_ITEMS.equals(group) )
return items(filter);
TupleSet t = getGroup(group);
return ( t==null ? Collections.EMPTY_LIST.iterator()
: t.tuples(filter) );
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* Issue a repaint request, causing all displays associated with this
* visualization to be repainted.
*/
public synchronized void repaint() {
Iterator items = items(ValidatedPredicate.FALSE);
while ( items.hasNext() ) {
((VisualItem)items.next()).validateBounds();
}
for ( int i=0; i<m_displays.size(); ++i ) {
getDisplay(i).repaint();
}
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* Get an iterator over all items in the given group which match the given
* filter expression.
* @param group the visual data group to iterate over
* @param expr an expression string that should parse to a Predicate
* indicating which items should be included in the iteration. The input
* string will be parsed using the
* {@link prefuse.data.expression.parser.ExpressionParser} class. If a
* parse error occurs, an empty iterator is returned.
* @return a filtered iterator over VisualItems
*/
public Iterator items(String group, String expr) {
Expression e = ExpressionParser.parse(expr);
if ( !(e instanceof Predicate) || ExpressionParser.getError()!=null )
return Collections.EMPTY_LIST.iterator();
return items(group, (Predicate)e);
}
代码示例来源:origin: org.qi4j.tool/org.qi4j.tool.envisage
@Override
public void run( double frac )
{
Iterator iter = m_vis.items( m_group );
while( iter.hasNext() )
{
DecoratorItem item = (DecoratorItem) iter.next();
VisualItem node = item.getDecoratedItem();
Rectangle2D bounds = node.getBounds();
setX( item, node, bounds.getX() + StackedLayout.INSET );
setY( item, node, bounds.getY() + StackedLayout.INSET + 12 );
}
}
} // end of inner class LabelLayout
代码示例来源:origin: org.qi4j.tool/org.qi4j.tool.envisage
@Override
public void run( double frac )
{
super.run( frac );
// set uses_edges always visible
Iterator items = m_vis.items( GRAPH_EDGES );
while( items.hasNext() )
{
VisualItem item = (VisualItem) items.next();
if( item.getBoolean( USES_EDGES ) )
{
PrefuseLib.updateVisible( item, true );
}
}
}
}
代码示例来源:origin: neueda/jetbrains-plugin-graph-database-support
@Override
public void run(double frac) {
Iterator iter = m_vis.items(m_group);
while (iter.hasNext()) {
DecoratorItem decorator = (DecoratorItem) iter.next();
VisualItem decoratedItem = decorator.getDecoratedItem();
Rectangle2D bounds = decoratedItem.getBounds();
double x = bounds.getCenterX();
double y = bounds.getCenterY();
setX(decorator, null, x);
setY(decorator, null, y);
}
}
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* @see prefuse.action.Action#run(double)
*/
public void run(double frac) {
Iterator iter = m_vis.items(m_group);
while ( iter.hasNext() ) {
VisualItem item = (VisualItem)iter.next();
try {
if ( m_xfield != null )
setX(item, null, item.getDouble(m_xfield));
if ( m_yfield != null )
setY(item, null, item.getDouble(m_yfield));
if ( m_fixedfield != null )
item.setFixed(item.getBoolean(m_fixedfield));
} catch ( Exception e ) {
}
}
}
代码示例来源:origin: de.sciss/prefuse-core
private void finish() {
// set faded-out nodes to permanently invisible
Iterator items = m_vis.items(m_group, StartVisiblePredicate.TRUE);
while ( items.hasNext() ) {
VisualItem item = (VisualItem) items.next();
if ( !item.isEndVisible() ) {
item.setVisible(false);
item.setStartVisible(false);
}
}
// set faded-in nodes to permanently visible
items = m_vis.visibleItems(m_group);
while ( items.hasNext() ) {
VisualItem item = (VisualItem) items.next();
process(item, 1.0);
item.setStartFillColor(item.getEndFillColor());
item.setStartTextColor(item.getEndTextColor());
item.setStartStrokeColor(item.getEndStrokeColor());
}
}
代码示例来源:origin: de.sciss/prefuse-core
/**
* Compute an ordinal axis layout.
*/
protected void ordinalLayout(TupleSet ts) {
if ( !m_modelSet) {
Object[] array = DataLib.ordinalArray(ts, m_field);
if ( m_model == null ) {
m_model = new ObjectRangeModel(array);
} else {
((ObjectRangeModel)m_model).setValueRange(array);
}
}
ObjectRangeModel model = (ObjectRangeModel)m_model;
int start = model.getValue();
int end = start + model.getExtent();
double total = (double)(end-start);
Iterator iter = m_vis.items(m_group, m_filter);
while ( iter.hasNext() ) {
VisualItem item = (VisualItem)iter.next();
int order = model.getIndex(item.get(m_field)) - start;
set(item, (total > 0.0) ? order/total : 0.5);
}
}
代码示例来源:origin: de.sciss/prefuse-core
private void finish() {
// set faded-out nodes to permanently invisible
Iterator items = m_vis.items(m_group, StartVisiblePredicate.TRUE);
while ( items.hasNext() ) {
VisualItem item = (VisualItem) items.next();
if ( !item.isEndVisible() ) {
item.setVisible(false);
item.setStartVisible(false);
}
}
// set faded-in nodes to permanently visible
items = m_vis.visibleItems(m_group);
while ( items.hasNext() ) {
VisualItem item = (VisualItem) items.next();
if ( !item.isStartVisible() ) {
item.setStartVisible(true);
item.setStartFillColor(item.getEndFillColor());
item.setStartTextColor(item.getEndTextColor());
item.setStartStrokeColor(item.getEndStrokeColor());
}
}
}
内容来源于网络,如有侵权,请联系作者删除!