@Override public Canvas fillCircle(float x, float y, float radius) { currentState().prepareFill(gfx); ellipse.setFrame(x - radius, y - radius, 2 * radius, 2 * radius); gfx.fill(ellipse); isDirty = true; return this; }
@Override public Canvas strokeCircle(float x, float y, float radius) { currentState().prepareStroke(gfx); ellipse.setFrame(x - radius, y - radius, 2 * radius, 2 * radius); gfx.draw(ellipse); isDirty = true; return this; }
@Override public Canvas fillCircle(float x, float y, float radius) { currentState().prepareFill(g2d); ellipse.setFrame(x - radius, y - radius, 2 * radius, 2 * radius); g2d.fill(ellipse); isDirty = true; return this; }
protected void build() throws SVGException { super.build(); StyleAttribute sty = new StyleAttribute(); if (getPres(sty.setName("cx"))) { cx = sty.getFloatValueWithUnits(); } if (getPres(sty.setName("cy"))) { cy = sty.getFloatValueWithUnits(); } if (getPres(sty.setName("rx"))) { rx = sty.getFloatValueWithUnits(); } if (getPres(sty.setName("ry"))) { ry = sty.getFloatValueWithUnits(); } ellipse.setFrame(cx - rx, cy - ry, rx * 2f, ry * 2f); }
@Override protected void build() throws SVGException { super.build(); StyleAttribute sty = new StyleAttribute(); if (getPres(sty.setName("cx"))) { cx = sty.getFloatValueWithUnits(); } if (getPres(sty.setName("cy"))) { cy = sty.getFloatValueWithUnits(); } if (getPres(sty.setName("r"))) { r = sty.getFloatValueWithUnits(); } circle.setFrame(cx - r, cy - r, r * 2f, r * 2f); }
@Override protected void build() throws SVGException { super.build(); StyleAttribute sty = new StyleAttribute(); if (getPres(sty.setName("cx"))) { cx = sty.getFloatValueWithUnits(); } if (getPres(sty.setName("cy"))) { cy = sty.getFloatValueWithUnits(); } if (getPres(sty.setName("r"))) { r = sty.getFloatValueWithUnits(); } circle.setFrame(cx - r, cy - r, r * 2f, r * 2f); }
protected void build() throws SVGException { super.build(); StyleAttribute sty = new StyleAttribute(); if (getPres(sty.setName("cx"))) { cx = sty.getFloatValueWithUnits(); } if (getPres(sty.setName("cy"))) { cy = sty.getFloatValueWithUnits(); } if (getPres(sty.setName("r"))) { r = sty.getFloatValueWithUnits(); } circle.setFrame(cx - r, cy - r, r * 2f, r * 2f); }
/** * Creates a path representing an ellipse that covers the rectangle * provided. * * @param x left of rectangle * @param y top of rectangle * @param width width of rectangle * @param height height of rectangle * @return created ellipse */ public static PSWTPath createEllipse(final float x, final float y, final float width, final float height) { TEMP_ELLIPSE.setFrame(x, y, width, height); final PSWTPath result = new PSWTPath(TEMP_ELLIPSE); result.setPaint(Color.white); return result; }
@Override public void drawOval(int x, int y, int width, int height, boolean fill) { ELLIPSE.setFrame(x, y, width, height); if (fill) { fill(ELLIPSE, true); } else { draw(ELLIPSE); } }
/** * Resets the path to an ellipse positioned at the coordinate provided with * the dimensions provided. * * @param x left of the ellipse * @param y top of the ellipse * @param width width of the ellipse * @param height height of the ellipse */ public void setPathToEllipse(final float x, final float y, final float width, final float height) { TEMP_ELLIPSE.setFrame(x, y, width, height); setShape(TEMP_ELLIPSE); }
@Override public void drawOval(int x, int y, int width, int height, boolean fill) { ELLIPSE.setFrame(x, y, width, height); if (fill) { fill(ELLIPSE, true); } else { draw(ELLIPSE); } }
@Override public Canvas fillCircle(float x, float y, float radius) { currentState().prepareFill(g2d); ellipse.setFrame(x - radius, y - radius, 2 * radius, 2 * radius); g2d.fill(ellipse); isDirty = true; return this; }
@Override public Canvas strokeCircle(float x, float y, float radius) { currentState().prepareStroke(gfx); ellipse.setFrame(x - radius, y - radius, 2 * radius, 2 * radius); gfx.draw(ellipse); isDirty = true; return this; }
protected void build() throws SVGException { super.build(); StyleAttribute sty = new StyleAttribute(); if (getPres(sty.setName("cx"))) cx = sty.getFloatValueWithUnits(); if (getPres(sty.setName("cy"))) cy = sty.getFloatValueWithUnits(); if (getPres(sty.setName("rx"))) rx = sty.getFloatValueWithUnits(); if (getPres(sty.setName("ry"))) ry = sty.getFloatValueWithUnits(); ellipse.setFrame(cx - rx, cy - ry, rx * 2f, ry * 2f); }
@Override public Canvas fillCircle(float x, float y, float radius) { currentState().prepareFill(gfx); ellipse.setFrame(x - radius, y - radius, 2 * radius, 2 * radius); gfx.fill(ellipse); isDirty = true; return this; }
@Override public Canvas strokeCircle(float x, float y, float radius) { currentState().prepareStroke(g2d); ellipse.setFrame(x - radius, y - radius, 2 * radius, 2 * radius); g2d.draw(ellipse); isDirty = true; return this; }
protected void build() throws SVGException { super.build(); StyleAttribute sty = new StyleAttribute(); if (getPres(sty.setName("cx"))) cx = sty.getFloatValueWithUnits(); if (getPres(sty.setName("cy"))) cy = sty.getFloatValueWithUnits(); if (getPres(sty.setName("r"))) r = sty.getFloatValueWithUnits(); circle.setFrame(cx - r, cy - r, r * 2f, r * 2f); }
@Override public Canvas strokeCircle(float x, float y, float radius) { currentState().prepareStroke(g2d); ellipse.setFrame(x - radius, y - radius, 2 * radius, 2 * radius); g2d.draw(ellipse); isDirty = true; return this; }
@Override protected void ellipseImpl(float x, float y, float w, float h) { ellipse.setFrame(x, y, w, h); drawShape(ellipse); }
public Shape getShape(float xMin, float yMin, float xMax, float yMax) { ellipse.setFrame(xMin, yMin, xMax - xMin, yMax - yMin); return ellipse; }