Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef-dev] Changes to draw2d Graphics class


It is a lot of work to subclass Graphics because many of the methods have duplicate signatures (for convenience to callers).

from org.eclipse.draw2d.Graphics:
...
public abstract void drawRectangle(Rectangle r);
public abstract void drawRectangle(int x, int y, int w, int h);
...

I would like to change this so that subclasses will have fewer methods to implement, and fewer chances to make mistakes.  So it will become:

public final void drawRectangle(Rectangle r){
    drawRectangle(r.x, r.y, r.width, r.height);
}

Subclasses will *only* implement the method signature with the most parameters.  Does anyone object to this change?

Back to the top