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

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

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

Region.add介绍

[英]Adds the given rectangle to the collection of polygons the receiver maintains to describe its area.
[中]将给定的矩形添加到接收器维护的多边形集合中,以描述其面积。

代码示例

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

@Override
  public void addDamagedRegion(FigureDrawContext fdc, Region region) {
    region.add(fdc.toClientRectangle(x1, y1, x2, y2));
  }
}

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

@Override
  public void addDamagedRegion(FigureDrawContext fdc, Region region) {
    region.add(fdc.toClientRectangle(x1, y1, x2, y2));
  }
}

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

@Override
public void updateRegion(Region region) {
  region.add(label.getBounds());
}

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

@Override
  public void addDamagedRegion(FigureDrawContext fdc, Region region) {
    region.add(fdc.toClientRectangle(x1, y1, x2, y2));
  }
}

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

@Override
  public void addDamagedRegion(FigureDrawContext fdc, Region region) {
    region.add(fdc.toClientRectangle(x, y, x, y));
  }
}

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

@Override
  public void addDamagedRegion(FigureDrawContext fdc, Region region) {
    region.add(fdc.toClientRectangle(x1, y1, x2, y2));
  }
}

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

@Override
  public void addDamagedRegion(FigureDrawContext fdc, Region region) {
    region.add(fdc.toClientRectangle(x1, y1, x2, y2));
  }
}

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

@Override
  public void addDamagedRegion(FigureDrawContext fdc, Region region) {
    region.add(fdc.toClientRectangle(x1, y1, x2, y2));
  }
}

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

@Override
  public void addDamagedRegion(FigureDrawContext fdc, Region region) {
    region.add(fdc.toClientRectangle(x1, y1, x2, y2));
  }
}

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

@Override
  public void addDamagedRegion(FigureDrawContext fdc, Region region) {
    int xmin = Integer.MAX_VALUE, ymin = Integer.MAX_VALUE;
    int xmax = Integer.MIN_VALUE, ymax = Integer.MIN_VALUE;

    for (int i = 0; i < points.length; i += 2) {
      if (points[i] < xmin) xmin = points[i];
      if (points[i] > xmax) xmax = points[i];
      if (points[i+1] < ymin) ymin = points[i+1];
      if (points[i+1] > ymax) ymax = points[i+1];
    }
    region.add(fdc.toClientRectangle(xmin, ymin, xmax, ymax));
  }
}

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

@Override
public void updateRegion(Region region) {
  outerRect = new Rectangle(innerRect.x - width, innerRect.y - width,
      innerRect.width + (2 * width), innerRect.height
          + (2 * width));
  region.add(outerRect);
  region.subtract(innerRect);
}

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

@Override
public void updateRegion(Region region) {
  outerRect = new Rectangle(innerRect.x - width, innerRect.y - width,
      innerRect.width + (2 * width), innerRect.height
          + (2 * width));
  region.add(outerRect);
  region.subtract(innerRect);
}

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

@Override
  public void addDamagedRegion(FigureDrawContext fdc, Region region) {
    Font oldFont = fdc.gc.getFont();
    fdc.gc.setFont(font);
    Point textExtent = fdc.gc.textExtent(text);
    fdc.gc.setFont(oldFont);
    region.add(fdc.toClientRectangle(x, y, x + textExtent.x, y + textExtent.y));
  }
}

代码示例来源: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.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();
}

相关文章