Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.fx   Previous This
Package
Next

 


Class FxFill

public abstract class FxFill extends FxColor
{
  // Constructors
  public FxFill();
  public FxFill(int rgb);
  public FxFill(int r, int g, int b);

  // Methods
  public boolean draw3DRectCallback(FxGraphics g, int x, int y, int
        width, int height, boolean raised);
  public boolean drawArcCallback(FxGraphics g, int x, int y,
        int width, int height, int startAngle, int arcAngle);
  public boolean drawBytesCallback(FxGraphics g, byte data[],
        int offset, int length, int x, int y, Rectangle r,
        int options, int dx[], int dy[]);
  public boolean drawCharsCallback(FxGraphics g, char data[],
        int offset, int length, int x, int y, Rectangle r,
        int options, int dx[], int dy[]);
  public boolean drawLineCallback(FxGraphics g, int x1, int y1, int
        x2, int y2);
  public boolean drawOvalCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean drawPolylineCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean drawRectCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean drawRoundRectCallback(FxGraphics g, int x, int y,
        int width, int height, int arcWidth, int arcHeight);
  public boolean drawScanLinesCallback(FxGraphics g,
        boolean xChanging, int points[], int offset, int nPoints);
  public boolean drawStringCallback(FxGraphics g, String str,
        int x, int y, Rectangle r, int options, int dx[],
        int dy[]);
  public boolean fill3DRectCallback(FxGraphics g, int x, int y, int
        width, int height, boolean raised);
  public boolean fillArcCallback(FxGraphics g, int x, int y,
        int width, int height, int startAngle, int arcAngle);
  public boolean fillOvalCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean fillPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean fillRectCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean fillRoundRectCallback(FxGraphics g, int x, int y,
        int width, int height, int arcWidth, int arcHeight);
}

This class defines and manages extended fill objects.

The FxFill class is derived from FxColor and serves as one of the base classes for com.ms.fx extended graphics objects. These objects include FxTexture and FxPen, and its derivatives. Objects derived from FxFill are selected into a graphics context the same way a Color object is selected. When an FxGraphics object calls a method that uses the features of this extended color object, the call is processed through a callback method. These callback methods are onlyused internally and are not intended to be used directly by applications.

The callback method's boolean return values indicate only whether a call has successfully been processed. If the method returns false, default colors are used to perform the drawing operation. For more information on the use of callback methods in the com.ms.fx package, see the overview information at the beginning of this package.

Warning Any method in this class should not be called directly on the graphics object, as this will result in an endless loop.

BaseColor
  |
  +--FxColor
    |
    +--FxFill

Constructors

FxFill

public FxFill();

Creates an FxFill object with a default color.

FxFill

public FxFill(int rgb);

Creates an FxFill object with a specified color.

ParameterDescription
rgb The RGB (red, green, and blue) color used as a default.

FxFill

public FxFill(int r, int g, int b);

Creates a FxFill object with the specified color components.

ParameterDescription
r The red component of the color.
g The green component of the color.
b The blue component of the color.

Methods

draw3DRectCallback

public boolean draw3DRectCallback(FxGraphics g, int x, int y, int width,
        int height, boolean raised);

Draws a three-dimensional rectangle when called by an FxGraphics object.

Note This method is called by FxGraphics if draw3DRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object used.
x The x coordinate of the location where the rectangle is drawn.
y The y coordinate of the location where the rectangle is drawn.
width The width of the rectangle (in pixels).
height The height of the rectangle (in pixels).
raised Determines if the three-dimensional edge of the rectangle is raised or sunken.

See Also: com.ms.fx.FxGraphics.draw3DRect

drawArcCallback

public boolean drawArcCallback(FxGraphics g, int x, int y, int width,
        int height, int startAngle, int arcAngle);

Draws an arc centered on the given (x, y) coordinates when called by an FxGraphics object.

Note This method is called by FxGraphics if drawArc is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object used.
x The x coordinate of the arc's origin.
y The y coordinate of the arc's origin.
width The width of the arc (in pixels).
height The height of the arc (in pixels).
startAngle The starting angle of the arc.
arcAngle The angle of the arc.

See Also: java.awt.Graphics.drawArc

drawBytesCallback

public boolean drawBytesCallback(FxGraphics g, byte data[], int offset, int
        length, int x, int y, Rectangle r, int options, int dx[], int dy[]);

Draws an array of bytes when called by an FxGraphics object.

Note This method is called by FxGraphics if drawBytes is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
data The array of bytes.
offset The offset used.
length The length of the array used.
x The x coordinate of the point where the bytes are drawn.
y The y coordinate of the point where the bytes are drawn.
r The optional rectangle used for clipping and opaquing.
options The options for this method.
dx An array of dx values.
dy An array of dy values.

See Also: java.awt.Graphics.drawBytes

drawCharsCallback

public boolean drawCharsCallback(FxGraphics g, char data[], int offset, int
        length, int x, int y, Rectangle r, int options, int dx[], int dy[]);

Draws an array of characters when called by an FxGraphics object.

Note This method is called by FxGraphics if drawChars is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
data The array of characters to be drawn.
offset The offset to use.
length The length of the array used.
x The x coordinate of the point where the characters are drawn.
y The y coordinate of the point where the characters are drawn.
r The optional rectangle for clipping and opaquing.
options The options for this method.
dx An array of dx values.
dy An array of dy values.

See Also: com.ms.fx.FxGraphics.drawChars

drawLineCallback

public boolean drawLineCallback(FxGraphics g, int x1, int y1, int x2,
        int y2);

Draws a line when called by an FxGraphics object.

Note This method is called by FxGraphics if drawLine is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
x1 The x coordinate of the starting point of the line.
y1 The y coordinate of the starting point of the line.
x2 The x coordinate of the ending point of the line.
y2 The y coordinate of the ending point of the line.

See Also: java.awt.Graphics.drawLine

drawOvalCallback

public boolean drawOvalCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws an oval when called by an FxGraphics object.

Note This method is called by FxGraphics if drawOval is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
x The x coordinate of the upper-left part of the oval.
y The y coordinate of the upper-left part of the oval.
width The width of the oval (in pixels).
height The height of the oval (in pixels).

See Also: java.awt.Graphics.drawOval

drawPolygonCallback

public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws a polygon when called by an FxGraphics object.

Note This method is called by FxGraphics if drawPolygon is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise returns false.

ParameterDescription
g The graphics object.
xPoints An array that contains the polygon's x coordinates.
yPoints An array that contains the polygon's y coordinates.
nPoints The number of points in the polygon.

See Also: java.awt.Graphics.drawPolygon

drawPolylineCallback

public boolean drawPolylineCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws multiple lines at once when called by an FxGraphics object.

Note This method is called by FxGraphics if drawPolygon is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise returns false.

ParameterDescription
g The graphics object.
xPoints An array containing the lines' x coordinates.
yPoints An array containing the lines' y coordinates.
nPoints The number of points generated by the arrays of coordinates.

See Also: java.awt.Graphics.drawPolyline

drawRectCallback

public boolean drawRectCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws a rectangle when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
x The x coordinate of the rectangle's starting point.
y The y coordinate of the rectangle's starting point.
width The width of the rectangle (in pixels).
height The height of the rectangle (in pixels).

See Also: java.awt.Graphics.drawRect

drawRoundRectCallback

public boolean drawRoundRectCallback(FxGraphics g, int x, int y, int width,
        int height, int arcWidth, int arcHeight);

Draws an rectangle with rounded edges when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRoundRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
x The x coordinate of the rectangle's starting point.
y The y coordinate of the rectangle's starting point.
width The width of the rectangle (in pixels).
height The height of the rectangle (in pixels).
arcWidth The arc width of the rectangle's rounded edges.
arcHeight The arc height of the rectangle's rounded edges.

See Also: java.awt.Graphics.drawRoundRect

drawScanLinesCallback

public boolean drawScanLinesCallback(FxGraphics g, boolean xChanging,
        int points[], int offset, int nPoints);

Draws scan lines when called by an FxGraphics object.

Note This method is called by FxGraphics if drawScanLines is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
xChanging The direction the line should be drawn, either horizontally or vertically.
points An array of points.
offset The offset to use.
nPoints The number of points in the array.

See Also: com.ms.fx.FxGraphics.drawScanLines

drawStringCallback

public boolean drawStringCallback(FxGraphics g, String str, int x, int y,
        Rectangle r, int options, int dx[], int dy[]);

Draws a graphical representation of a string when called by an FxGraphics object.

Note This method is called by FxGraphics if drawString is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
str The string that is drawn.
x The x coordinate of the location where the string is drawn.
y The y coordinate of the location where the string should be drawn.
r The optional rectangle used for clipping and opaquing.
options The options of this method.
dx An array of dx values.
dy An array of dy values.

See Also: com.ms.fx.FxGraphics.drawString

fill3DRectCallback

public boolean fill3DRectCallback(FxGraphics g, int x, int y, int width,
        int height, boolean raised);

Draws a filled three-dimensional rectangle when called by an FxGraphics object.

Note This method is called by FxGraphics if fill3DRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object to use.
x The x coordinate of the location where the rectangle is drawn.
y The y coordinate of the location where the rectangle is drawn.
width The width of the rectangle (in pixels).
height The height of the rectangle (in pixels).
raised Determines if the three-dimensional edge is raised or sunken.

See Also: com.ms.fx.FxGraphics.fill3DRect

fillArcCallback

public boolean fillArcCallback(FxGraphics g, int x, int y, int width,
        int height, int startAngle, int arcAngle);

Draws a filled arc centered on the given (x, y) coordinates when called by an FxGraphics object.

Note This method is called by FxGraphics if fillArc is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
x The x coordinate of the arc's origin.
y The y coordinate of the arc's origin.
width The width of the arc (in pixels).
height The height of the arc (in pixels).
startAngle The starting angle of the arc.
arcAngle The angle of the arc.

See Also: java.awt.Graphics.fillArc

fillOvalCallback

public boolean fillOvalCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws a filled oval when called by an FxGraphics object.

Note This method is called by FxGraphics if fillOval is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
x The x coordinate of the upper-left corner of the oval.
y The y coordinate of the upper-left corner of the oval.
width The width of the oval (in pixels).
height The height of the oval (in pixels).

See Also: java.awt.Graphics.fillOval

fillPolygonCallback

public boolean fillPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws a filled polygon when called by an FxGraphics object.

Note This method is called by FxGraphics if fillPolygon is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
xPoints The x coordinate of the upper-left corner of the oval.
yPoints The y coordinate of the upper-left corner of the oval.
nPoints The number of points in the polygon.

See Also: java.awt.Graphics.fillPolygon

fillRectCallback

public boolean fillRectCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws a filled rectangle when called by an FxGraphics object.

Note This method is called by FxGraphics if fillRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
x The x coordinate of the upper-left corner of the oval.
y The y coordinate of the upper-left corner of the oval.
width The width of the rectangle (in pixels).
height The height of the rectangle (in pixels).

See Also: java.awt.Graphics.fillRect

fillRoundRectCallback

public boolean fillRoundRectCallback(FxGraphics g, int x, int y, int width,
        int height, int arcWidth, int arcHeight);

Draws a filled rectangle with rounded edges color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillRoundRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object.
x The x coordinate of the upper-left corner of the oval.
y The y coordinate of the upper-left corner of the oval.
width The width of the rectangle (in pixels).
height The height of the rectangle (in pixels).
arcWidth The arc width of the rectangle's rounded edges.
arcHeight The arc height of the rectangle's rounded edges.

See Also: java.awt.Graphics.fillRoundRect

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.