Interface IFxSystemInterface
public interface IFxSystemInterface
{
// Methods
public int getColorType(BaseColor c);
public int getColorType(Color c);
public Object getComponentLock();
public Font getDialogFont(String name, int style, int size,
int flags);
public FxFontMetrics getFontMetrics(Graphics g, Font f);
public GlyphOutline getGlyphOutline(FxGraphics g, char ch);
public Point getHostLocationOnScreen(Component host);
public FxGraphics getNewGraphics(Graphics g);
public FxGraphics getNewGraphics(Component c, Image img);
public InputStream getResourceAsStream(Class cl, String resource);
public int getSystemFontFlags(int id);
public int getSystemFontHeight(int id);
public String getSystemFontName(int id);
public int getSystemFontStyle(int id);
public int getSystemLCID();
public int setCursor(IUIComponent mouse, Component host,
int cursorType);
public void setModal(Dialog d, boolean b);
public boolean setNoActivate( Container c, boolean on ) ;
public boolean setOnTop( Container c, boolean on ) ;
}
This interface defines methods used to determine system graphics and font properties. Due to incompatabilities between different Java platforms, not all methods are implemented for all platforms. However, these methods are all available using AFC with the Microsoft VM.
Use the FxToolkit.getSystemInterface method to retrieve the proper system interface for the platform that AFC is running on.
IFxSystemInterface ifxsi = FxToolkit.getSystemInterface();
// After you get the IFxSystemInterface, you can call
// IFxSystemInterface methods.
int localeID = ifxsi.getSystemLCID();
public int getColorType(BaseColor c);
Retrieves the color type used on the current platform. This method is included for JDK 1.0.2 support.
Return Value:
Returns COLORTYPE_NONE if there is no color type currently specified for the platform. Typically, COLORTYPE_NORMAL is returned if there is a specified color type for the platform. If the color type is an instance of the FxFill extended color class, then COLORTYPE_TEXTURE is returned.
- Note:
- The color type flags and all constants that are shared between the com.ms.awt and the com.ms.fx packages are defined in the public interface PeerConstants.
Parameter | Description |
c
| The color object for which to retrieve the color type.
|
public int getColorType(Color c);
Retrieves the color type used on the current platform.
Return Value:
Returns COLORTYPE_NONE if there is no color type currently specified for the platform. Typically, COLORTYPE_NORMAL is returned if there is a specified color type for the platform. If the color type is an instance of the FxFill extended color class, then COLORTYPE_TEXTURE is returned.
- Note:
- The color type flags and all constants that are shared between the com.ms.awt and the com.ms.fx packages are defined in the public interface, PeerConstants.
Parameter | Description |
c
| The color object for which to retrieve the color type.
|
public Object getComponentLock();
Retrieves a common component lock.
Return Value:
Returns the component lock.
public Font getDialogFont(String name, int style, int size, int flags);
Retrieves the best possible platform independent font.
Return Value:
Returns a Font object that best matches the specified name, style, size and flags.
Parameter | Description |
name
| The name of the font.
|
style
| The style of the font. This may be either BOLD, ITALIC, or PLAIN.
|
size
| The size of the font (in points).
|
flags
| The flags associated with the font. This may be any combination of the following.
STRIKEOUT
|
UNDERLINE
|
OUTLINE
|
|
public FxFontMetrics getFontMetrics(Graphics g, Font f);
Retrieves the metrics of a font on the current platform.
Return Value:
Returns an FxFontMetrics object that describes the font metrics.
Parameter | Description |
g
| The Graphics object to use.
|
f
| The Font that you obtain the metrics for.
|
public GlyphOutline getGlyphOutline(FxGraphics g, char ch);
Retrieves a glyph outline for the character.
Return Value:
Returns a GlyphOutline for the character.
Parameter | Description |
g
| The Graphics object to use.
|
ch
| The character to find the glyph outline for.
|
See Also: com.ms.fx.FxOutlineFont.getGlyphOutlineCallback, com.ms.fx.GlyphOutline
public Point getHostLocationOnScreen(Component host);
Retrieves the screen location of the host AWT component.
Return Value:
Returns a Point that defines the upper-left corner of the host component.
Parameter | Description |
host
| |
public FxGraphics getNewGraphics(Graphics g);
Retrieves an instance an FxGraphics object that is an extension of the Graphics object, g.
Return Value:
Returns an extended graphics object.
Parameter | Description |
g
| the graphics object that the FxGraphics object is based on.
|
public FxGraphics getNewGraphics(Component c, Image img);
Retrieve an instance an FxGraphics object based on a given Component and Image.
Return Value:
Returns an extended graphics object.
Parameter | Description |
c
| The Component to base the graphics object on.
|
img
| The Image to base the graphics object on.
|
public InputStream getResourceAsStream(Class cl, String resource);
Retrieves an input stream for the specified resource file. For JDK 1.1 compliant VMs, this resouce file is in the same directory where the cl is in. For JDK 1.0.2 VMs, this method will try to load the specefied resource file from the java.home directory.
You can use System.getProperties().getProperty("java.home"); to get the path for the java.home directory.
Return Value:
Returns an InputStream for the resource.
Parameter | Description |
cl
| |
resource
| The name of the resource type.
|
public int getSystemFontFlags(int id);
Retrieves the font flags of the current platform system font.
Return Value:
Returns the system font flags. On the Microsoft® Win32® platform, these flags may be one or a combination of OUTLINE and STRIKEOUT. A return value of 0 on any platform indicates that there are no flags set for the current font.
public int getSystemFontHeight(int id);
Retrieves the height of the current platform system font (in points).
Return Value:
Returns the height of the system font.
Parameter | Description |
id
| The system font identifier.
|
public String getSystemFontName(int id);
Retrieves the name of the current platform system font.
Return Value:
Returns the name of the system font. On the Win32 platform, this method will return a font face that is currently used as the system font. With other virtual machine implementations, this method returns a default font face, typically the Dialog font.
Parameter | Description |
id
| The identifier of the system font.
|
public int getSystemFontStyle(int id);
Retrieves the style of the current platform system font.
Return Value:
Returns the style of the system font. This may be one or a combination of BOLD and ITALIC.
Parameter | Description |
id
| The identifier of the system font.
|
public int getSystemLCID();
Retrieves the system default LCID value. This value can be translated to a java.util.Locale when using JDK1.1.
Return Value:
Returns The system default LCID value.
See Also: java.util.Locale.getLCID
public int setCursor(IUIComponent mouse, Component host, int cursorType);
Sets the cursor for a IUIComponent.
Return Value:
Returns the cursor type that was set to the component.
Parameter | Description |
mouse
| |
host
| The AWT Component host object.
|
cursorType
| The type of cursor
|
public void setModal(Dialog d, boolean b);
Sets (or resets) the modality of a dialog window.
Return Value:
No return value.
Parameter | Description |
d
| The dialog window to set the modality for.
|
b
| Set this parameter to true if the window should be modal.
|
Remarks:
This method is supported only by the Microsoft® Win32® VM for Java; other JDK 1.0.2 or JDK 1.1 VMs do not support it.
public boolean setNoActivate( Container c, boolean on ) ;
Sets a container to show without activating.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter | Description |
c
| The container to be set.
|
on
| Set this parameter to true if the container is shown without activating.
|
Remarks:
This method is supported only by the Microsoft® Win32® VM for Java; other JDK 1.0.2 or JDK 1.1 VMs do not support it.
public boolean setOnTop( Container c, boolean on ) ;
Sets a top-level container, such as a Window or Frame to remain visible when selecting through other windows.
Return Value:
Returns true if successful; otherwise, returns false.
Parameter | Description |
c
| The container to be set.
|
on
| Set to true if the container is to remain on top of other windows.
|
Remarks:
This method is supported only by the Microsoft® Win32® VM for Java; other JDK 1.0.2 or JDK 1.1 VMs do not support it.