Login | Register
My pages Projects Community openCollabNet

Discussions > issues > [Issue 319] New - Fig Constructor calls setOwner() with null

gef
Discussion topic

Back to topic list

[Issue 319] New - Fig Constructor calls setOwner() with null

Reply

Author mvw
Full name Michiel van der Wulp
Date 2008-08-19 07:19:50 PDT
Message http://gef.tigris.or​g/issues/show_bug.cg​i?id=319
                 Issue #|319
                 Summary|Fig Constructor calls setOwner() with null
               Component|gef
                 Version|current
                Platform|All
                     URL|
              OS/Version|All
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P2
            Subcomponent|core
             Assigned to|issues@gef
             Reported by|mvw






------- Additional comments from mvw at tigris dot org Tue Aug 19 07:19:48 -0700 2008 -------
The Fig constructors are organised in a way that causes the setOwner(owner) to
be called with a null parameter.
These are the current ones:

    public Fig(int x, int y, int w, int h) {
        this(x, y, w, h, Color.black, Color.white, null);
    }

    public Fig(int x, int y, int w, int h, Color lineColor, Color fillColor) {
        this(x, y, w, h, lineColor, fillColor, null);
    }

    public Fig(int x, int y, int w, int h, Color lineColor, Color fillColor,
Object own) {
        this();
        _x = x;
        _y = y;
        _w = w;
        _h = h;
        if(lineColor != null) {
            _lineColor = lineColor;
        } else {
            _lineWidth = 0;
        }

        if(fillColor != null) {
            _fillColor = fillColor;
        } else {
            _filled = false;
        }

        setOwner(own);
    }



It would be much better to have this:

    public Fig(int x, int y, int w, int h) {
        this(x, y, w, h, Color.black, Color.white);
    }

    public Fig(int x, int y, int w, int h, Color lineColor, Color fillColor) {
        this();
        _x = x;
        _y = y;
        _w = w;
        _h = h;
        if(lineColor != null) {
            _lineColor = lineColor;
        } else {
            _lineWidth = 0;
        }

        if(fillColor != null) {
            _fillColor = fillColor;
        } else {
            _filled = false;
        }

    }

    public Fig(int x, int y, int w, int h, Color lineColor, Color fillColor,
Object own) {
        this(x, y, w, h, lineColor, fillColor);

        setOwner(own);
    }

Rationale:
ArgoUML has many calls to setOwner() with a null parameter during construction
of the Figs when loading. Since normally setting the owner influences the
layout, all these calls to setOwner would cause a layout update.

« Previous message in topic | 1 of 5 | Next message in topic »

Messages

Show all messages in topic

[Issue 319] New - Fig Constructor calls setOwner() with null mvw Michiel van der Wulp 2008-08-19 07:19:50 PDT
     [Issue 319] Fig Constructor calls setOwner() with null mvw Michiel van der Wulp 2008-10-06 00:42:23 PDT
     [Issue 319] Fig Constructor calls setOwner() with null bobtarling Bob Tarling 2008-10-06 00:56:47 PDT
     [Issue 319] Fig Constructor calls setOwner() with null mvw Michiel van der Wulp 2008-10-07 01:42:29 PDT
     [Issue 319] Fig Constructor calls setOwner() with null bobtarling Bob Tarling 2008-11-23 08:02:09 PST
Messages per page: