Create account / Log in

Reremaining tasks for beta3

Topics related to the main Vassal engine.

Moderators: uckelman, Tim M

Reremaining tasks for beta3

Postby Brent Easton » June 3rd, 2008, 6:50 am

* The Server Status pane is always hidden on startup, regardless of
the user's preferences (which I've verified are read correctly).


Ok, Ok, I'll have a look at this one. I have had experience with fixing
prefe
rence weirdness before :)

It has nothing to do with the prefs. I've verified that the values being
retrieved from the prefs are always correct. The problem is with the
ComponentSplitter.

Done (finally!) in swampwallaby-work@3710. For bonus points, I am saving the Module Manager window position, size and the split divider location in prefs.

This was a bugger of thing to fix. To fix the bug where the splitter on the main map was not setting correctly, Rodney was setting the divider location in ComponentSplitter usinf SwingUtilities.invokeLater(). This was causing all sorts of race conditions in the Module Manager assuming the split was there.

The only way I could eventually get this to work was to remove the invokeLater in the SplitPane.hideComponent() method. My testing indicates that this was not needed to fix the original bug, only the ones in showComponent().

Brent.


_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
Brent Easton
 
Posts: 2991
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Reremaining tasks for beta3

Postby uckelman » June 3rd, 2008, 7:47 am

Thus spake "Brent Easton":
* The Server Status pane is always hidden on startup, regardless of
the user's preferences (which I've verified are read correctly).


Ok, Ok, I'll have a look at this one. I have had experience with fixing
prefe
rence weirdness before :)

It has nothing to do with the prefs. I've verified that the values being
retrieved from the prefs are always correct. The problem is with the
ComponentSplitter.

Done (finally!) in swampwallaby-work@3710. For bonus points, I am saving the
Module Manager window position, size and the split divider location in prefs.

Is saving the window position a good idea? Shouldn't your window manager
take care of that?

This was a bugger of thing to fix. To fix the bug where the splitter on the m
ain map was not setting correctly, Rodney was setting the divider location in
ComponentSplitter usinf SwingUtilities.invokeLater(). This was causing all s
orts of race conditions in the Module Manager assuming the split was there.

The only way I could eventually get this to work was to remove the invokeLate
r in the SplitPane.hideComponent() method. My testing indicates that this was
not needed to fix the original bug, only the ones in showComponent().

Thanks very much. I was pretty sure that this wasn't a superficial
problem, as I spent something like six hours on it myself before saying
to hell with it.

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8623
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Reremaining tasks for beta3

Postby Brent Easton » June 3rd, 2008, 11:01 am

Done (finally!) in swampwallaby-work@3710. For bonus points, I am saving
the
Module Manager window position, size and the split divider location in
prefs.

Is saving the window position a good idea? Shouldn't your window manager
take care of that?

I'm saving the Module Manager position when you quit the Module Manager. When you next start it up, it opens the same size, in the same position with the same divider setting. Current behaviour is to reset everything to a standard size.

B.


_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
Brent Easton
 
Posts: 2991
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Reremaining tasks for beta3

Postby tar » June 3rd, 2008, 3:52 pm

On Jun 3, 2008, at 4:00 AM, Brent Easton wrote:

Done (finally!) in swampwallaby-work@3710. For bonus points, I am
saving
the
Module Manager window position, size and the split divider
location in
prefs.

Is saving the window position a good idea? Shouldn't your window
manager
take care of that?

I'm saving the Module Manager position when you quit the Module
Manager. When you next start it up, it opens the same size, in the
same position with the same divider setting. Current behaviour is to
reset everything to a standard size.

Is there a check to make sure that the window is on-screen?
This can be a problem if
1. The user changes screen resolution between runs.
2. A laptop user switches between a larger, external screen and
the smaller, built-in screen.

I'm a fan of remembering the positions and sizes, but there also needs
to be a sanity check in there as well.

Especially for Mac users, it would also be good if the total size of
the window didn't exceed the current screen size (plus an allowance
for the menu bar....), since the resize area is at the bottom left
corner (only!), so if the window is too tall, the only way to resize
it is to use the "zoom" button in the upper left to get the lower
right corner on-screen.

Looking at <http://codeidol.com/java/swing/Transparent-and-Animated-Windows/Slide-Notes-Out-from-the-Taskbar/

I found the following advice:

"The key to figuring out your available space is to get the local
GraphicsEnvironment, which describes the display, and then call
getMaximumWindowBounds( ). This method, introduced in Java 1.4,
returns a Rectangle representing the largest centered Window that
could fit on the display, accounting for objects that intrude on the
display's usable space, like the Windows taskbar or the Mac's
monolithic menu bar"

The site also has some sample code showing an application of this
technique.

It looks like the key call would be:


GraphicsEnvironment
.getLocalGraphicsEnvironment().getMaximumWindowBounds()



_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
tar
 
Posts: 776
Joined: January 2nd, 2008, 6:53 pm
Location: Los Angeles area

Reremaining tasks for beta3

Postby Brent Easton » June 3rd, 2008, 11:08 pm

Hi Jeffrey, Thomas,

Thanks for your input.

The window preference saving uses a standard Vassal class (PositionOption) to save and restore window sizes in Preferences. It already attempted to adjust the window size to the screen size, but did not do a very good job.

I have fixed PositionOption to

a) Ensure the window size is no greater than the desktop size and
b) The entire window is slid over to be completely on the desktop if any part of it is off the desktop.

Thomas, thanks very much for pointer to

GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds()

We has been using

Toolkit.getDefaultToolkit().getScreenSize()

which does not take into account things like toolbars. It can leave windows obscured by the Windows Taskbar for example. Multiple desktops would also potentially cause problems.

Joel, swampwallaby-work@3712 contains this fix.

Jeff wrote:
I really want the same (size storing) feature for the
play window too (at least per module), so if you guys don't get to it first,
I still plan on trying to help.

I guess you mean the main Player window? Individual Map windows already have the save position feature enabled, but they will now take advantage of my changes to PositionOption.

I'll have a look at adding this to PlayerWindow.

Regards,
Brent.


*********** REPLY SEPARATOR ***********

On 3/06/2008 at 8:51 AM Thomas Russ wrote:

On Jun 3, 2008, at 4:00 AM, Brent Easton wrote:

Done (finally!) in swampwallaby-work@3710. For bonus points, I am
saving
the
Module Manager window position, size and the split divider
location in
prefs.

Is saving the window position a good idea? Shouldn't your window
manager
take care of that?

I'm saving the Module Manager position when you quit the Module
Manager. When you next start it up, it opens the same size, in the
same position with the same divider setting. Current behaviour is to
reset everything to a standard size.

Is there a check to make sure that the window is on-screen?
This can be a problem if
1. The user changes screen resolution between runs.
2. A laptop user switches between a larger, external screen and
the smaller, built-in screen.

I'm a fan of remembering the positions and sizes, but there also needs
to be a sanity check in there as well.

Especially for Mac users, it would also be good if the total size of
the window didn't exceed the current screen size (plus an allowance
for the menu bar....), since the resize area is at the bottom left
corner (only!), so if the window is too tall, the only way to resize
it is to use the "zoom" button in the upper left to get the lower
right corner on-screen.

Looking at
<http://codeidol.com/java/swing/Transparent-and-Animated-Windows/Slide-Notes-Out-from-the-Taskbar/

I found the following advice:

"The key to figuring out your available space is to get the local
GraphicsEnvironment, which describes the display, and then call
getMaximumWindowBounds( ). This method, introduced in Java 1.4,
returns a Rectangle representing the largest centered Window that
could fit on the display, accounting for objects that intrude on the
display's usable space, like the Windows taskbar or the Mac's
monolithic menu bar"

The site also has some sample code showing an application of this
technique.

It looks like the key call would be:


GraphicsEnvironment
.getLocalGraphicsEnvironment().getMaximumWindowBounds()



_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org




_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
Brent Easton
 
Posts: 2991
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Reremaining tasks for beta3

Postby uckelman » June 4th, 2008, 8:51 pm

Thus spake Thomas Russ:
Is there a check to make sure that the window is on-screen?
This can be a problem if
1. The user changes screen resolution between runs.
2. A laptop user switches between a larger, external screen and
the smaller, built-in screen.

I'm a fan of remembering the positions and sizes, but there also needs
to be a sanity check in there as well.

There's another problem with remembering window size: You need to check
whether the window is maximized, and only save the size the window
would have unmaximized, but also save a maximized flag. It's going to
be extremely annoying if I quit VASSAL when it's maximized and I then
lose the unmaxized size as a result.

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8623
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Reremaining tasks for beta3

Postby Brent Easton » June 4th, 2008, 9:49 pm

There's another problem with remembering window size: You need to check
whether the window is maximized, and only save the size the window
would have unmaximized, but also save a maximized flag. It's going to
be extremely annoying if I quit VASSAL when it's maximized and I then
lose the unmaxized size as a result.

Can do.

What should the default behaviour on startup be? When you restart Vassal, should the window be maximized again, or should it go back to it's unmaximized size?

My feeling is it should return to the unmaximized size. This is only an issue for the three main windows, all the subsidiary windoes in Vassal do not support maximization.

B.


_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
Brent Easton
 
Posts: 2991
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Reremaining tasks for beta3

Postby Rindis » June 6th, 2008, 4:11 pm

Brent Easton wrote:What should the default behaviour on startup be? When you restart Vassal, should the window be maximized again, or should it go back to it's unmaximized size?

My feeling is it should return to the unmaximized size. This is only an issue for the three main windows, all the subsidiary windoes in Vassal do not support maximization.

If I maximized a window (and left it that way), I would expect it to be maximized the next time I start. This normal program behavior, and Vassal is about the only one I see not doing it.
User avatar
Rindis
 
Posts: 198
Joined: December 22nd, 2007, 12:49 am

Reremaining tasks for beta3

Postby uckelman » June 6th, 2008, 6:55 pm

Thus spake "Rindis":
If I maximized a window (and left it that way), I would expect it to be maxim
ized the next time I start. This normal program behavior, and Vassal is about
the only one I see not doing it.


I concur.

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8623
Joined: December 10th, 2007, 9:48 am
Location: Durham, England


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests