diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java | 150 |
1 files changed, 131 insertions, 19 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java index f42d211901..18be591589 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java @@ -89,8 +89,8 @@ GC() { /** * Constructs a new instance of this class which has been * configured to draw on the specified drawable. Sets the - * foreground and background color in the GC to match those - * in the drawable. + * foreground color, background color and font in the GC + * to match those in the drawable. * <p> * You must dispose the graphics context when it is no longer required. * </p> @@ -114,8 +114,8 @@ public GC(Drawable drawable) { /** * Constructs a new instance of this class which has been * configured to draw on the specified drawable. Sets the - * foreground and background color in the GC to match those - * in the drawable. + * foreground color, background color and font in the GC + * to match those in the drawable. * <p> * You must dispose the graphics context when it is no longer required. * </p> @@ -992,7 +992,12 @@ public void drawOval(int x, int y, int width, int height) { /** * Draws the path described by the parameter. - * + * <p> + * This operation requires the operating system's advanced + * graphics subsystem which may not be available on some + * platforms. + * </p> + * * @param path the path to draw * * @exception IllegalArgumentException <ul> @@ -1001,6 +1006,7 @@ public void drawOval(int x, int y, int width, int height) { * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> * * @see Path @@ -1366,7 +1372,7 @@ public void drawText(String string, int x, int y, boolean isTransparent) { * @param string the string to be drawn * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn - * @param flags the flags specifing how to process the text + * @param flags the flags specifying how to process the text * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> @@ -1618,6 +1624,11 @@ public void fillOval(int x, int y, int width, int height) { /** * Fills the path described by the parameter. + * <p> + * This operation requires the operating system's advanced + * graphics subsystem which may not be available on some + * platforms. + * </p> * * @param path the path to fill * @@ -1627,6 +1638,7 @@ public void fillOval(int x, int y, int width, int height) { * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> * * @see Path @@ -1897,6 +1909,7 @@ public Pattern getBackgroundPattern() { * </ul> * * @see #setAdvanced + * * @since 3.1 */ public boolean getAdvanced() { @@ -2235,6 +2248,17 @@ public int getInterpolation() { return SWT.DEFAULT; } +/** + * Returns the receiver's line attributes. + * + * @return the line attributes used for drawing lines + * + * @exception SWTException <ul> + * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * </ul> + * + * @since 3.3 + */ public LineAttributes getLineAttributes() { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); float[] dashes = null; @@ -2267,7 +2291,7 @@ public int getLineCap() { * Returns the receiver's line dash style. The default value is * <code>null</code>. * - * @return the lin dash style used for drawing lines + * @return the line dash style used for drawing lines * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> @@ -2514,8 +2538,7 @@ boolean isIdentity(float[] transform) { * advanced and normal graphics operations. Because the two subsystems are * different, their output may differ. Switching to advanced graphics before * any graphics operations are performed ensures that the output is consistent. - * </p> - * <p> + * </p><p> * Advanced graphics may not be installed for the operating system. In this * case, this operation does nothing. Some operating system have only one * graphics subsystem, so switching from normal to advanced graphics does @@ -2535,6 +2558,7 @@ boolean isIdentity(float[] transform) { * @see #setBackgroundPattern * @see #setClipping(Path) * @see #setForegroundPattern + * @see #setLineAttributes * @see #setInterpolation * @see #setTextAntialias * @see #setTransform @@ -2558,13 +2582,21 @@ public void setAdvanced(boolean advanced) { /** * Sets the receiver's alpha value. - * + * <p> + * This operation requires the operating system's advanced + * graphics subsystem which may not be available on some + * platforms. + * </p> * @param alpha the alpha value * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> * + * @see #getAdvanced + * @see #setAdvanced + * * @since 3.1 */ public void setAlpha(int alpha) { @@ -2578,6 +2610,11 @@ public void setAlpha(int alpha) { * which must be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> * or <code>SWT.ON</code>. Note that this controls anti-aliasing for all * <em>non-text drawing</em> operations. + * <p> + * This operation requires the operating system's advanced + * graphics subsystem which may not be available on some + * platforms. + * </p> * * @param antialias the anti-aliasing setting * @@ -2587,8 +2624,11 @@ public void setAlpha(int alpha) { * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> * + * @see #getAdvanced + * @see #setAdvanced * @see #setTextAntialias * * @since 3.1 @@ -2638,7 +2678,12 @@ public void setBackground(Color color) { /** * Sets the background pattern. The default value is <code>null</code>. - * + * <p> + * This operation requires the operating system's advanced + * graphics subsystem which may not be available on some + * platforms. + * </p> + * * @param pattern the new background pattern * * @exception IllegalArgumentException <ul> @@ -2646,9 +2691,12 @@ public void setBackground(Color color) { * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> * * @see Pattern + * @see #getAdvanced + * @see #setAdvanced * * @since 3.1 */ @@ -2714,8 +2762,13 @@ public void setClipping(int x, int y, int width, int height) { /** * Sets the area of the receiver which can be changed * by drawing operations to the path specified - * by the argument. - * + * by the argument. + * <p> + * This operation requires the operating system's advanced + * graphics subsystem which may not be available on some + * platforms. + * </p> + * * @param path the clipping path. * * @exception IllegalArgumentException <ul> @@ -2723,9 +2776,12 @@ public void setClipping(int x, int y, int width, int height) { * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> * * @see Path + * @see #getAdvanced + * @see #setAdvanced * * @since 3.1 */ @@ -2934,7 +2990,11 @@ public void setForeground(Color color) { /** * Sets the foreground pattern. The default value is <code>null</code>. - * + * <p> + * This operation requires the operating system's advanced + * graphics subsystem which may not be available on some + * platforms. + * </p> * @param pattern the new foreground pattern * * @exception IllegalArgumentException <ul> @@ -2942,9 +3002,12 @@ public void setForeground(Color color) { * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> * * @see Pattern + * @see #getAdvanced + * @see #setAdvanced * * @since 3.1 */ @@ -2962,7 +3025,12 @@ public void setForegroundPattern(Pattern pattern) { * Sets the receiver's interpolation setting to the parameter, which * must be one of <code>SWT.DEFAULT</code>, <code>SWT.NONE</code>, * <code>SWT.LOW</code> or <code>SWT.HIGH</code>. - * + * <p> + * This operation requires the operating system's advanced + * graphics subsystem which may not be available on some + * platforms. + * </p> + * * @param interpolation the new interpolation setting * * @exception IllegalArgumentException <ul> @@ -2971,8 +3039,12 @@ public void setForegroundPattern(Pattern pattern) { * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> * + * @see #getAdvanced + * @see #setAdvanced + * * @since 3.1 */ public void setInterpolation(int interpolation) { @@ -2989,6 +3061,30 @@ public void setInterpolation(int interpolation) { OS.CGContextSetInterpolationQuality(handle, quality); } +/** + * Sets the receiver's line attributes. + * <p> + * This operation requires the operating system's advanced + * graphics subsystem which may not be available on some + * platforms. + * </p> + * @param attributes the line attributes + * + * @exception IllegalArgumentException <ul> + * <li>ERROR_NULL_ARGUMENT - if the attributes is null</li> + * <li>ERROR_INVALID_ARGUMENT - if any of the line attributes is not valid</li> + * </ul> + * @exception SWTException <ul> + * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> + * </ul> + * + * @see LineAttributes + * @see #getAdvanced + * @see #setAdvanced + * + * @since 3.3 + */ public void setLineAttributes(LineAttributes attributes) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (attributes == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); @@ -3346,7 +3442,12 @@ public void setXORMode(boolean xor) { * which must be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> * or <code>SWT.ON</code>. Note that this controls anti-aliasing only * for all <em>text drawing</em> operations. - * + * <p> + * This operation requires the operating system's advanced + * graphics subsystem which may not be available on some + * platforms. + * </p> + * * @param antialias the anti-aliasing setting * * @exception IllegalArgumentException <ul> @@ -3355,8 +3456,11 @@ public void setXORMode(boolean xor) { * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> * + * @see #getAdvanced + * @see #setAdvanced * @see #setAntialias * * @since 3.1 @@ -3374,11 +3478,16 @@ public void setTextAntialias(int antialias) { data.textAntialias = antialias; } -/** +/** * Sets the transform that is currently being used by the receiver. If * the argument is <code>null</code>, the current transform is set to * the identity transform. - * + * <p> + * This operation requires the operating system's advanced + * graphics subsystem which may not be available on some + * platforms. + * </p> + * * @param transform the transform to set * * @exception IllegalArgumentException <ul> @@ -3386,9 +3495,12 @@ public void setTextAntialias(int antialias) { * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> + * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> * </ul> * * @see Transform + * @see #getAdvanced + * @see #setAdvanced * * @since 3.1 */ @@ -3486,7 +3598,7 @@ public Point textExtent(String string) { * </p> * * @param string the string to measure - * @param flags the flags specifing how to process the text + * @param flags the flags specifying how to process the text * @return a point containing the extent of the string * * @exception IllegalArgumentException <ul> |