private void addImageListeners() { imp.addImageListener(this); ImageWindow win = imp.getWindow(); if (win == null) close(); canvas = win.getCanvas(); canvas.addKeyListener(this); }
private void addImageListeners() { imp.addImageListener(this); ImageWindow win = imp.getWindow(); if (win == null) close(); canvas = win.getCanvas(); canvas.addKeyListener(this); }
private void createListeners() { //IJ.log("createListeners"); if(srcImp == null) { return; } ImageCanvas canvas = srcImp.getCanvas(); if(canvas == null) { return; } canvas.addMouseListener(this); canvas.addMouseMotionListener(this); canvas.addKeyListener(this); ImagePlus.addImageListener(this); Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.BOLD, font.getSize())); live.setForeground(Color.red); }
public ImageCanvas(ImagePlus imp) { this.imp = imp; paintPending = new AtomicBoolean(false); ij = IJ.getInstance(); int width = imp.getWidth(); int height = imp.getHeight(); imageWidth = width; imageHeight = height; srcRect = new Rectangle(0, 0, imageWidth, imageHeight); setSize(imageWidth, imageHeight); magnification = 1.0; addMouseListener(this); addMouseMotionListener(this); addKeyListener(ij); // ImageJ handles keyboard shortcuts setFocusTraversalKeysEnabled(false); //setScaleToFit(true); }
public ImageCanvas(ImagePlus imp) { this.imp = imp; paintPending = new AtomicBoolean(false); ij = IJ.getInstance(); int width = imp.getWidth(); int height = imp.getHeight(); imageWidth = width; imageHeight = height; srcRect = new Rectangle(0, 0, imageWidth, imageHeight); setSize(imageWidth, imageHeight); magnification = 1.0; addMouseListener(this); addMouseMotionListener(this); addKeyListener(ij); // ImageJ handles keyboard shortcuts setFocusTraversalKeysEnabled(false); //setScaleToFit(true); }
private void addListeners(ImageCanvas canvas) { canvas.addMouseListener(this); canvas.addMouseMotionListener(this); canvas.addKeyListener(this); win.addWindowListener (this); win.addMouseWheelListener(this); win.addFocusListener(this); ImagePlus.addImageListener(this); Executer.addCommandListener(this); }
private void addListeners(ImageCanvas canvas) { canvas.addMouseListener(this); canvas.addMouseMotionListener(this); canvas.addKeyListener(this); win.addWindowListener (this); win.addMouseWheelListener(this); win.addFocusListener(this); ImagePlus.addImageListener(this); Executer.addCommandListener(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 */
imp.getCanvas().addKeyListener( this );
imp.getCanvas().addKeyListener( this );
imp1.getCanvas().addKeyListener( this ); imp2.getCanvas().addKeyListener( this ); ImagePlus.addImageListener( this );
@Override public void run( final String arg ) { /* cleanup */ m.clear(); imp = IJ.getImage(); target = imp.getProcessor(); source = target.duplicate(); source.setInterpolationMethod( ImageProcessor.BILINEAR ); init(); createMapping(); painter = new MappingThread( imp, source, target, pleaseRepaint, mapping, interpolate ); painter.start(); Toolbar.getInstance().setTool( Toolbar.getInstance().addTool( "Add_and_drag_handles." ) ); imp.getCanvas().addMouseListener( this ); imp.getCanvas().addMouseMotionListener( this ); imp.getCanvas().addKeyListener( this ); imp.getWindow().addKeyListener( this ); IJ.getInstance().addKeyListener( this ); }
imp.getCanvas().addKeyListener( this );
imp.getCanvas().addKeyListener( this );
@Override public void run( final String arg ) { /* cleanup */ m.clear(); imp = IJ.getImage(); target = imp.getProcessor(); source = target.duplicate(); source.setInterpolationMethod( ImageProcessor.BILINEAR ); init(); createMapping(); painter = new MappingThread( imp, source, target, pleaseRepaint, mapping, interpolate ); painter.start(); Toolbar.getInstance().setTool( Toolbar.getInstance().addTool( "Add_and_drag_handles." ) ); imp.getCanvas().addMouseListener( this ); imp.getCanvas().addMouseMotionListener( this ); imp.getCanvas().addKeyListener( this ); imp.getWindow().addKeyListener( this ); IJ.getInstance().addKeyListener( this ); }
ic.removeMouseListener(ic); ic.removeKeyListener(IJ.getInstance()); ic.addKeyListener(pa); ic.addMouseListener(pa); ic.addMouseMotionListener(pa);
yz_image.show(); ImageCanvas ic = yz_image.getCanvas(); ic.addKeyListener(this); ic.addMouseListener(this); ic.addMouseMotionListener(this); xz_image.show(); ImageCanvas ic = xz_image.getCanvas(); ic.addKeyListener(this); ic.addMouseListener(this); ic.addMouseMotionListener(this);
yz_image.show(); ImageCanvas ic = yz_image.getCanvas(); ic.addKeyListener(this); ic.addMouseListener(this); ic.addMouseMotionListener(this); xz_image.show(); ImageCanvas ic = xz_image.getCanvas(); ic.addKeyListener(this); ic.addMouseListener(this); ic.addMouseMotionListener(this);
window.addKeyListener(handler); window.addMouseWheelListener(handler); canvas.addKeyListener(handler); canvas.addMouseMotionListener(handler); canvas.addMouseListener(handler);
canvas.addKeyListener(IJ.getInstance()); canvas.addMouseMotionListener(canvas); canvas.addMouseListener(canvas);