Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334637

Summary: Refactor GC
Product: [RT] RAP Reporter: Rüdiger Herrmann <ruediger.herrmann>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: 1.4 M5   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 318900, 334627    
Attachments:
Description Flags
Proposed refactoring none

Description Rüdiger Herrmann CLA 2011-01-18 08:39:24 EST
The GC implementation in its current state does two things. It serves as a GC for 'Devices' like in new GC( display ) with all actual drawing operations implemented as no-ops, plus it handles the actual drawing on canvases like so: new GC( canvas). With bug 334627 in mind, the situation will become even worse.

The GC should be refactored act as a facade that delegates to distinct implementations that do the actual work of drawing on a certain 'surface'.
Comment 1 Rüdiger Herrmann CLA 2011-01-18 09:03:30 EST
Created attachment 186997 [details]
Proposed refactoring

A new abstract class GCDelegate was introduced. The GC holds an instance of GCDelegate and almost all methods delegate to this instance.
Currently two implementations of GCDelegate exist: DeviceGC and ControlGC
Comment 2 Rüdiger Herrmann CLA 2011-01-28 07:53:44 EST
Released patch to CVS HEAD