-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
1.3.1
-
Fix Understood
-
x86
-
generic
The Issue
---------
Our application has a grid control, areas of which need to be redrawn
based on application events.
( In this case prices changing in an electronic market )
In order to schedule this painting we call:
component.repaint(rect1)
which indirectly causes the rect1 area of the control to be redrawn.
When the area of the control invalidated is hidden by another window or
off the screen there is no reason for this redraw to go ahead. In this
case we would prefer that the repaint event got clipped.
Unfortunately it appears that Swing does not clip these other windows
or device bounds. "void paint(Graphics g)" is still executed with rect1
passed in as the clip region.
Operating system generated repaints do clip correctly.
This has performance implications for applications with internally
generated screen updates since they will be doing processing that is
unneccesary.
An example of performance implications
--------------------------------------
For example, we have two windows containing a grid with 50rows at
30columns (1500cells per window).
Every second around 100 cells are updated by the application and
require redrawing.
If one window is placed in front of another, proper clipping would
halve the amount of repaint work neccesary.
If a window is iconised then there should be no need to do drawing
either.
Currently none of this is taken in to account.
---------
Our application has a grid control, areas of which need to be redrawn
based on application events.
( In this case prices changing in an electronic market )
In order to schedule this painting we call:
component.repaint(rect1)
which indirectly causes the rect1 area of the control to be redrawn.
When the area of the control invalidated is hidden by another window or
off the screen there is no reason for this redraw to go ahead. In this
case we would prefer that the repaint event got clipped.
Unfortunately it appears that Swing does not clip these other windows
or device bounds. "void paint(Graphics g)" is still executed with rect1
passed in as the clip region.
Operating system generated repaints do clip correctly.
This has performance implications for applications with internally
generated screen updates since they will be doing processing that is
unneccesary.
An example of performance implications
--------------------------------------
For example, we have two windows containing a grid with 50rows at
30columns (1500cells per window).
Every second around 100 cells are updated by the application and
require redrawing.
If one window is placed in front of another, proper clipping would
halve the amount of repaint work neccesary.
If a window is iconised then there should be no need to do drawing
either.
Currently none of this is taken in to account.