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

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

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

Canvas.setLayoutData介绍

暂无

代码示例

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

fdFFont.top = new FormAttachment( 0, margin );
fdFFont.bottom = new FormAttachment( 0, h );
wFFont.setLayoutData( fdFFont );
wFFont.addPaintListener( new PaintListener() {
 public void paintControl( PaintEvent pe ) {
fdGFont.top = new FormAttachment( 0, nr * h + margin );
fdGFont.bottom = new FormAttachment( 0, ( nr + 1 ) * h + margin );
wGFont.setLayoutData( fdGFont );
wGFont.addPaintListener( new PaintListener() {
 public void paintControl( PaintEvent pe ) {
fdNFont.top = new FormAttachment( 0, nr * h + margin );
fdNFont.bottom = new FormAttachment( 0, ( nr + 1 ) * h + margin );
wNFont.setLayoutData( fdNFont );
wNFont.addPaintListener( new PaintListener() {
 public void paintControl( PaintEvent pe ) {
fdBGColor.top = new FormAttachment( 0, nr * h + margin );
fdBGColor.bottom = new FormAttachment( 0, ( nr + 1 ) * h + margin );
wBGColor.setLayoutData( fdBGColor );
fdGrColor.top = new FormAttachment( 0, nr * h + margin );
fdGrColor.bottom = new FormAttachment( 0, ( nr + 1 ) * h + margin );
wGrColor.setLayoutData( fdGrColor );
fdTabColor.top = new FormAttachment( 0, nr * h + margin );
fdTabColor.bottom = new FormAttachment( 0, ( nr + 1 ) * h + margin );
wTabColor.setLayoutData( fdTabColor );

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

fdCanvas.right = new FormAttachment( 100, 0 );
fdCanvas.bottom = new FormAttachment( 100, -220 );
wCanvas.setLayoutData( fdCanvas );

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

fdCanvas.top = new FormAttachment( 0, 0 );
fdCanvas.bottom = new FormAttachment( 100, 0 );
canvas.setLayoutData( fdCanvas );

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

fdCanvas.top = new FormAttachment( 0, 0 );
fdCanvas.bottom = new FormAttachment( 100, 0 );
canvas.setLayoutData( fdCanvas );

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

fdCanvas.top = new FormAttachment( 0, Const.MARGIN );
fdCanvas.bottom = new FormAttachment( 100, 0 );
canvas.setLayoutData( fdCanvas );

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

fdCanvas.top = new FormAttachment( 0, 0 );
fdCanvas.bottom = new FormAttachment( 100, 0 );
canvas.setLayoutData( fdCanvas );

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

@Override
public void
setLayoutData(
  Object    ld )
{
  if ( ld instanceof GridData ){
    GridData gd = (GridData)ld;
      // need to ensure we have the right vertical align
    gd.verticalAlignment    = 4;
  }
  super.setLayoutData( ld );
}

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

public void setLayoutData(Object data) {
  canvas.setLayoutData(data);
}

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

public void setLayoutData(Object data) {
  canvas.setLayoutData(data);
}

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

public void setLayoutData(Object data) {
 canvas.setLayoutData(data);
}

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

public void setLayoutData(Object data) {
  canvas.setLayoutData(data);
}

代码示例来源: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: 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.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: BiglySoftware/BiglyBT

@Override
  public void handleEvent(Event event) {
    GridData gridData = (GridData) cPaint.getLayoutData();
    gridData.heightHint = spinnerHeight.getSelection();
    cPaint.setLayoutData(gridData);
    shell.layout();
  }
});

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

@Override
  public void runSupport() {
    FormData fd = (FormData) canvas.getLayoutData();
    if (fd == null) {
      fd = new FormData(0, 0);
    } else {
      fd.width = 0;
      fd.height = 0;
    }
    canvas.setLayoutData(fd);
    if (initialized) {
      Utils.relayout(canvas);
    }
  }
});

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

@Override
  public void runSupport() {
    if (cHeaderArea != null && !cHeaderArea.isDisposed()) {
      cHeaderArea.setVisible(visible);
      FormData fd = Utils.getFilledFormData();
      fd.height = visible ? headerHeight : 1;
      fd.bottom = null;
      cHeaderArea.setLayoutData(fd);
      cHeaderArea.getParent().layout(true);
    }
  }
});

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

void recreateCanvas() {
  if (dbItem.getSelection() == ((canvas.getStyle() & SWT.DOUBLE_BUFFERED) != 0)) return;
  Object data = canvas.getLayoutData();
  if (canvas != null) canvas.dispose();
  createCanvas(parent);
  canvas.setLayoutData(data);
  parent.layout(true, true);
}

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

@Override
  public void imageDownloaded(Image image, String key, boolean returnedImmediately) {
    if (!returnedImmediately) {
      if (lblImage.isDisposed()) {
        return;
      }
      lblImage.setData("Image", image);
      Rectangle bounds = image.getBounds();
      GridData gridData = (GridData) lblImage.getLayoutData();
      gridData.heightHint = bounds.height + 10;
      gridData.widthHint = bounds.width + 16;
      lblImage.setLayoutData(gridData);
      lblImage.getShell().layout(new Control[] {
        lblImage
      });
      Point computeSize = shell.computeSize(600, SWT.DEFAULT, true);
      shell.setSize(computeSize);
    }
  }
});

相关文章

Canvas类方法