summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java
diff options
context:
space:
mode:
authorCarolyn MacLeod <carolyn>2007-05-31 20:34:20 +0000
committerCarolyn MacLeod <carolyn>2007-05-31 20:34:20 +0000
commit20a3f2c29e1d6bada2326bd04dcead2e1ae22ad9 (patch)
tree39bd3703cea1020d3f848e884fffd09cef858c42 /bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java
parent29ed0b9d892e5929f54e524e3dc1c92d73ee99db (diff)
downloadeclipse.platform.swt-20a3f2c29e1d6bada2326bd04dcead2e1ae22ad9.tar.gz
eclipse.platform.swt-20a3f2c29e1d6bada2326bd04dcead2e1ae22ad9.tar.xz
eclipse.platform.swt-20a3f2c29e1d6bada2326bd04dcead2e1ae22ad9.zip
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java150
1 files changed, 131 insertions, 19 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java
index 67cfc62356..cbb7c451dd 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java
@@ -90,8 +90,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>
@@ -1205,7 +1205,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>
@@ -1214,6 +1219,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
@@ -1705,7 +1711,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>
@@ -1991,6 +1997,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
*
@@ -2000,6 +2011,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
@@ -2374,6 +2386,7 @@ public int getAdvanceWidth(char ch) {
* </ul>
*
* @see #setAdvanced
+ *
* @since 3.1
*/
public boolean getAdvanced() {
@@ -3097,6 +3110,17 @@ public int getInterpolation() {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
return data.interpolation;
}
+/**
+ * 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;
@@ -3127,7 +3151,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>
@@ -3397,8 +3421,7 @@ boolean isIdentity(double[] matrix) {
* 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
@@ -3418,6 +3441,7 @@ boolean isIdentity(double[] matrix) {
* @see #setBackgroundPattern
* @see #setClipping(Path)
* @see #setForegroundPattern
+ * @see #setLineAttributes
* @see #setInterpolation
* @see #setTextAntialias
* @see #setTransform
@@ -3444,13 +3468,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) {
@@ -3465,6 +3497,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
*
@@ -3474,8 +3511,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
@@ -3565,7 +3605,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>
@@ -3573,9 +3618,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
*/
@@ -3696,8 +3744,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>
@@ -3705,9 +3758,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
*/
@@ -3851,7 +3907,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>
@@ -3859,9 +3919,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
*/
@@ -3878,7 +3941,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>
@@ -3887,8 +3955,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) {
@@ -3906,6 +3978,30 @@ public void setInterpolation(int interpolation) {
initCairo();
data.interpolation = interpolation;
}
+/**
+ * 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);
@@ -4198,7 +4294,12 @@ void setText(String string, int flags) {
* 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>
@@ -4207,8 +4308,11 @@ void setText(String string, int flags) {
* </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
@@ -4231,11 +4335,16 @@ public void setTextAntialias(int antialias) {
Cairo.cairo_set_font_options(data.cairo, options);
Cairo.cairo_font_options_destroy(options);
}
-/**
+/**
* 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>
@@ -4243,9 +4352,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
*/
@@ -4377,7 +4489,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>