當前位置: 首頁>>代碼示例>>Java>>正文


Java TreeSelectionEvent.getNewLeadSelectionPath方法代碼示例

本文整理匯總了Java中javax.swing.event.TreeSelectionEvent.getNewLeadSelectionPath方法的典型用法代碼示例。如果您正苦於以下問題:Java TreeSelectionEvent.getNewLeadSelectionPath方法的具體用法?Java TreeSelectionEvent.getNewLeadSelectionPath怎麽用?Java TreeSelectionEvent.getNewLeadSelectionPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.event.TreeSelectionEvent的用法示例。


在下文中一共展示了TreeSelectionEvent.getNewLeadSelectionPath方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: valueChanged

import javax.swing.event.TreeSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged(TreeSelectionEvent e) {
	TreePath newLeadSelectionPath = e.getNewLeadSelectionPath();
	if (newLeadSelectionPath == null) {
		return;
	}
	Object lastPathComponent = newLeadSelectionPath.getLastPathComponent();
	if (lastPathComponent instanceof ValueSourceTreeNode) {

		ValueSourceTreeNode valueSourceNode = (ValueSourceTreeNode) lastPathComponent;
		// get the selected PVC
		ValueSource selectedValueSource = valueSourceNode.getUserObject();

		if (selectedValueSource == currentValueSource) {
			return;
		}

		// change current PlotValueConfig
		currentValueSource = selectedValueSource;

	} else {
		currentValueSource = null;
	}

}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:26,代碼來源:DataTableColumnDropTextFieldTransferHandler.java

示例2: valueChanged

import javax.swing.event.TreeSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged(TreeSelectionEvent e) {
	TreePath newLeadSelectionPath = e.getNewLeadSelectionPath();
	if (newLeadSelectionPath == null) {
		selectedRangeAxisConfig = null;
		return;
	}
	Object lastPathComponent = newLeadSelectionPath.getLastPathComponent();
	if (lastPathComponent instanceof RangeAxisConfigTreeNode) {

		RangeAxisConfig selectedConfig = ((RangeAxisConfigTreeNode) lastPathComponent).getUserObject();

		selectedRangeAxisConfig = selectedConfig;

		adaptGUI();

	} else {
		selectedRangeAxisConfig = null;
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:21,代碼來源:RangeAxisConfigPanel.java

示例3: valueChanged

import javax.swing.event.TreeSelectionEvent; //導入方法依賴的package包/類
/************ imple of TreeSelectionListener *******/

@Override
public void valueChanged(TreeSelectionEvent e) {
    showPopupCompletion = false;
    FileSystemView fsv = fileChooser.getFileSystemView();
    JTree tree = (JTree) e.getSource();
    TreePath path = tree.getSelectionPath();
    TreePath curSel = e.getNewLeadSelectionPath();
    curSelPath = (curSel != null) ? new WeakReference<TreePath>(curSel) : null;
    
    if(path != null) {
        
        DirectoryNode node = (DirectoryNode)path.getLastPathComponent();
        File file = node.getFile();
        
        if(file != null) {
            setSelected(getSelectedNodes(tree.getSelectionPaths()));
            newFolderAction.setEnabled(false);
            
            if(!node.isLeaf()) {
                newFolderAction.enable(file);
                setDirectorySelected(true);
            }
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:28,代碼來源:DirectoryChooserUI.java

示例4: valueChanged

import javax.swing.event.TreeSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged(TreeSelectionEvent e) {
	TreePath newLeadSelectionPath = e.getNewLeadSelectionPath();
	if (newLeadSelectionPath != null) {
		if (newLeadSelectionPath.getLastPathComponent() instanceof DimensionConfigTreeNode) {
			adaptGUI();
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:10,代碼來源:GroupingConfigurationPanel.java

示例5: valueChanged

import javax.swing.event.TreeSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged(TreeSelectionEvent e) {
	TreePath newLeadSelectionPath = e.getNewLeadSelectionPath();
	if (newLeadSelectionPath == null) {
		return;
	}
	Object lastPathComponent = newLeadSelectionPath.getLastPathComponent();
	if (lastPathComponent instanceof ValueSourceTreeNode) {

		valueSourceNode = (ValueSourceTreeNode) lastPathComponent;
		// get the selected PVC
		ValueSource selectedValueSource = valueSourceNode.getUserObject();

		if (selectedValueSource == currentValueSource) {
			return;
		}

		// change current PlotValueConfig
		currentValueSource = selectedValueSource;

		adaptGUI();
	} else {
		currentValueSource = null;
		valueSourceNode = null;
	}

}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:28,代碼來源:AbstractTreeSelectionDependentPanel.java

示例6: valueChanged

import javax.swing.event.TreeSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged(TreeSelectionEvent e) {
	TreePath path = e.getNewLeadSelectionPath();
	if (path != null) {
		if (path.getLastPathComponent() instanceof GroupTree) {
			setOperatorList((GroupTree) path.getLastPathComponent());
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:10,代碼來源:NewOperatorEditor.java

示例7: valueChanged

import javax.swing.event.TreeSelectionEvent; //導入方法依賴的package包/類
/**
 * Once you select a subsection from the menu window,
 * it does refer to the correct page
 */
@Override
public void valueChanged(TreeSelectionEvent e) {
	TreePath path = e.getNewLeadSelectionPath();
	OutlineNode selectedNode = (OutlineNode) path.getLastPathComponent();
	GoToAction act = (GoToAction) selectedNode.getAction();
	try {
		int pageNode = pdfFile
				.getPageNumber(act.getDestination().getPage());
		bar.setValue(pageNode - pageStart);
		loadPage(pageNode - pageStart);
		updateCanvas();
	} catch (IOException e1) {
	}
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:19,代碼來源:PDFViewerBuffer.java

示例8: valueChanged

import javax.swing.event.TreeSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged(TreeSelectionEvent arg0) {
    RelationType rel = null;
    if (arg0 != null && arg0.getNewLeadSelectionPath() != null) {
        Object lastElem = arg0.getNewLeadSelectionPath().getLastPathComponent();
        if (lastElem != null) {
            rel = (RelationType) lastElem;
        }
    }
    // buttonChoose.setEnabled(rel != null && RemoteUtils.relationTypeRemote.dbGetChildren(rel, LexiconManager.getInstance().getLexicons()).isEmpty());
    selectedRelation = rel;
}
 
開發者ID:CLARIN-PL,項目名稱:WordnetLoom,代碼行數:13,代碼來源:ReverseRelationWindow.java

示例9: valueChanged

import javax.swing.event.TreeSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged(TreeSelectionEvent e) {
	TreePath path = e.getNewLeadSelectionPath();
	if (listener != null) {
		listener.selectionChanged(new Event(path));
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:8,代碼來源:ProjectExplorer.java

示例10: valueChanged

import javax.swing.event.TreeSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged(final TreeSelectionEvent e)
{
	final TreePath newPath = e.getNewLeadSelectionPath();
	saveChanges(new Runnable()
	{
		@Override
		public void run()
		{
			GlassSwingWorker<?> worker = new GlassSwingWorker<AbstractTreeNodeEditor>()
			{
				@Override
				@SuppressWarnings("unchecked")
				public AbstractTreeNodeEditor construct()
				{
					if( newPath == null )
					{
						return noSelectionEditor;
					}
					else
					{
						return createEditor((NodeType) newPath.getLastPathComponent());
					}
				}

				@Override
				public void finished()
				{
					showTreeNodeEditor(get());
				}

				@Override
				public void exception()
				{
					getException().printStackTrace();
				}
			};
			worker.setComponent(AbstractTreeEditor.this);
			worker.start();
		}
	});
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:43,代碼來源:AbstractTreeEditor.java


注:本文中的javax.swing.event.TreeSelectionEvent.getNewLeadSelectionPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。