private Point topleft(final MouseEvent e) { final Point topleft = mtrackj.window().getLocation(); topleft.x += mtrackj.canvas().getX() + e.getX() + 10; topleft.y += mtrackj.canvas().getY() + e.getY() + 10; return topleft; }
/** Converts the specified multi-channel (composite) image to RGB. */ public static void convertToRGB(ImagePlus imp) { if (!imp.isComposite()) throw new IllegalArgumentException("Multi-channel image required"); RGBStackConverter converter = new RGBStackConverter(); ImageWindow win = imp.getWindow(); Point location = null; if (win!=null) { location = win.getLocation(); imp.hide(); } converter.image = imp; converter.run(""); if (win!=null) { ImageWindow.setNextLocation(location); imp.show(); } }
/** Converts an RGB image to a Lab stack. */ public void convertToLab() { if (type!=ImagePlus.COLOR_RGB) throw new IllegalArgumentException("Image must be RGB"); ColorSpaceConverter converter = new ColorSpaceConverter(); ImagePlus imp2 = converter.RGBToLab(imp); Point loc = null; ImageWindow win = imp.getWindow(); if (win!=null) loc = win.getLocation(); ImageWindow.setNextLocation(loc); imp2.show(); imp.hide(); imp2.copyAttributes(imp); imp.changes = false; imp.close(); }
/** Converts the specified multi-channel (composite) image to RGB. */ public static void convertToRGB(ImagePlus imp) { if (!imp.isComposite()) throw new IllegalArgumentException("Multi-channel image required"); RGBStackConverter converter = new RGBStackConverter(); ImageWindow win = imp.getWindow(); Point location = null; if (win!=null) { location = win.getLocation(); imp.hide(); } converter.image = imp; converter.run(""); if (win!=null) { ImageWindow.setNextLocation(location); imp.show(); } }
/** Converts an RGB image to a Lab stack. */ public void convertToLab() { if (type!=ImagePlus.COLOR_RGB) throw new IllegalArgumentException("Image must be RGB"); ColorSpaceConverter converter = new ColorSpaceConverter(); ImagePlus imp2 = converter.RGBToLab(imp); Point loc = null; ImageWindow win = imp.getWindow(); if (win!=null) loc = win.getLocation(); ImageWindow.setNextLocation(loc); imp2.show(); imp.hide(); imp2.copyAttributes(imp); imp.changes = false; imp.close(); }
ImagePlus convertRGBToCompositeImage(ImagePlus imp) { ImageWindow win = imp.getWindow(); Point loc = win!=null?win.getLocation():null; ImagePlus imp2 = new CompositeImage(imp, CompositeImage.COMPOSITE); if (loc!=null) ImageWindow.setNextLocation(loc); imp2.show(); imp.hide(); WindowManager.setCurrentWindow(imp2.getWindow()); return imp2; }
void arrangeWindows(boolean sticky) { ImageWindow xyWin = imp.getWindow(); if (xyWin==null) return; Point loc = xyWin.getLocation(); if ((xyX!=loc.x)||(xyY!=loc.y)) { xyX = loc.x;
void arrangeWindows(boolean sticky) { ImageWindow xyWin = imp.getWindow(); if (xyWin==null) return; Point loc = xyWin.getLocation(); if ((xyX!=loc.x)||(xyY!=loc.y)) { xyX = loc.x;
ImageWindow win = getWindow(); Point loc = null; if (win!=null) loc = win.getLocation(); changes = false; close();
if (imp2!=null) { ImageWindow win = imp2.getWindow(); if (win!=null) loc = win.getLocation(); imp2.changes=false; imp2.close();
void getLocationAndSize() { Variable v1 = getFirstVariable(); Variable v2 = getNextVariable(); Variable v3 = getNextVariable(); Variable v4 = getLastVariable(); ImagePlus imp = getImage(); int x=0, y=0, w=0, h=0; ImageWindow win = imp.getWindow(); if (win!=null) { Point loc = win.getLocation(); Dimension size = win.getSize(); x=loc.x; y=loc.y; w=size.width; h=size.height; } v1.setValue(x); v2.setValue(y); v3.setValue(w); v4.setValue(h); }
void getLocationAndSize() { Variable v1 = getFirstVariable(); Variable v2 = getNextVariable(); Variable v3 = getNextVariable(); Variable v4 = getLastVariable(); ImagePlus imp = getImage(); int x=0, y=0, w=0, h=0; ImageWindow win = imp.getWindow(); if (win!=null) { Point loc = win.getLocation(); Dimension size = win.getSize(); x=loc.x; y=loc.y; w=size.width; h=size.height; } v1.setValue(x); v2.setValue(y); v3.setValue(w); v4.setValue(h); }
if (imp2!=null) { ImageWindow win = imp2.getWindow(); if (win!=null) loc = win.getLocation(); imp2.changes=false; imp2.close();
win.toFront(); IJ.wait(500); Point loc = win.getLocation(); ImageCanvas ic = win.getCanvas(); Rectangle bounds = ic.getBounds();
win.toFront(); IJ.wait(500); Point loc = win.getLocation(); ImageCanvas ic = win.getCanvas(); Rectangle bounds = ic.getBounds();
/** Overrides ImagePlus.show(). */ public void show() { img = ip.createImage(); ImageCanvas ic = new PlotsCanvas(this); win = new ImageWindow(this, ic); IJ.showStatus(""); if (ic.getMagnification()==1.0) return; while(ic.getMagnification()<1.0) ic.zoomIn(0,0); Point loc = win.getLocation(); int w = getWidth()+20; int h = getHeight()+30; Dimension screen = IJ.getScreenSize(); if (loc.x+w>screen.width) w = screen.width-loc.x-20; if (loc.y+h>screen.height) h = screen.height-loc.y-30; win.setSize(w, h); win.validate(); repaintWindow(); }
/** Overrides ImagePlus.show(). */ public void show() { img = ip.createImage(); ImageCanvas ic = new PlotsCanvas(this); win = new ImageWindow(this, ic); IJ.showStatus(""); if (ic.getMagnification()==1.0) return; while(ic.getMagnification()<1.0) ic.zoomIn(0,0); Point loc = win.getLocation(); int w = getWidth()+20; int h = getHeight()+30; Dimension screen = IJ.getScreenSize(); if (loc.x+w>screen.width) w = screen.width-loc.x-20; if (loc.y+h>screen.height) h = screen.height-loc.y-30; win.setSize(w, h); win.validate(); repaintWindow(); }
{xloc = 0; yloc = 0;} if (firstSmallWindow) Prefs.saveLocation(LOC_KEY, getLocation()); WindowManager.removeWindow(this); if (ij!=null && ij.quitting()) // this may help avoid thread deadlocks
private void initiateLocation() { mtrackj.window().getLocation(curwinloc); mtrackj.window().getSize(curwindim);
imp.changes = false; ImageWindow win = imp.getWindow(); Point loc = win!=null?win.getLocation():null; ImagePlus imp2 = new ImagePlus(imp.getTitle(), stack2); imp2.setDimensions(3, n/3, 1);