Package com.ms.fx |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class FxBrushPen extends FxFill { // Constructor public FxBrushPen(Color edge, Color fill); // Methods public boolean drawLineCallback(FxGraphics g, int x1, int y1, int x2, int y2); public boolean fillRectCallback(FxGraphics g, int x, int y, int width, int height); public boolean drawScanLinesCallback(FxGraphics g, boolean xChanging, int points[], int offset, int nPoints); public boolean drawPolygonCalback(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 fillRoundRectCallback(FxGraphics g, int x, int y, int width, int height, int arcWidth, int arcHeight); public boolean drawOvalCallback(FxGraphics g, int x, int y, int width, int height); public boolean fillOvalCallback(FxGraphics g, int x, int y, int width, int height); public boolean drawArcCallback(FxGraphics g, int x, int y, int width, int height, int startAngle, int arcAngle); public boolean fillArcCallback(FxGraphics g, int x, int y, int width, int height, int startAngle, int arcAngle); public boolean fillPolygonCallback(FxGraphics g, int xPoints[], int yPoints[], int nPoints); public boolean drawStringCallback(FxGraphics g, String str, int x, int y, Rectangle r, int options, int dx[], int dy[], boolean metaList); public boolean drawCharsCallback(FxGraphics g, char data[], int offset, int length, int x, int y, Rectangle r, int options, int dx[], int dy[], boolean metaList); public boolean drawBytesCallback(FxGraphics g, byte data[], int offset, int length, int x, int y, Rectangle r, int options, int dx[], int dy[], boolean metaList); public boolean fill3DRectCallback(FxGraphics g, int x, int y, int width, int height, boolean raised); public boolean draw3DRectCallback(FxGraphics g, int x, int y, int width, int height, boolean raised); }
A class that provides both a brush and a pen.
The main constructor takes two colors. The first color is used for all drawing operations. The second color is used for all fill operations.
The Microsoft com.ms.fx Java package is more powerful and more flexible than other graphics packages because it uses extensible objects.
public FxBrushPen(Color edge, Color fill);Creates a pen with a default base color.
Parameter Description edge The edge or outline color of the pen. fill The fill color of the pen.
public boolean drawLineCallback(FxGraphics g, int x1, int y1, int x2, int y2);Draws a line by usign the pen.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. 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. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean fillRectCallback(FxGraphics g, int x, int y, int width, int height);Draws a filled rectangle by using the pen.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. 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. height The height of the rectangle. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean drawScanLinesCallback(FxGraphics g, boolean xChanging, int points[], int offset, int nPoints);Draws fast lines, either horizontally or vertically.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. xChanging The direction that 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. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean drawPolygonCalback(FxGraphics g, int xPoints[], int yPoints[], int nPoints);Draws a polygon using the pen.
Return Value:
Returns true if successful, false otherwise.
Parameter Description g The graphics object to use. xPoints An array containing the polygon's x coordinates. yPoints An array containing the polygon's y coordinates. nPoints The number of points in the polygon. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean drawRectCallback(FxGraphics g, int x, int y, int width, int height);Draws a rectangle using the pen.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. 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. height The height of the rectangle. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean drawRoundRectCallback(FxGraphics g, int x, int y, int width, int height, int arcWidth, int arcHeight);Draws a rectangle that has rounded edges by using the pen.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. 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. height The height of the rectangle. arcWidth The arc width of the rectangle's rounded edges. arcHeight The arc height of the rectangle's rounded edges. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean fillRoundRectCallback(FxGraphics g, int x, int y, int width, int height, int arcWidth, int arcHeight);Draws a filled rectangle that has rounded edges by using the pen.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. 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. height The height of the rectangle. arcWidth The arc width of the rectangle's rounded edges. arcHeight The arc height of the rectangle's rounded edges. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean drawOvalCallback(FxGraphics g, int x, int y, int width, int height);Draws an oval by using the pen.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. 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. height The height of the oval. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean fillOvalCallback(FxGraphics g, int x, int y, int width, int height);Draws a filled oval by using the pen.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. 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. height The height of the oval. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean drawArcCallback(FxGraphics g, int x, int y, int width, int height, int startAngle, int arcAngle);Draws an arc by using the pen.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. x The x coordinate of the arc's starting point. y The y coordinate of the arc's starting point. 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. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean fillArcCallback(FxGraphics g, int x, int y, int width, int height, int startAngle, int arcAngle);Draws a filled arc by using the pen.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. x The x coordinate of the arc's starting point. y The y coordinate of the arc's starting point. 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. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean fillPolygonCallback(FxGraphics g, int xPoints[], int yPoints[], int nPoints);Draws a filled polygon by using the pen.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. xPoints An array containing the polygon's x coordinates. yPoints An array containing the polygon's y coordinates. nPoints The number of points in the polygon. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
public boolean drawStringCallback(FxGraphics g, String str, int x, int y, Rectangle r, int options, int dx[], int dy[], boolean metaList);Draws a string.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. str The string to draw. 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 for clipping and opaquing. options The options for this method. dx An array of dx values. dy An array of dy values. metaList The value that determines if a meta list should be used. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
Overrides:
Overrides drawStringCallback in class FxFill.
public boolean drawCharsCallback(FxGraphics g, char data[], int offset, int length, int x, int y, Rectangle r, int options, int dx[], int dy[], boolean metaList);Draws an array of characters.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. 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 location where the characters should be drawn. y The y coordinate of the location where the characters should be 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. metaList The value that determines if a meta list should be used. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
Overrides:
Overrides drawCharsCallback in class FxFill.
public boolean drawBytesCallback(FxGraphics g, byte data[], int offset, int length, int x, int y, Rectangle r, int options, int dx[], int dy[], boolean metaList);Draws an array of bytes.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. data The array of bytes. offset The offset to use. 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 for clipping and opaquing. options The options for this method. dx An array of dx values. dy An array of dy values. metaList The value that determines if a meta list should be used. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
Overrides:
Overrides drawbytesCallback in class FxFill.
public boolean fill3DRectCallback(FxGraphics g, int x, int y, int width, int height, boolean raised);Draws a filled, three-dimensional rectangle.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter Description g The graphics object to use. x The x coordinate of the location where the rectangle is to be drawn. y The y coordinate of the location where the rectangle is to be 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. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
Overrides:
Overrides fill3DRectCallback in class FxFill.
public boolean draw3DRectCallback(FxGraphics g, int x, int y, int width, int height, boolean raised);Draws a three-dimensional rectangle.
Return Value:
Returns true if successful, false otherwise.
Parameter Description g The graphics object to use. x The x coordinate of the location where the rectangle is to be drawn. y The y coordinate of the location where the rectangle is to be 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. Remarks:
This method is used internally and is not intended to be called by applications. It is made public so that derived classes may extend the callback functionality.
Overrides:
Overrides draw3DRectCallback in class FxFill.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.