本文整理了Java中org.eclipse.jface.util.Geometry.getExtrudedEdge()
方法的一些代码示例,展示了Geometry.getExtrudedEdge()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.getExtrudedEdge()
方法的具体详情如下:
包路径:org.eclipse.jface.util.Geometry
类名称:Geometry
方法名:getExtrudedEdge
[英]Extrudes the given edge inward by the given distance. That is, if one side of the rectangle was sliced off with a given thickness, this returns the rectangle that forms the slice. Note that the returned rectangle will be inside the given rectangle if size > 0.
[中]将给定边向内挤出给定距离。也就是说,如果矩形的一侧以给定的厚度被切掉,则返回形成切片的矩形。请注意,如果大小>0,则返回的矩形将位于给定矩形内。
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
/**
* Gets the closest monitor given an anchor and the subject area.
*
* @param area the subject area
* @param anchor the anchor
* @return the monitor closest to the edge of <code>area</code> defined by
* <code>anchor</code>
* @since 3.3
*/
private Monitor getClosestMonitor(Rectangle area, Anchor anchor) {
Point center;
if (ANCHOR_GLOBAL == anchor)
center= Geometry.centerPoint(area);
else
center= Geometry.centerPoint(Geometry.getExtrudedEdge(area, 0, anchor.getSWTFlag()));
return getClosestMonitor(fSubjectControl.getDisplay(), Geometry.createRectangle(center, new Point(0, 0)));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
/**
* Gets the closest monitor given an anchor and the subject area.
*
* @param area the subject area
* @param anchor the anchor
* @return the monitor closest to the edge of <code>area</code> defined by
* <code>anchor</code>
* @since 3.3
*/
private Monitor getClosestMonitor(Rectangle area, Anchor anchor) {
Point center;
if (ANCHOR_GLOBAL == anchor)
center= Geometry.centerPoint(area);
else
center= Geometry.centerPoint(Geometry.getExtrudedEdge(area, 0, anchor.getSWTFlag()));
return Util.getClosestMonitor(fSubjectControl.getDisplay(), center);
}
内容来源于网络,如有侵权,请联系作者删除!