javax.swing.JTree.clearSelection()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中javax.swing.JTree.clearSelection()方法的一些代码示例,展示了JTree.clearSelection()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.clearSelection()方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:clearSelection

JTree.clearSelection介绍

暂无

代码示例

代码示例来源:origin: UISpec4J/UISpec4J

/**
 * Removes the current selection.
 */
public void clearSelection() {
 jTree.clearSelection();
}

代码示例来源:origin: net.sf.sfac/sfac-core

public void clearSelection() {
  if (theTree != null) {
    theTree.clearSelection();
  }
}

代码示例来源:origin: robward-scisys/sldeditor

/** Clear selection. */
protected void clearSelection() {
  tree.clearSelection();
}

代码示例来源:origin: net.sf.ingenias/ingeniasjgraphmod

/**
 * Messages cancelCellEditing to the realEditor and removes it from
 * this instance.
 */
public void cancelCellEditing() {
  if (componentValue instanceof JTree)
    ((JTree) componentValue).clearSelection();
  super.cancelCellEditing();
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@Override
 public void actionPerformed(ActionEvent e) {
  m_toolBarBean = null;
  m_mode = NONE;
  KnowledgeFlowApp.this.setCursor(Cursor
   .getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  m_componentTree.clearSelection();
 }
});

代码示例来源:origin: net.sourceforge.jadex/jadex-tools-base-swing

public void mouseClicked(MouseEvent e)
  {
    if(tree.getPathForLocation(e.getX(), e.getY())==null)
    {
      tree.clearSelection();
    }
  }
});

代码示例来源:origin: dsukhoroslov/bagri

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  if (!enabled) {
    tree.clearSelection();
  }
}

代码示例来源:origin: net.sf.ingenias/ingeniasjgraphmod

/**
 * If the realEditor will allow editing to stop, the realEditor is
 * removed and true is returned, otherwise false is returned.
 */
public boolean stopCellEditing() {
  if (componentValue instanceof JTree)
    ((JTree) componentValue).clearSelection();
  return super.stopCellEditing();
}

代码示例来源:origin: org.zaproxy/zap

@Override
  public void mouseClicked(java.awt.event.MouseEvent e) {
    // right mouse button action
    if (treeSite.getLastSelectedPathComponent() != null) {
      // They selected a site node, deselect any context
      getTreeContext().clearSelection();
    }
    if (e.getClickCount() > 1) {
      // Its a double click - close the dialog to select this node
      nodeSelected();
    }
  }
});

代码示例来源:origin: org.zaproxy/zap

@Override
  public void mouseClicked(java.awt.event.MouseEvent e) {
    // right mouse button action
    if (treeContext.getLastSelectedPathComponent() != null) {
      // They selected a context node, deselect any site node
      getTreeSite().clearSelection();
    }
    if (e.getClickCount() > 1) {
      // Its a double click - close the dialog to select this node
      contextSelected();
    }
  }
});

代码示例来源:origin: Waikato/weka-trunk

@Override
 public void actionPerformed(ActionEvent e) {
  m_toolBarBean = null;
  m_mode = NONE;
  KnowledgeFlowApp.this.setCursor(Cursor
   .getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  m_componentTree.clearSelection();
 }
});

代码示例来源:origin: org.jacorb/jacorb

/**
 * Delete selection in tree, if a table row has been selected.
 *
 * @param event
 */
public void valueChanged(ListSelectionEvent event) {
  if (! ((ListSelectionModel)event.getSource()).isSelectionEmpty())
  m_tree.clearSelection();
}

代码示例来源:origin: org.gephi/directory-chooser

@Override
  public void focusGained(FocusEvent e) {
    if (!getFileChooser().isMultiSelectionEnabled()) {
      tree.clearSelection();
    }
  }
});

代码示例来源:origin: UISpec4J/UISpec4J

/**
 * Sets the selection on the given node.
 */
public void select(String path) {
 jTree.clearSelection();
 jTree.setSelectionPath(getTreePath(path));
}

代码示例来源:origin: UISpec4J/UISpec4J

public void select(String[] paths) {
 jTree.clearSelection();
 for (String path : paths) {
  jTree.addSelectionPath(getTreePath(path));
 }
}

代码示例来源:origin: UISpec4J/UISpec4J

/**
 * Simulates a user right-click on a given node.
 */
public void rightClick(String path) {
 jTree.clearSelection();
 clickOnPath(getTreePath(path), true);
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

/** {@inheritDoc}} */
@Override
public void clearGui() {
  super.clearGui();
  selected = null;
  hasAtLeastOneController = false;
  if(moduleToRunTreeModel != null) {
    ((DefaultMutableTreeNode) moduleToRunTreeModel.getRoot()).removeAllChildren();
  }
  if(moduleToRunTreeNodes != null) {
    moduleToRunTreeNodes.clearSelection();
  }
}

代码示例来源:origin: javax.help/javahelp

/**
 * Select a certian node
 */
private void selectNode(DefaultMutableTreeNode node) {
if (node == null) {
  // node doesn't exist. Need to clear the selection.
  tree.clearSelection();
  return;
}
TreePath path = new TreePath(node.getPath());
tree.expandPath(path);
tree.setSelectionPath(path);
tree.scrollPathToVisible(path);
}

代码示例来源:origin: javax.help/javahelp

/**
 * Select a certian node
 */
private void selectNode(DefaultMutableTreeNode node) {
if (node == null) {
  // node doesn't exist. Need to clear the selection.
  tree.clearSelection();
  return;
}
TreePath path = new TreePath(node.getPath());
tree.expandPath(path);
tree.setSelectionPath(path);
tree.scrollPathToVisible(path);
}

代码示例来源:origin: org.scijava/scijava-ui-swing

LogSourcesPanel(JButton reloadButton) {
  initMenu();
  initTreeView();
  JButton visibilityButton = initVisibilityButton();
  setLayout(new MigLayout("inset 0", "[grow]", "[][grow][]"));
  add(new JLabel("Log Sources:"), "grow, wrap");
  add(new JScrollPane(tree), "grow, wrap");
  add(new JLabel(""), "split 3, grow");
  add(reloadButton);
  add(visibilityButton);
  actionWhenFocusLost(() -> tree.clearSelection(), Arrays.asList(tree, visibilityButton));
}

相关文章

JTree类方法