本文整理汇总了Java中ij.gui.ImageCanvas.addMouseListener方法的典型用法代码示例。如果您正苦于以下问题:Java ImageCanvas.addMouseListener方法的具体用法?Java ImageCanvas.addMouseListener怎么用?Java ImageCanvas.addMouseListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.gui.ImageCanvas
的用法示例。
在下文中一共展示了ImageCanvas.addMouseListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createListeners
import ij.gui.ImageCanvas; //导入方法依赖的package包/类
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);
}
示例2: killListeners
import ij.gui.ImageCanvas; //导入方法依赖的package包/类
/**
* Kill listeners.
*/
public void killListeners ()
{
if(imp != null)
{
final ImageWindow iw = imp.getWindow();
final ImageCanvas ic = iw.getCanvas();
ic.removeKeyListener(pa);
ic.removeMouseListener(pa);
ic.removeMouseMotionListener(pa);
ic.addMouseMotionListener(ic);
ic.addMouseListener(ic);
ic.addKeyListener(IJ.getInstance());
}
}
示例3: killListeners
import ij.gui.ImageCanvas; //导入方法依赖的package包/类
public void killListeners (
) {
final ImageWindow iw = imp.getWindow();
final ImageCanvas ic = iw.getCanvas();
ic.removeKeyListener(pa);
ic.removeMouseListener(pa);
ic.removeMouseMotionListener(pa);
ic.addMouseMotionListener(ic);
ic.addMouseListener(ic);
ic.addKeyListener(IJ.getInstance());
}
示例4: unwarpJPointHandler
import ij.gui.ImageCanvas; //导入方法依赖的package包/类
public unwarpJPointHandler (
final ImagePlus imp,
final unwarpJPointToolbar tb,
final unwarpJMask mask,
final unwarpJDialog dialog
) {
super(0, 0, imp.getWidth(), imp.getHeight(), imp);
this.imp = imp;
this.tb = tb;
this.dialog=dialog;
pa = new unwarpJPointAction(imp, this, tb, dialog);
final ImageWindow iw = imp.getWindow();
final ImageCanvas ic = iw.getCanvas();
iw.requestFocus();
iw.removeKeyListener(IJ.getInstance());
iw.addKeyListener(pa);
ic.removeMouseMotionListener(ic);
ic.removeMouseListener(ic);
ic.removeKeyListener(IJ.getInstance());
ic.addKeyListener(pa);
ic.addMouseListener(pa);
ic.addMouseMotionListener(pa);
setSpectrum();
started = true;
this.mask=mask;
clearMask();
}
示例5: PointHandler
import ij.gui.ImageCanvas; //导入方法依赖的package包/类
/**
* Constructor with graphical capabilities, create an instance of PointHandler.
*
* @param imp pointer to the image
* @param tb pointer to the toolbar
* @param mask pointer to the mask
* @param dialog pointer to the bUnwarpJ dialog
*/
public PointHandler (
final ImagePlus imp,
final PointToolbar tb,
final Mask mask,
final MainDialog dialog)
{
super(0, 0, imp.getWidth(), imp.getHeight(), imp);
this.imp = imp;
this.tb = tb;
this.dialog = dialog;
this.pa = new PointAction(imp, this, tb, dialog);
final ImageWindow iw = imp.getWindow();
final ImageCanvas ic = iw.getCanvas();
//iw.requestFocus();
iw.removeKeyListener(IJ.getInstance());
iw.addKeyListener(pa);
ic.removeMouseMotionListener(ic);
ic.removeMouseListener(ic);
ic.removeKeyListener(IJ.getInstance());
ic.addKeyListener(pa);
ic.addMouseListener(pa);
ic.addMouseMotionListener(pa);
started = true;
this.mask = mask;
//clearMask(); // This line was commented to allow loading masks from the second slice of a stack.
}