>>         Graphics2D g2d = (Graphics2D) g;
>>
>>         // draw the foreground layer
>>         //
>>         Area clipArea = new Area( this.getBounds() );
>>
>>         Iterator nodeIterator = widgets.iterator();
>>         while (nodeIterator.hasNext())
>>         {
>>             WidgetIF widget = (WidgetIF) nodeIterator.next();
>>
>>             widget.draw( g2d );
>>
>>             clipArea.subtract( new Area( widget.getBounds() ) );
>>         }
>>
>>
>>         g2d.setClip( clipArea );
>>
>>
>>         // draw all of the links
>>         Iterator linkIterator = links.iterator();
>>         while (linkIterator.hasNext())
>>         {
>>             WidgetIF widget = (WidgetIF) linkIterator.next();
>>
>>             widget.draw( g2d );
>>         }
>

I think that you can optimize this if you don't create your clipping area
every paint.

Why you use widget.getBounds ? is your widget rectangular? if not then
widget.getShape would be better.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to