本文整理汇总了Java中prefuse.data.event.TupleSetListener类的典型用法代码示例。如果您正苦于以下问题:Java TupleSetListener类的具体用法?Java TupleSetListener怎么用?Java TupleSetListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TupleSetListener类属于prefuse.data.event包,在下文中一共展示了TupleSetListener类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: fireTupleEvent
import prefuse.data.event.TupleSetListener; //导入依赖的package包/类
/**
* Fire a Tuple event.
* @param t the Table on which the event has occurred
* @param start the first row changed
* @param end the last row changed
* @param type the type of event, one of
* {@link prefuse.data.event.EventConstants#INSERT} or
* {@link prefuse.data.event.EventConstants#DELETE}.
*/
protected void fireTupleEvent(Table t, int start, int end, int type) {
if ( m_tupleListeners != null && m_tupleListeners.size() > 0 ) {
Object[] lstnrs = m_tupleListeners.getArray();
Tuple[] tuples = new Tuple[end-start+1];
for ( int i=0, r=start; r <= end; ++r, ++i ) {
tuples[i] = t.getTuple(r);
}
for ( int i=0; i<lstnrs.length; ++i ) {
TupleSetListener tsl = (TupleSetListener)lstnrs[i];
if ( type == EventConstants.INSERT ) {
tsl.tupleSetChanged(this, tuples, EMPTY_ARRAY);
} else {
tsl.tupleSetChanged(this, EMPTY_ARRAY, tuples);
}
}
}
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:27,代码来源:AbstractTupleSet.java
示例2: addTupleSetListener
import prefuse.data.event.TupleSetListener; //导入依赖的package包/类
/**
* @see prefuse.data.tuple.TupleSet#addTupleSetListener(prefuse.data.event.TupleSetListener)
*/
public void addTupleSetListener(TupleSetListener tsl) {
if ( m_tupleListeners == null )
m_tupleListeners = new CopyOnWriteArrayList<TupleSetListener>();
if ( !m_tupleListeners.contains(tsl) )
m_tupleListeners.add(tsl);
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:10,代码来源:AbstractTupleSet.java
示例3: initUI
import prefuse.data.event.TupleSetListener; //导入依赖的package包/类
protected void initUI() {
referencePropertyControl = new CIAttributeModel();
referencePropertyControl.setAdvanced(true);
pTree = new JTreeTable(referencePropertyControl);
//pTree.setDefaultEditor(CiBean.class, referencePropertyControl.getTableCellEditor());
ctrl = new TemplateRelationGraphControl(tModel);
gView = new GraphView(ctrl.getGraph(), "alias", "type");
gView.setEnableDistanceFilter(true);
gView.setDistance(defaultDistance);
gView.getVisualization().getGroup(Visualization.FOCUS_ITEMS).addTupleSetListener(
new TupleSetListener() {
public void tupleSetChanged(TupleSet t, Tuple[] add, Tuple[] rem) {
if (add.length == 1) {
// Fire selection change...
if (add[0] instanceof Node) {
Node n = (Node)add[0];
EventDispatcher.fireEvent(this, new Event(CEvents.RELATION_ITEM_SELECTED, n.getString("alias")));
}
}
}
}
);
JPanel center = new JPanel();
center.setLayout(new BorderLayout());
//center.add(getToolBar(), BorderLayout.NORTH);
center.add(gView, BorderLayout.CENTER);
tp = new JTabbedPane();
tp.setTabPlacement(JTabbedPane.TOP);
tp.add(new JScrollPane(pTree), "Attributes");
tp.add(new JScrollPane(getControlPanel()), "Graph Control");
//tp.add(new TemplateReferencePanel(), "Reference(s)");
final JSplitPane split = new JSplitPane();
split.setTopComponent(center);
split.setBottomComponent(tp);
split.setOrientation(JSplitPane.VERTICAL_SPLIT);
split.setOneTouchExpandable(true);
setLayout(new BorderLayout());
add(split, BorderLayout.CENTER);
this.addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent e) {
Dimension newDimension = e.getComponent().getSize();
split.setDividerLocation(0.8D);
}
});
}
开发者ID:luox12,项目名称:onecmdb,代码行数:54,代码来源:TemplateReferencePanel.java
示例4: initUI
import prefuse.data.event.TupleSetListener; //导入依赖的package包/类
protected void initUI() {
referencePropertyControl = new CIAttributeModel();
referencePropertyControl.setAdvanced(true);
pTree = new JTreeTable(referencePropertyControl);
//pTree.setDefaultEditor(CiBean.class, referencePropertyControl.getTableCellEditor());
ctrl = new TemplateRelationGraphControl(tModel);
gView = new GraphView(ctrl.getGraph(), "alias", "type");
gView.setEnableDistanceFilter(true);
gView.setDistance(defaultDistance);
gView.getVisualization().getGroup(Visualization.FOCUS_ITEMS).addTupleSetListener(
new TupleSetListener() {
public void tupleSetChanged(TupleSet t, Tuple[] add, Tuple[] rem) {
if (add.length == 1) {
// Fire selection change...
if (add[0] instanceof Node) {
Node n = (Node)add[0];
EventDispatcher.fireEvent(this, new Event(CEvents.RELATION_ITEM_SELECTED, n.getString("alias")));
}
}
}
}
);
JPanel center = new JPanel();
center.setLayout(new BorderLayout());
//center.add(getToolBar(), BorderLayout.NORTH);
center.add(gView, BorderLayout.CENTER);
tp = new JTabbedPane();
tp.setTabPlacement(JTabbedPane.TOP);
tp.add(new JScrollPane(pTree), "Attributes");
tp.add(getControlPanel(), "Graph Control");
//tp.add(new TemplateReferencePanel(), "Reference(s)");
final JSplitPane split = new JSplitPane();
split.setTopComponent(center);
split.setBottomComponent(tp);
split.setOrientation(JSplitPane.VERTICAL_SPLIT);
split.setOneTouchExpandable(true);
setLayout(new BorderLayout());
add(split, BorderLayout.CENTER);
this.addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent e) {
Dimension newDimension = e.getComponent().getSize();
split.setDividerLocation(0.8D);
}
});
}
开发者ID:luox12,项目名称:onecmdb,代码行数:54,代码来源:TemplateReferencePanel.java
示例5: removeTupleSetListener
import prefuse.data.event.TupleSetListener; //导入依赖的package包/类
/**
* @see prefuse.data.tuple.TupleSet#removeTupleSetListener(prefuse.data.event.TupleSetListener)
*/
public void removeTupleSetListener(TupleSetListener tsl) {
if ( m_tupleListeners != null ) {
m_tupleListeners.remove(tsl);
}
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:9,代码来源:AbstractTupleSet.java
示例6: addGraph
import prefuse.data.event.TupleSetListener; //导入依赖的package包/类
/**
* Adds a Graph, refreshes search items and removes aggregates.
*
* @param graph
*/
protected void addGraph(Graph graph){
if(graph == null) return;
// stop visualization
m_vis.cancel(Actions.DRAW.name()).setEnabled(false);
m_vis.cancel(Actions.AGGR.name()).setEnabled(false);
// wait till layout calculations finished.
while(m_aggregateLayout.runs);
// remove all rows
m_aTable.clear();
// remove old groups
m_vis.removeGroup(AGGR_DECORATORS);
m_vis.removeGroup(Visualization.SEARCH_ITEMS);
m_vis.removeGroup(GRAPH);
// add new graph
VisualGraph vg = m_vis.addGraph(GRAPH, graph);
// set focus group
VisualItem f = (VisualItem)vg.getNode(0);
m_vis.getGroup(Visualization.FOCUS_ITEMS).setTuple(f);
//f.setFixed(true);
m_vis.setValue(EDGES, null, VisualItem.INTERACTIVE, Boolean.FALSE);
// refresh search group
SearchTupleSet searchTup = new KeywordSearchTupleSet();
m_vis.addFocusGroup(Visualization.SEARCH_ITEMS, searchTup);
searchTup.addTupleSetListener(new TupleSetListener() {
@Override
public void tupleSetChanged(TupleSet t, Tuple[] add, Tuple[] rem) {
m_vis.run(Actions.DRAW.name() );
}
});
//
SearchQueryBinding sq = new SearchQueryBinding( vg.getNodeTable(), NODE_NAME,
(SearchTupleSet)m_vis.getGroup(Visualization.SEARCH_ITEMS));
// refresh search gui
search = sq.createSearchPanel();
search.setShowResultCount(true);
search.setBorder(BorderFactory.createEmptyBorder(5,5,4,0));
search.setFont(FontLib.getFont("Tahoma", Font.PLAIN, 11));
// refresh box
m_searchBox.removeAll();
m_searchBox.add(Box.createHorizontalStrut(10));
m_searchBox.add(m_searchLabel);
m_searchBox.add(Box.createHorizontalGlue());
m_searchBox.add(search);
m_searchBox.add(Box.createHorizontalStrut(3));
// run
m_vis.run(Actions.DRAW.name()).setEnabled(true);
m_vis.run(Actions.DRAW.name());
//
revalidate();
repaint();
}
开发者ID:renespeck,项目名称:Cugar,代码行数:59,代码来源:AggregatePanel.java
示例7: addTupleSetListener
import prefuse.data.event.TupleSetListener; //导入依赖的package包/类
/**
* Add a listener to this tuple set that will be notified when tuples
* are added and removed from the set.
* @param tsl the TupleSetListener to add
*/
public void addTupleSetListener(TupleSetListener tsl);
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:7,代码来源:TupleSet.java
示例8: removeTupleSetListener
import prefuse.data.event.TupleSetListener; //导入依赖的package包/类
/**
* Remove a listener from this tuple set.
* @param tsl the TupleSetListener to remove
*/
public void removeTupleSetListener(TupleSetListener tsl);
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:6,代码来源:TupleSet.java
注:本文中的prefuse.data.event.TupleSetListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论