Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341924 - [Theming] Refactor Borders-handling
Summary: [Theming] Refactor Borders-handling
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.4 M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 332509
  Show dependency tree
 
Reported: 2011-04-05 10:29 EDT by Tim Buschtoens CLA
Modified: 2011-04-13 06:29 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Buschtoens CLA 2011-04-05 10:29:12 EDT
RoundedBorders are currently handled in a very awkward fashion: 

Normal borders are handled like other complex values (Fonts, Gradients), i.e. created as a QxBorder instance on the Server, send to the client as an json-object, there converted to an qooxdoo-border and then stored in the ThemeStore where its reused as often as needed.

With rounded-borders however, things are different. The radii are a separate css-property (BoxDimension) and handled as such. When AppearanceBase requests a border for a widget that has radii bigger than 0, an new RoundedBorder object is created (in *addition* to a potentially useless not-rounded border) and *not* stored anywhere. This means everytime a RoundedBorder is needed in AppearanceBase, a new instance is created, even if an identical one already exists.

So i propose two steps:

1. Merge the qooxdoo classes Border and RoundedBorder. There is no need to make a difference between them, it just makes everyting more complicated. (Its a leftover from before we freely editied qooxdoo code.) This step will require some changes in Border and GraphicsMixin.

2. Re-use rounded borders. This can be achieved by either combining border and radii on the server (which might be difficult), or by creating an additional storage for rounded borders in ThemeStore.js. As a result we will save a bit of time and memory, and will a more consistent behavior.
Comment 1 Tim Buschtoens CLA 2011-04-06 06:02:42 EDT
After some discussion with Ivan we agreed to the following:

- The new Border (combined) implementation should have a method like "isComplex", we could use it in ThemeStore#getBorder.
- Generated rounded borders objectes should be stored with a separate key (created by combining the borders key + a separator + the radii key).
- Non-rounded borders should not be created if they are not used. The Rounded borders can be created from either the original (non-resolved) border-object, or from the qooxdoo border object, so its not releavant which we have.
Comment 2 Tim Buschtoens CLA 2011-04-11 11:24:34 EDT
Some changes in CVS HEAD:
- added BorderTest.js
- removed Border-manager, border-statics
- formatting Border.js
Comment 3 Tim Buschtoens CLA 2011-04-12 11:56:02 EDT
qx.ui.core.Border and org.eclipse.rwt.RoundedBorder have been merged into org.eclipse.rwt.Border in CVS HEAD.
Comment 4 Tim Buschtoens CLA 2011-04-13 06:29:57 EDT
Changes in CVS HEAD.

Rounded borders are now cached, and non-rounded borders are only created if necessary.

With these changes the bug can be closed.