本文整理汇总了Java中javax.swing.tree.TreeModel.addTreeModelListener方法的典型用法代码示例。如果您正苦于以下问题:Java TreeModel.addTreeModelListener方法的具体用法?Java TreeModel.addTreeModelListener怎么用?Java TreeModel.addTreeModelListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.tree.TreeModel
的用法示例。
在下文中一共展示了TreeModel.addTreeModelListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DefaultOutlineModel
import javax.swing.tree.TreeModel; //导入方法依赖的package包/类
/** Creates a new instance of DefaultOutlineModel. <strong><b>Note</b>
* Do not fire table structure changes from the wrapped TableModel (value
* changes are okay). Changes that affect the number of rows must come
* from the TreeModel.
* @param treeModel The tree model
* @param tableModel The table model
* @param largeModel <code>true</code> if it's a large model tree, <code>false</code> otherwise.
* @param nodesColumnLabel Label of the node's column
*/
protected DefaultOutlineModel(TreeModel treeModel, TableModel tableModel, boolean largeModel, String nodesColumnLabel) {
this.treeModel = treeModel;
this.tableModel = tableModel;
if (nodesColumnLabel != null) {
this.nodesColumnLabel = nodesColumnLabel;
}
layout = largeModel ? (AbstractLayoutCache) new FixedHeightLayoutCache()
: (AbstractLayoutCache) new VariableHeightLayoutCache();
broadcaster = new EventBroadcaster (this);
layout.setRootVisible(true);
layout.setModel(this);
treePathSupport = new TreePathSupport(this, layout);
treePathSupport.addTreeExpansionListener(broadcaster);
treePathSupport.addTreeWillExpandListener(broadcaster);
treeModel.addTreeModelListener(broadcaster);
tableModel.addTableModelListener(broadcaster);
if (tableModel instanceof ProxyTableModel) {
((ProxyTableModel) tableModel).setOutlineModel(this);
}
}
示例2: createTreeView
import javax.swing.tree.TreeModel; //导入方法依赖的package包/类
private void createTreeView() {
synchronized (lock) {
releaseTreeView();
treeView = new DebugTreeView();
treeView.setRootVisible(false);
treeView.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
treeView.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
treeView.getAccessibleContext().setAccessibleName(NbBundle.getMessage(DebuggingViewComponent.class, "DebuggingViewComponent.treeView.AccessibleContext.accessibleName")); // NOI18N
treeView.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DebuggingViewComponent.class, "DebuggingViewComponent.treeView.AccessibleContext.accessibleDescription")); // NOI18N
treeView.getTree().addMouseWheelListener(this);
treeView.addTreeExpansionListener(this);
TreeModel model = treeView.getTree().getModel();
model.addTreeModelListener(this);
treeView.getViewport().addChangeListener(this);
treeView.getTree().setScrollsOnExpand(false);
mainPanel.add(treeView, BorderLayout.CENTER);
}
}
示例3: subscribeActual
import javax.swing.tree.TreeModel; //导入方法依赖的package包/类
@Override
protected void subscribeActual(Observer<? super TreeModelEvent> observer) {
TreeModel w = widget;
TreeModelEventConsumer aec = new TreeModelEventConsumer(observer, w);
observer.onSubscribe(aec);
w.addTreeModelListener(aec);
if (aec.get() == null) {
aec.onDispose(w);
}
}
示例4: watch
import javax.swing.tree.TreeModel; //导入方法依赖的package包/类
public void watch(TreeModel m)
{
m.addTreeModelListener(listener);
}