There was a reason i did this. look further in the code when i use
insets. If i did it your way, there would be another if-statement i
would need to add. This way it is always used.
Thanks anyways,
Lillian
On Fri, 2005-08-19 at 00:34 +0200, Mark Wielaard wrote:
> Hi,
>
> On Thu, 2005-08-18 at 11:46 -0400, Lillian Angel wrote:
> > 2005-08-18 Lillian Angel <[EMAIL PROTECTED]>
> >
> > * javax/swing/tree/DefaultTreeCellRenderer.java
> > (paint): Added check for null border.
>
> > + Insets insets = new Insets(0, 0, 0, 0);
> > + Border border = UIManager.getLookAndFeelDefaults().getBorder
> > + ("Tree.selectionBorder");
> > + if (border != null)
> > + insets = border.getBorderInsets(this);
>
> Just a little performance note. This would be a little more efficient:
>
> Border border = UIManager.getLookAndFeelDefaults().getBorder
> ("Tree.selectionBorder");
> Insets inset;
> if (border != null)
> insets = border.getBorderInsets(this);
> else
> insets = new Insets(0, 0, 0, 0);
>
> That way you don't always create a new Insets object that might
> immediately turn into garbage.
>
> Cheers,
>
> Mark
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches