本文整理汇总了Java中org.eclipse.draw2d.RectangleFigure.setPreferredSize方法的典型用法代码示例。如果您正苦于以下问题:Java RectangleFigure.setPreferredSize方法的具体用法?Java RectangleFigure.setPreferredSize怎么用?Java RectangleFigure.setPreferredSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.RectangleFigure
的用法示例。
在下文中一共展示了RectangleFigure.setPreferredSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRootTreeNode
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
protected TreeNode createRootTreeNode(IFigure parent) {
final List<IFigure> rootFigures = getGraphRootFigures(parent);
if (rootFigures.size() > 1) {
// initializes a "virtual" root
// tree level (needed for correct size calculations)
RectangleFigure rootFigure = new RectangleFigure();
rootFigure.setPreferredSize(1, 1);
rootFigure.setSize(1, 1);
setConstraint(rootFigure, new Rectangle(0, 0, 0, 0));
TreeNode rootTreeNode = new TreeNode(null, rootFigure);
for (IFigure figure : rootFigures) {
rootTreeNode.children.add(new TreeNode(null, figure));
}
return rootTreeNode;
} else if (rootFigures.size() == 1) {
return new TreeNode(null, rootFigures.get(0));
}
return null;
}
示例2: SplitFigure
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
public SplitFigure(int orientation) {
this.orientation = orientation;
setLayoutManager(new SplitFigureLayout());
dividerFigure = new RectangleFigure();
dividerFigure.setOutline(false);
dividerFigure.setBorder(new SimpleRaisedBorder());
switch(getOrientation()) {
case HORIZONTAL_SPLIT:
dividerFigure.setSize(5, 0);
dividerFigure.setPreferredSize(new Dimension(5, 0));
break;
case VERTICAL_SPLIT:
dividerFigure.setSize(0, 5);
dividerFigure.setPreferredSize(new Dimension(0, 5));
break;
}
add(dividerFigure, DIVIDER);
}