/** Reloads icon. */
 public void loadSkin() {
   if (messagePanel != null) {
     for (Component component : messagePanel.getComponents()) {
       if (component instanceof ImageCanvas) {
         ImageCanvas cmp = (ImageCanvas) component;
         cmp.setImage(ImageLoader.getImage(ImageLoader.RENAME_DIALOG_ICON));
       }
     }
   }
 }
 /** Sets the color used used for the ROI Manager "Show All" mode. */
 public static void setShowAllColor(Color c) {
   if (c == null) return;
   showAllColor = c;
   labelColor = null;
   ImagePlus img = WindowManager.getCurrentImage();
   if (img != null) {
     ImageCanvas ic = img.getCanvas();
     if (ic != null && ic.getShowAllROIs()) img.draw();
   }
 }
Exemple #3
0
 private boolean deleteOverlayRoi(ImagePlus imp) {
   if (imp == null) return false;
   Overlay overlay = null;
   ImageCanvas ic = imp.getCanvas();
   if (ic != null) overlay = ic.getShowAllList();
   if (overlay == null) overlay = imp.getOverlay();
   if (overlay == null) return false;
   Roi roi = imp.getRoi();
   for (int i = 0; i < overlay.size(); i++) {
     Roi roi2 = overlay.get(i);
     if (roi2 == roi) {
       overlay.remove(i);
       imp.deleteRoi();
       ic = imp.getCanvas();
       if (ic != null) ic.roiManagerSelect(roi, true);
       return true;
     }
   }
   return false;
 }
Exemple #4
0
 private void loadCursors() {
   Toolkit toolkit = Toolkit.getDefaultToolkit();
   String path = Prefs.getImageJDir() + "images/crosshair-cursor.gif";
   File f = new File(path);
   if (!f.exists()) return;
   // Image image = toolkit.getImage(path);
   ImageIcon icon = new ImageIcon(path);
   Image image = icon.getImage();
   if (image == null) return;
   int width = icon.getIconWidth();
   int height = icon.getIconHeight();
   Point hotSpot = new Point(width / 2, height / 2);
   Cursor crosshairCursor = toolkit.createCustomCursor(image, hotSpot, "crosshair-cursor.gif");
   ImageCanvas.setCursor(crosshairCursor, 0);
 }
Exemple #5
0
 public StackWindow(ImagePlus imp, ImageCanvas ic) {
   super(imp, ic);
   addScrollbars(imp);
   addMouseWheelListener(this);
   if (sliceSelector == null && this.getClass().getName().indexOf("Image5D") != -1)
     sliceSelector = new Scrollbar(); // prevents Image5D from crashing
   // IJ.log(nChannels+" "+nSlices+" "+nFrames);
   pack();
   ic = imp.getCanvas();
   if (ic != null) ic.setMaxBounds();
   show();
   int previousSlice = imp.getCurrentSlice();
   if (previousSlice > 1 && previousSlice <= imp.getStackSize()) imp.setSlice(previousSlice);
   else imp.setSlice(1);
   thread = new Thread(this, "zSelector");
   thread.start();
 }