public static Rectangle getMaxWindowBounds() { if (GraphicsEnvironment.isHeadless()) return new Rectangle(0,0,0,0); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Rectangle bounds = ge.getMaximumWindowBounds(); if (IJ.isLinux() && unionOfBounds==null) unionOfBounds = getUnionOfBounds(ge); zeroBasedMaxBounds = null; if (bounds.x>300 || bounds.equals(unionOfBounds)) bounds = getZeroBasedMonitor(ge, bounds); if (bounds.x<0 || bounds.x>300 || bounds.width<300) { Dimension screen = getScreenSize(); bounds = new Rectangle(0, 0, screen.width, screen.height); } if (IJ.debugMode) IJ.log("GUI.getMaxWindowBounds: "+bounds); maxBounds = bounds; return bounds; }
public static Rectangle getMaxWindowBounds() { if (GraphicsEnvironment.isHeadless()) return new Rectangle(0,0,0,0); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Rectangle bounds = ge.getMaximumWindowBounds(); if (IJ.isLinux() && unionOfBounds==null) unionOfBounds = getUnionOfBounds(ge); zeroBasedMaxBounds = null; if (bounds.x>300 || bounds.equals(unionOfBounds)) bounds = getZeroBasedMonitor(ge, bounds); if (bounds.x<0 || bounds.x>300 || bounds.width<300) { Dimension screen = getScreenSize(); bounds = new Rectangle(0, 0, screen.width, screen.height); } if (IJ.debugMode) IJ.log("GUI.getMaxWindowBounds: "+bounds); maxBounds = bounds; return bounds; }
private void listMonitors(GraphicsEnvironment ge, ArrayList list) { int max = 10; String[] str = new String[max]; int n = 0; Rectangle bounds2 = null; GraphicsDevice[] gs = ge.getScreenDevices(); for (int j=0; j<gs.length; j++) { GraphicsDevice gd = gs[j]; GraphicsConfiguration[] gc = gd.getConfigurations(); for (int i=0; i<gc.length; i++) { Rectangle bounds = gc[i].getBounds(); if (bounds!=null && !bounds.equals(bounds2) && n<max) { str[n++] = toString(bounds); bounds2 = bounds; } } } if (n>1) { Rectangle ub = GUI.getUnionOfBounds(); if (ub!=null) list.add(" Union of bounds: " + toString(ub)); for (int i=0; i<n; i++) list.add(" Monitor"+(i+1)+": " + str[i]); } }
private void listMonitors(GraphicsEnvironment ge, ArrayList list) { int max = 10; String[] str = new String[max]; int n = 0; Rectangle bounds2 = null; GraphicsDevice[] gs = ge.getScreenDevices(); for (int j=0; j<gs.length; j++) { GraphicsDevice gd = gs[j]; GraphicsConfiguration[] gc = gd.getConfigurations(); for (int i=0; i<gc.length; i++) { Rectangle bounds = gc[i].getBounds(); if (bounds!=null && !bounds.equals(bounds2) && n<max) { str[n++] = toString(bounds); bounds2 = bounds; } } } if (n>1) { Rectangle ub = GUI.getUnionOfBounds(); if (ub!=null) list.add(" Union of bounds: " + toString(ub)); for (int i=0; i<n; i++) list.add(" Monitor"+(i+1)+": " + str[i]); } }