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

x33g5p2x  于2022-01-29 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(117)

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

Region.<init>介绍

[英]Constructs a new empty region.

You must dispose the region when it is no longer required.
[中]构造一个新的空区域。
当不再需要该区域时,必须对其进行处理。

代码示例

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

/**
 * Invokes platform specific functionality to allocate a new region.
 * <p>
 * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
 * API for <code>Region</code>. It is marked public only so that it
 * can be shared within the packages provided by SWT. It is not
 * available on all platforms, and should never be called from
 * application code.
 * </p>
 *
 * @param device the device on which to allocate the region
 * @param handle the handle for the region
 * @return a new region object containing the specified device and handle
 *
 * @noreference This method is not intended to be referenced by clients.
 */
public static Region win32_new(Device device, int handle) {
  return new Region(device, handle);
}

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

void setNewShape() {
    Region oldRegion = region;
    region = new Region();
    region.add(getPolygon(false));
    hoverShell.setRegion(region);
    if (oldRegion != null) {
      oldRegion.dispose();
    }
  }
}

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

@Override
public void initialize(AnimationEngine engine) {
  Color color = getAnimationShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW);
  getAnimationShell().setBackground(color);
  // Ensure that the background won't show on the initial display
  shellRegion = new Region(getAnimationShell().getDisplay());
  getAnimationShell().setRegion(shellRegion);
}

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

void setNewShape() {
    Region oldRegion = region;
    region = new Region();
    region.add(getPolygon(false));
    hoverShell.setRegion(region);
    if (oldRegion != null) {
      oldRegion.dispose();
    }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui

void setNewShape() {
  Region oldRegion = region;
  region = new Region();
  region.add(getPolygon(false));
  hoverShell.setRegion(region);
  if(oldRegion != null) {
   oldRegion.dispose();
  }
 }
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

private void updateRegion() {
  Region region = new Region();
  for (Adornment adornment : adornments) {
    adornment.updateRegion(region);
  }
  overlayShell.setRegion(region);
  if (!overlayShell.getVisible())
    overlayShell.setVisible(true);
}

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

void setNewShape() {
    Region oldRegion = region;
    region = new Region();
    region.add(getPolygon(false));
    hoverShell.setRegion(region);
    if (oldRegion != null) {
      oldRegion.dispose();
    }
  }
}

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

void setNewShape() {
    Region oldRegion = region;
    region = new Region();
    region.add(getPolygon(false));
    hoverShell.setRegion(region);
    if (oldRegion != null) {
      oldRegion.dispose();
    }
  }
}

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

private void updateRegion() {
  Region region = new Region();
  for (Adornment adornment : adornments) {
    adornment.updateRegion(region);
  }
  overlayShell.setRegion(region);
  if (!overlayShell.getVisible()) {
    overlayShell.setVisible(true);
  }
}

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

/**
 * Hides the rubberband (but does not eliminate it).
 * <p>
 * Increments by one the rubberband "hide" nesting count.  The rubberband
 * is hidden from view (but remains active) if it wasn't already hidden.
 * </p>
 */
public void hideRubberband() {
  if (rubberbandHiddenNestingCount++ <= 0) {
    Region region = new Region();
    rubberband.addDamagedRegion(displayFDC, region);
    Rectangle r = region.getBounds();
    paintCanvas.redraw(r.x, r.y, r.width, r.height, true);
    region.dispose();
  }
}

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

void fillRegion(GC gc, Region region) {
  // NOTE: region passed in to this function will be modified
  Region clipping = new Region();
  gc.getClipping(clipping);
  region.intersect(clipping);
  gc.setClipping(region);
  gc.fillRectangle(region.getBounds());
  gc.setClipping(clipping);
  clipping.dispose();
}

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

void fillRegion(GC gc, Region region) {
  // NOTE: region passed in to this function will be modified
  Region clipping = new Region();
  gc.getClipping(clipping);
  region.intersect(clipping);
  gc.setClipping(region);
  gc.fillRectangle(region.getBounds());
  gc.setClipping(clipping);
  clipping.dispose();
}

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

void fillRegion(GC gc, Region region) {
  // NOTE: region passed in to this function will be modified
  Region clipping = new Region();
  gc.getClipping(clipping);
  region.intersect(clipping);
  gc.setClipping(region);
  gc.fillRectangle(region.getBounds());
  gc.setClipping(clipping);
  clipping.dispose();
}

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

void fillRegion(GC gc, Region region) {
  // NOTE: region passed in to this function will be modified
  Region clipping = new Region();
  gc.getClipping(clipping);
  region.intersect(clipping);
  gc.setClipping(region);
  gc.fillRectangle(region.getBounds());
  gc.setClipping(clipping);
  clipping.dispose();
}

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

void fillRegion(GC gc, Region region) {
  // NOTE: region passed in to this function will be modified
  Region clipping = new Region();
  gc.getClipping(clipping);
  region.intersect(clipping);
  gc.setClipping(region);
  gc.fillRectangle(region.getBounds());
  gc.setClipping(clipping);
  clipping.dispose();
}

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

/**
 * Clears the active rubberband selection.
 * <p>
 * Erases any rubberband objects on the screen then clears the selection.
 * </p>
 */
public void clearRubberbandSelection() {
  if (! isRubberbandHidden()) {
    Region region = new Region();
    rubberband.addDamagedRegion(displayFDC, region);
    Rectangle r = region.getBounds();
    paintCanvas.redraw(r.x, r.y, r.width, r.height, true);
    region.dispose();
  }
  rubberband.clear();
}

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

protected void packPopup() {
  popupLayout.marginTop = HAH;
  popupLayout.marginBottom = 0;
  popup.pack();
  Region oldRegion = region;
  region = new Region();
  region.add(getPolygon(false));
  popup.setRegion(region);
  Rectangle bounds = region.getBounds();
  popup.setSize(bounds.width, bounds.height + 2);
  if (oldRegion != null) {
    oldRegion.dispose();
  }
}

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

static Region mirrorRegion (Region region) {
  if (region == null) return null;

  Region mirrored = new Region (region.getDevice ());

  long /*int*/ rgn = region.handle;
  int [] nRects = new int [1];
  long /*int*/ [] rects = new long /*int*/ [1];
  gdk_region_get_rectangles (rgn, rects, nRects);
  Rectangle bounds = DPIUtil.autoScaleUp(region.getBounds ());
  GdkRectangle rect = new GdkRectangle ();
  for (int i = 0; i < nRects [0]; i++) {
    OS.memmove (rect, rects[0] + (i * GdkRectangle.sizeof), GdkRectangle.sizeof);
    rect.x = bounds.x + bounds.width - rect.x - rect.width;
    OS.gdk_region_union_with_rect (mirrored.handle, rect);
  }
  if (rects [0] != 0) OS.g_free (rects [0]);
  return mirrored;
}

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

static Region mirrorRegion (Region region) {
  if (region == null) return null;

  Region mirrored = new Region (region.getDevice ());

  int /*long*/ rgn = region.handle;
  int [] nRects = new int [1];
  int /*long*/ [] rects = new int /*long*/ [1];
  gdk_region_get_rectangles (rgn, rects, nRects);
  Rectangle bounds = DPIUtil.autoScaleUp(region.getBounds ());
  GdkRectangle rect = new GdkRectangle ();
  for (int i = 0; i < nRects [0]; i++) {
    OS.memmove (rect, rects[0] + (i * GdkRectangle.sizeof), GdkRectangle.sizeof);
    rect.x = bounds.x + bounds.width - rect.x - rect.width;
    OS.gdk_region_union_with_rect (mirrored.handle, rect);
  }
  if (rects [0] != 0) OS.g_free (rects [0]);
  return mirrored;
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

private void defineRegion() {
  Region rgn = new Region();
  for (Rectangle r : rects) {
    rgn.add(r);
    rgn.subtract(r.x + 2, r.y + 2, r.width - 4, r.height - 4);
  }
  if (feedbackShell.getRegion() != null && !feedbackShell.getRegion().isDisposed())
    feedbackShell.getRegion().dispose();
  feedbackShell.setRegion(rgn);
  feedbackShell.redraw();
  display.update();
}

相关文章