1.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Sat Sep 07 18:25:09 2013 +0200
1.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Thu Sep 26 14:20:18 2013 -0700
1.3 @@ -19,7 +19,6 @@
1.4
1.5 import net.java.html.canvas.Dimension;
1.6 import net.java.html.canvas.Image;
1.7 -import net.java.html.canvas.ImageData;
1.8 import net.java.html.canvas.Style;
1.9
1.10 /**
1.11 @@ -84,19 +83,16 @@
1.12
1.13 public void scale(double x, double y);
1.14
1.15 - public Object drawImage(Image image, double x, double y, Object nativeImage);
1.16 + public Object drawImage(Image image, double x, double y, Object nativeImage);
1.17
1.18 public Object drawImage(Image image, double x, double y, double width, double height, Object nativeImage);
1.19
1.20 public Object drawImage(Image image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height, Object nativeImage);
1.21
1.22 -
1.23 public int getWidth(Image image, Object nativeImage);
1.24 -
1.25 +
1.26 public int getHeight(Image image, Object nativeImage);
1.27 -
1.28 -
1.29 -
1.30 +
1.31 /**
1.32 * When implementing you can return an Object of your choice to enable
1.33 * caching. Returning null means no caching. When caching is enabled, and
1.34 @@ -123,70 +119,189 @@
1.35 */
1.36 public Object setStrokeStyle(Style style, Object nativeStyle);
1.37
1.38 - public void setShadowColor(String color);
1.39 -
1.40 - public void setShadowBlur(double blur);
1.41 -
1.42 - public void setShadowOffsetX(double x);
1.43 -
1.44 - public void setShadowOffsetY(double y);
1.45 -
1.46 - public String getShadowColor();
1.47 -
1.48 - public double getShadowBlur();
1.49 -
1.50 - public double getShadowOffsetX();
1.51 -
1.52 - public double getShadowOffsetY();
1.53 -
1.54 +// public void setShadowColor(String color);
1.55 +//
1.56 +// public void setShadowBlur(double blur);
1.57 +//
1.58 +// public void setShadowOffsetX(double x);
1.59 +//
1.60 +// public void setShadowOffsetY(double y);
1.61 +//
1.62 +// public String getShadowColor();
1.63 +//
1.64 +// public double getShadowBlur();
1.65 +//
1.66 +// public double getShadowOffsetX();
1.67 +//
1.68 +// public double getShadowOffsetY();
1.69 + /**
1.70 + * Gets the current stroke line cap.
1.71 + *
1.72 + * @return {@code StrokeLineCap} with a value of Butt, Round, or Square.
1.73 + */
1.74 public String getLineCap();
1.75
1.76 + /**
1.77 + * Sets the current stroke line cap.
1.78 + *
1.79 + * @param style a value of Butt, Round, or Square.
1.80 + */
1.81 public void setLineCap(String style);
1.82
1.83 + /**
1.84 + * Gets the current stroke line join.
1.85 + *
1.86 + * @return a value of Miter, Bevel, or Round.
1.87 + */
1.88 public String getLineJoin();
1.89
1.90 + /**
1.91 + * Sets the current stroke line join.
1.92 + *
1.93 + * @param style with a value of Miter, Bevel, or Round.
1.94 + */
1.95 public void setLineJoin(String style);
1.96
1.97 + /**
1.98 + * Gets the current line width.
1.99 + *
1.100 + * @return value between 0 and infinity.
1.101 + */
1.102 public double getLineWidth();
1.103
1.104 + /**
1.105 + * Sets the current line width.
1.106 + *
1.107 + * @param width value in the range {0-positive infinity}, with any other
1.108 + * value being ignored and leaving the value unchanged.
1.109 + */
1.110 public void setLineWidth(double width);
1.111
1.112 + /**
1.113 + * Gets the current miter limit. v
1.114 + *
1.115 + * @return the miter limit value in the range {@code 0.0-positive infinity}
1.116 + */
1.117 public double getMiterLimit();
1.118
1.119 + /**
1.120 + * Sets the current miter limit.
1.121 + *
1.122 + * @param limit miter limit value between 0 and positive infinity with any
1.123 + * other value being ignored and leaving the value unchanged.
1.124 + */
1.125 public void setMiterLimit(double limit);
1.126
1.127 + /**
1.128 + * Gets the current Font.
1.129 + *
1.130 + * @return the Font
1.131 + */
1.132 public String getFont();
1.133
1.134 + /**
1.135 + * Sets the current Font.
1.136 + *
1.137 + */
1.138 public void setFont(String font);
1.139
1.140 + /**
1.141 + * Gets the current {@code TextAlignment}.
1.142 + *
1.143 + * @return TextAlignment with values of Left, Center, Right, or Justify.
1.144 + */
1.145 public String getTextAlign();
1.146
1.147 + /**
1.148 + * Defines horizontal text alignment, relative to the text origin.
1.149 + *
1.150 + * @param textAlign with values of Left, Center, Right.
1.151 + */
1.152 public void setTextAlign(String textAlign);
1.153
1.154 + /**
1.155 + * Sets the current Text Baseline.
1.156 + *
1.157 + * @param baseline with values of Top, Center, Baseline, or Bottom
1.158 + */
1.159 public String getTextBaseline();
1.160
1.161 - public void setTextBaseline(String textbaseline);
1.162 + /**
1.163 + * Sets the current Text Baseline.
1.164 + *
1.165 + * @param baseline with values of Top, Center, Baseline, or Bottom
1.166 + */
1.167 + public void setTextBaseline(String baseline);
1.168
1.169 + /**
1.170 + * Fills the given string of text at position x, y (0,0 at top left) with
1.171 + * the current fill paint attribute.
1.172 + *
1.173 + * @param text the string of text.
1.174 + * @param x position on the x axis.
1.175 + * @param y position on the y axis.
1.176 + */
1.177 public void fillText(String text, double x, double y);
1.178
1.179 + /**
1.180 + * Fills text and includes a maximum width of the string.
1.181 + *
1.182 + * If the width of the text extends past max width, then it will be sized to
1.183 + * fit.
1.184 + *
1.185 + * @param text the string of text.
1.186 + * @param x position on the x axis.
1.187 + * @param y position on the y axis.
1.188 + * @param maxWidth maximum width the text string can have.
1.189 + */
1.190 public void fillText(String text, double x, double y, double maxWidth);
1.191
1.192 + /**
1.193 + * The Dimension of this text using the current Font settings
1.194 + *
1.195 + * @param text
1.196 + * @return the Dimension of this text using the current Font settings
1.197 + */
1.198 public Dimension measureText(String text);
1.199
1.200 + /**
1.201 + * draws the given string of text at position x, y (0,0 at top left) with
1.202 + * the current stroke paint attribute.
1.203 + *
1.204 + * @param text the string of text.
1.205 + * @param x position on the x axis.
1.206 + * @param y position on the y axis.
1.207 + */
1.208 public void strokeText(String text, double x, double y);
1.209
1.210 + /**
1.211 + * Draws text with stroke paint and includes a maximum width of the string.
1.212 + *
1.213 + * If the width of the text extends past max width, then it will be sized to
1.214 + * fit.
1.215 + *
1.216 + * @param text the string of text.
1.217 + * @param x position on the x axis.
1.218 + * @param y position on the y axis.
1.219 + * @param maxWidth maximum width the text string can have.
1.220 + */
1.221 public void strokeText(String text, double x, double y, double maxWidth);
1.222
1.223 - public ImageData createPixelMap(double x, double y);
1.224 -
1.225 - public ImageData createPixelMap(ImageData imageData);
1.226 -
1.227 - public ImageData getPixelMap(double x, double y, double width, double height);
1.228 -
1.229 - public void putPixelMap(ImageData imageData, double x, double y);
1.230 -
1.231 - public void putPixelMap(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
1.232 -
1.233 +// public ImageData createPixelMap(double x, double y);
1.234 +//
1.235 +// public ImageData createPixelMap(ImageData imageData);
1.236 +//
1.237 +// public ImageData getPixelMap(double x, double y, double width, double height);
1.238 +//
1.239 +// public void putPixelMap(ImageData imageData, double x, double y);
1.240 +//
1.241 +// public void putPixelMap(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
1.242 + /**
1.243 + * Sets the global alpha of the current state.
1.244 + *
1.245 + * @param alpha value in the range {@code 0.0-1.0}. The value is clamped if
1.246 + * it is out of range.
1.247 + */
1.248 public void setGlobalAlpha(double alpha);
1.249
1.250 public double getGlobalAlpha();
1.251 @@ -194,14 +309,14 @@
1.252 public void setGlobalCompositeOperation(String operation);
1.253
1.254 public String getGlobalCompositeOperation();
1.255 -
1.256 +
1.257 public int getHeight();
1.258
1.259 public int getWidth();
1.260
1.261 - public void setHeight(int height);
1.262 -
1.263 - public void setWidth(int width);
1.264 +// public void setHeight(int height);
1.265 +//
1.266 +// public void setWidth(int width);
1.267
1.268 public Object mergeImages(Image a, Image b, Object cachedA, Object cachedB);
1.269 }