本文整理了Java中org.netbeans.swing.outline.Outline.convertRowIndexToModel()
方法的一些代码示例,展示了Outline.convertRowIndexToModel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Outline.convertRowIndexToModel()
方法的具体详情如下:
包路径:org.netbeans.swing.outline.Outline
类名称:Outline
方法名:convertRowIndexToModel
暂无
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api
private static boolean testNodeInRow(Outline outline, Node node, int i) {
int modelIndex = outline.convertRowIndexToModel(i);
if (modelIndex != -1) {
Object o = outline.getModel().getValueAt(modelIndex, 0);
Node n = Visualizer.findNode(o);
if (n == node) {
return true;
}
}
return false;
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
public Node nodeForRow(int row) {
int r = outline.convertRowIndexToModel(row);
TreePath tp = outline.getLayoutCache().getPathForRow(r);
return Visualizer.findNode(tp.getLastPathComponent());
}
public String getShortDescription(int column) {
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-dlight-visualizers
@Override
public Node nodeForRow(int row) {
int r = outline.convertRowIndexToModel(row);
TreePath tp = outline.getLayoutCache().getPathForRow(r);
return Visualizer.findNode(tp.getLastPathComponent());
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api
@Override
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e) && MouseUtils.isDoubleClick(e)) {
int row = view.getOutline().rowAtPoint(e.getPoint());
if (row == -1) return;
T n = convertNode(getNodeAt(view.getOutline().convertRowIndexToModel(row)));
if (n != null) {
Action action = n.getNodeAction();
if (action != null && action.isEnabled()) {
action.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "")); // NOI18N
e.consume();
}
}
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api
private static Node[] getChildrenInDisplayedOrder(Node parent,
OutlineView outlineView) {
Outline outline = outlineView.getOutline();
Node[] unsortedChildren = parent.getChildren().getNodes(true);
int rows = outlineView.getOutline().getRowCount();
int start = findRowIndexInOutline(parent, outline, rows);
if (start == -1 && parent != ExplorerManager.find(outlineView).getRootContext()) {
return unsortedChildren;
}
List<Node> children = new LinkedList<Node>();
for (int j = start + 1; j < rows; j++) {
int childModelIndex = outline.convertRowIndexToModel(j);
if (childModelIndex == -1) {
continue;
}
Object childObject = outline.getModel().getValueAt(
childModelIndex, 0);
Node childNode = Visualizer.findNode(childObject);
if (childNode.getParentNode() == parent) {
children.add(childNode);
} else if (children.size() == unsortedChildren.length) {
break;
}
}
return children.toArray(new Node[children.size()]);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api
@Override
public T getNodeAtPosition (int position) {
for (int i = 0; i < view.getOutline().getRowCount(); ++i) {
Node n = getNodeAt(view.getOutline().convertRowIndexToModel(i));
T converted = convertNode(n);
if (converted != null) {
if (position-- == 0) {
return converted;
}
}
}
return null;
}
代码示例来源:origin: uk.gov.nationalarchives/droid-ui
/**
* @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
*/
@Override
public void mouseClicked(MouseEvent e) {
Point mousePoint = e.getPoint();
int colIndex = resultsOutline.columnAtPoint(mousePoint);
int rowIndex = resultsOutline.rowAtPoint(mousePoint);
int colModelIndex = resultsOutline.convertColumnIndexToModel(resultsOutline.columnAtPoint(mousePoint));
if (colModelIndex == OutlineColumn.IDENTIFICATION_COUNT.ordinal() + 1) {
DirectoryComparableLong count = (DirectoryComparableLong) resultsOutline
.getValueAt(rowIndex, colIndex);
if (count != null && count.getSource() != null && count.getSource() > 1) {
int rowModelIndex = resultsOutline.convertRowIndexToModel(rowIndex);
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) mdl.getValueAt(rowModelIndex, 0);
ProfileResourceNode node = (ProfileResourceNode) treeNode.getUserObject();
multiIdentificationDialog.showDialog(node);
}
}
}
}
代码示例来源:origin: in.jlibs/org-netbeans-swing-outline
protected void configureTreeCellEditor( Component editor, int row, int column ) {
if( !(editor instanceof JComponent) ) {
return;
}
TreeCellEditorBorder b = new TreeCellEditorBorder();
TreePath path = getLayoutCache().getPathForRow(convertRowIndexToModel(row));
Object o = getValueAt(row, column);
RenderDataProvider rdp = getRenderDataProvider();
b.icon = rdp.getIcon(o);
b.nestingDepth = Math.max( 0, path.getPathCount() - (isRootVisible() ? 1 : 2) );
b.isLeaf = getOutlineModel().isLeaf(o);
b.isExpanded = getLayoutCache().isExpanded(path);
((JComponent)editor).setBorder(b);
}
代码示例来源:origin: digital-preservation/droid
/**
* @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
*/
@Override
public void mouseClicked(MouseEvent e) {
Point mousePoint = e.getPoint();
int colIndex = resultsOutline.columnAtPoint(mousePoint);
int rowIndex = resultsOutline.rowAtPoint(mousePoint);
int colModelIndex = resultsOutline.convertColumnIndexToModel(resultsOutline.columnAtPoint(mousePoint));
if (colModelIndex == OutlineColumn.IDENTIFICATION_COUNT.ordinal() + 1) {
DirectoryComparableLong count = (DirectoryComparableLong) resultsOutline
.getValueAt(rowIndex, colIndex);
if (count != null && count.getSource() != null && count.getSource() > 1) {
int rowModelIndex = resultsOutline.convertRowIndexToModel(rowIndex);
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) mdl.getValueAt(rowModelIndex, 0);
ProfileResourceNode node = (ProfileResourceNode) treeNode.getUserObject();
multiIdentificationDialog.showDialog(node);
}
}
}
}
代码示例来源:origin: in.jlibs/org-netbeans-swing-outline
TreePath path = getLayoutCache().getPathForRow(convertRowIndexToModel(row));
if (!getOutlineModel().isLeaf(path.getLastPathComponent())) {
int handleWidth = DefaultOutlineCellRenderer.getExpansionHandleWidth();
代码示例来源:origin: org.netbeans.api/org-openide-explorer
view.getOutline().convertRowIndexToModel(row));
if (LOGABLE) {
log("tp == " + tp); //NOI18N
view.getOutline().convertRowIndexToModel(row));
if( null != path ) {
TreePath parentPath = path.getParentPath();
view.getOutline().convertRowIndexToModel(row));
boolean expanded = view.getOutline().getLayoutCache().isExpanded(path);
if (
代码示例来源:origin: in.jlibs/org-netbeans-swing-outline
if (tbl.isTreeColumnIndex(column)) {
AbstractLayoutCache layout = tbl.getLayoutCache();
row = tbl.convertRowIndexToModel(row);
boolean leaf = tbl.getOutlineModel().isLeaf(value);
setLeaf(leaf);
内容来源于网络,如有侵权,请联系作者删除!