public void actionPerformed(ActionEvent e) { final Outline outline = ov.getOutline(); int cols = outline.getColumnCount(); int rows = outline.getRowCount(); for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { System.out.print(outline.getValueAt(i, j) + ", "); } System.out.println(); } }
/** * * @return A list of the profile resource nodes selected in the outline. */ public List<ProfileResourceNode> getSelectedNodes() { List<ProfileResourceNode> results = new ArrayList<ProfileResourceNode>(); Outline outline = getResultsOutline(); int[] selectedRows = outline.getSelectedRows(); for (int i = selectedRows.length; i > 0; i--) { int index = selectedRows[i - 1]; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) outline .getValueAt(index, 0); ProfileResourceNode prn = (ProfileResourceNode) treeNode .getUserObject(); results.add(prn); } return results; }
/** * * @return A list of the profile resource nodes selected in the outline. */ public List<ProfileResourceNode> getSelectedNodes() { List<ProfileResourceNode> results = new ArrayList<ProfileResourceNode>(); Outline outline = getResultsOutline(); int[] selectedRows = outline.getSelectedRows(); for (int i = selectedRows.length; i > 0; i--) { int index = selectedRows[i - 1]; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) outline .getValueAt(index, 0); ProfileResourceNode prn = (ProfileResourceNode) treeNode .getUserObject(); results.add(prn); } return results; }
private DefaultMutableTreeNode getSelectedNode() { Outline outline = droidContext.getSelectedProfile().getResultsOutline(); return (DefaultMutableTreeNode) outline.getValueAt(outline.getSelectedRow(), 0); }
private DefaultMutableTreeNode getSelectedNode() { Outline outline = droidContext.getSelectedProfile().getResultsOutline(); return (DefaultMutableTreeNode) outline.getValueAt(outline.getSelectedRow(), 0); }
/** * Expands the selected nodes in the tree. * @param recursive whether to expand all children. */ public void expandSelectedNodes(boolean recursive) { Outline outline = getResultsOutline(); int[] selectedRows = outline.getSelectedRows(); for (int i = selectedRows.length; i > 0; i--) { int index = selectedRows[i - 1]; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) outline .getValueAt(index, 0); expandNode(treeNode, recursive, 1); } }
/** * Expands the selected nodes in the tree. * @param recursive whether to expand all children. */ public void expandSelectedNodes(boolean recursive) { Outline outline = getResultsOutline(); int[] selectedRows = outline.getSelectedRows(); for (int i = selectedRows.length; i > 0; i--) { int index = selectedRows[i - 1]; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) outline .getValueAt(index, 0); expandNode(treeNode, recursive, 1); } }
Object cellObj = resultsOutline.getValueAt(rowIndex, colIndex); if (cellObj != null) { String cellValue = cellObj.toString();
Object cellObj = resultsOutline.getValueAt(rowIndex, colIndex); if (cellObj != null) { String cellValue = cellObj.toString();
final int colModelIndex = resultsOutline.convertColumnIndexToModel( resultsOutline.columnAtPoint(mousePoint)); final Object cellObject = resultsOutline.getValueAt(rowIndex, colIndex); if (cellObject != null) { String cellValue = cellObject.toString(); cellValue = resultsOutline.getValueAt(rowIndex, colIndex).toString(); cellValue = cellValue.replace(puidValuePrefix, ""); cellValue = cellValue.replace(puidValueSuffix, ""); resultsOutline.getValueAt(resultsOutline.rowAtPoint(e.getPoint()), resultsOutline.columnAtPoint(e.getPoint())); if (value.getSource() != null && value.getSource() > 1) {
final int colModelIndex = resultsOutline.convertColumnIndexToModel( resultsOutline.columnAtPoint(mousePoint)); final Object cellObject = resultsOutline.getValueAt(rowIndex, colIndex); if (cellObject != null) { String cellValue = cellObject.toString(); cellValue = resultsOutline.getValueAt(rowIndex, colIndex).toString(); cellValue = cellValue.replace(puidValuePrefix, ""); cellValue = cellValue.replace(puidValueSuffix, ""); resultsOutline.getValueAt(resultsOutline.rowAtPoint(e.getPoint()), resultsOutline.columnAtPoint(e.getPoint())); if (value.getSource() != null && value.getSource() > 1) {
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); }
/** * @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); } } } }
/** * @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); } } } }
/** * Applies the filter. */ public void applyFilter() { //ProfileForm selectedProfile = droidContext.getSelectedProfile(); //DefaultTreeModel treeMdl = (DefaultTreeModel) selectedProfile DefaultTreeModel treeMdl = (DefaultTreeModel) profileToFilter .getTreeModel(); Outline outline = profileToFilter.getResultsOutline(); for (int i = outline.getRowCount(); i > 0; i--) { // remove node from profile spec DefaultMutableTreeNode node = (DefaultMutableTreeNode) outline.getValueAt(i - 1, 0); if (!node.isRoot()) { treeMdl.removeNodeFromParent(node); } } treeMdl.reload(); DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) treeMdl.getRoot(); //String profileId = droidContext.getSelectedProfile().getProfile().getUuid(); String profileId = profileToFilter.getProfile().getUuid(); List<ProfileResourceNode> childNodes = profileManager.findRootNodes(profileId); for (ProfileResourceNode profileNode : childNodes) { DefaultMutableTreeNode treeNode = new DefaultMutableTreeNode(profileNode); treeNode.setAllowsChildren(profileNode.allowsChildren()); rootNode.add(treeNode); } treeMdl.reload(); }
/** * Applies the filter. */ public void applyFilter() { //ProfileForm selectedProfile = droidContext.getSelectedProfile(); //DefaultTreeModel treeMdl = (DefaultTreeModel) selectedProfile DefaultTreeModel treeMdl = (DefaultTreeModel) profileToFilter .getTreeModel(); Outline outline = profileToFilter.getResultsOutline(); for (int i = outline.getRowCount(); i > 0; i--) { // remove node from profile spec DefaultMutableTreeNode node = (DefaultMutableTreeNode) outline.getValueAt(i - 1, 0); if (!node.isRoot()) { treeMdl.removeNodeFromParent(node); } } treeMdl.reload(); DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) treeMdl.getRoot(); //String profileId = droidContext.getSelectedProfile().getProfile().getUuid(); String profileId = profileToFilter.getProfile().getUuid(); List<ProfileResourceNode> childNodes = profileManager.findRootNodes(profileId); for (ProfileResourceNode profileNode : childNodes) { DefaultMutableTreeNode treeNode = new DefaultMutableTreeNode(profileNode); treeNode.setAllowsChildren(profileNode.allowsChildren()); rootNode.add(treeNode); } treeMdl.reload(); }
.getValueAt(index, 0); ProfileResourceNode prn = (ProfileResourceNode) treeNode .getUserObject();
.getValueAt(index, 0); ProfileResourceNode prn = (ProfileResourceNode) treeNode .getUserObject();