I'm working with Mason and I have a Continuous2D field where
I store the data for my agents.  I'm using a SimplePortrayal2D
that contains a RectanglePortrayal2D to draw my agents, and a
LabelledPortrayal2D for drawing the agents' names.  Everything
is working fine, except that my simulation drawing is upside-

The data used for my original agent locations, and the code
that moves agents around during the simulation assume that
the origin [0,0] is at the bottom-left corner of the screen.
But it appears that Mason believes the origin is at the top-left
corner of the screen.  So I need to flip my agents' locations
about the Y axis when the portrayal is drawn.

I wrote the following code which I call from my draw method.

  private DrawInfo2D transform(DrawInfo2D orig, Continuous2D field)
    // calculate the new Y location
    // multiply by draw's height because it represents scale
    double height = field.getHeight() * orig.draw.getHeight();
    double origY = orig.draw.getY();
    double flipY = height - origY;
    // create new draw & clip from original draw info, with new Y coordinate
    Rectangle2D.Double flipDraw = new Rectangle2D.Double(orig.draw.getX(),
    origY = orig.clip.getY();
    flipY = height - origY;
    Rectangle2D.Double flipClip = new Rectangle2D.Double(orig.clip.getX(),
    DrawInfo2D flip = new DrawInfo2D(flipDraw, flipClip);
    return flip;

This code works only initially.  It does not draw correctly if
I change the size of the display window (e.g., maximize) or
change the scale.

I would appreciate some advice from anyone who can give it.  Do
you know what I'm doing wrong?  Is there another approach to
solving this problem?  (Changing the input data is unfortunately
not an option.)

Thanks very much.   -Diane Kramer