當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。