diff -r 088331d4cb76 -r e67363288df1 javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java --- a/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Sat Sep 07 18:25:09 2013 +0200 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Thu Sep 26 14:20:18 2013 -0700 @@ -19,7 +19,6 @@ import net.java.html.canvas.Dimension; import net.java.html.canvas.Image; -import net.java.html.canvas.ImageData; import net.java.html.canvas.Style; /** @@ -84,19 +83,16 @@ public void scale(double x, double y); - public Object drawImage(Image image, double x, double y, Object nativeImage); + public Object drawImage(Image image, double x, double y, Object nativeImage); public Object drawImage(Image image, double x, double y, double width, double height, Object nativeImage); public Object drawImage(Image image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height, Object nativeImage); - public int getWidth(Image image, Object nativeImage); - + public int getHeight(Image image, Object nativeImage); - - - + /** * When implementing you can return an Object of your choice to enable * caching. Returning null means no caching. When caching is enabled, and @@ -123,70 +119,189 @@ */ public Object setStrokeStyle(Style style, Object nativeStyle); - public void setShadowColor(String color); - - public void setShadowBlur(double blur); - - public void setShadowOffsetX(double x); - - public void setShadowOffsetY(double y); - - public String getShadowColor(); - - public double getShadowBlur(); - - public double getShadowOffsetX(); - - public double getShadowOffsetY(); - +// public void setShadowColor(String color); +// +// public void setShadowBlur(double blur); +// +// public void setShadowOffsetX(double x); +// +// public void setShadowOffsetY(double y); +// +// public String getShadowColor(); +// +// public double getShadowBlur(); +// +// public double getShadowOffsetX(); +// +// public double getShadowOffsetY(); + /** + * Gets the current stroke line cap. + * + * @return {@code StrokeLineCap} with a value of Butt, Round, or Square. + */ public String getLineCap(); + /** + * Sets the current stroke line cap. + * + * @param style a value of Butt, Round, or Square. + */ public void setLineCap(String style); + /** + * Gets the current stroke line join. + * + * @return a value of Miter, Bevel, or Round. + */ public String getLineJoin(); + /** + * Sets the current stroke line join. + * + * @param style with a value of Miter, Bevel, or Round. + */ public void setLineJoin(String style); + /** + * Gets the current line width. + * + * @return value between 0 and infinity. + */ public double getLineWidth(); + /** + * Sets the current line width. + * + * @param width value in the range {0-positive infinity}, with any other + * value being ignored and leaving the value unchanged. + */ public void setLineWidth(double width); + /** + * Gets the current miter limit. v + * + * @return the miter limit value in the range {@code 0.0-positive infinity} + */ public double getMiterLimit(); + /** + * Sets the current miter limit. + * + * @param limit miter limit value between 0 and positive infinity with any + * other value being ignored and leaving the value unchanged. + */ public void setMiterLimit(double limit); + /** + * Gets the current Font. + * + * @return the Font + */ public String getFont(); + /** + * Sets the current Font. + * + */ public void setFont(String font); + /** + * Gets the current {@code TextAlignment}. + * + * @return TextAlignment with values of Left, Center, Right, or Justify. + */ public String getTextAlign(); + /** + * Defines horizontal text alignment, relative to the text origin. + * + * @param textAlign with values of Left, Center, Right. + */ public void setTextAlign(String textAlign); + /** + * Sets the current Text Baseline. + * + * @param baseline with values of Top, Center, Baseline, or Bottom + */ public String getTextBaseline(); - public void setTextBaseline(String textbaseline); + /** + * Sets the current Text Baseline. + * + * @param baseline with values of Top, Center, Baseline, or Bottom + */ + public void setTextBaseline(String baseline); + /** + * Fills the given string of text at position x, y (0,0 at top left) with + * the current fill paint attribute. + * + * @param text the string of text. + * @param x position on the x axis. + * @param y position on the y axis. + */ public void fillText(String text, double x, double y); + /** + * Fills text and includes a maximum width of the string. + * + * If the width of the text extends past max width, then it will be sized to + * fit. + * + * @param text the string of text. + * @param x position on the x axis. + * @param y position on the y axis. + * @param maxWidth maximum width the text string can have. + */ public void fillText(String text, double x, double y, double maxWidth); + /** + * The Dimension of this text using the current Font settings + * + * @param text + * @return the Dimension of this text using the current Font settings + */ public Dimension measureText(String text); + /** + * draws the given string of text at position x, y (0,0 at top left) with + * the current stroke paint attribute. + * + * @param text the string of text. + * @param x position on the x axis. + * @param y position on the y axis. + */ public void strokeText(String text, double x, double y); + /** + * Draws text with stroke paint and includes a maximum width of the string. + * + * If the width of the text extends past max width, then it will be sized to + * fit. + * + * @param text the string of text. + * @param x position on the x axis. + * @param y position on the y axis. + * @param maxWidth maximum width the text string can have. + */ public void strokeText(String text, double x, double y, double maxWidth); - public ImageData createPixelMap(double x, double y); - - public ImageData createPixelMap(ImageData imageData); - - public ImageData getPixelMap(double x, double y, double width, double height); - - public void putPixelMap(ImageData imageData, double x, double y); - - public void putPixelMap(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight); - +// public ImageData createPixelMap(double x, double y); +// +// public ImageData createPixelMap(ImageData imageData); +// +// public ImageData getPixelMap(double x, double y, double width, double height); +// +// public void putPixelMap(ImageData imageData, double x, double y); +// +// public void putPixelMap(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight); + /** + * Sets the global alpha of the current state. + * + * @param alpha value in the range {@code 0.0-1.0}. The value is clamped if + * it is out of range. + */ public void setGlobalAlpha(double alpha); public double getGlobalAlpha(); @@ -194,14 +309,14 @@ public void setGlobalCompositeOperation(String operation); public String getGlobalCompositeOperation(); - + public int getHeight(); public int getWidth(); - public void setHeight(int height); - - public void setWidth(int width); +// public void setHeight(int height); +// +// public void setWidth(int width); public Object mergeImages(Image a, Image b, Object cachedA, Object cachedB); }