tried it on my dual monitor system, seems to be fixed. ..ede

On 15.11.2016 23:15, jump-pilot-...@lists.sourceforge.net wrote:
> Revision: 5190
>           http://sourceforge.net/p/jump-pilot/code/5190
> Author:   michaudm
> Date:     2016-11-15 22:15:19 +0000 (Tue, 15 Nov 2016)
> Log Message:
> -----------
> Fix #353 Dialogs do not use preferred size on dual screen
> 
> Modified Paths:
> --------------
>     core/trunk/ChangeLog
>     core/trunk/src/com/vividsolutions/jump/workbench/ui/GUIUtil.java
> 
> Modified: core/trunk/ChangeLog
> ===================================================================
> --- core/trunk/ChangeLog      2016-11-15 11:31:49 UTC (rev 5189)
> +++ core/trunk/ChangeLog      2016-11-15 22:15:19 UTC (rev 5190)
> @@ -3,6 +3,9 @@
>  # 2. make sure that lines break at 80 chars for constricted display 
> situations
>  #<-------------------------------- 80 chars 
> ---------------------------------->#
>  
> +2016-11-15 mmichaud <m.michael.mich...@orange.fr>
> +  * Fix #353 Dialogs do not use preferred size on dual screen
> +
>  2016-11-14 mmichaud <m.michael.mich...@orange.fr>
>    * deactivate the misleading disjoint predicate in query and join plugins
>    * #FR 249 - add "intersects interior point" and "interior point intersects"
> 
> Modified: core/trunk/src/com/vividsolutions/jump/workbench/ui/GUIUtil.java
> ===================================================================
> --- core/trunk/src/com/vividsolutions/jump/workbench/ui/GUIUtil.java  
> 2016-11-15 11:31:49 UTC (rev 5189)
> +++ core/trunk/src/com/vividsolutions/jump/workbench/ui/GUIUtil.java  
> 2016-11-15 22:15:19 UTC (rev 5190)
> @@ -388,7 +388,7 @@
>    public static void centre(Component componentToMove,
>        Component componentToCentreOn) {
>      int offset = 30;
> -    Dimension screendim = Toolkit.getDefaultToolkit().getScreenSize();
> +    Dimension screendim = getMultiScreenDimension();
>      Dimension componentToCentreOnSize = componentToCentreOn.getSize();
>      int newx = componentToCentreOn.getX()
>          + ((componentToCentreOnSize.width - componentToMove.getWidth()) / 2);
> @@ -413,6 +413,18 @@
>      componentToMove.setBounds(newx, newy, neww, newh);
>    }
>  
> +  private static Dimension getMultiScreenDimension() {
> +    GraphicsDevice[] gds = 
> GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
> +    int w = 0, h = 0;
> +    for (GraphicsDevice gd : gds) {
> +      Rectangle r = gd.getDefaultConfiguration().getBounds();
> +      if (r.getX()+r.getWidth() > w) w = (int)(r.getX()+r.getWidth());
> +      if (r.getY()+r.getHeight() > h) h = (int)(r.getY()+r.getHeight());
> +      System.out.println(r);
> +    }
> +    return new Dimension(w, h);
> +  }
> +
>    /**
>     * Centres the component on the screen
>     * 
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> 

------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to