Java 类javax.swing.event.TreeSelectionEvent 实例源码
项目:incubator-netbeans
文件:TreeView.java
@Override
public void valueChanged(TreeSelectionEvent ev) {
TreePath[] paths = tree.getSelectionPaths();
if (paths == null) {
// part of bugfix #37279, if DnD is active then is useless select a nearby node
if (ExplorerDnDManager.getDefault().isDnDActive()) {
return;
}
callSelectionChanged(new Node[0]);
} else {
// we need to force no changes to nodes hierarchy =>
// we are requesting read request, but it is not necessary
// to execute the next action immediatelly, so postReadRequest
// should be enough
readAccessPaths = paths;
Children.MUTEX.postReadRequest(this);
}
}
项目:incubator-netbeans
文件:HintsPanel.java
public HintsPanel(HintMetadata preselected, @NullAllowed final CustomizerContext<?, ?> cc, ClassPathBasedHintWrapper cpBased) {
this.cpBased = cpBased;
this.queryStatus = cc == null ? QueryStatus.NEVER : QueryStatus.SHOW_QUERIES;
this.showHeavyInspections = true;
init(null, true, false, false, false, cc == null, false, cc != null);
select(preselected);
configurationsPanel.setVisible(false);
if (cc != null) {
errorTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
@Override public void valueChanged(TreeSelectionEvent e) {
HintMetadata hm = getSelectedHint();
if (hm != null) {
cc.setSelectedId(AnalyzerImpl.ID_JAVA_HINTS_PREFIX + hm.id);
}
}
});
}
}
项目:incubator-netbeans
文件:PathsCustomizer.java
@Override
public void valueChanged(TreeSelectionEvent e) {
if (e.isAddedPath()) {
otherTreeSelectionModel.clearSelection();
}
int idx = treeModel.getIndexOfChild(treeModel.getRoot(), e.getPath().getLastPathComponent());
if (idx >= 0) {
if (otherListModel != null) {
idx += otherListModel.getSize() + 1;
}
if (e.isAddedPath()) {
list.setSelectionInterval(idx, idx);
} else {
list.removeSelectionInterval(idx, idx);
}
} else {
list.clearSelection();
}
}
项目:incubator-netbeans
文件:PathsCustomizer.java
@Override
public void valueChanged(TreeSelectionEvent e) {
if (e.isAddedPath()) {
otherTreeSelectionModel.clearSelection();
}
int idx = treeModel.getIndexOfChild(treeModel.getRoot(), e.getPath().getLastPathComponent());
if (idx >= 0) {
if (otherListModel != null) {
idx += otherListModel.getSize() + 1;
}
if (e.isAddedPath()) {
list.setSelectionInterval(idx, idx);
} else {
list.removeSelectionInterval(idx, idx);
}
} else {
list.clearSelection();
}
}
项目:rapidminer
文件:DataTableColumnDropTextFieldTransferHandler.java
@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;
}
}
项目:rapidminer
文件:RangeAxisConfigPanel.java
@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;
}
}
项目:rapidminer
文件:ClusterTreeVisualization.java
@Override
public void valueChanged(TreeSelectionEvent e) {
TreePath[] paths = getSelectionPaths();
// If only one item has been selected, then change the text in the
// description area
if (paths == null) {
return;
}
if (paths.length == 1) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) paths[0].getLastPathComponent();
if (!node.getAllowsChildren()) {
ClusterTreeLeaf leaf = (ClusterTreeLeaf) node.getUserObject();
ObjectVisualizer viz = ObjectVisualizerService.getVisualizerForObject(clusterModel);
viz.startVisualization(leaf.getId());
}
}
}
项目:jmt
文件:TemplateAddingPanel.java
public AvailableTreeTable() {
super();
setTreeTableModel(new AvailableTreeTableModel(data.getRoot()));
sizeColumns();
setRowHeight(CELL_HEIGHT);
setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
getTableHeader().setReorderingAllowed(false);
addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
TreePath path = e.getPath();
TreeTableNode node = (TreeTableNode) path.getLastPathComponent();
if ("template".equals(node.getType())) {
tempDownload.setEnabled(true);
} else {
tempDownload.setEnabled(false);
}
}
});
}
项目:marathonv5
文件:TreeDemo.java
/** Required by TreeSelectionListener interface. */
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
if (node == null)
return;
Object nodeInfo = node.getUserObject();
if (node.isLeaf()) {
BookInfo book = (BookInfo) nodeInfo;
displayURL(book.bookURL);
if (DEBUG) {
System.out.print(book.bookURL + ": \n ");
}
} else {
displayURL(helpURL);
}
if (DEBUG) {
System.out.println(nodeInfo.toString());
}
}
项目:marathonv5
文件:TreeIconDemo.java
/** Required by TreeSelectionListener interface. */
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
if (node == null)
return;
Object nodeInfo = node.getUserObject();
if (node.isLeaf()) {
BookInfo book = (BookInfo) nodeInfo;
displayURL(book.bookURL);
if (DEBUG) {
System.out.print(book.bookURL + ": \n ");
}
} else {
displayURL(helpURL);
}
if (DEBUG) {
System.out.println(nodeInfo.toString());
}
}
项目:marathonv5
文件:TreeIconDemo2.java
/** Required by TreeSelectionListener interface. */
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
if (node == null)
return;
Object nodeInfo = node.getUserObject();
if (node.isLeaf()) {
BookInfo book = (BookInfo) nodeInfo;
displayURL(book.bookURL);
if (DEBUG) {
System.out.print(book.bookURL + ": \n ");
}
} else {
displayURL(helpURL);
}
if (DEBUG) {
System.out.println(nodeInfo.toString());
}
}
项目:VASSAL-src
文件:ChooseComponentPathDialog.java
public void valueChanged(TreeSelectionEvent e) {
super.valueChanged(e);
final TreePath p = e.getPath();
if (p != null) {
final DefaultMutableTreeNode node =
(DefaultMutableTreeNode) p.getLastPathComponent();
Object x[] = node.getUserObjectPath();
Configurable[] userObjectPath = new Configurable[x.length];
for (int i = 0; i < x.length; i++) {
userObjectPath[i] = (Configurable) x[i];
}
path = ArrayUtils.copyOfRange(userObjectPath, 1, userObjectPath.length);
}
else {
path = null;
}
}
项目:OpenDA
文件:TreeDemo.java
/** Required by TreeSelectionListener interface. */
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode)
tree.getLastSelectedPathComponent();
if (node == null) return;
Object nodeInfo = node.getUserObject();
if (node.isLeaf()) {
BookInfo book = (BookInfo)nodeInfo;
displayURL(book.bookURL);
if (DEBUG) {
System.out.print(book.bookURL + ": \n ");
}
} else {
displayURL(helpURL);
}
if (DEBUG) {
System.out.println(nodeInfo.toString());
}
}
项目:org.alloytools.alloy
文件:OurTree.java
/** Construct a Tree object with the given font size. */
public OurTree(int fontSize) {
Font font = OurUtil.getVizFont().deriveFont((float) fontSize);
OurTreeRenderer renderer = new OurTreeRenderer(fontSize);
renderer.setFont(font);
renderer.invalidate();
renderer.validate();
setRowHeight(0); // To allow variable row height on Mac OS X
setCellRenderer(renderer);
setFont(font);
setBorder(new EmptyBorder(8, 8, 2, 2));
getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
putClientProperty("JTree.lineStyle", "Angled");
setRootVisible(true);
setForeground(Color.BLACK);
setBackground(Color.WHITE);
setOpaque(true);
addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
TreePath path = OurTree.this.getSelectionPath();
if (path != null)
OurTree.this.listeners.fire(OurTree.this, Listener.Event.CLICK, path.getLastPathComponent());
}
});
}
项目:JavaGraph
文件:LabelTree.java
/**
* Emphasises/deemphasises cells in the associated jmodel, based on the list
* selection.
*/
@Override
public void valueChanged(TreeSelectionEvent e) {
Set<JCell<?>> emphSet = new HashSet<>();
TreePath[] selectionPaths = getSelectionPaths();
if (selectionPaths != null) {
for (TreePath selectedPath : selectionPaths) {
Object treeNode = selectedPath.getLastPathComponent();
if (treeNode instanceof LabelTree.EntryNode) {
Entry entry = ((EntryNode) treeNode).getEntry();
Set<JCell<G>> occurrences = getFilter().getJCells(entry);
if (occurrences != null) {
emphSet.addAll(occurrences);
}
}
}
}
this.jGraph.setSelectionCells(emphSet.toArray());
}
项目:ramus
文件:AbstractTableView.java
protected void createInnerComponent() {
panel.removeAll();
Attribute[] attributes = getAttributes();
RootCreater rootCreater = getRootCreater();
component = new RowTreeTableComponent(engine, qualifier, accessRules,
rootCreater, attributes, framework);
rowSet = component.getRowSet();
table = component.getTable();
table.getTreeSelectionModel().addTreeSelectionListener(
new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
refreshActions();
}
});
refreshActions();
panel.add(component, BorderLayout.CENTER);
panel.revalidate();
panel.repaint();
}
项目:freecol
文件:OptionGroupUI.java
/**
* This function analyses a tree selection event and calls the
* right methods to take care of building the requested unit's
* details.
*
* @param event The incoming TreeSelectionEvent.
*/
@Override
public void valueChanged(TreeSelectionEvent event) {
detailPanel.removeAll();
DefaultMutableTreeNode node
= (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
if (node != null) {
if (node.isLeaf()) {
OptionGroup group = (OptionGroup) node.getUserObject();
for (Option option : group.getOptions()) {
addOptionUI(option, editable && group.isEditable());
}
} else {
tree.expandPath(event.getPath());
}
}
detailPanel.revalidate();
detailPanel.repaint();
}
项目:WordnetLoom
文件:ViwnLexicalUnitRelationsViewUI.java
@Override
public void valueChanged(TreeSelectionEvent evt) {
// Get all nodes whose selection status has changed
TreePath[] paths = evt.getPaths();
if (paths.length > 0
&& evt.isAddedPath(0)
&& paths[0].getLastPathComponent() instanceof DefaultMutableTreeNode) {
if (((DefaultMutableTreeNode) paths[0].getLastPathComponent())
.isLeaf()
&& !((DefaultMutableTreeNode) paths[0]
.getLastPathComponent()).isRoot()) {
// a leaf has been selected, allow delete relation
deleteRelationButton.setEnabled(true);
} else {
deleteRelationButton.setEnabled(false);
}
}
}
项目:OpenJSharp
文件:ElementTreePanel.java
/**
* Called whenever the value of the selection changes.
* @param e the event that characterizes the change.
*/
public void valueChanged(TreeSelectionEvent e) {
if (!updatingSelection && tree.getSelectionCount() == 1) {
TreePath selPath = tree.getSelectionPath();
Object lastPathComponent = selPath.getLastPathComponent();
if (!(lastPathComponent instanceof DefaultMutableTreeNode)) {
Element selElement = (Element) lastPathComponent;
updatingSelection = true;
try {
getEditor().select(selElement.getStartOffset(),
selElement.getEndOffset());
} finally {
updatingSelection = false;
}
}
}
}
项目:Tarski
文件:OurTree.java
/** Construct a Tree object with the given font size. */
public OurTree(int fontSize) {
Font font = OurUtil.getVizFont().deriveFont((float)fontSize);
OurTreeRenderer renderer = new OurTreeRenderer(fontSize);
renderer.setFont(font);
renderer.invalidate();
renderer.validate();
setRowHeight(0); // To allow variable row height on Mac OS X
setCellRenderer(renderer);
setFont(font);
setBorder(new EmptyBorder(8, 8, 2, 2));
getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
putClientProperty("JTree.lineStyle", "Angled");
setRootVisible(true);
setForeground(Color.BLACK);
setBackground(Color.WHITE);
setOpaque(true);
addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
TreePath path = OurTree.this.getSelectionPath();
if (path!=null) OurTree.this.listeners.fire(OurTree.this, Listener.Event.CLICK, path.getLastPathComponent());
}
});
}
项目:Tarski
文件:OurTree.java
/** Construct a Tree object with the given font size. */
public OurTree(int fontSize) {
Font font = OurUtil.getVizFont().deriveFont((float)fontSize);
OurTreeRenderer renderer = new OurTreeRenderer(fontSize);
renderer.setFont(font);
renderer.invalidate();
renderer.validate();
setRowHeight(0); // To allow variable row height on Mac OS X
setCellRenderer(renderer);
setFont(font);
setBorder(new EmptyBorder(8, 8, 2, 2));
getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
putClientProperty("JTree.lineStyle", "Angled");
setRootVisible(true);
setForeground(Color.BLACK);
setBackground(Color.WHITE);
setOpaque(true);
addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
TreePath path = OurTree.this.getSelectionPath();
if (path!=null) OurTree.this.listeners.fire(OurTree.this, Listener.Event.CLICK, path.getLastPathComponent());
}
});
}
项目:jdk8u-jdk
文件:ElementTreePanel.java
/**
* Called whenever the value of the selection changes.
* @param e the event that characterizes the change.
*/
public void valueChanged(TreeSelectionEvent e) {
if (!updatingSelection && tree.getSelectionCount() == 1) {
TreePath selPath = tree.getSelectionPath();
Object lastPathComponent = selPath.getLastPathComponent();
if (!(lastPathComponent instanceof DefaultMutableTreeNode)) {
Element selElement = (Element) lastPathComponent;
updatingSelection = true;
try {
getEditor().select(selElement.getStartOffset(),
selElement.getEndOffset());
} finally {
updatingSelection = false;
}
}
}
}
项目:openjdk-jdk10
文件:ElementTreePanel.java
/**
* Called whenever the value of the selection changes.
* @param e the event that characterizes the change.
*/
public void valueChanged(TreeSelectionEvent e) {
if (!updatingSelection && tree.getSelectionCount() == 1) {
TreePath selPath = tree.getSelectionPath();
Object lastPathComponent = selPath.getLastPathComponent();
if (!(lastPathComponent instanceof DefaultMutableTreeNode)) {
Element selElement = (Element) lastPathComponent;
updatingSelection = true;
try {
getEditor().select(selElement.getStartOffset(),
selElement.getEndOffset());
} finally {
updatingSelection = false;
}
}
}
}
项目:Mujeed-Arabic-Prolog
文件:FileTree.java
/** Construct a FileTree */
public FileTree(File dir) {
setLayout(new BorderLayout());
applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
setBorder(null);
// Make a tree list with all the nodes, and make it a JTree
JTree tree = new JTree(addNodes(null, dir));
tree.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
// Add a listener
tree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) e
.getPath().getLastPathComponent();
}
});
add(BorderLayout.CENTER, tree);
JScrollPane scrollBarExplorer = new JScrollPane();
scrollBarExplorer.getViewport().add(tree);
scrollBarExplorer.setBorder(null);
add(scrollBarExplorer, BorderLayout.CENTER);
}
项目:FreeCol
文件:OptionGroupUI.java
/**
* This function analyses a tree selection event and calls the
* right methods to take care of building the requested unit's
* details.
*
* @param event The incoming TreeSelectionEvent.
*/
@Override
public void valueChanged(TreeSelectionEvent event) {
detailPanel.removeAll();
DefaultMutableTreeNode node
= (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
if (node != null) {
if (node.isLeaf()) {
OptionGroup group = (OptionGroup) node.getUserObject();
for (Option option : group.getOptions()) {
addOptionUI(option, editable && group.isEditable());
}
} else {
tree.expandPath(event.getPath());
}
}
detailPanel.revalidate();
detailPanel.repaint();
}
项目:Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud
文件:ViewTreeGroups.java
public ViewTreeGroups(String directory) {
//super("JTree FileSystem Viewer - JavaProgrammingForums.com");
setTitle("GroupsTree Structure");
fileDetailsTextArea.setEditable(false);
fileSystemModel = new FileSystemModel(new File(directory));
fileTree = new JTree(fileSystemModel);
fileTree.setEditable(true);
fileTree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent event) {
File file = (File) fileTree.getLastSelectedPathComponent();
fileDetailsTextArea.setText(getFileDetails(file));
}
});
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
true, new JScrollPane(fileTree), new JScrollPane(
fileDetailsTextArea));
getContentPane().add(splitPane);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(640, 480);
setVisible(true);
}
项目:geomapapp
文件:KMLExportConfigDialog.java
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode)
tree.getLastSelectedPathComponent();
// If nothing is selected, or it is not a data child, or it is the Unscaled Data
// load the field config panel
if (node == null || !data.isNodeChild(node) || data.getChildAt(0) == node) {
if (currentComponent == fieldConfig)
return;
getContentPane().remove(currentComponent);
getContentPane().add(fieldConfig);
currentComponent = fieldConfig;
} else {
int i = data.getIndex(node) - 1;
JPanel p = scalePanels.get(i);
if (currentComponent == p) return;
getContentPane().remove(currentComponent);
getContentPane().add(p);
currentComponent = p;
}
validate();
currentComponent.repaint();
}
项目:poi-visualizer
文件:POIMainFrame.java
private void loadEntry(final TreeSelectionEvent e) {
final DefaultMutableTreeNode node =
(DefaultMutableTreeNode)treeDir.getLastSelectedPathComponent();
if (node == null) {
return;
}
final Object userObject = node.getUserObject();
if (userObject instanceof TreeModelEntry) {
((TreeModelEntry)userObject).activate();
treeObservable.notifyObservers();
}
}
项目:Reer
文件:TaskTreeTab.java
private Component createTreePanel() {
treeComponent = new TaskTreeComponent(gradlePluginLord, new TaskTreeComponent.Interaction() {
public void rightClick(JTree tree, int x, int y) {
enableThingsAppropriately();
popupMenu.show(tree, x, y);
}
public void taskInvoked(TaskView task, boolean isCtrlKeyDown) {
if (isCtrlKeyDown) {
gradlePluginLord.addExecutionRequestToQueue(task, false, "-a");
} else {
gradlePluginLord.addExecutionRequestToQueue(task, false);
}
}
public void projectInvoked(ProjectView project) {
executeDefaultTasksInProject(project);
}
});
treeComponent.getTree().addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
enableThingsAppropriately();
}
});
defaultTreeBackground = treeComponent.getTree().getBackground();
treeScrollPane = new JScrollPane();
treeComponent.getTree().setBackground(workingBackgroundColor); //change the color to better indicate that
showTextInViewport("Has not built projects/tasks yet.");
return treeScrollPane;
}
项目:incubator-netbeans
文件:ExcludeDependencyPanel.java
private void trTransValueChanged(javax.swing.event.TreeSelectionEvent evt) {//GEN-FIRST:event_trTransValueChanged
TreeNode tn = (TreeNode) evt.getPath().getLastPathComponent();
if (tn instanceof CheckNode) {
setReferenceTree((CheckNode)tn);
} else {
trRef.setModel(new DefaultTreeModel(new DefaultMutableTreeNode()));
}
}
项目:incubator-netbeans
文件:HintsPanelLogic.java
public void valueChanged(TreeSelectionEvent ex) {
Object o = getUserObject(errorTree.getSelectionPath());
if ( o instanceof UserConfigurableRule ) {
UserConfigurableRule hint = (UserConfigurableRule) o;
// Enable components
componentsSetEnabled(true);
// Set proper values to the componetnts
Preferences p = getCurrentPrefernces(hint);
ignoreControlChanges = true;
try {
HintSeverity severity = HintsSettings.getSeverity(hint, p);
severityComboBox.setSelectedIndex(severity2index.get(severity));
boolean toTasklist = HintsSettings.isShowInTaskList(hint, p);
tasklistCheckBox.setSelected(toTasklist);
String description = hint.getDescription();
descriptionTextArea.setText( description == null ? wrapDescription("") : wrapDescription(description)); // NOI18N
} finally {
ignoreControlChanges = false;
}
// Optionally show the customizer
customizerPanel.removeAll();
JComponent c = hint.getCustomizer(getPreferences4Modification(hint));
if ( c != null ) {
customizerPanel.add(c, BorderLayout.CENTER);
}
customizerPanel.getParent().invalidate();
((JComponent)customizerPanel.getParent()).revalidate();
customizerPanel.getParent().repaint();
}
else { // Category or nonsense selected.
componentsSetEnabled(false);
}
}
项目:xdman
文件:XDMMainWindow.java
public void valueChanged(TreeSelectionEvent e) {
String status = null;
int state = 0;
Object o[] = e.getPath().getPath();
for (int i = 0; i < o.length; i++) {
XDMTreeNode node = (XDMTreeNode) o[i];
if (node.id.equals("TREE_UNFINISHED")) {
state = 1;
}
if (node.id.equals("TREE_FINISHED")) {
state = IXDMConstants.COMPLETE;
}
if (node.id.equals("TREE_DOCUMENTS")) {
status = IXDMConstants.DOCUMENTS;
}
if (node.id.equals("TREE_COMPRESSED")) {
status = IXDMConstants.COMPRESSED;
}
if (node.id.equals("TREE_MUSIC")) {
status = IXDMConstants.MUSIC;
}
if (node.id.equals("TREE_PROGRAMS")) {
status = IXDMConstants.PROGRAMS;
}
if (node.id.equals("TREE_VIDEOS")) {
status = IXDMConstants.VIDEO;
}
list.setState(state);
list.setType(status);
model.fireTableDataChanged();
}
}
项目:incubator-netbeans
文件:ProfilerTreeTable.java
public void valueChanged(TreeSelectionEvent e) {
if (internal) return;
TreePath selected = e.getPath();
int row = selected == null ? -1 : tree.getRowForPath(selected);
try {
internal = true;
if (row != -1) selectRow(row, !tree.isChangingModel());
else clearSelection();
} finally {
internal = false;
}
}
项目:rapidminer
文件:OperatorTree.java
/**
* This method will be invoked after a user selection of an operator in the tree. Causes a
* property table update and an update of the conditional action container.
*/
@Override
public void valueChanged(TreeSelectionEvent e) {
if (preventEvent) {
return;
}
if (mainFrame != null) {
List<Operator> selectedOperators = getSelectedOperators();
if (selectedOperators != null && !selectedOperators.isEmpty()) {
mainFrame.selectOperators(selectedOperators);
}
}
}
项目:rapidminer
文件:GroupingConfigurationPanel.java
@Override
public void valueChanged(TreeSelectionEvent e) {
TreePath newLeadSelectionPath = e.getNewLeadSelectionPath();
if (newLeadSelectionPath != null) {
if (newLeadSelectionPath.getLastPathComponent() instanceof DimensionConfigTreeNode) {
adaptGUI();
}
}
}
项目:rapidminer
文件:AbstractTreeSelectionDependentPanel.java
@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;
}
}
项目:rapidminer
文件:NewOperatorEditor.java
@Override
public void valueChanged(TreeSelectionEvent e) {
TreePath path = e.getNewLeadSelectionPath();
if (path != null) {
if (path.getLastPathComponent() instanceof GroupTree) {
setOperatorList((GroupTree) path.getLastPathComponent());
}
}
}
项目:jmt
文件:PDFViewerBuffer.java
/**
* 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) {
}
}
项目:call-IDE
文件:FileNavigator.java
/**
* This method get last selected node
* @param e Tree selection event
*/
@Override
public void valueChanged( TreeSelectionEvent e)
{
lastSelectedFile = (FileNode) (((JTree)(e.getSource())).getLastSelectedPathComponent());
// if (lastSelectedFile != null)
// lastSelectedFile.shallowUpdate();
}
项目:call-IDE
文件:SummaryTree.java
@Override
public void valueChanged( TreeSelectionEvent e) {
TreeNode clickedNode = (TreeNode)((JTree) e.getSource()).getLastSelectedPathComponent();
if (clickedNode instanceof VisitableNode) {
File file = ((VisitableNode) clickedNode).getFile();
Position position = ((VisitableNode) clickedNode).getPosition();
visitor.visitNode( file, position);
}
}