/** Assigns the ROI at the specified index to the current image. */ public void select(int index) { select(null, index); }
public boolean roiManagerSelect(Roi roi, boolean delete) { RoiManager rm=RoiManager.getInstance(); if (rm==null) return false; int index = rm.getRoiIndex(roi); if (index<0) return false; if (delete) { rm.select(imp, index); rm.runCommand("delete"); } else rm.selectAndMakeVisible(imp, index); return true; }
/** Assigns the ROI at the specified index to the current image. */ public void select(int index) { select(null, index); }
public boolean roiManagerSelect(Roi roi, boolean delete) { RoiManager rm=RoiManager.getInstance(); if (rm==null) return false; int index = rm.getRoiIndex(roi); if (index<0) return false; if (delete) { rm.select(imp, index); rm.runCommand("delete"); } else rm.selectAndMakeVisible(imp, index); return true; }
public void selectAndMakeVisible(ImagePlus imp, int index) { select(imp, index); list.ensureIndexIsVisible(index); }
public void selectAndMakeVisible(ImagePlus imp, int index) { select(imp, index); list.ensureIndexIsVisible(index); }
public void select(int index, boolean shiftKeyDown, boolean altKeyDown) { if (!(shiftKeyDown||altKeyDown)) select(index); ImagePlus imp = IJ.getImage(); if (imp==null) return; Roi previousRoi = imp.getRoi(); if (previousRoi==null) { select(index); return; } Roi.previousRoi = (Roi)previousRoi.clone(); Roi roi = (Roi)rois.get(index); if (roi!=null) { roi.setImage(imp); roi.update(shiftKeyDown, altKeyDown); } }
public void select(int index, boolean shiftKeyDown, boolean altKeyDown) { if (!(shiftKeyDown||altKeyDown)) select(index); ImagePlus imp = IJ.getImage(); if (imp==null) return; Roi previousRoi = imp.getRoi(); if (previousRoi==null) { select(index); return; } Roi.previousRoi = (Roi)previousRoi.clone(); Roi roi = (Roi)rois.get(index); if (roi!=null) { roi.setImage(imp); roi.update(shiftKeyDown, altKeyDown); } }
rm.select(roiIndices.get(0)); IJ.showStatus("1 of 1 Rois selected."); rm.select(roiIndices.get(roiIndex)); IJ.showStatus((roiIndex + 1) + " of " + roiIndices.size() + " Rois selected. Click to cycle..."); rm.select(roiIndices.get(0)); for (int i = 1; i < roiIndices.size(); i++) { rm.select(roiIndices.get(i), true, false);
public void mouseWheelMoved(MouseWheelEvent event) { synchronized(this) { int index = list.getSelectedIndex(); int rot = event.getWheelRotation(); if (rot<-1) rot = -1; if (rot>1) rot = 1; index += rot; if (index<0) index = 0; if (index>=getCount()) index = getCount(); //IJ.log(index+" "+rot); select(index); if (IJ.isWindows()) list.requestFocusInWindow(); if (IJ.isJava18()&&IJ.isMacOSX()) repaint(); } }
public void mouseWheelMoved(MouseWheelEvent event) { synchronized(this) { int index = list.getSelectedIndex(); int rot = event.getWheelRotation(); if (rot<-1) rot = -1; if (rot>1) rot = 1; index += rot; if (index<0) index = 0; if (index>=getCount()) index = getCount(); //IJ.log(index+" "+rot); select(index); if (IJ.isWindows()) list.requestFocusInWindow(); if (IJ.isJava18()&&IJ.isMacOSX()) repaint(); } }