162 } 163 } 164 165 protected void paintHorizontalPartOfLeg(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) { 166 if (lineStyle == LEG_LINE_STYLE) { 167 super.paintHorizontalPartOfLeg(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); 168 } 169 } 170 171 /** This class listens for changes in line style */ 172 class LineListener implements PropertyChangeListener { 173 public void propertyChange(final PropertyChangeEvent e) { 174 final String name = e.getPropertyName(); 175 if (name.equals(LINE_STYLE)) { 176 decodeLineStyle(e.getNewValue()); 177 } 178 } 179 } 180 181 /** 182 * Paints the expand (toggle) part of a row. The receiver should NOT modify <code>clipBounds</code>, or 183 * <code>insets</code>. 184 */ 185 protected void paintExpandControl(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) { 186 final Object value = path.getLastPathComponent(); 187 188 // Draw icons if not a leaf and either hasn't been loaded, 189 // or the model child count is > 0. 190 if (isLeaf || (hasBeenExpanded && treeModel.getChildCount(value) <= 0)) return; 191 192 final boolean isLeftToRight = AquaUtils.isLeftToRight(tree); // Basic knows, but keeps it private 193 194 final State state = getState(path); 195 196 // if we are not animating, do the expected thing, and use the icon 197 // also, if there is a custom (non-LaF defined) icon - just use that instead 198 if (fAnimationFrame == -1 && state != State.PRESSED) { 199 super.paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); 200 return; 201 } 202 203 // Both icons are the same size | 162 } 163 } 164 165 protected void paintHorizontalPartOfLeg(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) { 166 if (lineStyle == LEG_LINE_STYLE) { 167 super.paintHorizontalPartOfLeg(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); 168 } 169 } 170 171 /** This class listens for changes in line style */ 172 class LineListener implements PropertyChangeListener { 173 public void propertyChange(final PropertyChangeEvent e) { 174 final String name = e.getPropertyName(); 175 if (name.equals(LINE_STYLE)) { 176 decodeLineStyle(e.getNewValue()); 177 } 178 } 179 } 180 181 /** 182 * Paints the expand (toggle) part of a row. The receiver should NOT modify {@code clipBounds}, or 183 * {@code insets}. 184 */ 185 protected void paintExpandControl(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) { 186 final Object value = path.getLastPathComponent(); 187 188 // Draw icons if not a leaf and either hasn't been loaded, 189 // or the model child count is > 0. 190 if (isLeaf || (hasBeenExpanded && treeModel.getChildCount(value) <= 0)) return; 191 192 final boolean isLeftToRight = AquaUtils.isLeftToRight(tree); // Basic knows, but keeps it private 193 194 final State state = getState(path); 195 196 // if we are not animating, do the expected thing, and use the icon 197 // also, if there is a custom (non-LaF defined) icon - just use that instead 198 if (fAnimationFrame == -1 && state != State.PRESSED) { 199 super.paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); 200 return; 201 } 202 203 // Both icons are the same size |