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

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

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

Canvas.<init>介绍

[英]Prevents uninitialized instances from being created outside the package.
[中]防止在包外部创建未初始化的实例。

代码示例

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

canvas = new Canvas( parent, SWT.BORDER );
canvas.addListener( SWT.Paint, new Listener() {
 public void handleEvent( Event event ) {

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

wFFont = new Canvas( wLookComp, SWT.BORDER );
props.setLook( wFFont );
FormData fdFFont = new FormData();
wGFont = new Canvas( wLookComp, SWT.BORDER );
props.setLook( wGFont );
FormData fdGFont = new FormData();
wNFont = new Canvas( wLookComp, SWT.BORDER );
props.setLook( wNFont );
FormData fdNFont = new FormData();
wBGColor = new Canvas( wLookComp, SWT.BORDER );
props.setLook( wBGColor );
wBGColor.setBackground( background );
wGrColor = new Canvas( wLookComp, SWT.BORDER );
props.setLook( wGrColor );
wGrColor.setBackground( graphColor );
wTabColor = new Canvas( wLookComp, SWT.BORDER );
props.setLook( wTabColor );
wTabColor.setBackground( tabColor );

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

fdlCanvas.top = new FormAttachment( 0, margin );
wlCanvas.setLayoutData( fdlCanvas );
wCanvas = new Canvas( shell, SWT.BORDER );
props.setLook( wCanvas );
wCanvas.addPaintListener( new PaintListener() {

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

canvas = new Canvas( metricsComposite, SWT.NONE );
spoon.props.setLook( canvas );
FormData fdCanvas = new FormData();

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

canvas = new Canvas( metricsComposite, SWT.NONE );
spoon.props.setLook( canvas );
FormData fdCanvas = new FormData();

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

stepsList.setLayoutData( fdStepsList );
canvas = new Canvas( perfComposite, SWT.NONE );
spoon.props.setLook( canvas );
FormData fdCanvas = new FormData();

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

canvas = new Canvas( sashForm, SWT.V_SCROLL | SWT.H_SCROLL | SWT.NO_BACKGROUND | SWT.BORDER );

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

canvas = new Canvas( sashForm, SWT.V_SCROLL | SWT.H_SCROLL | SWT.NO_BACKGROUND | SWT.BORDER );

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

stepsList.setLayoutData( fdStepsList );
canvas = new Canvas( shell, SWT.NONE );
props.setLook( canvas );
FormData fdCanvas = new FormData();

代码示例来源:origin: be.yildiz-games/module-window-swt

public Canvas createCanvas(int width, int height) {
  Canvas canvas = new Canvas(this.shell, SWT.NONE);
  canvas.setSize(width, height);
  return canvas;
}

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

private void createCanvas() {
 indicatorCanvas = new Canvas( this, SWT.NONE );
 indicatorCanvas.setLayoutData( new GridData( SWT.CENTER, SWT.CENTER, true, true ) );
 addPaintListener();
}

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

private void initialize(Composite composite) {
  GridData gridData;
  composite.setLayout( new GridLayout());
  upSpeedCanvas = new Canvas(composite, SWT.DOUBLE_BUFFERED);
  gridData = new GridData(GridData.FILL_BOTH);
  upSpeedCanvas.setLayoutData(gridData);
  upSpeedGraphic = SpeedGraphic.getInstance();
  upSpeedGraphic.initialize(upSpeedCanvas);
  //upSpeedGraphic.setAutoAlpha(true);
}

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

private void createPieceDistPanel() {
  comp.setLayout(new FillLayout());
  //pieceDistComposite = new Composite(parent, SWT.NONE);
  pieceDistCanvas = new Canvas(comp,SWT.NO_BACKGROUND);
  pieceDistCanvas.addListener(SWT.Paint, new Listener() {
    @Override
    public void handleEvent(Event event) {
      if ( pem==null || pem.isDestroyed()){
        event.gc.fillRectangle(event.x, event.y, event.width, event.height);
      }else{
        if (imgToPaint != null && !imgToPaint.isDisposed()) {
          event.gc.drawImage(imgToPaint, 0, 0);
        }
      }
    }
  });
}

代码示例来源: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: org.eclipse/org.eclipse.wst.xsd.ui

public Control createControl(Composite composite)
{
 Canvas canvas = new Canvas(composite, SWT.NONE);
 canvas.setBackground(ColorConstants.white);
 setControl(canvas);
 return getControl();
}

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

@Override
protected void createControl(Composite parent, int styles) {
  if (fVerticalRuler != null || fOverviewRuler != null) {
    styles= (styles & ~SWT.BORDER);
    fComposite= new Canvas(parent, SWT.NONE);
    fComposite.setLayout(createLayout());
    parent= fComposite;
  }
  super.createControl(parent, styles);
  if (fVerticalRuler != null)
    fVerticalRuler.createControl(fComposite, this);
  if (fOverviewRuler != null)
    fOverviewRuler.createControl(fComposite, this);
}

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

@Override
protected void createControl(Composite parent, int styles) {
  if (fVerticalRuler != null || fOverviewRuler != null) {
    styles= (styles & ~SWT.BORDER);
    fComposite= new Canvas(parent, SWT.NONE);
    fComposite.setLayout(createLayout());
    parent= fComposite;
  }
  super.createControl(parent, styles);
  if (fVerticalRuler != null)
    fVerticalRuler.createControl(fComposite, this);
  if (fOverviewRuler != null)
    fOverviewRuler.createControl(fComposite, this);
}

代码示例来源:origin: diffplug/gradle-and-eclipse-rcp

public ColorPicker(Composite parent) {
  super(new Canvas(parent, SWT.DOUBLE_BUFFERED));
  setY(128);
  wrapped.addListener(SWT.Paint, e -> {
    Point size = wrapped.getSize();
    Image img = getMapFor(e.display);
    e.gc.drawImage(img, 0, 0, _256, _256, 0, 0, size.x, size.y);
  });
  mouseDown = SwtRx.addListener(wrapped, SWT.MouseDown).map(this::posToColor);
  mouseMove = SwtRx.addListener(wrapped, SWT.MouseMove).map(this::posToColor);
}

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

public AnimatedImage(Composite parent) {
  canvas = new Canvas(parent,SWT.NO_BACKGROUND);
  Color background = null;
  Composite p = parent;
  while(p != null && background == null) {
    background = p.getBackground();
    if(background != null) {
      //System.out.println("background : " + background + ", composite : " + p);
      break;
    }
    p = p.getParent();
  }
  canvas.setBackground(background);
  canvas.addListener(SWT.Dispose, new Listener() {
    @Override
    public void handleEvent(Event event) {
      stop();
      disposeImages();
    }
  });
}

相关文章

Canvas类方法