@Override public Canvas clip(Path path) { currentState().clipper = (JavaPath) path; return this; }
@Override public Canvas setMiterLimit(float miter) { currentState().miterLimit = miter; return this; }
@Override public Canvas setStrokeWidth(float w) { currentState().strokeWidth = w; return this; }
@Override public Canvas setStrokeWidth(float w) { currentState().strokeWidth = w; return this; }
@Override public Canvas setFillPattern(Pattern pattern) { currentState().fillPattern = (JavaPattern) pattern; currentState().fillGradient = null; currentState().fillColor = 0; return this; }
@Override public Canvas save() { // update saved transform currentState().transform = gfx.getTransform(); // clone to maintain current state stateStack.push(new JavaCanvasState(currentState())); return this; }
@Override public Canvas save() { // update saved transform currentState().transform = g2d.getTransform(); // clone to maintain current state stateStack.push(new JavaCanvasState(currentState())); return this; }
@Override public Canvas strokePath(Path path) { currentState().prepareStroke(g2d); g2d.setColor(new Color(currentState().strokeColor, false)); g2d.draw(((JavaPath) path).path); isDirty = true; return this; }
@Override public Canvas fillPath(Path path) { currentState().prepareFill(gfx); gfx.fill(((JavaPath) path).path); isDirty = true; return this; }
@Override protected Graphics2D gc() { currentState().prepareFill(gfx); return gfx; }
@Override public Canvas drawPoint(float x, float y) { currentState().prepareStroke(g2d); g2d.drawLine((int) x, (int) y, (int) x, (int) y); isDirty = true; return this; }
@Override protected Graphics2D gc() { currentState().prepareFill(g2d); return g2d; }
@Override public Canvas fillPath(Path path) { currentState().prepareFill(g2d); g2d.fill(((JavaPath) path).path); isDirty = true; return this; }
@Override public Canvas fillRect(float x, float y, float width, float height) { currentState().prepareFill(g2d); rect.setRect(x, y, width, height); g2d.fill(rect); isDirty = true; return this; }
@Override public Canvas fillRoundRect(float x, float y, float width, float height, float radius) { currentState().prepareFill(g2d); roundRect.setRoundRect(x, y, width, height, radius*2, radius*2); g2d.fill(roundRect); isDirty = true; return this; }
@Override public Canvas fillRect(float x, float y, float width, float height) { currentState().prepareFill(gfx); rect.setRect(x, y, width, height); gfx.fill(rect); isDirty = true; return this; }
@Override public Canvas fillRoundRect(float x, float y, float width, float height, float radius) { currentState().prepareFill(gfx); roundRect.setRoundRect(x, y, width, height, radius*2, radius*2); gfx.fill(roundRect); 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; }
@Override public Canvas strokeText(TextLayout layout, float x, float y) { currentState().prepareStroke(g2d); ((JavaTextLayout)layout).stroke(g2d, x, y); isDirty = true; return this; }