org.eclipse.swt.widgets.Canvas.addMouseMoveListener()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中org.eclipse.swt.widgets.Canvas.addMouseMoveListener()方法的一些代码示例,展示了Canvas.addMouseMoveListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.addMouseMoveListener()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Canvas
类名称:Canvas
方法名:addMouseMoveListener

Canvas.addMouseMoveListener介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

canvas.addMouseMoveListener( this );
canvas.addMouseTrackListener( this );
canvas.addMouseWheelListener( this );

代码示例来源:origin: pentaho/pentaho-kettle

canvas.addMouseMoveListener( this );
canvas.addMouseTrackListener( this );
canvas.addMouseWheelListener( this );

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
public void addMouseMoveListener(MouseMoveListener listener) {
  super.addMouseMoveListener(listener);
  addListener(MouseMoveListener.class, listener);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public void addMouseMoveListener(MouseMoveListener listener) {
  super.addMouseMoveListener(listener);
  addListener(MouseMoveListener.class, listener);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
public void mouseDown(MouseEvent e) {
  Rectangle shellBounds= fShell.getBounds();
  final int shellX= shellBounds.x;
  final int shellY= shellBounds.y;
  final int shellWidth= shellBounds.width;
  final int shellHeight= shellBounds.height;
  Point mouseLoc= resizer.toDisplay(e.x, e.y);
  final int mouseX= mouseLoc.x;
  final int mouseY= mouseLoc.y;
  fResizeListener= new MouseMoveListener() {
    @Override
    public void mouseMove(MouseEvent e2) {
      Point mouseLoc2= resizer.toDisplay(e2.x, e2.y);
      int dx= mouseLoc2.x - mouseX;
      int dy= mouseLoc2.y - mouseY;
      if (isRTL) {
        setLocation(new Point(shellX + dx, shellY));
        setSize(shellWidth - dx, shellHeight + dy);
      } else {
        setSize(shellWidth + dx, shellHeight + dy);
      }
    }
  };
  resizer.addMouseMoveListener(fResizeListener);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public void mouseDown(MouseEvent e) {
  Rectangle shellBounds= fShell.getBounds();
  final int shellX= shellBounds.x;
  final int shellY= shellBounds.y;
  final int shellWidth= shellBounds.width;
  final int shellHeight= shellBounds.height;
  Point mouseLoc= resizer.toDisplay(e.x, e.y);
  final int mouseX= mouseLoc.x;
  final int mouseY= mouseLoc.y;
  fResizeListener= e2 -> {
    Point mouseLoc2= resizer.toDisplay(e2.x, e2.y);
    int dx= mouseLoc2.x - mouseX;
    int dy= mouseLoc2.y - mouseY;
    if (isRTL) {
      setLocation(new Point(shellX + dx, shellY));
      setSize(shellWidth - dx, shellHeight + dy);
    } else {
      setSize(shellWidth + dx, shellHeight + dy);
    }
  };
  resizer.addMouseMoveListener(fResizeListener);
}

代码示例来源:origin: BiglySoftware/BiglyBT

canvas.addMouseMoveListener(this);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

example.canvas.addMouseMoveListener(mouseMoveListener);
example.canvas.addMouseListener(mouseListener);

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public Control createControl(CompositeRuler parentRuler, Composite parentControl) {
  fParentRuler= parentRuler;
  fCachedTextViewer= parentRuler.getTextViewer();
  fCachedTextWidget= fCachedTextViewer.getTextWidget();
  fCanvas= new Canvas(parentControl, SWT.NONE);
  fCanvas.setBackground(getBackground());
  fCanvas.addPaintListener(event -> {
    if (fCachedTextViewer != null)
      doubleBufferPaint(event.gc);
  });
  fCanvas.addDisposeListener(e -> {
    handleDispose();
    fCachedTextViewer= null;
    fCachedTextWidget= null;
  });
  fCanvas.addMouseListener(fMouseHandler);
  fCanvas.addMouseMoveListener(fMouseHandler);
  if (fCachedTextViewer != null) {
    fCachedTextViewer.addViewportListener(fInternalListener);
    fCachedTextViewer.addTextListener(fInternalListener);
  }
  fRevisionPainter.setParentRuler(parentRuler);
  fDiffPainter.setParentRuler(parentRuler);
  return fCanvas;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

fCanvas.addMouseMoveListener(fMouseHandler);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
public Control createControl(CompositeRuler parentRuler, Composite parentControl) {
  Assert.isLegal(parentControl != null);
  Assert.isLegal(parentRuler != null);
  Assert.isLegal(fParentRuler == null); // only call when not yet initialized!
  fParentRuler= parentRuler;
  fTextViewer= getParentRuler().getTextViewer();
  fTextViewer.addViewportListener(fInternalListener);
  fTextViewer.addTextListener(fInternalListener);
  fStyledText= fTextViewer.getTextWidget();
  fCanvas= new Canvas(parentControl, getCanvasStyle());
  fCanvas.setBackground(getDefaultBackground());
  fCanvas.setFont(getFont());
  fCanvas.addPaintListener(new PaintListener() {
    @Override
    public void paintControl(PaintEvent event) {
      AbstractRulerColumn.this.paintControl(event);
    }
  });
  fCanvas.addMouseListener(fMouseHandler);
  fCanvas.addMouseMoveListener(fMouseHandler);
  return fCanvas;
}

代码示例来源:origin: org.xworker/xworker_swt

canvas.addMouseMoveListener(this);
canvas.addPaintListener(this);

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public Control createControl(CompositeRuler parentRuler, Composite parentControl) {
  Assert.isLegal(parentControl != null);
  Assert.isLegal(parentRuler != null);
  Assert.isLegal(fParentRuler == null); // only call when not yet initialized!
  fParentRuler= parentRuler;
  fTextViewer= getParentRuler().getTextViewer();
  fTextViewer.addViewportListener(fInternalListener);
  fTextViewer.addTextListener(fInternalListener);
  fStyledText= fTextViewer.getTextWidget();
  fCanvas= new Canvas(parentControl, getCanvasStyle());
  fCanvas.setBackground(getDefaultBackground());
  fCanvas.setFont(getFont());
  fCanvas.addPaintListener(new PaintListener() {
    @Override
    public void paintControl(PaintEvent event) {
      AbstractRulerColumn.this.paintControl(event);
    }
  });
  fCanvas.addMouseListener(fMouseHandler);
  fCanvas.addMouseMoveListener(fMouseHandler);
  return fCanvas;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

fCanvas.addMouseMoveListener(new MouseMoveListener() {
  @Override
  public void mouseMove(MouseEvent event) {

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

fCanvas.addMouseListener(fMouseListener);
fCanvas.addMouseMoveListener(new MouseMoveListener() {
  @Override
  public void mouseMove(MouseEvent e) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

fCanvas.addMouseMoveListener(event -> handleMouseMove(event));

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

fCanvas.addMouseListener(fMouseListener);
fCanvas.addMouseMoveListener(e -> handleMouseMove(e));

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

fCanvas.addMouseMoveListener(fMouseHandler);
fCanvas.addMouseWheelListener(fMouseHandler);

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

fCanvas.addMouseMoveListener(fMouseHandler);
fCanvas.addMouseWheelListener(fMouseHandler);

代码示例来源:origin: org.xworker/xworker_swt

canvas.addMouseMoveListener(new MouseMoveListener(){
  @Override
  public void mouseMove(MouseEvent event) {

相关文章

Canvas类方法