Class GraphicsX
public class GraphicsX extends FxGraphics implements
PeerConstants, PaintSurface
{
// Constructors
public GraphicsX(int hdc);
// Methods
public void drawCharsWithoutFxFont(char data[], int offset,
int length, int x, int y, Rectangle optionRect,
int options, int dx[], int dy[]);
public void drawOutlinePolygon(int xOrig, int yOrig,
OutlinePolygon op);
public void drawPixels(int[] pels, int len);
public void drawScanLines(boolean xChanging, int[] points,
int offset, int nPoints);
public void drawStringWithoutFxFont(String str,int x, int y,
Rectangle optionRect, int options, int[] dx,int[] dy);
public Device getDevice() throws DeviceException;
public GlyphOutline getGlyphOutline(char ch);
public int gethdc();
public Point getTranslation();
public void setTextBackgroundColor(Color c);
}
This class provides a graphics implementation specifically for the Microsoft VM. This class is not used directly in applets or applications, and is not cross-platform.
The following methods are methods implemented only for the Microsoft Virtual Machine. All other graphics methods are defined in FxGraphics and the java.awt.Graphics class.
FxGraphics
|
+--GraphicsX
public GraphicsX(int hdc);
Creates a graphics object for a user-supplied display context.
Parameter | Description |
hdc
| The display context to create the graphics object for.
|
public void drawCharsWithoutFxFont(char data[], int offset, int length, int
x, int y, Rectangle optionRect, int options, int dx[], int dy[]);
Uses a native peer graphics object to draw the given character array using the supplied advancement lists. This method is used by an FxFont object if it needs to be able to draw and then process a character array.
Return Value:
No return value.
Parameter | Description |
str
| The string to draw.
|
x
| The x coordinate of the point where the string is drawn.
|
y
| The y coordinate of the point where the string is drawn.
|
optionRect
| The optional rectangle used for clipping and opaquing.
|
options
| The options for this method.
|
dx
| An array of destination x values.
|
dy
| An array of destination y values.
|
See Also: com.ms.fx.FxGraphics
public void drawOutlinePolygon(int xOrig, int yOrig, OutlinePolygon op);
Draws an outline polygon.
Return Value:
No return value.
Parameter | Description |
xOrig
| The horizontal starting point for the shape.
|
yOrig
| The vertical starting point for the shape.
|
op
| The OutlinePolygon to draw.
|
See Also: com.ms.fx.OutlinePolygon
public void drawPixels(int[] pels, int len);
Draws a given list of pixels.
Return Value:
No return value.
Parameter | Description |
pels
| An array of pixels.
|
len
| The length of the array.
|
public void drawScanLines(boolean xChanging, int[] points, int offset,
int nPoints);
Draws fast lines, either horizontally or vertically.
Return Value:
No return value.
Parameter | Description |
xChanging
| The direction that the line is drawn, either vertically or horizontally.
|
points
| An array of points.
|
offset
| The offset to use.
|
nPoints
| The number of points in the array.
|
public void drawStringWithoutFxFont(String str,int x, int y,
Rectangle optionRect, int options, int[] dx,int[] dy);
Uses a native peer graphics object to draw the given string using the supplied advancement lists. This method is used by an FxFont object if it needs to be able to draw and then process a string.
Return Value:
No return value.
Parameter | Description |
str
| The string to draw.
|
x
| The x coordinate of the point where the string is drawn.
|
y
| The y coordinate of the point where the string is drawn.
|
optionRect
| The optional rectangle used for clipping and opaquing.
|
options
| The options for this method.
|
dx
| An array of destination x values.
|
dy
| An array of destination y values.
|
See Also: com.ms.fx.FxGraphics
public Device getDevice() throws DeviceException;
Retrieves an an instance of a device class that the graphics object draws on.
Return Value:
Returns an instance of the either the DisplayDevice or the PrinterDevice class.
Exceptions:
com.ms.awt.DeviceException
public GlyphOutline getGlyphOutline(char ch);
Retrieves the outline of a character in the currently selected font.
Note This method is obsolete. Use the FxOutlineFont class.
Return Value:
Returns an OutlinePolygon object. If the font is not an outline font, then null is returned.
Parameter | Description |
ch
| The character whose outline is requested.
|
public int gethdc();
Retrieves the Win32 display context handle. This is useful when the graphics object is used with a Microsoft DirectDraw surface, printer or ActiveX object (graphics objects created for components do not have consistent HDC values).
Return Value:
Returns the Win32 display context handle.
public Point getTranslation();
Retrieves the origin Point used in a translate operation on a graphics context, after the translation is complete.
Return Value:
Returns the origin for the translation.
public void setTextBackgroundColor(Color c);
Sets the text background color. This is used for opaquing text.
Return Value:
No return value.
Parameter | Description |
c
| The Color to set the text background to.
|