org.netbeans.swing.outline.Outline.getSelectedRow()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(118)

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

Outline.getSelectedRow介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api

private static int findRowIndexInOutline(Node node, Outline outline,
    int rows) {
  int startRow = Math.max(outline.getSelectedRow(), 0);
  int offset = 0;
  while (startRow + offset < rows || startRow - offset >= 0) {
    int up = startRow + offset + 1;
    int down = startRow - offset;
    if (up < rows && testNodeInRow(outline, node, up)) {
      return up;
    } else if (down >= 0 && testNodeInRow(outline, node, down)) {
      return down;
    } else {
      offset++;
    }
  }
  return -1;
}

代码示例来源:origin: in.jlibs/org-netbeans-swing-outline

public void actionPerformed(ActionEvent e) {
    if( getSelectedRowCount() == 1 && isTreeColumnIndex (getSelectedColumn()) ) {
      int selRow = getSelectedRow();
      TreePath selPath = getLayoutCache().getPathForRow(selRow);
      if( null != selPath 
          && !getOutlineModel().isLeaf(selPath.getLastPathComponent()) ) {
        boolean expanded = getLayoutCache().isExpanded(selPath);
        if( expanded && !expand ) {
          collapsePath(selPath);
          return;
        } else if( !expanded && expand ) {
          expandPath(selPath);
          return;
        }
      }
    }
    if( null != origAction )
      origAction.actionPerformed(e);
  }
}

代码示例来源:origin: uk.gov.nationalarchives/droid-ui

private DefaultMutableTreeNode getSelectedNode() {
  Outline outline = droidContext.getSelectedProfile().getResultsOutline();
  return (DefaultMutableTreeNode) outline.getValueAt(outline.getSelectedRow(), 0);
}

代码示例来源:origin: digital-preservation/droid

private DefaultMutableTreeNode getSelectedNode() {
  Outline outline = droidContext.getSelectedProfile().getResultsOutline();
  return (DefaultMutableTreeNode) outline.getValueAt(outline.getSelectedRow(), 0);
}

代码示例来源:origin: digital-preservation/droid

@Override
public void keyPressed(KeyEvent e) {
  if (e.getKeyCode() == F5_KEY_CODE) {
    Outline outline = droidContext.getSelectedProfile().getResultsOutline();
    // if any row is selected and hte node is not the root node.
    if (outline.getSelectedRow() != -1 && !getSelectedNode().isRoot()) {
      populateNode();
    }
  }
}

代码示例来源:origin: uk.gov.nationalarchives/droid-ui

@Override
public void keyPressed(KeyEvent e) {
  if (e.getKeyCode() == F5_KEY_CODE) {
    Outline outline = droidContext.getSelectedProfile().getResultsOutline();
    // if any row is selected and hte node is not the root node.
    if (outline.getSelectedRow() != -1 && !getSelectedNode().isRoot()) {
      populateNode();
    }
  }
}

代码示例来源:origin: digital-preservation/droid

@Override
public void valueChanged(ListSelectionEvent event) {
  if (!event.getValueIsAdjusting()) {
    Outline outline = droidContext.getSelectedProfile().getResultsOutline();
    ListSelectionModel m = outline.getSelectionModel();
    if (outline.getSelectedRow() != -1 && m.getMinSelectionIndex() == m.getMaxSelectionIndex()) {
      if (!getSelectedNode().isRoot() && getSelectedNode().getDepth() == 0) {
        populateNode();
      }
    }
  }
}

代码示例来源:origin: uk.gov.nationalarchives/droid-ui

@Override
public void valueChanged(ListSelectionEvent event) {
  if (!event.getValueIsAdjusting()) {
    Outline outline = droidContext.getSelectedProfile().getResultsOutline();
    ListSelectionModel m = outline.getSelectionModel();
    if (outline.getSelectedRow() != -1 && m.getMinSelectionIndex() == m.getMaxSelectionIndex()) {
      if (!getSelectedNode().isRoot() && getSelectedNode().getDepth() == 0) {
        populateNode();
      }
    }
  }
}

相关文章