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

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

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

Canvas.addMouseListener介绍

暂无

代码示例

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

canvas.addMouseListener( new MouseAdapter() {
 @Override
 public void mouseDown( MouseEvent event ) {

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

canvas.addMouseListener( new MouseAdapter() {
 @Override
 public void mouseDown( MouseEvent event ) {

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

lastclick = null;
canvas.addMouseListener( this );
canvas.addMouseMoveListener( this );
canvas.addMouseTrackListener( this );

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

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

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

@Override
  public void addMouseListener(MouseListener listener) {
    if (isPropagatingMouseListener() || listener == fMouseListener)
      super.addMouseListener(listener);
  }
};

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

@Override
public void addMouseListener(MouseListener listener) {
  super.addMouseListener(listener);
  addListener(MouseListener.class, listener);
}

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

/**
 * Adds the given mouse listener.
 *
 * @param listener the listener to be added
 * @deprecated will be removed
 * @since 2.0
 */
@Deprecated
public void addMouseListener(MouseListener listener) {
  if (fCanvas != null && !fCanvas.isDisposed())
    fCanvas.addMouseListener(listener);
}

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

@Override
public void addMouseListener(MouseListener listener) {
  super.addMouseListener(listener);
  addListener(MouseListener.class, listener);
}

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

/**
 * Adds the given mouse listener.
 *
 * @param listener the listener to be added
 * @deprecated will be removed
 * @since 2.0
 */
@Deprecated
public void addMouseListener(MouseListener listener) {
  if (fCanvas != null && !fCanvas.isDisposed())
    fCanvas.addMouseListener(listener);
}

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

@Override
  public void addMouseListener(MouseListener listener) {
    if (isPropagatingMouseListener() || listener == fMouseListener)
      super.addMouseListener(listener);
  }
};

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

@Override
  public void addMouseListener(MouseListener listener) {
    // see bug 40889, bug 230073 and AnnotationRulerColumn#isPropagatingMouseListener()
    if (listener == fMouseHandler)
      super.addMouseListener(listener);
    else {
      TypedListener typedListener= null;
      if (listener != null)
        typedListener= new TypedListener(listener);
      addListener(SWT.MouseDoubleClick, typedListener);
    }
  }
};

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

@Override
  public void addMouseListener(MouseListener listener) {
    // see bug 40889, bug 230073 and AnnotationRulerColumn#isPropagatingMouseListener()
    if (listener == fMouseHandler)
      super.addMouseListener(listener);
    else {
      TypedListener typedListener= null;
      if (listener != null)
        typedListener= new TypedListener(listener);
      addListener(SWT.MouseDoubleClick, typedListener);
    }
  }
};

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

});
fCanvas.addMouseListener(new MouseListener() {
  @Override
  public void mouseUp(MouseEvent event) {

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

protected void adjustItemNumber() {
  if (fComposite == null)
    return;
  Control[] children= fComposite.getChildren();
  int oldSize= children.length;
  int newSize= fInput == null ? 0 : fInput.fAnnotations.length;
  Display display= fShell.getDisplay();
  // add missing items
  for (int i= oldSize; i < newSize; i++) {
    Canvas canvas= new Canvas(fComposite, SWT.NONE);
    Object gridData= fLayouter.getLayoutData();
    canvas.setLayoutData(gridData);
    canvas.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    canvas.addPaintListener(fPaintListener);
    canvas.addMouseTrackListener(fMouseTrackListener);
    canvas.addMouseListener(fMouseListener);
    canvas.addListener(SWT.MenuDetect, fMenuDetectListener);
    canvas.addDisposeListener(fDisposeListener);
  }
  // dispose of exceeding resources
  for (int i= oldSize; i > newSize; i--) {
    Item item= (Item) children[i - 1].getData();
    item.deselect();
    children[i - 1].dispose();
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

protected void adjustItemNumber() {
  if (fComposite == null)
    return;
  Control[] children= fComposite.getChildren();
  int oldSize= children.length;
  int newSize= fInput == null ? 0 : fInput.fAnnotations.length;
  Display display= fShell.getDisplay();
  // add missing items
  for (int i= oldSize; i < newSize; i++) {
    Canvas canvas= new Canvas(fComposite, SWT.NONE);
    Object gridData= fLayouter.getLayoutData();
    canvas.setLayoutData(gridData);
    canvas.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    canvas.addPaintListener(fPaintListener);
    canvas.addMouseTrackListener(fMouseTrackListener);
    canvas.addMouseListener(fMouseListener);
    canvas.addListener(SWT.MenuDetect, fMenuDetectListener);
    canvas.addDisposeListener(fDisposeListener);
  }
  // dispose of exceeding resources
  for (int i= oldSize; i > newSize; i--) {
    Item item= (Item) children[i - 1].getData();
    item.deselect();
    children[i - 1].dispose();
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

protected void adjustItemNumber() {
  if (fComposite == null)
    return;
  Control[] children= fComposite.getChildren();
  int oldSize= children.length;
  int newSize= fInput == null ? 0 : fInput.fAnnotations.length;
  Display display= fShell.getDisplay();
  // add missing items
  for (int i= oldSize; i < newSize; i++) {
    Canvas canvas= new Canvas(fComposite, SWT.NONE);
    Object gridData= fLayouter.getLayoutData();
    canvas.setLayoutData(gridData);
    canvas.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    canvas.addPaintListener(fPaintListener);
    canvas.addMouseTrackListener(fMouseTrackListener);
    canvas.addMouseListener(fMouseListener);
    canvas.addListener(SWT.MenuDetect, fMenuDetectListener);
    canvas.addDisposeListener(fDisposeListener);
  }
  // dispose of exceeding resources
  for (int i= oldSize; i > newSize; i--) {
    Item item= (Item) children[i - 1].getData();
    item.deselect();
    children[i - 1].dispose();
  }
}

代码示例来源: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.addMouseListener(fMouseHandler);
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.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;
}

相关文章

Canvas类方法