本文整理汇总了Java中org.eclipse.draw2d.geometry.Rectangle.getSize方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle.getSize方法的具体用法?Java Rectangle.getSize怎么用?Java Rectangle.getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.geometry.Rectangle
的用法示例。
在下文中一共展示了Rectangle.getSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CommentBoxSetConstraintCommand
import org.eclipse.draw2d.geometry.Rectangle; //导入方法依赖的package包/类
/**
* Create a command that can resize and/or move a shape.
*
* @param shape the shape to manipulate
* @param request the move and resize request
* @param newBounds the new size and location
* @throws IllegalArgumentException if any of the parameters is null
*/
public CommentBoxSetConstraintCommand(CommentBox shape, ChangeBoundsRequest request, Rectangle newBounds) {
if (shape == null || request == null || newBounds == null) {
throw new IllegalArgumentException();
}
this.shape = shape;
this.request = request;
this.newBounds = newBounds.getCopy();
this.newSize = newBounds.getSize();
setLabel("move / resize");
}
示例2: adjustConstraints
import org.eclipse.draw2d.geometry.Rectangle; //导入方法依赖的package包/类
public void adjustConstraints() {
int size = getColumns().size();
Rectangle r = getConstraints().getCopy();
Point point = r.getLocation();
Dimension dimension = r.getSize();
setConstraints(new Rectangle(point, new Dimension(dimension.width(), size >= 5 ? size * (i + 3) + 5 : h)));
}