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

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

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

Canvas.addPaintListener介绍

[英]Adds the listener to the collection of listeners who will be notified when the receiver needs to be painted, by sending it one of the messages defined in the PaintListener interface.
[中]通过发送PaintListener接口中定义的消息之一,将侦听器添加到侦听器集合中,当需要绘制接收器时,将通知这些侦听器。

代码示例

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

canvas.addPaintListener( new PaintListener() {

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

wCanvas = new Canvas( shell, SWT.BORDER );
props.setLook( wCanvas );
wCanvas.addPaintListener( new PaintListener() {
 public void paintControl( PaintEvent pe ) {
  repaint( pe.gc, pe.width, pe.height );

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

fdFFont.bottom = new FormAttachment( 0, h );
wFFont.setLayoutData( fdFFont );
wFFont.addPaintListener( new PaintListener() {
 public void paintControl( PaintEvent pe ) {
  pe.gc.setFont( fixedFont );
fdGFont.bottom = new FormAttachment( 0, ( nr + 1 ) * h + margin );
wGFont.setLayoutData( fdGFont );
wGFont.addPaintListener( new PaintListener() {
 public void paintControl( PaintEvent pe ) {
  pe.gc.setFont( graphFont );
fdNFont.bottom = new FormAttachment( 0, ( nr + 1 ) * h + margin );
wNFont.setLayoutData( fdNFont );
wNFont.addPaintListener( new PaintListener() {
 public void paintControl( PaintEvent pe ) {
  pe.gc.setFont( noteFont );

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

canvas.addPaintListener( new PaintListener() {

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

canvas.addPaintListener( new PaintListener() {

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

canvas.addPaintListener( new PaintListener() {
 public void paintControl( PaintEvent e ) {
  JobGraph.this.paintControl( e );

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

canvas.addPaintListener( new PaintListener() {
 @Override
 public void paintControl( PaintEvent e ) {

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

canvas.addPaintListener( new PaintListener() {

代码示例来源:origin: com.eclipsesource.tabris/tabris

private void addPaintListener() {
 indicatorCanvas.addPaintListener( new PaintListener() {
  @Override
  public void paintControl( PaintEvent event ) {
   drawIndicators( event.gc );
   getParent().layout( true, true );
  }
 } );
}

代码示例来源:origin: com.eclipsesource.tabris/tabris

private void addDispatchPaintListener() {
 paintListener = new PaintListener() {
  @Override
  public void paintControl( PaintEvent event ) {
   GC gc = event.gc;
   processClientDrawings( gc );
   gc.drawPoint( -1, -1 ); //TODO: This is a workaround to force updates, see RAP bug 377070
  }
 };
 super.addPaintListener( paintListener );
}

代码示例来源:origin: com.eclipsesource.tabris/tabris

@Override
public void addPaintListener( PaintListener listener ) {
 removePaintListener( paintListener );
 super.addPaintListener( listener );
 super.addPaintListener( paintListener );
}

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

@Override
public void addPaintListener(PaintListener listener) {
  super.addPaintListener(listener);
  addListener(PaintListener.class, listener);
}

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

@Override
public void addPaintListener(PaintListener listener) {
  super.addPaintListener(listener);
  addListener(PaintListener.class, listener);
}

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

public void addPaintListener(PaintListener l) {
  super.addPaintListener(l);
  label.addPaintListener(l);
}

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

private Composite createFontPreviewControl() {
  fontSampler = new Canvas(previewComposite, SWT.NONE);
  GridLayout gridLayout = new GridLayout();
  gridLayout.marginWidth = 0;
  gridLayout.marginHeight = 0;
  fontSampler.setLayout(gridLayout);
  fontSampler.setLayoutData(new GridData(GridData.FILL_BOTH));
  fontSampler.addPaintListener(e -> {
    if (currentFont != null) // do the font preview
      paintFontSample(e.gc);
  });
  return fontSampler;
}

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

private Composite createColorPreviewControl() {
  colorSampler = new Canvas(previewComposite, SWT.NONE);
  GridLayout gridLayout = new GridLayout();
  gridLayout.marginWidth = 0;
  gridLayout.marginHeight = 0;
  colorSampler.setLayout(gridLayout);
  colorSampler.setLayoutData(new GridData(GridData.FILL_BOTH));
  colorSampler.addPaintListener(e -> {
    if (currentColor != null) // do the color preview
      paintColorSample(e.gc);
  });
  return colorSampler;
}

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

@Override
public void initialize(Canvas canvas) {
  super.initialize(canvas);
  drawCanvas.addPaintListener(new PaintListener() {
     @Override
     public void paintControl(PaintEvent e) {
       if (bufferImage != null && !bufferImage.isDisposed()) {
         Rectangle bounds = bufferImage.getBounds();
         if (bounds.width >= ( e.width + e.x ) && bounds.height >= ( e.height + e.y )) {
           e.gc.drawImage(bufferImage, e.x, e.y, e.width, e.height, e.x, e.y,
               e.width, e.height);
         }
       }
     }
   });
  drawCanvas.addListener(SWT.Resize, new Listener() {
     @Override
     public void handleEvent(Event event) {
       drawChart(true);
     }
   });
}

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

public Clock(Thing thing, Canvas canvas, ActionContext actionContext) {
  this.thing = thing;
  this.canvas = canvas;
  this.actionContext = actionContext;
  
  this.canvas.addPaintListener(this);
  
  //时间
  this.date = thing.doAction("getDate", actionContext);
  if(this.date == null) {
    this.date = new Date();
  }    
  
  //时钟绘画者
  Thing clockDrawerThing = thing.doAction("getClockDrawer", actionContext);
  if(clockDrawerThing != null) {
    this.clockDrawer = clockDrawerThing.doAction("create", actionContext);
  }
}

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

@Override
  public void runSupport() {
    customImage = true;
    customImageID = null;
    drawAlpha  = 255;
    canvas.setData("image", image);
    canvas.setData("ImageID", null);
    canvas.setData("image-left", null);
    canvas.setData("image-right", null);
    canvas.setData("drawAlpha", null);
    canvas.removePaintListener(paintListener);
    canvas.addPaintListener(paintListener);
    Utils.relayout(canvas);
    canvas.redraw();
  }
});

代码示例来源: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;
}

相关文章

Canvas类方法