Bug 411655 - VPG Browser Annotations tab performance improvement
Summary: VPG Browser Annotations tab performance improvement
Status: ASSIGNED
Alias: None
Product: PTP
Classification: Tools
Component: Photran.Unknown (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Jeffrey Overbey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-26 02:19 EDT by Louis Orenstein CLA
Modified: 2013-08-17 02:00 EDT (History)
3 users (show)

See Also:


Attachments
proposed patch (8.51 KB, text/plain)
2013-06-26 02:19 EDT, Louis Orenstein CLA
no flags Details
updated proposed patch (2.46 KB, text/plain)
2013-07-03 16:11 EDT, Louis Orenstein CLA
no flags Details
updated proposed patch (2.46 KB, text/plain)
2013-07-03 16:13 EDT, Louis Orenstein CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Louis Orenstein CLA 2013-06-26 02:19:39 EDT
Created attachment 232768 [details]
proposed patch

When using the VPG Browser (Refactor menu -> VPG Browser) and viewing the Annotations tab, attempting to scroll the file's text will feel slow to the user if the file has a large number of annotations.

If a token has an annotation it will have a box drawn around it and the slow scrolling is due to the way those boxes are drawn.

The current method of using the RectanglePainter (custom class implementing PaintListener) causes every box to be drawn around every token whenever the file's text area needs to be refreshed (this includes whenever the cursor flashes in the text area! ). Specifically, the drawRectangle method's use of StyledText.getTextBounds prevents the RectanglePainter from keeping up with any amount of scrolling if a file has a large number of annotations.

Instead of re-drawing the annotation-indicating boxes each time the file's text area needs to be refreshed, the AnnotationsTab class should use the StyleRange aspect of the StyledText class.

I confirm that:

(a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of others
(b) I have the right to contribute the code to Eclipse
(c) I have included the EPL license header in all source files.
Comment 1 Louis Orenstein CLA 2013-07-03 16:11:06 EDT
Created attachment 233057 [details]
updated proposed patch

This updated proposed patch is a lot less complex and still performs much better than the current implementation.

This patch leaves the RectanglePainter in place but only attempts to paint a rectangle if it is in the text widget's visible area.
Comment 2 Louis Orenstein CLA 2013-07-03 16:13:36 EDT
Created attachment 233058 [details]
updated proposed patch

This updated patch is a lot less complex and still performs much better than the current implementation.

This patch leaves the RectanglePainter in place but only attempts to paint a rectangle if it is in the text widget's visible area.

I confirm that:

(a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of others
(b) I have the right to contribute the code to Eclipse
(c) I have included the EPL license header in all source files.