本文整理了Java中org.eclipse.jface.util.Geometry.subtract()
方法的一些代码示例,展示了Geometry.subtract()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.subtract()
方法的具体详情如下:
包路径:org.eclipse.jface.util.Geometry
类名称:Geometry
方法名:subtract
[英]Performs vector subtraction on two points. Returns a new point equal to (point1 - point2).
[中]对两个点执行向量减法。返回等于(点1-点2)的新点。
代码示例来源:origin: pentaho/pentaho-kettle
/**
* @param constrainee
* @param container
*/
private void constrainRectangleToContainer( Rectangle constrainee, Rectangle container ) {
Point originalSize = Geometry.getSize( constrainee );
Point containerSize = Geometry.getSize( container );
Point oversize = Geometry.subtract( originalSize, containerSize );
if ( oversize.x > 0 ) {
constrainee.width = originalSize.x - oversize.x;
}
if ( oversize.y > 0 ) {
constrainee.height = originalSize.y - oversize.y;
}
// Detect if the dialog was positioned outside the container
Geometry.moveInside( constrainee, container );
}
代码示例来源: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);
代码示例来源: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);
内容来源于网络,如有侵权,请联系作者删除!