protected void unregisterTool(ImageCanvas canvas) { if (canvas == null) return; if (mouseProxy != null) canvas.removeMouseListener(mouseProxy); if (mouseMotionProxy != null) // we leave the ijMouseMotionProxy in because it might be required by another active custom tool canvas.removeMouseMotionListener(mouseMotionProxy); if (mouseWheelProxy != null) canvas.removeMouseWheelListener(mouseWheelProxy); if (keyProxy != null) // we leave the ijKeyProxy in because it might be required by another active custom tool canvas.removeKeyListener(keyProxy); }
private void removeListeners() { //IJ.log("removeListeners"); if(srcImp == null) { return; } ImageCanvas canvas = srcImp.getCanvas(); canvas.removeMouseListener(this); canvas.removeMouseMotionListener(this); canvas.removeKeyListener(this); ImagePlus.removeImageListener(this); Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.PLAIN, font.getSize())); live.setForeground(Color.black); }
/** Remove "this" object as mouse listener and mouse motion * listener from the window with ID I. */ private void removeWindow(Integer I) { ImagePlus imp; ImageWindow iw; ImageCanvas ic; imp = WindowManager.getImage(I.intValue()); if (imp != null) { iw = imp.getWindow(); if (iw != null) { ic = iw.getCanvas(); if (ic != null) { ic.removeMouseListener(this); ic.removeMouseMotionListener(this); // Repaint to get rid of sync indicator. ic.paint(ic.getGraphics()); } } } }
/** Remove "this" object as mouse listener and mouse motion * listener from the window with ID I. */ private void removeWindow(Integer I) { ImagePlus imp; ImageWindow iw; ImageCanvas ic; imp = WindowManager.getImage(I.intValue()); if (imp != null) { iw = imp.getWindow(); if (iw != null) { ic = iw.getCanvas(); if (ic != null) { ic.removeMouseListener(this); ic.removeMouseMotionListener(this); // Repaint to get rid of sync indicator. ic.paint(ic.getGraphics()); } } } }
protected final void close( final Frame parent, final SliceObserver sliceObserver, final ImagePlus imp, final RoiListener roiListener ) { if ( parent != null ) parent.dispose(); if ( sliceObserver != null ) sliceObserver.unregister(); if ( imp != null ) { if ( roiListener != null ) imp.getCanvas().removeMouseListener( roiListener ); imp.getOverlay().clear(); imp.updateAndDraw(); } isFinished = true; }
@Override public void keyPressed( final KeyEvent e) { if ( e.getKeyCode() == KeyEvent.VK_ESCAPE ) { if ( imp1 != null ) { imp1.getCanvas().removeMouseListener( this ); imp1.getCanvas().removeKeyListener( this ); imp1.getCanvas().setDisplayList( null ); imp1.setRoi( ( Roi )null ); } if ( impFeature1 != null ) impFeature1.close(); if ( imp2 != null ) { imp2.getCanvas().removeMouseListener( this ); imp2.getCanvas().removeKeyListener( this ); imp2.getCanvas().setDisplayList( null ); imp2.setRoi( ( Roi )null ); } if ( impFeature2 != null ) impFeature2.close(); } else if ( ( e.getKeyCode() == KeyEvent.VK_F1 ) && ( e.getSource() instanceof TextField ) ){} }
@Override public void keyPressed( final KeyEvent e) { if ( e.getKeyCode() == KeyEvent.VK_ESCAPE ) { if ( imp1 != null ) { imp1.getCanvas().removeMouseListener( this ); imp1.getCanvas().removeKeyListener( this ); imp1.getCanvas().setDisplayList( null ); imp1.setRoi( ( Roi )null ); } if ( impFeature1 != null ) impFeature1.close(); if ( imp2 != null ) { imp2.getCanvas().removeMouseListener( this ); imp2.getCanvas().removeKeyListener( this ); imp2.getCanvas().setDisplayList( null ); imp2.setRoi( ( Roi )null ); } if ( impFeature2 != null ) impFeature2.close(); } else if ( ( e.getKeyCode() == KeyEvent.VK_F1 ) && ( e.getSource() instanceof TextField ) ){} }
if ( imp != null ) imp.getCanvas().removeMouseListener( this ); imp.getCanvas().removeMouseMotionListener( this ); imp.getCanvas().removeKeyListener( this );
if ( imp != null ) imp.getCanvas().removeMouseListener( this ); imp.getCanvas().removeMouseMotionListener( this ); imp.getCanvas().removeKeyListener( this );
/** * Kill listeners. */ public void killListeners () { if(imp != null) { final ImageWindow iw = imp.getWindow(); if(null != iw) { final ImageCanvas ic = iw.getCanvas(); ic.removeKeyListener(pa); ic.removeMouseListener(pa); ic.removeMouseMotionListener(pa); ic.addMouseMotionListener(ic); ic.addMouseListener(ic); ic.addKeyListener(IJ.getInstance()); } } } /* end killListeners */
if ( imp != null ) imp.getCanvas().removeMouseListener( this ); imp.getCanvas().removeMouseMotionListener( this ); imp.getCanvas().removeKeyListener( this );
public ImageCanvas3D(final int width, final int height, final UIAdapter uia) { super(SimpleUniverse.getPreferredConfiguration()); this.ui = uia; setPreferredSize(new Dimension(width, height)); final ByteProcessor ip = new ByteProcessor(width, height); roiImagePlus = new RoiImagePlus("RoiImage", ip); roiImageCanvas = new ImageCanvas(roiImagePlus) { /* prevent ROI to enlarge/move on mouse click */ @Override public void mousePressed(final MouseEvent e) { if (!ui.isMagnifierTool() && !ui.isPointTool()) super.mousePressed(e); } }; roiImageCanvas.removeKeyListener(ij.IJ.getInstance()); roiImageCanvas.removeMouseListener(roiImageCanvas); roiImageCanvas.removeMouseMotionListener(roiImageCanvas); roiImageCanvas.disablePopupMenu(true); background = new Background(new Color3f(UniverseSettings.defaultBackground)); background.setCapability(Background.ALLOW_COLOR_WRITE); addListeners(); }
if ( imp != null ) imp.getCanvas().removeMouseListener( this ); imp.getCanvas().removeMouseMotionListener( this ); imp.getCanvas().removeKeyListener( this );
canvas.removeMouseListener(this); canvas.removeMouseMotionListener(this); canvas.removeKeyListener(this); if (ic!=null) { ic.removeKeyListener(this); ic.removeMouseListener(this); ic.removeMouseMotionListener(this); ic.setCustomRoi(false); if (ic!=null) { ic.removeKeyListener(this); ic.removeMouseListener(this); ic.removeMouseMotionListener(this); ic.setCustomRoi(false);
canvas.removeMouseListener(this); canvas.removeMouseMotionListener(this); canvas.removeKeyListener(this); if (ic!=null) { ic.removeKeyListener(this); ic.removeMouseListener(this); ic.removeMouseMotionListener(this); ic.setCustomRoi(false); if (ic!=null) { ic.removeKeyListener(this); ic.removeMouseListener(this); ic.removeMouseMotionListener(this); ic.setCustomRoi(false);
final StackWindow stack = new StackWindow(imp); final MouseListener[] ml = stack.getCanvas().getMouseListeners(); for (final MouseListener m : ml) stack.getCanvas().removeMouseListener(m); stack.getCanvas().addMouseListener(new MouseAdapter() { @Override
canvas.removeMouseListener(this); islistening=false; islisteningRef=false; Nbtrack++; img.setRoi(roi); canvas.removeMouseListener(this); islistening=false; checkCent.setState(false);
iw.addKeyListener(pa); ic.removeMouseMotionListener(ic); ic.removeMouseListener(ic); ic.removeKeyListener(IJ.getInstance()); ic.addKeyListener(pa);
canvas.removeKeyListener(IJ.getInstance()); canvas.removeMouseMotionListener(canvas); canvas.removeMouseListener(canvas); logok();
canvas.removeKeyListener(handler); canvas.removeMouseMotionListener(handler); canvas.removeMouseListener(handler);