More JavaDoc improvements. canvas
authorAnton Epple <toni.epple@eppleton.de>
Wed, 12 Feb 2014 08:56:40 +0100
branchcanvas
changeset 1446619f507713a2
parent 1445 493cae4fd458
child 1447 3e3fb431d2b7
More JavaDoc improvements.
javaquery/canvas/src/main/java/net/java/html/canvas/Style.java
     1.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/Style.java	Wed Feb 12 08:43:07 2014 +0100
     1.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Style.java	Wed Feb 12 08:56:40 2014 +0100
     1.3 @@ -1,23 +1,22 @@
     1.4  /**
     1.5 - * Back 2 Browser Bytecode Translator
     1.6 - * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     1.7 + * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
     1.8 + * <jaroslav.tulach@apidesign.org>
     1.9   *
    1.10 - * This program is free software: you can redistribute it and/or modify
    1.11 - * it under the terms of the GNU General Public License as published by
    1.12 - * the Free Software Foundation, version 2 of the License.
    1.13 + * This program is free software: you can redistribute it and/or modify it under
    1.14 + * the terms of the GNU General Public License as published by the Free Software
    1.15 + * Foundation, version 2 of the License.
    1.16   *
    1.17 - * This program is distributed in the hope that it will be useful,
    1.18 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.19 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.20 - * GNU General Public License for more details.
    1.21 + * This program is distributed in the hope that it will be useful, but WITHOUT
    1.22 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    1.23 + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1.24 + * details.
    1.25   *
    1.26 - * You should have received a copy of the GNU General Public License
    1.27 - * along with this program. Look for COPYING file in the top folder.
    1.28 - * If not, see http://opensource.org/licenses/GPL-2.0.
    1.29 + * You should have received a copy of the GNU General Public License along with
    1.30 + * this program. Look for COPYING file in the top folder. If not, see
    1.31 + * http://opensource.org/licenses/GPL-2.0.
    1.32   */
    1.33  package net.java.html.canvas;
    1.34  
    1.35 -import java.util.Collection;
    1.36  import java.util.HashMap;
    1.37  import java.util.Objects;
    1.38  
    1.39 @@ -51,9 +50,9 @@
    1.40      }
    1.41  
    1.42      /**
    1.43 -     * A Fill Pattern using an Image Resource to create a fill style supporting 
    1.44 -     * different repeat styles repeat, repeat-x, repeat-y, or no-repeat. 
    1.45 -     * Default is repeat. 
    1.46 +     * A Fill Pattern using an Image Resource to create a fill style supporting
    1.47 +     * different repeat styles repeat, repeat-x, repeat-y, or no-repeat. Default
    1.48 +     * is repeat.
    1.49       */
    1.50      public static final class Pattern extends Style {
    1.51  
    1.52 @@ -61,9 +60,10 @@
    1.53          private final String repeat;
    1.54  
    1.55          /**
    1.56 -         * 
    1.57 +         *
    1.58           * @param imageResource the base image of thsi pattern
    1.59 -         * @param repeat the repeat pattern, possible values are repeat, repeat-x, repeat-y, or no-repeat.
    1.60 +         * @param repeat the repeat pattern, possible values are repeat,
    1.61 +         * repeat-x, repeat-y, or no-repeat.
    1.62           */
    1.63          public Pattern(Image imageResource, String repeat) {
    1.64              this.imageResource = imageResource;
    1.65 @@ -72,6 +72,7 @@
    1.66  
    1.67          /**
    1.68           * Get the base image of this pattern
    1.69 +         *
    1.70           * @return the base image of this pattern
    1.71           */
    1.72          public Image getImageResource() {
    1.73 @@ -80,6 +81,7 @@
    1.74  
    1.75          /**
    1.76           * Get the repeat style for this pattern
    1.77 +         *
    1.78           * @return return the repeat style
    1.79           */
    1.80          public String getRepeat() {
    1.81 @@ -88,6 +90,9 @@
    1.82  
    1.83      }
    1.84  
    1.85 +    /**
    1.86 +     * An RGB color
    1.87 +     */
    1.88      public static final class Color extends Style {
    1.89  
    1.90          private String web;
    1.91 @@ -102,8 +107,8 @@
    1.92          }
    1.93  
    1.94          /**
    1.95 -         * 
    1.96 -         * 
    1.97 +         *
    1.98 +         *
    1.99           * @return the Color value as a Web Color (e.g. #ff0000)
   1.100           */
   1.101          public String getAsString() {
   1.102 @@ -112,8 +117,8 @@
   1.103      }
   1.104  
   1.105      /**
   1.106 -     * A Linear Gradient. The GRadient has a direction defined by two coordinates
   1.107 -     * and stops defining the Color at a specific position.
   1.108 +     * A Linear Gradient. The Gradient has a direction defined by two
   1.109 +     * coordinates and stops defining the Color at a specific position.
   1.110       */
   1.111      public static class LinearGradient extends Style {
   1.112  
   1.113 @@ -121,7 +126,7 @@
   1.114          private double x0, y0, x1, y1;
   1.115  
   1.116          /**
   1.117 -         * 
   1.118 +         *
   1.119           * @param x0 the x coordinate of the start point for this gradient
   1.120           * @param y0 the y coordinate of the start point for this gradient
   1.121           * @param x1 the x coordinate of the end point for this gradient
   1.122 @@ -135,10 +140,11 @@
   1.123          }
   1.124  
   1.125          /**
   1.126 -         * Add a new Color stop. A color stop defines a fixed color at a position
   1.127 -         * along the coordinates.
   1.128 +         * Add a new Color stop. A color stop defines a fixed color at a
   1.129 +         * position along the coordinates.
   1.130 +         *
   1.131           * @param position the position of this stop in percent [0.0-1.0]
   1.132 -         * @param color A Color defined in web format (e.g. #ff0000) 
   1.133 +         * @param color A Color defined in web format (e.g. #ff0000)
   1.134           */
   1.135          void addColorStop(double position, String color) {
   1.136              if (stops == null) {
   1.137 @@ -148,50 +154,91 @@
   1.138          }
   1.139  
   1.140          /**
   1.141 -         * Get the stops of this gradient. 
   1.142 +         * Get the stops of this gradient.
   1.143 +         *
   1.144           * @return the stops of this gradient
   1.145           */
   1.146 -        public HashMap<Double, String> getStops(){
   1.147 +        public HashMap<Double, String> getStops() {
   1.148              return new HashMap<>(stops);
   1.149          }
   1.150 -        
   1.151 +
   1.152          /**
   1.153 -         * Set the stops as Position/Color pairs 
   1.154 +         * Set the stops as Position/Color pairs
   1.155 +         *
   1.156           * @param stops the stops for thsi Gradient
   1.157           */
   1.158 -        public void setStops(HashMap<Double, String> stops) {     
   1.159 +        public void setStops(HashMap<Double, String> stops) {
   1.160              this.stops = new HashMap<>(stops);
   1.161          }
   1.162  
   1.163 -        
   1.164 +        /**
   1.165 +         * Get the X coordinate of the Gradients start point
   1.166 +         *
   1.167 +         * @return x coordinate
   1.168 +         */
   1.169          public double getX0() {
   1.170              return x0;
   1.171          }
   1.172  
   1.173 +        /**
   1.174 +         * Set the X coordinate of the Gradients start point
   1.175 +         *
   1.176 +         * @param x0 x coordinate
   1.177 +         */
   1.178          public void setX0(double x0) {
   1.179              this.x0 = x0;
   1.180          }
   1.181  
   1.182 +        /**
   1.183 +         * Get the Y coordinate of the Gradients start point
   1.184 +         *
   1.185 +         * @return y coordinate
   1.186 +         */
   1.187          public double getY0() {
   1.188              return y0;
   1.189          }
   1.190  
   1.191 +        /**
   1.192 +         * Set the Y coordinate of the Gradients start point
   1.193 +         *
   1.194 +         * @param y0 y coordinate
   1.195 +         */
   1.196          public void setY0(double y0) {
   1.197              this.y0 = y0;
   1.198          }
   1.199  
   1.200 +        /**
   1.201 +         * Set the X coordinate of the Gradients end point
   1.202 +         *
   1.203 +         * @return x coordinate
   1.204 +         */
   1.205          public double getX1() {
   1.206              return x1;
   1.207          }
   1.208  
   1.209 +        /**
   1.210 +         * Set the X coordinate of the Gradients end point
   1.211 +         *
   1.212 +         * @param X coordinate
   1.213 +         */
   1.214          public void setX1(double x1) {
   1.215              this.x1 = x1;
   1.216          }
   1.217  
   1.218 +        /**
   1.219 +         * Get the Y coordinate of the Gradients end point
   1.220 +         *
   1.221 +         * @return y coordinate
   1.222 +         */
   1.223          public double getY1() {
   1.224              return y1;
   1.225          }
   1.226  
   1.227 +        /**
   1.228 +         * Set the Y coordinate of the Gradients end point
   1.229 +         *
   1.230 +         * @param y1 coordinate
   1.231 +         */
   1.232          public void setY1(double y1) {
   1.233              this.y1 = y1;
   1.234          }
   1.235 @@ -235,28 +282,59 @@
   1.236          }
   1.237      }
   1.238  
   1.239 +    /**
   1.240 +     * A Radial Gradient. Radial gradients are defined with two imaginary
   1.241 +     * circles, a starting circle and an ending circle. The gradient starts with
   1.242 +     * the start circle and moves towards the end circle.
   1.243 +     */
   1.244      public static final class RadialGradient extends LinearGradient {
   1.245  
   1.246          private double r0, r1;
   1.247  
   1.248 +        /**
   1.249 +         * Create a new RadialGradient
   1.250 +         *
   1.251 +         * @param x0 x Coordinate of starting circle
   1.252 +         * @param y0 y Coordinate of starting circle
   1.253 +         * @param r0 radius of starting circle
   1.254 +         * @param x1 x coordinate of ending circle
   1.255 +         * @param y1 y coordinate of ending circle
   1.256 +         * @param r1 radius of ending circle
   1.257 +         */
   1.258          RadialGradient(double x0, double y0, double r0, double x1, double y1, double r1) {
   1.259              super(x0, y0, x1, y1);
   1.260              this.r0 = r0;
   1.261              this.r1 = r1;
   1.262          }
   1.263  
   1.264 +        /**
   1.265 +         * get the radius of the start circle.
   1.266 +         * @return the radius
   1.267 +         */
   1.268          public double getR0() {
   1.269              return r0;
   1.270          }
   1.271  
   1.272 +        /**
   1.273 +         * set the radius of the start circle.
   1.274 +         * @param r0 the radius
   1.275 +         */
   1.276          public void setR0(double r0) {
   1.277              this.r0 = r0;
   1.278          }
   1.279  
   1.280 +        /**
   1.281 +         * get the radius of the end circle
   1.282 +         * @return the radius
   1.283 +         */
   1.284          public double getR1() {
   1.285              return r1;
   1.286          }
   1.287  
   1.288 +        /**
   1.289 +         * set the radius of the end circle.
   1.290 +         * @param r1 the radius.
   1.291 +         */
   1.292          public void setR1(double r1) {
   1.293              this.r1 = r1;
   1.294          }