本文整理汇总了Java中org.eclipse.draw2d.Ellipse类的典型用法代码示例。如果您正苦于以下问题:Java Ellipse类的具体用法?Java Ellipse怎么用?Java Ellipse使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Ellipse类属于org.eclipse.draw2d包,在下文中一共展示了Ellipse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: FoundMessageFigure
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
FoundMessageFigure(final boolean isTransparent)
{
super(isTransparent);
final Ellipse circle = new Ellipse();
circle.setBackgroundColor(ColorConstants.lightGray);
circle.setLineWidth(1);
final Rectangle bounds = Rectangle.SINGLETON;
final int diameter = PreferencesPlugin.getDefault().eventHeight();
bounds.x = 0;
bounds.y = 0;
bounds.width = diameter;
bounds.height = diameter;
circle.setBounds(bounds);
final ConnectionEndpointLocator locator = new ConnectionEndpointLocator(this, false);
locator.setUDistance(0);
locator.setVDistance(0);
add(circle, locator);
}
示例3: LostMessageFigure
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
LostMessageFigure(final boolean isTransparent, final boolean isException)
{
super(isTransparent, isException);
final Ellipse circle = new Ellipse();
circle.setBackgroundColor(ColorConstants.lightGray);
circle.setLineWidth(1);
final Rectangle bounds = Rectangle.SINGLETON;
final int diameter = PreferencesPlugin.getDefault().eventHeight();
bounds.x = 0;
bounds.y = 0;
bounds.width = diameter;
bounds.height = diameter;
circle.setBounds(bounds);
final ConnectionEndpointLocator locator = new ConnectionEndpointLocator(this, true);
locator.setUDistance(0);
locator.setVDistance(0);
add(circle, locator);
}
示例4: 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);
}
示例5: EllipseController
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
public EllipseController ( final SymbolController controller, final org.eclipse.scada.vi.model.Ellipse element, final ResourceManager manager )
{
super ( controller, manager );
final PrecisionRectangle rect = new PrecisionRectangle ();
if ( element.getSize () != null )
{
rect.setPreciseSize ( element.getSize ().getWidth (), element.getSize ().getHeight () );
}
this.figure = new Ellipse () {
@Override
public void addNotify ()
{
super.addNotify ();
start ();
}
@Override
public void removeNotify ()
{
stop ();
super.removeNotify ();
}
};
this.figure.setBounds ( rect );
controller.addElement ( element, this );
applyCommon ( element );
}
示例6: createLayout
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
protected void createLayout () {
setLayoutManager(new XYLayout());
setBackgroundColor(Activator.getStartVertexImageColor());
setOpaque(true);
this.setBorder(null);
ellipse = new Ellipse();
add(ellipse);
name = new Label("");
add(name);
}
示例7: createEllipse
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
/**
* Creates the {@link Ellipse} of the main {@link IFigure}.
*
* @return the {@link Ellipse} of the main {@link IFigure}
*/
private Ellipse createEllipse() {
final Ellipse res = new Ellipse();
res.setSize(SIZE, SIZE);
res.setForegroundColor(ColorConstants.listBackground);
return res;
}
示例8: add
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
/**
* @see org.eclipse.draw2d.Figure#add(org.eclipse.draw2d.IFigure,
* java.lang.Object, int)
*/
@Override
public void add(IFigure figure, Object constraint, int index) {
if (!(figure instanceof Ellipse)) {
super.add(figure, constraint, index);
}
}
示例9: createPrimaryShape
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
protected Ellipse createPrimaryShape() {
switch (resolveSemanticElement().getKind()) {
case DEEP_HISTORY:
return new DeepHistoryFigure();
case SHALLOW_HISTORY:
return new ShallowHistoryFigure();
case INITIAL:
return new InitialStateFigure();
}
throw new IllegalStateException();
}
示例10: createFigure
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
/**
* A simple filled circle taking up half the available space.
*
* @see seg.jUCMNav.figures.PathNodeFigure#createFigure()
*/
protected void createFigure() {
ellipse = new Ellipse();
ellipse.setBounds(new Rectangle(preferredSize.width / 4, preferredSize.height / 4, DEFAULT_WIDTH / 2, DEFAULT_HEIGHT / 2));
ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref());
add(ellipse);
}
示例11: createFigure
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
/**
* An invisible ellipse two which to bind the anchors; not used otherwise.
*
* @see seg.jUCMNav.figures.PathNodeFigure#createFigure()
*/
protected void createFigure() {
ellipse = new Ellipse();
ellipse.setBounds(new Rectangle(preferredSize.width / 4, preferredSize.height / 4, 0, 0)); // Size: 0 (invisible)
ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref());
add(ellipse);
}
示例12: createFigureForModel
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
/**
* Return a IFigure depending on the instance of the current model element.
* This allows this EditPart to be used for both sublasses of Shape.
*/
private IFigure createFigureForModel() {
if (getModel() instanceof EllipticalShape) {
return new Ellipse();
} else if (getModel() instanceof RectangularShape) {
return new RectangleFigure();
} else {
// if Shapes gets extended the conditions above must be updated
throw new IllegalArgumentException();
}
}
示例13: createFigure
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
@Override
protected IFigure createFigure() {
IFigure f = new Ellipse();
f.setBackgroundColor(ColorConstants.black);
f.setSize(6, 6);
return f;
}
示例14: createPrimaryShape
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
@Override
public Ellipse createPrimaryShape() {
return new FinalStateFigure(getMapMode());
}
示例15: customizeFigure
import org.eclipse.draw2d.Ellipse; //导入依赖的package包/类
protected void customizeFigure() {
this.ellipse = new Ellipse();
add(this.ellipse, 0);
this.ellipse.setBounds(getBounds());
setSize(40, 40);
}