本文整理了Java中org.eclipse.jface.util.Geometry.createRectangle()
方法的一些代码示例,展示了Geometry.createRectangle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.createRectangle()
方法的具体详情如下:
包路径:org.eclipse.jface.util.Geometry
类名称:Geometry
方法名:createRectangle
[英]Returns a new rectangle with the given position and dimensions, expressed as points.
[中]返回具有给定位置和尺寸(以点表示)的新矩形。
代码示例来源: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.xtext/ui
protected Point computePopupLocation() {
if (popup == null || popup.isDisposed())
return null;
LinkedPosition position = renameLinkedMode.getCurrentLinkedPosition();
if (position == null)
return null;
ISourceViewer viewer = editor.getInternalSourceViewer();
ITextViewerExtension5 viewer5 = (ITextViewerExtension5) viewer;
int widgetOffset = viewer5.modelOffset2WidgetOffset(position.offset);
StyledText textWidget = viewer.getTextWidget();
Point pos = textWidget.getLocationAtOffset(widgetOffset);
Point pSize = getExtent();
pSize.y += HAH + 1;
pos.x -= HAO;
pos.y += textWidget.getLineHeight(widgetOffset);
Point dPos = textWidget.toDisplay(pos);
Rectangle displayBounds = textWidget.getDisplay().getClientArea();
Rectangle dPopupRect = Geometry.createRectangle(dPos, pSize);
Geometry.moveInside(dPopupRect, displayBounds);
return new Point(dPopupRect.x, dPopupRect.y);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
Geometry.createRectangle(LOCATIONS[0], pSize),
Geometry.createRectangle(LOCATIONS[1], pSize),
new Rectangle(LOCATIONS[2].x, LOCATIONS[2].y + HAH, pSize.x, pSize.y),
Geometry.createRectangle(LOCATIONS[3], pSize),
Geometry.createRectangle(LOCATIONS[4], pSize)
};
final Rectangle MOUSE_MOVE_SOURCE= new Rectangle(1000000, 0, 0, 0);
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
Geometry.createRectangle(LOCATIONS[0], pSize),
Geometry.createRectangle(LOCATIONS[1], pSize),
new Rectangle(LOCATIONS[2].x, LOCATIONS[2].y + HAH, pSize.x, pSize.y),
Geometry.createRectangle(LOCATIONS[3], pSize),
Geometry.createRectangle(LOCATIONS[4], pSize)
};
final Rectangle MOUSE_MOVE_SOURCE= new Rectangle(1000000, 0, 0, 0);
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
Point dPos= textWidget.toDisplay(pos);
Rectangle displayBounds= textWidget.getDisplay().getClientArea();
Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize);
Geometry.moveInside(dPopupRect, displayBounds);
return new Point(dPopupRect.x, dPopupRect.y);
Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize);
Geometry.moveInside(dPopupRect, displayBounds);
return new Point(dPopupRect.x, dPopupRect.y);
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
Point dPos= textWidget.toDisplay(pos);
Rectangle displayBounds= textWidget.getDisplay().getClientArea();
Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize);
Geometry.moveInside(dPopupRect, displayBounds);
return new Point(dPopupRect.x, dPopupRect.y);
Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize);
Geometry.moveInside(dPopupRect, displayBounds);
return new Point(dPopupRect.x, dPopupRect.y);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
Point dPos= textWidget.toDisplay(pos);
Rectangle displayBounds= textWidget.getDisplay().getClientArea();
Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize);
Geometry.moveInside(dPopupRect, displayBounds);
return new Point(dPopupRect.x, dPopupRect.y);
Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize);
Geometry.moveInside(dPopupRect, displayBounds);
return new Point(dPopupRect.x, dPopupRect.y);
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
location= computeInformationControlLocation(subjectArea, size);
Rectangle controlBounds= Geometry.createRectangle(location, size);
cropToClosestMonitor(controlBounds);
location= Geometry.getLocation(controlBounds);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
location= computeInformationControlLocation(subjectArea, size);
Rectangle controlBounds= Geometry.createRectangle(location, size);
cropToClosestMonitor(controlBounds);
location= Geometry.getLocation(controlBounds);
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
validateSelectionRange(widgetSelection);
if (widgetSelection[0] >= 0) {
fTextWidget.setBlockSelectionBounds(Geometry.createRectangle(startLocation, Geometry.subtract(endLocation, startLocation)));
selectionChanged(startOffset, widgetLength);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
validateSelectionRange(widgetSelection);
if (widgetSelection[0] >= 0) {
fTextWidget.setBlockSelectionBounds(Geometry.createRectangle(startLocation, Geometry.subtract(endLocation, startLocation)));
selectionChanged(startOffset, widgetLength);
内容来源于网络,如有侵权,请联系作者删除!