当前位置: 首页>>代码示例>>Java>>正文


Java TupleSet.clear方法代码示例

本文整理汇总了Java中prefuse.data.tuple.TupleSet.clear方法的典型用法代码示例。如果您正苦于以下问题:Java TupleSet.clear方法的具体用法?Java TupleSet.clear怎么用?Java TupleSet.clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在prefuse.data.tuple.TupleSet的用法示例。


在下文中一共展示了TupleSet.clear方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mousePressed

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
public void mousePressed(MouseEvent e) {
	if (!SwingUtilities.isLeftMouseButton(e))
		return;
	Display d = (Display) e.getComponent();
	Visualization vis = d.getVisualization();
	TupleSet focus = vis.getFocusGroup(SELECTED);
	if (!e.isShiftDown()) {
		focus.clear();
	}
	float[] bandRect = (float[]) rubberBand.get(VisualItem.POLYGON);
	bandRect[0] = bandRect[1] = bandRect[2] = bandRect[3] =
	bandRect[4] = bandRect[5] = bandRect[6] = bandRect[7] = 0;
	d.setHighQuality(false);
	screenPoint.setLocation(e.getX(), e.getY());
	d.getAbsoluteCoordinate(screenPoint, absPoint);
	downX1 = (int) absPoint.getX();
	downY1 = (int) absPoint.getY();
	rubberBand.setVisible(true);
}
 
开发者ID:codydunne,项目名称:netgrok,代码行数:20,代码来源:GraphEditor.java

示例2: getTable

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
/**
 * Create a new table for representing line segments.
 */
protected VisualTable getTable() {
    TupleSet ts = m_vis.getGroup(m_group);
    if ( ts == null ) {
        Schema lineSchema = PrefuseLib.getVisualItemSchema();
        lineSchema.addColumn(VisualItem.X2, double.class);
        lineSchema.addColumn(VisualItem.Y2, double.class);
        lineSchema.addColumn("v1", VisualItem.class);
        lineSchema.addColumn("v2", VisualItem.class);
        
        VisualTable vt = m_vis.addTable(m_group, lineSchema);
        return vt;
    } else if ( ts instanceof VisualTable ) {
        // empty table
        ts.clear();
        return (VisualTable)ts;
    } else {
        throw new IllegalStateException(
            "Group already exists, not being used for line segments");
    }
}
 
开发者ID:ieg-vienna,项目名称:ieg-prefuse,代码行数:24,代码来源:LinePlotAction.java

示例3: setFocus

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
public void setFocus(Node n) {
	 TupleSet ts = m_vis.getFocusGroup(Visualization.FOCUS_ITEMS);
	 ts.clear();
	 VisualItem item = m_vis.getVisualItem(nodes, n);

	 if (item != null) {
    	 ts.setTuple(item);
     }
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:10,代码来源:GraphView.java

示例4: reset

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
/**
   * Reset this visualization, clearing out all visualization tuples. All
   * data sets added using the "addXXX" methods will be removed from the
   * visualization. All registered focus groups added using the 
   * addFocusGroup() methods will be retained, but will be cleared of all
   * tuples.
   */
  public synchronized void reset() {
  	// first clear out all the focus groups
for (Map.Entry<String, TupleSet> entry : m_focus.entrySet())
{
	TupleSet ts = entry.getValue();
	ts.clear();
}
      
      // finally clear out all map entries
      m_visual.clear();
      m_source.clear();
  }
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:20,代码来源:Visualization.java

示例5: removeGroup

import prefuse.data.tuple.TupleSet; //导入方法依赖的package包/类
/**
 * Removes a data group from this Visualization. If the group is a focus
 * group, the group will simply be removed, and any subsequent attempts to
 * retrieve the group will return null. If the group is a primary group, it
 * will be removed, and any members of the group will also be removed
 * from any registered focus groups.
 * @param group the data group to remove
 * @return true if the group was found and removed, false if the group
 * was not found in this visualization.
 */
public synchronized boolean removeGroup(String group) {
	// check for focus group first
    TupleSet ts = getFocusGroup(group);
    if ( ts != null ) {
        // invalidate the item to reflect group membership change
    	Iterator<Tuple> items = ts.tuples(ValidatedPredicate.TRUE);
    	while (items.hasNext())
    	{
    		( (VisualItem)  items.next()) .setValidated(false);
    	}
        
        ts.clear(); // trigger group removal callback
        m_focus.remove(group);
        return true;
    }
    
    // focus group not found, check for primary group
    ts = getVisualGroup(group);
    if ( ts == null ) {
        // exit with false if group not found
        return false;
    }
    // remove group members from focus sets and invalidate them
    TupleSet[] focus = new TupleSet[m_focus.size()];
    m_focus.values().toArray(focus);
    for ( Iterator<Tuple> items = ts.tuples(); items.hasNext(); ) {
        VisualItem item = (VisualItem) items.next();
        for ( int j=0; j<focus.length; ++j ) {
            focus[j].removeTuple(item);
        }
        item.setValidated(false);
    }
    // remove data
    if ( ts instanceof CompositeTupleSet ) {
        CompositeTupleSet cts = (CompositeTupleSet)ts;
        for ( Iterator<String> names = cts.setNames(); names.hasNext(); ) {
            String name = names.next();
            String subgroup = PrefuseLib.getGroupName(group,name); 
            m_visual.remove(subgroup);
            m_source.remove(subgroup);
        }
    }
    m_visual.remove(group);
    m_source.remove(group);
    return true;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:57,代码来源:Visualization.java


注:本文中的prefuse.data.tuple.TupleSet.clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。