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

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

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

Region.getBounds介绍

[英]Returns a rectangle which represents the rectangular union of the collection of polygons the receiver maintains to describe its area.
[中]返回一个矩形,该矩形表示接收器为描述其面积而维护的多边形集合的矩形并集。

代码示例

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

return;
String string = ( (Region) object ).getBounds().toString();
gc.drawString( string, 0, 0 );
return;

代码示例来源: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.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

if ((style & SWT.NO_TRIM) == 0) return;
if (region != null) {
  Rectangle bounds = region.getBounds ();
  setSize (bounds.x + bounds.width, bounds.y + bounds.height);

代码示例来源: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.aix.ppc

Rectangle bounds = region.getBounds ();
setSize (bounds.x + bounds.width, bounds.y + bounds.height);

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

Rectangle bounds = region.getBounds ();
setSize (bounds.x + bounds.width, bounds.y + bounds.height);

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

Rectangle bounds = region.getBounds ();
setSize (bounds.x + bounds.width, bounds.y + bounds.height);

代码示例来源: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.platform/org.eclipse.swt.gtk.aix.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/org.eclipse.jdt.ui

private void packPopup() {
  boolean isUnderLeft= fSnapPosition == SNAP_POSITION_UNDER_LEFT_FIELD;
  boolean isOverLeft= fSnapPosition == SNAP_POSITION_OVER_LEFT_FIELD;
  fPopupLayout.marginTop= isUnderLeft ? HAH : 0;
  fPopupLayout.marginBottom= isOverLeft ? HAH + 1 : 0;
  fPopup.pack();
  
  Region oldRegion= fRegion;
  if (isUnderLeft || isOverLeft) {
    fRegion= new Region();
    fRegion.add(getPolygon(false));
    fPopup.setRegion(fRegion);
    Rectangle bounds= fRegion.getBounds();
    fPopup.setSize(bounds.width, bounds.height + 1);
  } else {
    fRegion= null;
    fPopup.setRegion(null);
  }
  
  if (oldRegion != null) {
    oldRegion.dispose();
  }
}

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

private void packPopup() {
  if (!fSnapPositionChanged) {
    return;
  }
  fSnapPositionChanged= false;
  
  boolean isUnderLeft= fSnapPosition == SNAP_POSITION_UNDER_LEFT_FIELD;
  boolean isOverLeft= fSnapPosition == SNAP_POSITION_OVER_LEFT_FIELD;
  fPopupLayout.marginTop= isUnderLeft ? HAH : 0;
  fPopupLayout.marginBottom= isOverLeft ? HAH + 1 : 0;
  fPopup.pack();
  Region oldRegion= fRegion;
  if (isUnderLeft || isOverLeft) {
    fRegion= new Region();
    fRegion.add(getPolygon(false));
    fPopup.setRegion(fRegion);
    Rectangle bounds= fRegion.getBounds();
    fPopup.setSize(bounds.width, bounds.height + 1);
  } else {
    fRegion= null;
    fPopup.setRegion(null);
  }
  if (oldRegion != null) {
    oldRegion.dispose();
  }
}

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

private void packPopup() {
  if (!fSnapPositionChanged) {
    return;
  }
  fSnapPositionChanged= false;
  
  boolean isUnderLeft= fSnapPosition == SNAP_POSITION_UNDER_LEFT_FIELD;
  boolean isOverLeft= fSnapPosition == SNAP_POSITION_OVER_LEFT_FIELD;
  fPopupLayout.marginTop= isUnderLeft ? HAH : 0;
  fPopupLayout.marginBottom= isOverLeft ? HAH + 1 : 0;
  fPopup.pack();
  Region oldRegion= fRegion;
  if (isUnderLeft || isOverLeft) {
    fRegion= new Region();
    fRegion.add(getPolygon(false));
    fPopup.setRegion(fRegion);
    Rectangle bounds= fRegion.getBounds();
    fPopup.setSize(bounds.width, bounds.height + 1);
  } else {
    fRegion= null;
    fPopup.setRegion(null);
  }
  if (oldRegion != null) {
    oldRegion.dispose();
  }
}

相关文章