MASON-INTEREST-L Archives

June 2014

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:
Joey Harrison <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Tue, 10 Jun 2014 12:47:15 -0400
Content-Type:
multipart/alternative
Parts/Attachments:
text/plain (1187 bytes) , text/html (1844 bytes)
Perfect. That does exactly what I need.

Thank you,
Joey


On Tue, Jun 10, 2014 at 12:25 PM, Sean Luke <[log in to unmask]> wrote:

> On Jun 10, 2014, at 11:40 AM, Joey Harrison <[log in to unmask]> wrote:
>
> > I've got several models in the same directory and I'd like to have their
> "About" tabs populated with different info. However, GUIState is hard-coded
> to load up index.html, so there's no obvious way to have them use separate
> files.
>
> Sure there is!  If you override the GUIState's getInfo() method with your
> own static version, MASON won't hunt for the index.html file.
>
> public static Object getInfo() { return "Check this out!"; }
>
> public static Object getInfo() { return "<html><b>Check this out, now in
> HTML!</b>"; }
>
> You can load HTML files too.  Let's say your GUIState subclass is called
> Joey, and you want to load a file called "joey.html" located in the same
> directory as the Joey.class file:
>
> public static Object getInfo() { return
> Joey.class.getResource("joey.html"); }
>
> Not that I'm saying having multiple models in the same directory is a good
> idea.  It seems unclean.  I'm sure there's something else in MASON you'll
> have to override further down the line.
>
> Sean
>


ATOM RSS1 RSS2