Packages
 In this topic

*Constructors

*Methods

 

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

 


Class FxBrushPen

public class FxBrushPen extends FxFill
{
  // Constructors
  public FxBrushPen( FxColor edge, FxColor fill);
  public FxBrushPen(Color edge, Color fill);

  // 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 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 provides separate pen and brush components for drawing and filling operations.

The main constructor takes two colors. The first color, edge, is used by the pen component for all drawing operations and the second color, fill, is used by the brush component for all fill operations.

Note The callback methods used in this and other classes that are derived from FxColor are used internally only. A graphics object that has an FxBrushPen object selected into it may perform similar internal operations as one that uses an FxPen, with the added flexibility of being able to switch between colors for drawing and fill operations. 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.

BaseColor
  |
  +--FxColor
    |
    +--FxFill
      |
      +--FxBrushPen

Constructors

FxBrushPen

public FxBrushPen( FxColor edge, FxColor fill);

Creates an FxBrushPen object with specified edge and fill colors. This constructor is included for JDK 1.0.2 compatibility and is used if the edge and fill parameters are objects that extend from FxColor.

ParameterDescription
edge The color of the edge or outline (the pen).
fill The color of the fill (the brush).

FxBrushPen

public FxBrushPen(Color edge, Color fill);

Creates an FxBrushPen object with specified edge and fill colors. This constructor is called if the edge and fill parameters are objects that extend from java.awt.Color.

ParameterDescription
edge The color of the edge or outline (the pen).
fill The color of the fill (the brush).

Methods

draw3DRectCallback

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

Draws a three-dimensional rectangle in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if draw3DRect is called and an FxBrushPen 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.
height The height of the rectangle.
raised Determines whether the edge of the three-dimensional rectangle has a raised or sunken edge.

Overrides:

draw3DRectCallback(FxGraphics,int,int,int,int,boolean) in FxFill.

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 in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawArc is called and an FxBrushPen 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.
height The height of the arc.
startAngle The starting angle of the arc.
arcAngle The angle of the arc.

Overrides:

drawArcCallback(FxGraphics,int,int,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawArc, com.ms.fx.FxFill.drawArcCallback

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 in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawBytes is called and an FxBrushPen 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.
data The array of bytes.
offset The offset used.
length The length of the array used.
x The x coordinate of the location where the bytes should be drawn.
y The y coordinate of the location where the bytes should be 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.

Overrides:

drawBytesCallback(FxGraphics,byte[],int,int,int,int,Rectangle,int,int[],int[]) in FxFill.

See Also: com.ms.fx.FxGraphics.drawBytes, com.ms.fx.FxFill.drawBytesCallback

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 in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawChars is called and an FxBrushPen 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.
data The array of characters that are drawn.
offset The offset used.
length The length of the array used.
x The x coordinate of the location where the characters are drawn.
y The y coordinate of the location where the characters are 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.

Overrides:

drawCharsCallback(FxGraphics,char[],int,int,int,int,Rectangle,int,int[],int[]) in FxFill.

See Also: com.ms.fx.FxGraphics.drawChars, com.ms.fx.FxFill.drawCharsCallback

drawLineCallback

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

Draws a line in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawLine is called and an FxBrushPen 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.

Overrides:

drawLineCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawLine, com.ms.fx.FxFill.drawLineCallback

drawOvalCallback

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

Draws an oval in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawOval is called and an FxBrushPen 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 upper-left x coordinate of the oval's bounding rectangle.
y The upper-left y coordinate of the oval's bounding rectangle.
width The width of the oval (in pixels).
height The height of the oval (in pixels).

Overrides:

drawOvalCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawOval, com.ms.fx.FxFill.drawOvalCallback

drawPolygonCallback

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

Draws a polygon in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawPolygon is called and an FxBrushPen 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.

Overrides:

drawPolygonCallback(FxGraphics,int[],int[],int) in FxFill.

See Also: java.awt.Graphics.drawPolygon, com.ms.fx.FxFill.drawPolygonCallback

drawRectCallback

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

Draws a rectangle in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRect is called and an FxBrushPen 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.

Overrides:

drawRectCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawRect, com.ms.fx.FxFill.drawRectCallback

drawRoundRectCallback

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

Draws an rectangle with rounded edges in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRoundRect is called and an FxBrushPen 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.

Overrides:

drawRoundRectCallback(FxGraphics,int,int,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawRoundRect, com.ms.fx.FxFill.drawRoundRectCallback

drawScanLinesCallback

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

Draws scan lines in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawScanLines is called and an FxBrushPen 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 (horizontal or vertical) that the lines are drawn.
points An array of points. If xChanging is true, the points are organized as [x1, x2, y, x1, x2, y, ...] in the array. However, if xChanging is false, the points are organized as [x, y1, y2, x, y1, y2, ...].
offset The offset used.
nPoints The number of points in the array.

Overrides:

drawScanLinesCallback(FxGraphics,boolean,int[],int,int) in FxFill.

See Also: com.ms.fx.FxGraphics.drawScanLines, com.ms.fx.FxFill.drawScanLinesCallback

drawStringCallback

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

Draws a string in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawString is called and an FxBrushPen 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.
str The string that is drawn.
x The x coordinate of the location where the string should be 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.

Overrides:

drawStringCallback(FxGraphics,String,int,int,Rectangle,int,int[],int[]) in FxFill.

See Also: com.ms.fx.FxGraphics.drawString, com.ms.fx.FxFill.drawStringCallback

fill3DRectCallback

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

Draws a filled three-dimensional rectangle in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fill3DRect is called and an FxBrushPen 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 whether the three-dimensional rectangle has a raised or sunken edge.

Overrides:

fill3DRectCallback(FxGraphics,int,int,int,int,boolean) in FxFill.

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 in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillArc is called and an FxBrushPen 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.

Overrides:

fillArcCallback(FxGraphics,int,int,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillArc, com.ms.fx.FxFill.fillArcCallback

fillOvalCallback

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

Draws a filled oval in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillOval is called and an FxBrushPen 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 upper-left x coordinate of the oval.
y The upper-left y coordinate of the oval.
width The width of the oval, in pixels.
height The height of the oval, in pixels.

Overrides:

fillOvalCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillOval, com.ms.fx.FxFill.fillOvalCallback

fillPolygonCallback

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

Draws a filled polygon in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillPolygon is called and an FxBrushPen 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.

Overrides:

fillPolygonCallback(FxGraphics,int[],int[],int) in FxFill.

See Also: java.awt.Graphics.fillPolygon, com.ms.fx.FxFill.fillPolygonCallback

fillRectCallback

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

Draws a filled rectangle in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillRect is called and an FxBrushPen 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 upper-left x coordinate of the rectangle.
y The upper-left y coordinate of the rectangle.
width The width of the rectangle, in pixels.
height The height of the rectangle, in pixels.

Overrides:

fillRectCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillRect, com.ms.fx.FxFill.fillRectCallback

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 in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillRoundRect is called and an FxBrushPen 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 upper-left x coordinate of the rectangle.
y The upper-left y coordinate of the rectangle.
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.

Overrides:

fillRoundRectCallback(FxGraphics,int,int,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillRoundRect, com.ms.fx.FxFill.fillRoundRectCallback

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