[kepler-dev] _windowsProperty x and y checked against screen size

Matt Jones jones at nceas.ucsb.edu
Tue Jun 6 23:15:17 PDT 2006


I think it's a good idea to move the window.  Once you've determined the 
window is offscreen and you're going to move it, moving it so only 10 
pixels show isn't so useful -- why not relocate it to someplace where 
the user can see most of the the window, such as the upper left corner 
of the display?

Matt

Christopher Brooks wrote:
> Hi Dan,
> Good point, we now check for negative values of x and y.  This could
> cause problems with dual monitors, but I feel it is less wrong to
> move the window than it is to have a window that the user cannot
> access at all.
> 
> Let's see how this unfolds.  I'd entertain setting yet another
> property that if set would not change the values. 
> 
> Basically, I'm trying to optimize the experience of the new user who
> gets a model that was created on a machine with a large screen or dual
> monitors.
> 
> _Christopher
> 
> 
> --------
> 
>     Christopher,
>         I have seen the problem with dual monitors also. But I have also 
>     seen the case where the saved window has NEGATIVE locations (i.e. when x 
>     or y is too small rather than too large! (probably due to dual monitors 
>     with primary set to the right) So you might consider tests for that also.
>     
>         And maybe you should lobby for you and Edward to get bigger monitors 
>     ;-)
>     But as can be seen from my comment, that doesn't always help either!
>     
>     Dan
>     
>     Christopher Brooks wrote:
>     > Edward and I have 1024x768 laptops and I've run up against user
>     > submitted models that have the _windowsProperty attribute set
>     > such that the window is placed off the edge of the screen.  
>     >
>     > I think this can also happen when the user has a two headed display.
>     >
>     > The fix is to 
>     > ptolemy/actor/gui/WindowPropertiesAttribute.java
>     >
>     > 175a181,189
>     >   
>     >>             // If x or y is greater than the width or height of the
>     >>             // screen, then offset them by 30 pixels so the user can
>     >>             // drag the window.
>     >>             Toolkit tk = Toolkit.getDefaultToolkit();
>     >>             x = (x > tk.getScreenSize().width
>     >>                     ? tk.getScreenSize().width - 30 : x);
>     >>             y = (y > tk.getScreenSize().height
>     >>                     ? tk.getScreenSize().height - 30 : y);
>     >>
>     >>     
>     >
>     > I'm not sure if this should go into the release branch or not.
>     >
>     > Technically, it is a bug, because it is easy to have a model that will
>     > not appear on the user's screen if the user has a small screen.
>     >
>     > _Christopher
>     > _______________________________________________
>     > Kepler-dev mailing list
>     > Kepler-dev at ecoinformatics.org
>     > http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>     >
>     >   
>     
>     
>     -- 
>     *******************************************************************
>     Dan Higgins                                  higgins at nceas.ucsb.edu
>     http://www.nceas.ucsb.edu/    Ph: 805-893-5127
>     National Center for Ecological Analysis and Synthesis (NCEAS) Marine Scienc
>    e Building - Room 3405
>     Santa Barbara, CA 93195
>     *******************************************************************
>     
> --------
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at ecoinformatics.org
> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
> 


More information about the Kepler-dev mailing list