| Summary: | inconsistent implementation - Figure#setBackgroundColor always calls repaint | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Heiko Böttger <heiko.boettger> |
| Component: | GEF-Legacy Draw2d | Assignee: | Alexander Nyßen <nyssen> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | nyssen, remy.suen |
| Version: | 3.3.1 | ||
| Target Milestone: | 3.7.1 (Indigo) M5 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
IFigure? I think this is a GEF bug. Yes, it belongs to GEF. It is in the draw2d-component. The code is in the org.eclipse.draw2d.Figure class. Added guard to setBackgroundColor(Color) to return if provided color is already set as background color. Committed change to cvs HEAD (3.7M5). Resolving as fixed. |
Build ID: M20071023-1652 Steps To Reproduce: The implementation of setForegroundColor is guarded against assigning the same color while setBackgroundColor is not. 1. Compare setBackgroundColor with setForegroundColor /** * @see IFigure#setBackgroundColor(Color) */ public void setBackgroundColor(Color bg) { bgColor = bg; repaint(); } /** * @see IFigure#setForegroundColor(Color) */ public void setForegroundColor(Color fg) { if (fgColor != null && fgColor.equals(fg)) return; fgColor = fg; repaint(); } More information: This would be easy to fix and could improve performance. public void setBackgroundColor(Color bg) { if (bgColor != null && bgColor.equals(bg)) return; bgColor = bg; repaint(); }