public static Rectangle getZeroBasedMaxBounds() { if (maxBounds==null) getMaxWindowBounds(); //if (IJ.debugMode) IJ.log("GUI.getZeroBasedMaxBounds: "+zeroBasedMaxBounds); return zeroBasedMaxBounds; }
public static Rectangle getUnionOfBounds() { if (unionOfBounds==null) getMaxWindowBounds(); return unionOfBounds; }
public static Rectangle getZeroBasedMaxBounds() { if (maxBounds==null) getMaxWindowBounds(); //if (IJ.debugMode) IJ.log("GUI.getZeroBasedMaxBounds: "+zeroBasedMaxBounds); return zeroBasedMaxBounds; }
public static Rectangle getUnionOfBounds() { if (unionOfBounds==null) getMaxWindowBounds(); return unionOfBounds; }
/** Called once when ImageJ quits. */ public void savePreferences(Properties prefs) { Point loc = getLocation(); if (IJ.isLinux()) { Rectangle bounds = GUI.getMaxWindowBounds(); loc.y = bounds.y; } prefs.put(IJ_X, Integer.toString(loc.x)); prefs.put(IJ_Y, Integer.toString(loc.y)); }
/** Called once when ImageJ quits. */ public void savePreferences(Properties prefs) { Point loc = getLocation(); if (IJ.isLinux()) { Rectangle bounds = GUI.getMaxWindowBounds(); loc.y = bounds.y; } prefs.put(IJ_X, Integer.toString(loc.x)); prefs.put(IJ_Y, Integer.toString(loc.y)); }
Rectangle getMaxWindow(int xloc, int yloc) { Rectangle bounds = GUI.getMaxWindowBounds(); if (xloc>bounds.x+bounds.width || yloc>bounds.y+bounds.height) { Rectangle bounds2 = getSecondaryMonitorBounds(xloc, yloc); if (bounds2!=null) return bounds2; } Dimension ijSize = ij!=null?ij.getSize():new Dimension(0,0); if (bounds.height>600) { bounds.y += ijSize.height; bounds.height -= ijSize.height; } return bounds; }
Rectangle getMaxWindow(int xloc, int yloc) { Rectangle bounds = GUI.getMaxWindowBounds(); if (xloc>bounds.x+bounds.width || yloc>bounds.y+bounds.height) { Rectangle bounds2 = getSecondaryMonitorBounds(xloc, yloc); if (bounds2!=null) return bounds2; } Dimension ijSize = ij!=null?ij.getSize():new Dimension(0,0); if (bounds.height>600) { bounds.y += ijSize.height; bounds.height -= ijSize.height; } return bounds; }
public Point getPreferredLocation() { Rectangle maxBounds = GUI.getMaxWindowBounds(); int ijX = Prefs.getInt(IJ_X,-99); int ijY = Prefs.getInt(IJ_Y,-99); //System.out.println("getPreferredLoc1: "+ijX+" "+ijY+" "+maxBounds); if (ijX>=maxBounds.x && ijY>=maxBounds.y && ijX<(maxBounds.x+maxBounds.width-75)) return new Point(ijX, ijY); Dimension tbsize = toolbar.getPreferredSize(); int ijWidth = tbsize.width+10; double percent = maxBounds.width>832?0.8:0.9; ijX = (int)(percent*(maxBounds.width-ijWidth)); if (ijX<10) ijX = 10; return new Point(ijX, maxBounds.y); }
/** Positions the specified window in the center of the screen. */ public static void center(Window win) { if (win==null) return; Rectangle bounds = getMaxWindowBounds(); Dimension window= win.getSize(); if (window.width==0) return; int left = bounds.x + (bounds.width-window.width)/2; if (left<bounds.x) left=bounds.x; int top = bounds.y + (bounds.height-window.height)/4; if (top<bounds.y) top=bounds.y; win.setLocation(left, top); }
public Point getPreferredLocation() { Rectangle maxBounds = GUI.getMaxWindowBounds(); int ijX = Prefs.getInt(IJ_X,-99); int ijY = Prefs.getInt(IJ_Y,-99); //System.out.println("getPreferredLoc1: "+ijX+" "+ijY+" "+maxBounds); if (ijX>=maxBounds.x && ijY>=maxBounds.y && ijX<(maxBounds.x+maxBounds.width-75)) return new Point(ijX, ijY); Dimension tbsize = toolbar.getPreferredSize(); int ijWidth = tbsize.width+10; double percent = maxBounds.width>832?0.8:0.9; ijX = (int)(percent*(maxBounds.width-ijWidth)); if (ijX<10) ijX = 10; return new Point(ijX, maxBounds.y); }
/** Positions the specified window in the center of the screen. */ public static void center(Window win) { if (win==null) return; Rectangle bounds = getMaxWindowBounds(); Dimension window= win.getSize(); if (window.width==0) return; int left = bounds.x + (bounds.width-window.width)/2; if (left<bounds.x) left=bounds.x; int top = bounds.y + (bounds.height-window.height)/4; if (top<bounds.y) top=bounds.y; win.setLocation(left, top); }
public Rectangle getMaximumBounds() { Rectangle maxWindow = GUI.getMaxWindowBounds(); if (imp==null) return maxWindow;
public Rectangle getMaximumBounds() { Rectangle maxWindow = GUI.getMaxWindowBounds(); if (imp==null) return maxWindow;
list.add(" Screen size: " + d.width + "x" + d.height); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); String b1 = toString(GUI.getMaxWindowBounds()); String b2 = toString(ge.getMaximumWindowBounds()); if (!b2.equals(b1))
list.add(" Screen size: " + d.width + "x" + d.height); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); String b1 = toString(GUI.getMaxWindowBounds()); String b2 = toString(ge.getMaximumWindowBounds()); if (!b2.equals(b1))
String options = IJ.macroRunning()?Macro.getOptions():null; boolean legacyMacro = areaSelection && options!=null && options.contains("x=") && !options.contains("width="); Rectangle bounds = GUI.getMaxWindowBounds(); boolean smallImage = mag>1.0 && width*mag<bounds.width && height*mag<bounds.height; if ((areaSelection||smallImage||srcWidth!=srcRect.width||srcHeight!=srcRect.height) && !legacyMacro) {
String options = IJ.macroRunning()?Macro.getOptions():null; boolean legacyMacro = areaSelection && options!=null && options.contains("x=") && !options.contains("width="); Rectangle bounds = GUI.getMaxWindowBounds(); boolean smallImage = mag>1.0 && width*mag<bounds.width && height*mag<bounds.height; if ((areaSelection||smallImage||srcWidth!=srcRect.width||srcHeight!=srcRect.height) && !legacyMacro) {
Prefs.useJFileChooser = true; } else if (IJ.isMacOSX()) { Rectangle maxBounds = GUI.getMaxWindowBounds(); if (loc.x+size.width>maxBounds.x+maxBounds.width) setLocation(loc.x, loc.y);
Prefs.useJFileChooser = true; } else if (IJ.isMacOSX()) { Rectangle maxBounds = GUI.getMaxWindowBounds(); if (loc.x+size.width>maxBounds.x+maxBounds.width) setLocation(loc.x, loc.y);