private void removeListeners() { if (srcImp==null) return; ImagePlus.removeImageListener(this); Roi.removeRoiListener(this); if (live!=null) { Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.PLAIN, font.getSize())); live.setForeground(Color.black); } }
private void removeListeners() { if (srcImp==null) return; ImagePlus.removeImageListener(this); Roi.removeRoiListener(this); if (live!=null) { Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.PLAIN, font.getSize())); live.setForeground(Color.black); } }
private void disableLivePlot() { if (IJ.debugMode) IJ.log("PlotWindow.disableLivePlot: "+srcImp); if (srcImp==null) return; if (bgThread!=null) bgThread.interrupt(); bgThread = null; ImagePlus.removeImageListener(this); Roi.removeRoiListener(this); if (live != null) { Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.PLAIN, font.getSize())); live.setForeground(Color.black); } }
private void disableLivePlot() { if (IJ.debugMode) IJ.log("PlotWindow.disableLivePlot: "+srcImp); if (srcImp==null) return; if (bgThread!=null) bgThread.interrupt(); bgThread = null; ImagePlus.removeImageListener(this); Roi.removeRoiListener(this); if (live != null) { Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.PLAIN, font.getSize())); live.setForeground(Color.black); } }
public void eventOccurred(int eventID) { switch (eventID) { case IJEventListener.FOREGROUND_COLOR_CHANGED: String c = Integer.toHexString(Toolbar.getForegroundColor().getRGB()); c = "#"+c.substring(2); IJ.log("Changed foreground color to "+c); break; case IJEventListener.BACKGROUND_COLOR_CHANGED: c = Integer.toHexString(Toolbar.getBackgroundColor().getRGB()); c = "#"+c.substring(2); IJ.log("Changed background color to "+c); break; case IJEventListener.TOOL_CHANGED: String name = IJ.getToolName(); IJ.log("Switched to the "+name+(name.endsWith("Tool")?"":" tool")); break; case IJEventListener.COLOR_PICKER_CLOSED: IJ.log("Color picker closed"); break; case IJEventListener.LOG_WINDOW_CLOSED: IJ.removeEventListener(this); Executer.removeCommandListener(this); ImagePlus.removeImageListener(this); Roi.removeRoiListener(this); IJ.showStatus("Log window closed; EventListener stopped"); break; } }
public void eventOccurred(int eventID) { switch (eventID) { case IJEventListener.FOREGROUND_COLOR_CHANGED: String c = Integer.toHexString(Toolbar.getForegroundColor().getRGB()); c = "#"+c.substring(2); IJ.log("Changed foreground color to "+c); break; case IJEventListener.BACKGROUND_COLOR_CHANGED: c = Integer.toHexString(Toolbar.getBackgroundColor().getRGB()); c = "#"+c.substring(2); IJ.log("Changed background color to "+c); break; case IJEventListener.TOOL_CHANGED: String name = IJ.getToolName(); IJ.log("Switched to the "+name+(name.endsWith("Tool")?"":" tool")); break; case IJEventListener.COLOR_PICKER_CLOSED: IJ.log("Color picker closed"); break; case IJEventListener.LOG_WINDOW_CLOSED: IJ.removeEventListener(this); Executer.removeCommandListener(this); ImagePlus.removeImageListener(this); Roi.removeRoiListener(this); IJ.showStatus("Log window closed; EventListener stopped"); break; } }
/** * Called at the beginning of the process to know if the plugin can be run * with current image, and at the end to finalize. */ public int setup(String arg, ImagePlus imp) { if( null == imp ) return DONE; // Special case of plugin called to finalize the process if ( arg.equals("final") ) { // replace the preview image by the original image imagePlus.setProcessor( baseImage ); imagePlus.draw(); if( null != result ) { // Create a new ImagePlus with the filter result String newName = createResultImageName( imagePlus ); ImagePlus resPlus = new ImagePlus( newName, result ); resPlus.copyScale( imagePlus ); resPlus.show(); } Roi.removeRoiListener( listener ); return DONE; } return flags; }
/** * Called at the beginning of the process to know if the plugin can be run * with current image, and at the end to finalize. */ public int setup( String arg, ImagePlus imp ) { if( null == imp ) return DONE; // Special case of plugin called to finalize the process if ( arg.equals("final") ) { // replace the preview image by the original image imagePlus.setProcessor( baseImage ); imagePlus.draw(); if( null != result ) { // Create a new ImagePlus with the filter result String newName = createResultImageName( imagePlus ); ImagePlus resPlus = new ImagePlus( newName, result ); resPlus.copyScale( imagePlus ); resPlus.show(); } Roi.removeRoiListener( listener ); return DONE; } return flags; }