本文整理汇总了Java中org.eclipse.draw2d.Ellipse.add方法的典型用法代码示例。如果您正苦于以下问题:Java Ellipse.add方法的具体用法?Java Ellipse.add怎么用?Java Ellipse.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.Ellipse
的用法示例。
在下文中一共展示了Ellipse.add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContents
import org.eclipse.draw2d.Ellipse; //导入方法依赖的package包/类
protected void createContents() {
int size = mapMode.DPtoLP(2);
this.setBorder(new MarginBorder(size, size, size, size));
Ellipse whiteCircle = new Ellipse();
whiteCircle.setOutline(false);
whiteCircle.setLineWidth(1);
whiteCircle.setBackgroundColor(ColorConstants.white);
size = mapMode.DPtoLP(3);
whiteCircle.setBorder(new MarginBorder(size, size, size, size));
BorderLayout layout = new BorderLayout();
whiteCircle.setLayoutManager(layout);
Object data = BorderLayout.CENTER;
this.add(whiteCircle, data);
Ellipse blackCircle = new Ellipse();
blackCircle.setOutline(false);
blackCircle.setLineWidth(mapMode.DPtoLP(1));
blackCircle.setBackgroundColor(ColorConstants.black);
data = BorderLayout.CENTER;
whiteCircle.add(blackCircle, data);
}
示例2: createFigure
import org.eclipse.draw2d.Ellipse; //导入方法依赖的package包/类
/**
* Creates a filled circle containing an L like segment to simulate a clock.
*
* @see seg.jUCMNav.figures.PathNodeFigure#createFigure()
*/
protected void createFigure() {
ellipse = new Ellipse();
// we're making it larger than the empty point.
ellipse.setBounds(new Rectangle(preferredSize.width / 8, preferredSize.height / 8, DEFAULT_WIDTH * 3 / 4, DEFAULT_HEIGHT * 3 / 4));
ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref());
poly = new Polyline();
poly.addPoint(new Point(DEFAULT_WIDTH / 2, preferredSize.height / 8));
poly.addPoint(new Point(DEFAULT_WIDTH / 2, DEFAULT_HEIGHT / 2));
poly.addPoint(new Point(preferredSize.width * 7 / 8, DEFAULT_HEIGHT / 2));
poly.setAntialias(GeneralPreferencePage.getAntialiasingPref());
ellipse.add(poly);
ellipse.setLineWidth(2);
ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref());
poly.setLineWidth(2);
add(ellipse);
}