MASON-INTEREST-L Archives

April 2018

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Robert Zupko <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Mon, 2 Apr 2018 15:51:58 -0400
Content-Type:
multipart/alternative
Parts/Attachments:
text/plain (1769 bytes) , text/html (2543 bytes)
Indeed that is pretty standard code... that also makes it quite odd that
it's throwing an ArrayIndexOutOfBoundsException. I wonder if the height and
width being passed in is inverted some where? I know I've done that a
couple times in my own code.

On Mon, Apr 2, 2018 at 3:39 PM, Stewart Aitken <
[log in to unmask]> wrote:

> The 32 is thee code fault indicated and the controller is shown below.
> Pretty much standard, I think.
>
>
>         public static void main(String[] args) {
>                 SimEnviro2WithUI sim = new SimEnviro2WithUI();
>                 Console c = new Console(sim);
> 32              c.setVisible(true);
>
>         }
>
>         public void init(Controller c) {
>                 super.init(c);
>                 display = new Display2D(450.0D, 400.0D, this);
>                 displayFrame = display.createFrame();
>                 c.registerFrame(displayFrame);
>                 displayFrame.setVisible(true);
>                 portrayal = new ObjectGridPortrayal2D() {
>                         public Portrayal getDefaultPortrayal() {
>                                 return new OvalPortrayal2D(Color.red,
> 1.0D) {
>                                         public void draw(Object object,
> Graphics2D graphics, DrawInfo2D info) {
>                                                 if(object != null) {
>                                                         super.draw(object,
> graphics, info);
>                                                 }
>
>                                         }
>                                 };
>                         }
>                 };
>
>                 display.attach(this.portrayal, "von Neumann single
> offspring portrayal");
>                 display.setBackdrop(Color.white);
>         }
>


ATOM RSS1 RSS2