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

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

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

Canvas.getStyle介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

  1. @Override
  2. public int getStyle () {
  3. int style = super.getStyle();
  4. switch (align) {
  5. case SWT.RIGHT: style |= SWT.RIGHT; break;
  6. case SWT.CENTER: style |= SWT.CENTER; break;
  7. case SWT.LEFT: style |= SWT.LEFT; break;
  8. }
  9. return style;
  10. }

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.swt

  1. public int getStyle () {
  2. int style = super.getStyle();
  3. switch (align) {
  4. case SWT.RIGHT: style |= SWT.RIGHT; break;
  5. case SWT.CENTER: style |= SWT.CENTER; break;
  6. case SWT.LEFT: style |= SWT.LEFT; break;
  7. }
  8. return style;
  9. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

  1. @Override
  2. public int getStyle () {
  3. int style = super.getStyle();
  4. switch (align) {
  5. case SWT.RIGHT: style |= SWT.RIGHT; break;
  6. case SWT.CENTER: style |= SWT.CENTER; break;
  7. case SWT.LEFT: style |= SWT.LEFT; break;
  8. }
  9. return style;
  10. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

  1. @Override
  2. public int getStyle () {
  3. int style = super.getStyle();
  4. switch (align) {
  5. case SWT.RIGHT: style |= SWT.RIGHT; break;
  6. case SWT.CENTER: style |= SWT.CENTER; break;
  7. case SWT.LEFT: style |= SWT.LEFT; break;
  8. }
  9. return style;
  10. }

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

  1. public int getStyle () {
  2. int style = super.getStyle();
  3. switch (align) {
  4. case SWT.RIGHT: style |= SWT.RIGHT; break;
  5. case SWT.CENTER: style |= SWT.CENTER; break;
  6. case SWT.LEFT: style |= SWT.LEFT; break;
  7. }
  8. return style;
  9. }

代码示例来源:origin: de.dentrassi.eclipse.neoscada.hmi/org.eclipse.scada.swt

  1. public int getStyle () {
  2. int style = super.getStyle();
  3. switch (align) {
  4. case SWT.RIGHT: style |= SWT.RIGHT; break;
  5. case SWT.CENTER: style |= SWT.CENTER; break;
  6. case SWT.LEFT: style |= SWT.LEFT; break;
  7. }
  8. return style;
  9. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

  1. @Override
  2. public int getStyle () {
  3. int style = super.getStyle();
  4. switch (align) {
  5. case SWT.RIGHT: style |= SWT.RIGHT; break;
  6. case SWT.CENTER: style |= SWT.CENTER; break;
  7. case SWT.LEFT: style |= SWT.LEFT; break;
  8. }
  9. return style;
  10. }

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

  1. @Override
  2. public int getStyle() {
  3. int style = super.getStyle();
  4. switch (align) {
  5. case SWT.RIGHT:
  6. style |= SWT.RIGHT;
  7. break;
  8. case SWT.CENTER:
  9. style |= SWT.CENTER;
  10. break;
  11. case SWT.LEFT:
  12. style |= SWT.LEFT;
  13. break;
  14. }
  15. return style;
  16. }

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

  1. /**
  2. * Sets the state of the "Example" widgets.
  3. */
  4. @Override
  5. void setExampleWidgetState () {
  6. super.setExampleWidgetState ();
  7. horizontalButton.setSelection ((canvas.getStyle () & SWT.H_SCROLL) != 0);
  8. verticalButton.setSelection ((canvas.getStyle () & SWT.V_SCROLL) != 0);
  9. borderButton.setSelection ((canvas.getStyle () & SWT.BORDER) != 0);
  10. noBackgroundButton.setSelection ((canvas.getStyle () & SWT.NO_BACKGROUND) != 0);
  11. noFocusButton.setSelection ((canvas.getStyle () & SWT.NO_FOCUS) != 0);
  12. noMergePaintsButton.setSelection ((canvas.getStyle () & SWT.NO_MERGE_PAINTS) != 0);
  13. noRedrawResizeButton.setSelection ((canvas.getStyle () & SWT.NO_REDRAW_RESIZE) != 0);
  14. doubleBufferedButton.setSelection ((canvas.getStyle () & SWT.DOUBLE_BUFFERED) != 0);
  15. if (!instance.startup) setCaret ();
  16. }
  17. }

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

  1. void recreateCanvas() {
  2. if (dbItem.getSelection() == ((canvas.getStyle() & SWT.DOUBLE_BUFFERED) != 0)) return;
  3. Object data = canvas.getLayoutData();
  4. if (canvas != null) canvas.dispose();
  5. createCanvas(parent);
  6. canvas.setLayoutData(data);
  7. parent.layout(true, true);
  8. }

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

  1. /**
  2. * Paints the ruler column.
  3. *
  4. * @param event the paint event
  5. */
  6. private void paintControl(PaintEvent event) {
  7. if (fTextViewer == null)
  8. return;
  9. fWasShowingEntireContents= JFaceTextUtil.isShowingEntireContents(fStyledText);
  10. fLastTopPixel= fStyledText.getTopPixel();
  11. ILineRange lines= computeDirtyWidgetLines(event);
  12. GC gc= event.gc;
  13. paint(gc, lines);
  14. if ((fCanvas.getStyle() & SWT.NO_BACKGROUND) != 0) {
  15. // fill empty area below any lines
  16. int firstEmpty= Math.max(event.y, fStyledText.getLinePixel(fStyledText.getLineCount()));
  17. int lastEmpty= event.y + event.height;
  18. if (lastEmpty > firstEmpty) {
  19. gc.setBackground(getDefaultBackground());
  20. gc.fillRectangle(0, firstEmpty, getWidth(), lastEmpty - firstEmpty);
  21. }
  22. }
  23. }

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

  1. /**
  2. * Paints the ruler column.
  3. *
  4. * @param event the paint event
  5. */
  6. private void paintControl(PaintEvent event) {
  7. if (fTextViewer == null)
  8. return;
  9. fWasShowingEntireContents= JFaceTextUtil.isShowingEntireContents(fStyledText);
  10. fLastTopPixel= fStyledText.getTopPixel();
  11. ILineRange lines= computeDirtyWidgetLines(event);
  12. GC gc= event.gc;
  13. paint(gc, lines);
  14. if ((fCanvas.getStyle() & SWT.NO_BACKGROUND) != 0) {
  15. // fill empty area below any lines
  16. int firstEmpty= Math.max(event.y, fStyledText.getLinePixel(fStyledText.getLineCount()));
  17. int lastEmpty= event.y + event.height;
  18. if (lastEmpty > firstEmpty) {
  19. gc.setBackground(getDefaultBackground());
  20. gc.fillRectangle(0, firstEmpty, getWidth(), lastEmpty - firstEmpty);
  21. }
  22. }
  23. }

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

  1. } else if (drawMode == DRAW_NORMAL || drawMode == DRAW_CENTER
  2. || drawMode == DRAW_ANIMATE) {
  3. if ((control.getStyle() & SWT.RIGHT) != 0) {
  4. e.gc.drawImage(imgSrc, size.x - imgSrcBounds.width,
  5. (size.y - imgSrcBounds.height) / 2);

相关文章

Canvas类方法