示例#1
0
  private List<Node> getSelectedNodes() {
    List<Node> selectedNodes = new Vector<Node>();
    NodeStatusTableModel myTableModel = (NodeStatusTableModel) getModel();

    ListSelectionModel lsm = getSelectionModel();
    int minIndex = lsm.getMinSelectionIndex();
    int maxIndex = lsm.getMaxSelectionIndex();

    for (int i = minIndex; i <= maxIndex; i++) {
      if (lsm.isSelectedIndex(i)) {
        // System.out.println("row " + i + " is selected");
        Node currNode = myTableModel.getNode(i);
        if (currNode != null) selectedNodes.add(currNode);
      }
    }

    return selectedNodes;
  }
示例#2
0
 public void update() {
   model.updateAll();
 }