/** * @inheritDoc */ @Override protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { if (drawVerticalLines) { super.paintVerticalPartOfLeg(g, clipBounds, insets, path); } }
@Override protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { // if we restrict to the actual clip bounds then we will be trying to // paint subparts of the line. But if we do that then we have no way // of knowing that the overall line size hasn't changed. This means // that paintLine() will keep thinking it is drawing differnet lines and // it will look all choppy. So we just have to live with redrawing more // than we have to so that the line painting stuff knows whether the // overall line has changed or not. Rectangle rect = tree.getBounds(); rect.x = 0; rect.y = 0; super.paintVerticalPartOfLeg(g, rect, insets, path); }