MASON-INTEREST-L Archives

August 2011

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mime-Version:
1.0
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Subject:
From:
Joerg Hoehne <[log in to unmask]>
Date:
Tue, 23 Aug 2011 01:42:37 -0400
Content-Transfer-Encoding:
8bit
Content-Type:
text/plain
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Parts/Attachments:
text/plain (48 lines)
On Mon, 22 Aug 2011 09:16:03 -0400, Sean Luke <[log in to unmask]> 
wrote:

>Joerg, I suspect you're not using the version on the SVN repository.
>You might check that first.

Just checked the source, it is still there. The comment line tells me the color 
has to be set but this applies only to the case the precise flag is set to true. If 
it is false the color will be set.
I'm not sure what the reason for this implementation is so it might be a bug.

Jörg



    // assumes the graphics already has its color set
    public void draw(Object object, Graphics2D graphics, DrawInfo2D info)
        {
        Rectangle2D.Double draw = info.draw;
        final double width = draw.width*scale;
        final double height = draw.height*scale;

        if (info.precise)
            {
            preciseRectangle.setFrame(info.draw.x - width/2.0, info.draw.y - 
height/2.0, width, height);
            if (filled) graphics.fill(preciseRectangle);
            else graphics.draw(preciseRectangle);
            return;
            }
                
        graphics.setPaint(paint);
        // we are doing a simple draw, so we ignore the info.clip

        final int x = (int)(draw.x - width / 2.0);
        final int y = (int)(draw.y - height / 2.0);
        final int w = (int)(width);
        final int h = (int)(height);

        // draw centered on the origin
        if (filled)
            graphics.fillRect(x,y,w,h);
        else
            graphics.drawRect(x,y,w,h);
        }
        
    }

ATOM RSS1 RSS2