public void mouseReleased(MouseEvent e) { handleMouseUp(e.getX(), e.getY()); }
public void mouseReleased(MouseEvent e) { handleMouseUp(e.getX(), e.getY()); }
protected void handlePopupMenu(MouseEvent e) { if (disablePopupMenu) return; if (IJ.debugMode) IJ.log("show popup: " + (e.isPopupTrigger()?"true":"false")); int x = e.getX(); int y = e.getY(); Roi roi = imp.getRoi(); if (roi!=null && (roi.getType()==Roi.POLYGON || roi.getType()==Roi.POLYLINE || roi.getType()==Roi.ANGLE) && roi.getState()==roi.CONSTRUCTING) { roi.handleMouseUp(x, y); // simulate double-click to finalize roi.handleMouseUp(x, y); // polygon or polyline selection return; } PopupMenu popup = Menus.getPopupMenu(); if (popup!=null) { add(popup); if (IJ.isMacOSX()) IJ.wait(10); popup.show(this, x, y); } }
protected void handlePopupMenu(MouseEvent e) { if (disablePopupMenu) return; if (IJ.debugMode) IJ.log("show popup: " + (e.isPopupTrigger()?"true":"false")); int x = e.getX(); int y = e.getY(); Roi roi = imp.getRoi(); if (roi!=null && (roi.getType()==Roi.POLYGON || roi.getType()==Roi.POLYLINE || roi.getType()==Roi.ANGLE) && roi.getState()==roi.CONSTRUCTING) { roi.handleMouseUp(x, y); // simulate double-click to finalize roi.handleMouseUp(x, y); // polygon or polyline selection return; } PopupMenu popup = Menus.getPopupMenu(); if (popup!=null) { add(popup); if (IJ.isMacOSX()) IJ.wait(10); popup.show(this, x, y); } }
imp.deleteRoi(); else roi.handleMouseUp(e.getX(), e.getY());
imp.deleteRoi(); else roi.handleMouseUp(e.getX(), e.getY());
protected void handleMouseUp(int screenX, int screenY) { super.handleMouseUp(screenX, screenY); if (width<5 && height<5 && imp!=null && previousRoi==null) { int ox = ic!=null?ic.offScreenX(screenX):screenX; int oy = ic!=null?ic.offScreenY(screenY):screenY; TextRoi roi = new TextRoi(ox, oy, line1a); roi.setStrokeColor(Toolbar.getForegroundColor()); roi.firstChar = true; imp.setRoi(roi); return; } else if (firstMouseUp) { updateBounds(null); updateText(); firstMouseUp = false; } if (width<5 || height<5) imp.deleteRoi(); }
protected void handleMouseUp(int screenX, int screenY) { super.handleMouseUp(screenX, screenY); if (width<5 && height<5 && imp!=null && previousRoi==null) { int ox = ic!=null?ic.offScreenX(screenX):screenX; int oy = ic!=null?ic.offScreenY(screenY):screenY; TextRoi roi = new TextRoi(ox, oy, line1a); roi.setStrokeColor(Toolbar.getForegroundColor()); roi.firstChar = true; imp.setRoi(roi); return; } else if (firstMouseUp) { updateBounds(null); updateText(); firstMouseUp = false; } if (width<5 || height<5) imp.deleteRoi(); }