That is indeed strange. I presume you mean the button on the top-left of a Display which lets you pull down a menu of layers, correct? You're saying that clicking this button -- that is, revealing the menu -- causes the simulation to slow down for a while? This button is nothing more than a JToggleButton which triggers a JPopupMenu. What operating system are you running?
This sounds like an OS bug. The only thing I can think of (the button does _nothing_ but pop up that popup menu, which does _nothing_ unless you check or uncheck something) is that the popup menu obscured a part of the Display2D, causing the OS to start redrawing in a different mode because the drawing area for a little while wasn't square. That'd be a pretty stupid OS bug.
Try this:
1. Make sure you're using the current version of MASON on SVN, not the tarball, so we can be in sync.
2. In sim/display/Display2D.java there is a line of code (around 1129) which says:
popup.setLightWeightPopupEnabled(false);
Set this to true and see what happens.
Beyond this I will need an example. You can mail it to me but beware that my turnaround is bad for the next two weeks because I'm in Italy with a limited internet connection.
Sean
On Aug 7, 2012, at 7:27 AM, Andrew Reilly wrote:
> I have a simple simulation where agents have a field that is set initially at a
> random number and then increases by one with every step. The portrayal showing
> the value of this field shows the values growing in colour intensity until the value
> crosses the maximum value set in the SimpleColorMap class constructor.
>
> If the simulation is run, stopped and run again, everything is fine. But if at any
> point the "Show Layers" button is pressed, regardless of whether or not any of
> the checkboxes indicating the layers are checked or unchecked, the simulation
> slows down until the agent field values cross the maximum value. As each agent
> reaches this maximum the simulation starts to speed up again, and once all
> agents have crossed it the simulation runs as normal. It will still do this even
> when it is stopped and restarted again. Simply clicking on that button once will
> have this effect until the whole application is closed down.
>
> Why does clicking on this button have this effect?
|