public boolean isExpanded (TreePath path) { if( !isRootVisible() && null == path.getParentPath() ) return true; return getTreePathSupport().isExpanded(path); }
/** Set whether or not the root is visible */ public void setRootVisible (boolean val) { if (getOutlineModel() == null) { cachedRootVisible = val ? Boolean.TRUE : Boolean.FALSE; } if (val != isRootVisible()) { //TODO - need to force a property change on the model, //the layout cache doesn't have direct listener support getLayoutCache().setRootVisible(val); firePropertyChange("rootVisible", !val, val); //NOI18N } }
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); }
int handleWidth = DefaultOutlineCellRenderer.getExpansionHandleWidth(); Insets ins = getInsets(); int nd = path.getPathCount() - (isRootVisible() ? 1 : 2); if (nd < 0) { nd = 0;
boolean expanded = layout.isExpanded(path); setExpanded (expanded); int nd = path.getPathCount() - (tbl.isRootVisible() ? 1 : 2); if (nd < 0) { nd = 0;