Subject: | |
From: | |
Reply To: | |
Date: | Tue, 10 Jun 2014 12:25:08 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
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
|
|
|