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

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

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

Canvas.setLocation介绍

暂无

代码示例

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

case SWT.TOP:
  caretControl.setSize(trimRect.width-(2*hDelta), width);
  caretControl.setLocation(trimRect.x + hDelta, trimRect.y + trimRect.height + threshold);
  bb = caretControl.getBounds();
  end1.setLocation(bb.x, bb.y-width);
  end2.setLocation((bb.x+bb.width)-width, bb.y-width);
  break;
case SWT.BOTTOM:
  caretControl.setSize(trimRect.width-(2*hDelta), width);
  caretControl.setLocation(trimRect.x + hDelta, trimRect.y - threshold);
  bb = caretControl.getBounds();
  end1.setLocation(bb.x, bb.y+width);
  end2.setLocation((bb.x+bb.width)-width, bb.y+width);
  break;
case SWT.LEFT:
  caretControl.setSize(width, trimRect.height -(2*vDelta));
  caretControl.setLocation(trimRect.x + trimRect.width + threshold,
              trimRect.y + vDelta);
  bb = caretControl.getBounds();
  end1.setLocation(bb.x-bb.width, bb.y);
  end2.setLocation(bb.x-bb.width, (bb.y+bb.height)-width);
  break;
case SWT.RIGHT:
  caretControl.setSize(width, trimRect.height -(2*vDelta));
  caretControl.setLocation(trimRect.x - threshold,
              trimRect.y + vDelta);
  bb = caretControl.getBounds();
  end1.setLocation(bb.x+bb.width, bb.y);
  end2.setLocation(bb.x+bb.width, (bb.y+bb.height)-width);

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

border.setLocation(newPos.x - (size.x/2), newPos.y - (size.y/2));
  border.setLocation(newPos.x, newPos.y);
} else {
  border.setLocation(newPos.x, newPos.y - border.getSize().y);

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

/**
 * Build the window in the SWT thread.
 *
 * @param window Window to use as container.
 */
public void initialize(final SwtWindow window, boolean fullScreenMode, Coordinates c) {
  this.window = window;
  this.window.getShell().setBackgroundMode(SWT.INHERIT_DEFAULT);
  final Color white = this.window.getSystemColor(SWT.COLOR_WHITE);
  final Color black = this.window.getSystemColor(SWT.COLOR_BLACK);
  final PaletteData palette = new PaletteData(white.getRGB(), black.getRGB());
  final ImageData sourceData = new ImageData(16, 16, 1, palette);
  sourceData.transparentPixel = 0;
  this.invisibleCursor = new Cursor(window.getShell().getDisplay(), sourceData, 0, 0);
  if (fullScreenMode) {
    this.window.setFullScreen();
  }
  Image tmpImage = this.window.getImage("engine.png");
  this.loadingBackground = new Image(this.window.getShell().getDisplay(), tmpImage.getImageData().scaledTo(this.window.getShell().getBounds().width, this.window.getShell().getBounds().height));
  this.currentCursor = this.window.getCursor();
  this.window.setCursor(this.invisibleCursor);
  this.window.setBackground(this.loadingBackground);
  this.canvas = window.createCanvas(c.width, c.height);
  this.canvas.setLocation(c.left, c.top);
  if(fullScreenMode) {
    this.window.getShell().setLayout(new FillLayout());
  }
}

相关文章

Canvas类方法