diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk')
5 files changed, 161 insertions, 36 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java index 76506fa99c..67b3792c87 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java @@ -191,8 +191,7 @@ public Cursor(Device device, int style) { * <li>ERROR_NULL_ARGUMENT - if the source is null</li> * <li>ERROR_NULL_ARGUMENT - if the mask is null and the source does not have a mask</li> * <li>ERROR_INVALID_ARGUMENT - if the source and the mask are not the same - * size, or either is not of depth one, or if the hotspot is outside - * the bounds of the image</li> + * size, or if the hotspot is outside the bounds of the image</li> * </ul> * @exception SWTError <ul> * <li>ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation</li> diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java index 005f9e44aa..5087118d20 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java @@ -367,12 +367,12 @@ public void drawFocus(int x, int y, int width, int height) { * <li>ERROR_NULL_ARGUMENT - if the image is null</li> * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> * <li>ERROR_INVALID_ARGUMENT - if the given coordinates are outside the bounds of the image</li> - * @exception SWTError <ul> - * <li>ERROR_NO_HANDLES - if no handles are available to perform the operation</li> - * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> + * @exception SWTError <ul> + * <li>ERROR_NO_HANDLES - if no handles are available to perform the operation</li> + * </ul> */ public void drawImage(Image image, int x, int y) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); @@ -406,12 +406,12 @@ public void drawImage(Image image, int x, int y) { * <li>ERROR_INVALID_ARGUMENT - if any of the width or height arguments are negative. * <li>ERROR_INVALID_ARGUMENT - if the source rectangle is not contained within the bounds of the source image</li> * </ul> - * @exception SWTError <ul> - * <li>ERROR_NO_HANDLES - if no handles are available to perform the operation</li> - * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> + * @exception SWTError <ul> + * <li>ERROR_NO_HANDLES - if no handles are available to perform the operation</li> + * </ul> */ public void drawImage(Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); @@ -691,6 +691,9 @@ public void drawOval(int x, int y, int width, int height) { OS.gdk_draw_arc(data.drawable, handle, 0, x, y, width, height, 0, 23040); } +/** + * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE + */ public void drawPath(Path path) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (path.handle == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); @@ -855,14 +858,16 @@ public void drawRectangle(Rectangle rect) { * right edges of the rectangle are at <code>x</code> and <code>x + width</code>. * The top and bottom edges are at <code>y</code> and <code>y + height</code>. * The <em>roundness</em> of the corners is specified by the - * <code>arcWidth</code> and <code>arcHeight</code> arguments. + * <code>arcWidth</code> and <code>arcHeight</code> arguments, which + * are respectively the width and height of the ellipse used to draw + * the corners. * * @param x the x coordinate of the rectangle to be drawn * @param y the y coordinate of the rectangle to be drawn * @param width the width of the rectangle to be drawn * @param height the height of the rectangle to be drawn - * @param arcWidth the horizontal diameter of the arc at the four corners - * @param arcHeight the vertical diameter of the arc at the four corners + * @param arcWidth the width of the arc + * @param arcHeight the height of the arc * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> @@ -1328,6 +1333,9 @@ public void fillOval(int x, int y, int width, int height) { OS.gdk_gc_set_foreground(handle, color); } +/** + * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE + */ public void fillPath (Path path) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (path.handle == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); @@ -1464,8 +1472,8 @@ public void fillRectangle(Rectangle rect) { * @param y the y coordinate of the rectangle to be filled * @param width the width of the rectangle to be filled * @param height the height of the rectangle to be filled - * @param arcWidth the horizontal diameter of the arc at the four corners - * @param arcHeight the vertical diameter of the arc at the four corners + * @param arcWidth the width of the arc + * @param arcHeight the height of the arc * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> @@ -1584,6 +1592,9 @@ public int getAdvanceWidth(char ch) { return stringExtent(new String(new char[]{ch})).x; } +/** + * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE + */ public int getAlpha() { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); initCairo(); @@ -1758,6 +1769,19 @@ public Color getForeground() { return Color.gtk_new(data.device, color); } +/** + * Returns the receiver's line cap style, which will be one + * of the constants <code>SWT.CAP_FLAT</code>, <code>SWT.CAP_ROUND</code>, + * or <code>SWT.CAP_SQUARE</code>. + * + * @return the cap style used for drawing lines + * + * @exception SWTException <ul> + * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * </ul> + * + * @since 3.1 + */ public int getLineCap() { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); GdkGCValues values = new GdkGCValues(); @@ -1771,6 +1795,17 @@ public int getLineCap() { return cap; } +/** + * Returns the receiver's line dash style. + * + * @return the lin dash style used for drawing lines + * + * @exception SWTException <ul> + * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * </ul> + * + * @since 3.1 + */ public int[] getLineDash() { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); byte[] dash_list = data.dashes; @@ -1782,6 +1817,19 @@ public int[] getLineDash() { return dashes; } +/** + * Returns the receiver's line join style, which will be one + * of the constants <code>SWT.JOIN_MITER</code>, <code>SWT.JOIN_ROUND</code>, + * or <code>SWT.JOIN_BEVEL</code>. + * + * @return the join style used for drawing lines + * + * @exception SWTException <ul> + * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * </ul> + * + * @since 3.1 + */ public int getLineJoin() { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); GdkGCValues values = new GdkGCValues(); @@ -1854,6 +1902,9 @@ public int getStyle () { return data.style; } +/** + * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE + */ public void getTransform(Transform transform) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (transform == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); @@ -2034,6 +2085,9 @@ boolean isIdentity(int /*long*/ matrix) { return a[0] == 1 && b[0] == 0 && c[0] == 0 && d[0] == 1 && tx[0] == 0 && ty[0] == 0; } +/** + * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE + */ public void setAlpha(int alpha) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); initCairo(); @@ -2164,6 +2218,9 @@ public void setClipping(int x, int y, int width, int height) { OS.gdk_region_destroy(clipRgn); } +/** + * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE + */ public void setClipping(Path path) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (path != null && path.isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); @@ -2202,8 +2259,8 @@ public void setClipping(Rectangle rect) { * by the argument. * * @param region the clipping region. - * - * * @exception IllegalArgumentException <ul> + * + * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li> * </ul> * @exception SWTException <ul> @@ -2289,6 +2346,22 @@ public void setForeground(Color color) { } } +/** + * Sets the receiver's line cap style to the argument, which must be one + * of the constants <code>SWT.CAP_FLAT</code>, <code>SWT.CAP_ROUND</code>, + * or <code>SWT.CAP_SQUARE</code>. + * + * @param cap the cap style to be used for drawing lines + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_INVALID_ARGUMENT - if the style is not valid</li> + * </ul> + * @exception SWTException <ul> + * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * </ul> + * + * @since 3.1 + */ public void setLineCap(int cap) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); int cap_style = 0, cairo_style = 0; @@ -2318,6 +2391,20 @@ public void setLineCap(int cap) { } } +/** + * Sets the receiver's line dash style to the argument. + * + * @param dashes the dash style to be used for drawing lines + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_INVALID_ARGUMENT - if any of the values in the array is less than or equal 0</li> + * </ul> + * @exception SWTException <ul> + * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * </ul> + * + * @since 3.1 + */ public void setLineDash(int[] dashes) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (dashes != null && dashes.length > 0) { @@ -2352,6 +2439,22 @@ public void setLineDash(int[] dashes) { } } +/** + * Sets the receiver's line join style to the argument, which must be one + * of the constants <code>SWT.JOIN_MITER</code>, <code>SWT.JOIN_ROUND</code>, + * or <code>SWT.JOIN_BEVEL</code>. + * + * @param join the join style to be used for drawing lines + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_INVALID_ARGUMENT - if the style is not valid</li> + * </ul> + * @exception SWTException <ul> + * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * </ul> + * + * @since 3.1 + */ public void setLineJoin(int join) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); int join_style = 0, cairo_style = 0; @@ -2389,6 +2492,9 @@ public void setLineJoin(int join) { * * @param lineStyle the style to be used for drawing lines * + * @exception IllegalArgumentException <ul> + * <li>ERROR_INVALID_ARGUMENT - if the style is not valid</li> + * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> @@ -2507,6 +2613,9 @@ void setString(String string, int flags) { data.drawFlags = flags; } +/** + * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE + */ public void setTransform(Transform transform) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (transform == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java index cea1a8e05f..f31fe2e751 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java @@ -386,12 +386,12 @@ public Image(Device device, Rectangle bounds) { * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * <li>ERROR_NULL_ARGUMENT - if the image data is null</li> * </ul> - * @exception SWTError <ul> - * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> - * </ul> * @exception SWTException <ul> * <li>ERROR_UNSUPPORTED_DEPTH - if the depth of the ImageData is not supported</li> * </ul> + * @exception SWTError <ul> + * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> + * </ul> */ public Image(Device device, ImageData data) { if (device == null) device = Device.getDevice(); @@ -403,10 +403,8 @@ public Image(Device device, ImageData data) { /** * Constructs an instance of this class, whose type is * <code>SWT.ICON</code>, from the two given <code>ImageData</code> - * objects. The two images must be the same size, and the mask image - * must have a color depth of 1. Pixel transparency in either image - * will be ignored. If either image is an icon to begin with, an - * exception is thrown. + * objects. The two images must be the same size. Pixel transparency + * in either image will be ignored. * <p> * The mask image should contain white wherever the icon is to be visible, * and black wherever the icon is to be transparent. In addition, @@ -421,9 +419,7 @@ public Image(Device device, ImageData data) { * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * <li>ERROR_NULL_ARGUMENT - if either the source or mask is null </li> - * <li>ERROR_INVALID_ARGUMENT - if source and mask are different sizes or - * if the mask is not monochrome, or if either the source or mask - * is already an icon</li> + * <li>ERROR_INVALID_ARGUMENT - if source and mask are different sizes</li> * </ul> * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> @@ -449,7 +445,8 @@ public Image(Device device, ImageData source, ImageData mask) { * Constructs an instance of this class by loading its representation * from the specified input stream. Throws an error if an error * occurs while loading the image, or if the result is an image - * of an unsupported type. + * of an unsupported type. Application code is still responsible + * for closing the input stream. * <p> * This constructor is provided for convenience when loading a single * image only. If the stream contains multiple images, only the first @@ -473,7 +470,8 @@ public Image(Device device, ImageData source, ImageData mask) { * <li>ERROR_INVALID_IMAGE - if the image file contains invalid data </li> * <li>ERROR_IO - if an IO error occurs while reading data</li> * <li>ERROR_UNSUPPORTED_DEPTH - if the InputStream describes an image with an unsupported depth</li> - * </ul> + * <li>ERROR_UNSUPPORTED_FORMAT - if the image file contains an unrecognized format</li> + * * </ul> * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> * </ul> @@ -506,6 +504,7 @@ public Image(Device device, InputStream stream) { * <li>ERROR_INVALID_IMAGE - if the image file contains invalid data </li> * <li>ERROR_IO - if an IO error occurs while reading data</li> * <li>ERROR_UNSUPPORTED_DEPTH - if the image file has an unsupported depth</li> + * <li>ERROR_UNSUPPORTED_FORMAT - if the image file contains an unrecognized format</li> * </ul> * @exception SWTError <ul> * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li> diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java index 11dcd66eef..2d26d47d0f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java @@ -61,12 +61,12 @@ public Region() { * * @param device the device on which to allocate the region * -* @exception SWTError <ul> - * <li>ERROR_NO_HANDLES if a handle could not be obtained for region creation</li> - * </ul> * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * </ul> + * @exception SWTError <ul> + * <li>ERROR_NO_HANDLES if a handle could not be obtained for region creation</li> + * </ul> * * @see #dispose * @@ -134,9 +134,13 @@ public void add(Rectangle rect) { * Adds the given rectangle to the collection of polygons * the receiver maintains to describe its area. * - * @param rect the rectangle to merge with the receiver + * @param x the x coordinate of the rectangle + * @param y the y coordinate of the rectangle + * @param width the width coordinate of the rectangle + * @param height the height coordinate of the rectangle * * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the argument is null</li> * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li> * </ul> * @exception SWTException <ul> @@ -311,7 +315,10 @@ public void intersect(Rectangle rect) { * Intersects the given rectangle to the collection of polygons * the receiver maintains to describe its area. * - * @param rect the rectangle to intersect with the receiver + * @param x the x coordinate of the rectangle + * @param y the y coordinate of the rectangle + * @param width the width coordinate of the rectangle + * @param height the height coordinate of the rectangle * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li> @@ -486,9 +493,13 @@ public void subtract(Rectangle rect) { * Subtracts the given rectangle from the collection of polygons * the receiver maintains to describe its area. * - * @param rect the rectangle to subtract from the receiver + * @param x the x coordinate of the rectangle + * @param y the y coordinate of the rectangle + * @param width the width coordinate of the rectangle + * @param height the height coordinate of the rectangle * * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the argument is null</li> * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li> * </ul> * @exception SWTException <ul> @@ -556,7 +567,7 @@ public void translate (int x, int y) { * Translate all of the polygons the receiver maintains to describe * its area by the specified point. * - * @param point the point to translate + * @param pt the point to translate * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the argument is null</li> diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java index d2a972231a..fa7a6108e8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java @@ -240,6 +240,9 @@ public void dispose() { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> + * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the gc is null</li> + * </ul> */ public void draw(GC gc, int x, int y) { checkLayout (); @@ -264,6 +267,9 @@ public void draw(GC gc, int x, int y) { * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> + * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the gc is null</li> + * </ul> */ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground) { checkLayout (); @@ -789,6 +795,7 @@ int _getOffset (int offset, int movement, boolean forward) { * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the trailing length is less than <code>1</code></li> + * <li>ERROR_NULL_ARGUMENT - if the point is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> @@ -1102,7 +1109,7 @@ public void setAlignment (int alignment) { * </ul> * * @see #setDescent(int) - * @see #getLineMetrics() + * @see #getLineMetrics(int) */ public void setAscent (int ascent) { checkLayout(); @@ -1128,7 +1135,7 @@ public void setAscent (int ascent) { * </ul> * * @see #setAscent(int) - * @see #getLineMetrics() + * @see #getLineMetrics(int) */ public void setDescent (int descent) { checkLayout(); |