Package com.ms.fx Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class FxRubberPen

Constructor , Methods

public class FxRubberPen extends FxPen 
{
  // Constructor
  public FxRubberPen(Color c);
  // Methods
  public boolean drawRectCallback(FxGraphics g, int x1, int y1, int w, int h);
  public boolean drawRoundRectCallback(FxGraphics g, int x, int y, int width, int height, int arcWidth, int arcHeight);
  public boolean drawOvalCallback(FxGraphics g, int x1, int y1, int w, int h);
  public boolean drawLineCallback(FxGraphics g, int x1, int y1, int x2, int y2);
  public boolean drawPolygonCallback(FxGraphics g, int xPoints[], int yPoints[], int nPoints);
  public void drawLast(FxGraphics g);
}

A class that provides a rubber pen. A rubber pen is a pen that draws a shape or line after a drag-and-release mouse event.

The Microsoft com.ms.fx Java package is more powerful and more flexible than other graphics packages because it uses extensible objects.


Constructor


FxRubberPen

public FxRubberPen(Color c);

Creates a rubber pen object.

ParameterDescription
c The background color needed for the banding.


Methods


drawRectCallback

public boolean drawRectCallback(FxGraphics g, int x1, int y1, int w, int h);

Draws a rectangle using this pen.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object to use.
x1 The x coordinate of the rectangle's starting point.
y1 The y coordinate of the rectangle's starting point.
w The width of the rectangle.
h 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.


drawRoundRectCallback

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

Draws a rectangle with rounded edges using the pen.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object to use.
x The x coordinate of the rectangle's upper left corner.
y The y coordinate of the rectangle's upper left corner.
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.


drawOvalCallback

public boolean drawOvalCallback(FxGraphics g, int x1, int y1, int w, int h);

Draws an ellipse using this pen.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
g The graphics object to use.
x1 The x coordinate of the upper left part of the oval.
y1 The y coordinate of the upper left part of the oval.
w The width of the oval.
h 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.


drawLineCallback

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

Draws a line using this pen.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
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.


drawPolygonCallback

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

Draws a polygon using the pen.

Return Value:

Returns true if successful; otherwise, returns false.

ParameterDescription
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.


drawLast

public void drawLast(FxGraphics g);

Cleans out the last action performed by the pen.

Return Value:

No return value.

ParameterDescription
g The graphics object to use.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.