# HG changeset patch # User Anton Epple # Date 1392212800 -3600 # Node ID 76859a545dd758384e01e1df72c14bd4b93429c4 # Parent 0726c97795243c76294cf25736c4dd0a7a3e472e added missing javadoc diff -r 0726c9779524 -r 76859a545dd7 javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java --- a/javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java Wed Feb 12 14:43:38 2014 +0100 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java Wed Feb 12 14:46:40 2014 +0100 @@ -188,7 +188,7 @@ * @param x the X position of the upper left corner of the rectangle. * @param y the Y position of the upper left corner of the rectangle. * @param width the width of the rectangle. - * @param height the height of the rectangle. + * @param height the height of the rectangle. */ public void fillRect(double x, double y, double width, double height) { graphicsEnvironmentImpl.fillRect(x, y, width, height); @@ -344,7 +344,7 @@ * Draws an image at the given x, y position using the width and height of * the given image. * - * @param image the image to be drawn. + * @param image the image to be drawn. * @param x the X coordinate on the destination for the upper left of the * image. * @param y the Y coordinate on the destination for the upper left of the @@ -359,7 +359,7 @@ * Draws an image into the given destination rectangle of the canvas. The * Image is scaled to fit into the destination rectagnle. * - * @param image the image to be drawn. + * @param image the image to be drawn. * @param x the X coordinate on the destination for the upper left of the * image. * @param y the Y coordinate on the destination for the upper left of the @@ -376,7 +376,7 @@ * Draws the current source rectangle of the given image to the given * destination rectangle of the Canvas. * - * @param image the image to be drawn. + * @param image the image to be drawn. * @param sx the source rectangle's X coordinate position. * @param sy the source rectangle's Y coordinate position. * @param sw the source rectangle's width. @@ -443,20 +443,19 @@ // public double getShadowOffsetY() { // return graphicsEnvironmentImpl.getShadowOffsetY(); // } - /** - * Gets the current stroke line cap attribute. - * - * @return a value of butt, round, or square. - */ + * Gets the current stroke line cap attribute. + * + * @return a value of butt, round, or square. + */ public String getLineCap() { return graphicsEnvironmentImpl.getLineCap(); } - + /** * Sets the current stroke line cap attribute. - * - * @param style a value of miter, bevel, or round. + * + * @param style a value of miter, bevel, or round. */ public void setLineCap(String style) { graphicsEnvironmentImpl.setLineCap(style); @@ -465,7 +464,7 @@ /** * Gets the current stroke line join attribute. * - * @return a value of miter, bevel, or round. + * @return a value of miter, bevel, or round. */ public String getLineJoin() { return graphicsEnvironmentImpl.getLineJoin(); @@ -474,8 +473,7 @@ /** * Sets the current stroke line join attribute. * - * @param style a value of miter, bevel, or - * round. + * @param style a value of miter, bevel, or round. */ public void setLineJoin(String style) { graphicsEnvironmentImpl.setLineJoin(style); @@ -672,25 +670,65 @@ graphicsEnvironmentImpl.strokeText(text, x, y, maxWidth); } + /** + * Get a pixel array that you can manipulate, e.g. apply effects / + * transparency + * + * @param x width + * @param y height + * @return a PixelMap + */ public ImageData createPixelMap(double x, double y) { return graphicsEnvironmentImpl.createPixelMap(x, y); } + /** + * Create a new ImageData object with the same dimensions as the object + * specified by imageData (this does not copy the image data) + * + * @param pixelMap + * @return + */ public ImageData createPixelMap(ImageData pixelMap) { return graphicsEnvironmentImpl.createPixelMap(pixelMap); } - + + /** + * Get the pixels for a region of your GraphicsContext + * @param x start x coordinate + * @param y start y coordinate + * @param width width + * @param height height + * @return + */ public ImageData getSnapshot(double x, double y, double width, double height) { return graphicsEnvironmentImpl.getPixelMap(x, y, width, height); } - + + /** + * Render an ImageData Object at the specified position + * @param pixelMap the Pixel array + * @param x start x coordinate + * @param y start y coordinate + */ public void drawPixelMap(ImageData pixelMap, double x, double y) { graphicsEnvironmentImpl.putPixelMap(pixelMap, x, y); } + /** + * Render an ImageData Object at the specified position + * @param pixelMap the Pixel array to draw + * @param x start x coordinate + * @param y start y coordinate + * @param dirtyx The horizontal (x) value, in pixels, where to place the image on the canvas + * @param dirtyy The vertical (y) value, in pixels, where to place the image on the canvas + * @param dirtywidth The width to use to draw the image on the canvas + * @param dirtyheight The height to use to draw the image on the canvas + */ public void drawPixelMap(ImageData pixelMap, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight) { graphicsEnvironmentImpl.putPixelMap(pixelMap, x, y, dirtyx, dirtyy, dirtywidth, dirtyheight); } + /** * Sets the global alpha of the current state. *