private static Dimension getScreenSize() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] gd = ge.getScreenDevices(); GraphicsConfiguration[] gc = gd[0].getConfigurations(); Rectangle bounds = gc[0].getBounds(); if ((bounds.x==0&&bounds.y==0) || (IJ.isLinux()&&gc.length>1)) return new Dimension(bounds.width, bounds.height); else return Toolkit.getDefaultToolkit().getScreenSize(); }
/** 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)); }
private static Dimension getScreenSize() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] gd = ge.getScreenDevices(); GraphicsConfiguration[] gc = gd[0].getConfigurations(); Rectangle bounds = gc[0].getBounds(); if ((bounds.x==0&&bounds.y==0) || (IJ.isLinux()&&gc.length>1)) return new Dimension(bounds.width, bounds.height); else return Toolkit.getDefaultToolkit().getScreenSize(); }
public void paint(Graphics g) { drawInfo(g); Rectangle r = ic.getBounds(); int extraWidth = MIN_WIDTH - r.width; int extraHeight = MIN_HEIGHT - r.height; if (extraWidth<=0 && extraHeight<=0 && !Prefs.noBorder && !IJ.isLinux()) g.drawRect(r.x-1, r.y-1, r.width+1, r.height+1); }
public void paint(Graphics g) { drawInfo(g); Rectangle r = ic.getBounds(); int extraWidth = MIN_WIDTH - r.width; int extraHeight = MIN_HEIGHT - r.height; if (extraWidth<=0 && extraHeight<=0 && !Prefs.noBorder && !IJ.isLinux()) g.drawRect(r.x-1, r.y-1, r.width+1, r.height+1); }
public void paint(Graphics g) { int x, y; Dimension d = this.getSize(); if (!ij.IJ.isLinux()) setAntialiasedText(g); y = line_ascent + (d.height - num_lines * line_height)/2; for(int i = 0; i < num_lines; i++, y += line_height) { x = margin_width; g.drawString(lines[i], x, y); } }
void setMaxBounds() { if (maxBoundsReset) { maxBoundsReset = false; ImageWindow win = imp.getWindow(); if (win!=null && !IJ.isLinux() && win.maxBounds!=null) { win.setMaximizedBounds(win.maxBounds); win.setMaxBoundsTime = System.currentTimeMillis(); } } }
public void paint( final Graphics g ) { int x, y; final Dimension d = this.getSize(); if ( !ij.IJ.isLinux() ) setAntialiasedText( g ); y = line_ascent + (d.height - num_lines * line_height)/2; for( int i = 0; i < num_lines; i++, y += line_height ) { x = margin_width; g.drawString( lines[ i ], x, y ); } }
public void paint(Graphics g) { int x, y; Dimension d = this.getSize(); if (!ij.IJ.isLinux()) setAntialiasedText(g); y = line_ascent + (d.height - num_lines * line_height)/2; for(int i = 0; i < num_lines; i++, y += line_height) { x = margin_width; g.drawString(lines[i], x, y); } }
void setMaxBounds() { if (maxBoundsReset) { maxBoundsReset = false; ImageWindow win = imp.getWindow(); if (win!=null && !IJ.isLinux() && win.maxBounds!=null) { win.setMaximizedBounds(win.maxBounds); win.setMaxBoundsTime = System.currentTimeMillis(); } } }
private void installation() { String url = IJ.URL+"/docs/install/"; if (IJ.isMacintosh()) url += "osx.html"; else if (IJ.isWindows()) url += "windows.html"; else if (IJ.isLinux()) url += "linux.html"; IJ.runPlugIn("ij.plugin.BrowserLauncher", url); }
private void installation() { String url = IJ.URL+"/docs/install/"; if (IJ.isMacintosh()) url += "osx.html"; else if (IJ.isWindows()) url += "windows.html"; else if (IJ.isLinux()) url += "linux.html"; IJ.runPlugIn("ij.plugin.BrowserLauncher", url); }
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; }
public PlugInFrame(String title) { super(title); enableEvents(AWTEvent.WINDOW_EVENT_MASK); this.title = title; ImageJ ij = IJ.getInstance(); addWindowListener(this); addFocusListener(this); if (IJ.isLinux()) setBackground(ImageJ.backgroundColor); if (ij!=null && !IJ.isMacOSX()) { Image img = ij.getIconImage(); if (img!=null) try {setIconImage(img);} catch (Exception e) {} } }
public PlugInFrame(String title) { super(title); enableEvents(AWTEvent.WINDOW_EVENT_MASK); this.title = title; ImageJ ij = IJ.getInstance(); addWindowListener(this); addFocusListener(this); if (IJ.isLinux()) setBackground(ImageJ.backgroundColor); if (ij!=null && !IJ.isMacOSX()) { Image img = ij.getIconImage(); if (img!=null) try {setIconImage(img);} catch (Exception e) {} } }
/** Converts a 3-slice (hue, saturation, brightness) 8-bit stack to RGB. */ public void convertHSBToRGB() { if (imp.getStackSize()!=3) throw new IllegalArgumentException("3-slice 8-bit stack required"); ImageStack stack = imp.getStack(); byte[] H = (byte[])stack.getPixels(1); byte[] S = (byte[])stack.getPixels(2); byte[] B = (byte[])stack.getPixels(3); int width = imp.getWidth(); int height = imp.getHeight(); imp.trimProcessor(); ColorProcessor cp = new ColorProcessor(width, height); cp.setHSB(H, S, B); imp.setImage(cp.createImage()); imp.killStack(); if (IJ.isLinux()) imp.setTitle(imp.getTitle()); }
public PlugInDialog(String title) { super(IJ.isMacOSX()?IJ.getInstance():null,title); enableEvents(AWTEvent.WINDOW_EVENT_MASK); this.title = title; ImageJ ij = IJ.getInstance(); if (IJ.isMacOSX() && ij!=null) { ij.toFront(); // needed for keyboard shortcuts to work IJ.wait(250); } addWindowListener(this); addFocusListener(this); if (IJ.isLinux()) setBackground(ImageJ.backgroundColor); if (ij!=null && !IJ.isMacOSX()) { Image img = ij.getIconImage(); if (img!=null) try {setIconImage(img);} catch (Exception e) {} } }
public PlugInDialog(String title) { super(IJ.isMacOSX()?IJ.getInstance():null,title); enableEvents(AWTEvent.WINDOW_EVENT_MASK); this.title = title; ImageJ ij = IJ.getInstance(); if (IJ.isMacOSX() && ij!=null) { ij.toFront(); // needed for keyboard shortcuts to work IJ.wait(250); } addWindowListener(this); addFocusListener(this); if (IJ.isLinux()) setBackground(ImageJ.backgroundColor); if (ij!=null && !IJ.isMacOSX()) { Image img = ij.getIconImage(); if (img!=null) try {setIconImage(img);} catch (Exception e) {} } }