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


Java TreeModel.addTreeModelListener方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:DefaultOutlineModel.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:DebuggingViewComponent.java

示例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);
    }
}
 
开发者ID:akarnokd,项目名称:RxJava2Swing,代码行数:13,代码来源:TreeModelEventObservable.java

示例4: watch

import javax.swing.tree.TreeModel; //导入方法依赖的package包/类
public void watch(TreeModel m)
{
	m.addTreeModelListener(listener);
}
 
开发者ID:equella,项目名称:Equella,代码行数:5,代码来源:ChangeDetector.java


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