当前位置: 首页>>代码示例>>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;未经允许,请勿转载。