/** Redisplays the (x,y) coordinates and pixel value (which may have changed) in the status bar. Called by the Next Slice and Previous Slice commands to update the z-coordinate and pixel value. */ public void updateStatusbarValue() { IJ.showStatus(getLocationAsString(savex,savey) + getValueAsString(savex,savey)); }
/** Redisplays the (x,y) coordinates and pixel value (which may have changed) in the status bar. Called by the Next Slice and Previous Slice commands to update the z-coordinate and pixel value. */ public void updateStatusbarValue() { IJ.showStatus(getLocationAsString(savex,savey) + getValueAsString(savex,savey)); }
private void updateCrosses(int x, int y, double arat, double brat) { Point p; int z=imp.getNSlices(); int zlice=imp.getSlice()-1; int zcoord=(int)Math.round(arat*zlice); if (flipXZ) zcoord = (int)Math.round(arat*(z-zlice)); ImageCanvas xzCanvas = xz_image.getCanvas(); p=new Point (x, zcoord); GeneralPath path = new GeneralPath(); drawCross(xz_image, p, path); if (!done) xz_image.setOverlay(path, color, new BasicStroke(1)); if (rotateYZ) { if (flipXZ) zcoord=(int)Math.round(brat*(z-zlice)); else zcoord=(int)Math.round(brat*(zlice)); p=new Point (y, zcoord); } else { zcoord=(int)Math.round(arat*zlice); p=new Point (zcoord, y); } path = new GeneralPath(); drawCross(yz_image, p, path); if (!done) yz_image.setOverlay(path, color, new BasicStroke(1)); IJ.showStatus(imp.getLocationAsString(crossLoc.x, crossLoc.y)); }
private void updateCrosses(int x, int y, double arat, double brat) { Point p; int z=imp.getNSlices(); int zlice=imp.getSlice()-1; int zcoord=(int)Math.round(arat*zlice); if (flipXZ) zcoord = (int)Math.round(arat*(z-zlice)); ImageCanvas xzCanvas = xz_image.getCanvas(); p=new Point (x, zcoord); GeneralPath path = new GeneralPath(); drawCross(xz_image, p, path); if (!done) xz_image.setOverlay(path, color, new BasicStroke(1)); if (rotateYZ) { if (flipXZ) zcoord=(int)Math.round(brat*(z-zlice)); else zcoord=(int)Math.round(brat*(zlice)); p=new Point (y, zcoord); } else { zcoord=(int)Math.round(arat*zlice); p=new Point (zcoord, y); } path = new GeneralPath(); drawCross(yz_image, p, path); if (!done) yz_image.setOverlay(path, color, new BasicStroke(1)); IJ.showStatus(imp.getLocationAsString(crossLoc.x, crossLoc.y)); }
/** Displays the cursor coordinates and pixel value in the status bar. Called by ImageCanvas when the mouse moves. Can be overridden by ImagePlus subclasses. */ public void mouseMoved(int x, int y) { Roi roi2 = getRoi(); if (ij!=null && (roi2==null || roi2.getState()==Roi.NORMAL)) ij.showStatus(getLocationAsString(x,y) + getValueAsString(x,y)); savex=x; savey=y; }
/** Displays the cursor coordinates and pixel value in the status bar. Called by ImageCanvas when the mouse moves. Can be overridden by ImagePlus subclasses. */ public void mouseMoved(int x, int y) { Roi roi2 = getRoi(); if (ij!=null && (roi2==null || roi2.getState()==Roi.NORMAL)) ij.showStatus(getLocationAsString(x,y) + getValueAsString(x,y)); savex=x; savey=y; }
/** * Method mouse moved, show the coordinates of the mouse pointer. * * @param e mouse event */ public void mouseMoved (final MouseEvent e) { setControl(); final int x = mainImp.getWindow().getCanvas().offScreenX(e.getX()); final int y = mainImp.getWindow().getCanvas().offScreenY(e.getY()); IJ.showStatus(mainImp.getLocationAsString(x, y) + getValueAsString(x, y)); } /* end mouseMoved */
public void showStatus() { IJ.showStatus(imp.getLocationAsString(x2,y2)+", angle=" + IJ.d2s(getAngle()) + ", length=" + IJ.d2s(getLength())); }
public void showStatus() { IJ.showStatus(imp.getLocationAsString(x2,y2)+", angle=" + IJ.d2s(getAngle()) + ", length=" + IJ.d2s(getLength())); }
int ox = ic!=null?ic.offScreenX(sx):sx; int oy = ic!=null?ic.offScreenY(sy):sy; IJ.showStatus(imp.getLocationAsString(ox,oy) + length + angle);
int ox = ic!=null?ic.offScreenX(sx):sx; int oy = ic!=null?ic.offScreenY(sy):sy; IJ.showStatus(imp.getLocationAsString(ox,oy) + length + angle);
public void showStatus() { if (imp==null) return; String value; if (state!=CONSTRUCTING && (type==RECTANGLE||type==POINT) && width<=25 && height<=25) { ImageProcessor ip = imp.getProcessor(); double v = ip.getPixelValue(x,y); int digits = (imp.getType()==ImagePlus.GRAY8||imp.getType()==ImagePlus.GRAY16)?0:2; value = ", value="+IJ.d2s(v,digits); } else value = ""; Calibration cal = imp.getCalibration(); String size; if (cal.scaled()) size = ", w="+IJ.d2s(width*cal.pixelWidth)+" ("+width+"), h="+IJ.d2s(height*cal.pixelHeight)+" ("+height+")"; else size = ", w="+width+", h="+height; IJ.showStatus(imp.getLocationAsString(x,y)+size+value); }
public void showStatus() { if (imp==null) return; String value; if (state!=CONSTRUCTING && (type==RECTANGLE||type==POINT) && width<=25 && height<=25) { ImageProcessor ip = imp.getProcessor(); double v = ip.getPixelValue(x,y); int digits = (imp.getType()==ImagePlus.GRAY8||imp.getType()==ImagePlus.GRAY16)?0:2; value = ", value="+IJ.d2s(v,digits); } else value = ""; Calibration cal = imp.getCalibration(); String size; if (cal.scaled()) size = ", w="+IJ.d2s(width*cal.pixelWidth)+" ("+width+"), h="+IJ.d2s(height*cal.pixelHeight)+" ("+height+")"; else size = ", w="+width+", h="+height; IJ.showStatus(imp.getLocationAsString(x,y)+size+value); }
protected void moveHandle(int sx, int sy) { if (clipboard!=null) return; int ox = ic.offScreenX(sx); int oy = ic.offScreenY(sy); if (xpf!=null) { double offset = getOffset(-0.5); double xbase = getXBase(); double ybase = getYBase(); xpf[activeHandle] = (float)(ic.offScreenXD(sx)-xbase+offset); ypf[activeHandle] = (float)(ic.offScreenYD(sy)-ybase+offset); } else { xp[activeHandle] = ox-x; yp[activeHandle] = oy-y; } if (xSpline!=null) { fitSpline(splinePoints); imp.draw(); } else { if (!subPixelResolution() || (type==POINT&&nPoints==1)) resetBoundingRect(); if (type==POINT && width==0 && height==0) {width=1; height=1;} updateClipRectAndDraw(); } String angle = type==ANGLE?getAngleAsString():""; IJ.showStatus(imp.getLocationAsString(ox,oy) + angle); }
protected void moveHandle(int sx, int sy) { if (clipboard!=null) return; int ox = ic.offScreenX(sx); int oy = ic.offScreenY(sy); if (xpf!=null) { double offset = getOffset(-0.5); double xbase = getXBase(); double ybase = getYBase(); xpf[activeHandle] = (float)(ic.offScreenXD(sx)-xbase+offset); ypf[activeHandle] = (float)(ic.offScreenYD(sy)-ybase+offset); } else { xp[activeHandle] = ox-x; yp[activeHandle] = oy-y; } if (xSpline!=null) { fitSpline(splinePoints); imp.draw(); } else { if (!subPixelResolution() || (type==POINT&&nPoints==1)) resetBoundingRect(); if (type==POINT && width==0 && height==0) {width=1; height=1;} updateClipRectAndDraw(); } String angle = type==ANGLE?getAngleAsString():""; IJ.showStatus(imp.getLocationAsString(ox,oy) + angle); }