@Override protected Circle makeShape() { final Circle circle = new Circle( SHAPE_RADIUS ); circle.setStrokeColor( "#000000" ) .setStrokeWidth( ShapesUtils.RGB_STROKE_WIDTH_SHAPE ) .setFillColor( "#ff0000" ) .setDraggable( false ); return circle; }
@Override public double getWidth() { return circle.getRadius() * 2; }
/** * Constructor. Creates an instance of a circle. * * @param radius */ public Circle(double radius) { super(ShapeType.CIRCLE); setRadius(radius); }
public WiresExampleTreeNode1( final Circle shape ) { circle = shape; bounding = new Circle( circle.getRadius() + ( BOUNDARY_SIZE / 2 ) ); bounding.setStrokeWidth( BOUNDARY_SIZE ); bounding.setAlpha( 0.1 ); plus.setTextAlign( TextAlign.CENTER ); plus.setTextBaseLine( TextBaseLine.MIDDLE ); plus.setFillColor( ColorName.CORNFLOWERBLUE ); plus.setStrokeColor( ColorName.BLUE ); add( circle ); }
@Override public Circle create(JSONObject node, ValidationContext ctx) throws ValidationException { return new Circle(node); } }
/** * Sets this circle's radius. * * @param radius * @return this Circle */ public Circle setRadius(double radius) { getAttributes().setRadius(radius); return this; }
/** * Gets this circle's radius. * * @return double */ public double getRadius() { return getAttributes().getRadius(); }
@Override protected Circle makeShape() { final Circle circle = new Circle( SHAPE_RADIUS ); circle.setStrokeColor( "#000000" ) .setStrokeWidth( ShapesUtils.RGB_STROKE_WIDTH_SHAPE ) .setFillColor( "#660099" ) .setDraggable( false ); return circle; }
@Override public double getHeight() { return circle.getRadius() * 2; }
@Override protected Circle makeShape() { final Circle circle = new Circle( SHAPE_RADIUS ); circle.setStrokeColor( "#000000" ) .setStrokeWidth( ShapesUtils.RGB_STROKE_WIDTH_SHAPE ) .setFillColor( "#ffff00" ) .setDraggable( false ); return circle; }
/** * Draws this circle * * @param context the {@link Context2D} used to draw this circle. */ @Override public boolean prepare(Context2D context, Attributes attr, double alpha) { context.beginPath(); context.arc(0, 0, getRadius(), 0, Math.PI * 2, true); context.closePath(); return true; }