# HG changeset patch # User Anton Epple # Date 1392190987 -3600 # Node ID 493cae4fd458458372850af6b91148b53e83a166 # Parent 8cb57e6c7012db1a7bbc63634a35f40d5f866be7 More JavaDoc improvements. diff -r 8cb57e6c7012 -r 493cae4fd458 javaquery/canvas/src/main/java/net/java/html/canvas/Dimension.java --- a/javaquery/canvas/src/main/java/net/java/html/canvas/Dimension.java Wed Feb 12 08:33:31 2014 +0100 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Dimension.java Wed Feb 12 08:43:07 2014 +0100 @@ -23,7 +23,8 @@ /** * Just a simple class to replace the need of java.awt.Dimension, since we only - * want to use Java core APIs to keep porting simple. + * want to use Java core APIs to keep porting simple. You shouldn't need to + * ever create one, unless you write an implementation of your own Graphicsenvironment. * * @author antonepple */ @@ -31,6 +32,11 @@ final double width, height; + /** + * Constructor + * @param width + * @param height + */ public Dimension(double width, double height) { this.width = width; this.height = height; diff -r 8cb57e6c7012 -r 493cae4fd458 javaquery/canvas/src/main/java/net/java/html/canvas/Image.java --- a/javaquery/canvas/src/main/java/net/java/html/canvas/Image.java Wed Feb 12 08:33:31 2014 +0100 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Image.java Wed Feb 12 08:43:07 2014 +0100 @@ -61,6 +61,11 @@ return src; } + /** + * get the width of this Image. Might be an expensive operation, depending on the + * GraphicsEnvironment, it might need to be rendered. + * @return the width of this Image. + */ public int getWidth() { ServiceLoader loader = ServiceLoader.load(GraphicsEnvironment.class); GraphicsEnvironment ge = null; @@ -71,7 +76,11 @@ return ge.getWidth(this, cached); } - + /** + * get the height of this Image. Might be an expensive operation, depending on the + * GraphicsEnvironment, it might need to be rendered. + * @return the height of this Image. + */ public int getHeight() { ServiceLoader loader = ServiceLoader.load(GraphicsEnvironment.class); GraphicsEnvironment ge = null; diff -r 8cb57e6c7012 -r 493cae4fd458 javaquery/canvas/src/main/java/net/java/html/canvas/ImageData.java --- a/javaquery/canvas/src/main/java/net/java/html/canvas/ImageData.java Wed Feb 12 08:33:31 2014 +0100 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/ImageData.java Wed Feb 12 08:43:07 2014 +0100 @@ -1,19 +1,19 @@ /** - * Back 2 Browser Bytecode Translator - * Copyright (C) 2012 Jaroslav Tulach + * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach + * * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2 of the License. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, version 2 of the License. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with this program. Look for COPYING file in the top folder. - * If not, see http://opensource.org/licenses/GPL-2.0. + * You should have received a copy of the GNU General Public License along with + * this program. Look for COPYING file in the top folder. If not, see + * http://opensource.org/licenses/GPL-2.0. */ package net.java.html.canvas; @@ -26,23 +26,89 @@ */ public interface ImageData { + /** + * get the height. + * + * @return the height + */ public double getHeight(); + /** + * get the width + * + * @return the width + */ public double getWidth(); + /** + * get the red value at a specified coordinate + * + * @param x + * @param y + * @return the red value as an int (0 -255) + */ public int getR(int x, int y); + /** + * get the green value at a specified coordinate + * + * @param x + * @param y + * @return the green value as an int (0 -255) + */ public int getG(int x, int y); + /** + * get the blue value at a specified coordinate + * + * @param x + * @param y + * @return the blue value as an int (0 -255) + */ public int getB(int x, int y); + /** + * get the alpha (transparency) value at a specified coordinate + * + * @param x + * @param y + * @return the alpha value as an int (0 - 255) + */ public int getA(int x, int y); + /** + * set the red value at a specified coordinate + * + * @param x + * @param y + * @param value the red value as an int (0 - 255) + */ public void setR(int x, int y, int value); + /** + * set the green value at a specified coordinate + * + * @param x + * @param y + * @param value the green value as an int (0 - 255) + */ public void setG(int x, int y, int value); + /** + * set the blue value at a specified coordinate + * + * @param x + * @param y + * @param value the blue value as an int (0 - 255) + */ public void setB(int x, int y, int value); + /** + * set the alpha (transparency) value at a specified coordinate + * + * @param x + * @param y + * @param value the alpha value as an int (0 - 255) + */ public void setA(int x, int y, int value); }