MASON-INTEREST-L Archives

April 2005

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show Text 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:
Rob Alexander <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Tue, 5 Apr 2005 11:32:21 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (26 lines)
Hi,

Is there any way to attach a field portrayal to a Display2D such that it
appears in the "layers" popup menu but is off by default?

I can see how the mechanism works; the FieldPortrayal2DHolder instance
contains the actual menu item, and the menu item is given an
ActionListener which sets the 'draw' field depending on the new state of
the menu item. But the initial state appears to be hardcoded:

menuItem = new JCheckBoxMenuItem(name,true);

One option, I suppose, would be to subclass Display2D and override that
constructor as well as Display2D.attach(), so that the initial state was
controlled by a parameter. But have I missed something, is there a nicer
way to do this?

yours,
rob

--
Rob Alexander
Research Associate, Dept of Computer Science, The University of York,
York, YO10 5DD, UK
Tel: 01904 432764 Fax: 07976 889545   http://www.cs.york.ac.uk/~rda/

ATOM RSS1 RSS2