API Review RT:17407 Canvas Node
Dr. Michael Paus
mp at jugs.org
Wed Apr 18 23:57:19 PDT 2012
A Canvas node is very important but we should not limit the
GraphicsContext to be only usable for it.
Instead we should make GraphicsContext an interface and Canvas should
then provide a CanvasGraphicsContext
which implements this interface. The advantage would be that code can be
written against that interface and
if someone else writes a renderer for other output formats you can then
immediately render into that format
too like it is currently done for SVG, PDF and other formats by tools
like Batik, iText, etc.
LG, Michael
Am 19.04.2012 00:36, schrieb joe andresen:
> Hello Everyone,
>
> We propose to add a Canvas node and GraphicsContext to a new
> javafx.scene.canvas package for JavaFX 2.2. The javafx.scene.canvas
> package provides a pair of classes for an immediate mode style API for
> rendering. Canvas Node works seemlessly with effects as well as
> Animation timers, and will be tightly bound to the new ImageOps API.
>
> This new API will allow HTML5 Canvas users to easily port their
> existing applications that make heavy use of the HTML5 canvas directly
> to JavaFX without the need to morph their application to fit the
> scenegraph model.
>
> You can Download and unzip the (preliminary) relevant docs here:
> JIRA: http://javafx-jira.kenai.com/browse/RT-17407
>
> Note that the docs are a work in progress but should be enough for API
> Review. (Also, Jira will be down Thursday 4/19 at 1400 PDT for a while).
>
> A list of the the methods for Canvas and GraphicsContext are listed
> below.
>
> Canvas:
>
> GraphicsContext getGraphicsContext2D()
> double getHeight()
> double getWidth()
> DoubleProperty heightProperty()
> void setHeight(double value)
> void setWidth(double value)
> DoubleProperty widthProperty()
>
> GraphicsContext:
> void appendSVGPath(java.lang.String svgpath)
> void applyEffect(Effect e)
> void arc(double centerX, double centerY, double radiusX, double
> radiusY, double startAngle, double length)
> void arcTo(double x1, double y1, double x2, double y2, double radius)
> void beginPath()
> void bezierCurveTo(double xc1, double yc1, double xc2, double yc2,
> double x1, double y1)
> void clearRect(double x, double y, double w, double h)
> void clip()
> void closePath()
> void drawArc(double x, double y, double w, double h, double
> startAngle, double arcExtent, ArcType closure)
> void drawImage(Image img, double x, double y)
> void drawImage(Image img, double x, double y, double w, double h)
> void drawImage(Image img, double sx, double sy, double sw, double
> sh, double dx, double dy, double dw, double dh)
> void drawLine(double x1, double y1, double x2, double y2)
> void drawOval(double x, double y, double w, double h)
> void drawPolygon(double[] xPoints, double[] yPoints, int nPoints)
> void drawPolyline(double[] xPoints, double[] yPoints, int nPoints)
> void drawRoundRect(double x, double y, double w, double h, double
> arcWidth, double arcHeight)
> void fill()
> void fillArc(double x, double y, double w, double h, double
> startAngle, double arcExtent, ArcType closure)
> void fillOval(double x, double y, double w, double h)
> void fillPolygon(double[] xPoints, double[] yPoints, int nPoints)
> void fillRect(double x, double y, double w, double h)
> void fillRoundRect(double x, double y, double w, double h, double
> arcWidth, double arcHeight)
> void fillText(java.lang.String text, double x, double y)
> void fillText(java.lang.String text, double x, double y, double
> maxWidth)
> Canvas getCanvas()
> boolean isPointInPath(double x, double y)
> void lineTo(double x1, double y1)
> double measureText(java.lang.String text)
> void moveTo(double x0, double y0)
> void putImageData(GraphicsContext.ImageData imagedata, double dx,
> double dy)
> void putImageData(GraphicsContext.ImageData imagedata, double dx,
> double dy, double dirtyX, double dirtyY, double dirtyWidth, double
> dirtyHeight)
> void quadraticCurveTo(double xc, double yc, double x1, double y1)
> void rect(double x, double y, double w, double h)
> void restore()
> void rotate(double degrees)
> void save()
> void scale(double x, double y)
> void setEffect(Effect e)
> void setFill(Paint p)
> void setFont(Font f)
> void setGlobalAlpha(double alpha)
> void setGlobalCompositeOperation(GraphicsContext.CompositeOperation
> op)
> void setLineCap(StrokeLineCap cap)
> void setLineJoin(StrokeLineJoin join)
> void setLineWidth(double lw)
> void setMiterLimit(double ml)
> void setStroke(Paint p)
> void setTextAlign(TextAlignment align)
> void setTextBaseline(VPos baseline)
> void setTransform(double mxx, double myx, double mxy, double myy,
> double mxt, double myt)
> void stroke()
> void strokeRect(double x, double y, double w, double h)
> void strokeText(java.lang.String text, double x, double y)
> void strokeText(java.lang.String text, double x, double y, double
> maxWidth)
> void transform(double mxx, double myx, double mxy, double myy,
> double mxt, double myt)
> void translate(double x, double y)
--
--------------------------------------------------------------------------------------
Dr. Michael Paus, Chairman of the Java User Group Stuttgart e.V. (JUGS).
For more information visit www.jugs.de.
More information about the openjfx-dev
mailing list