Packages
 In this topic

*Methods

 

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

 


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();

Methods

getColorType

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.

ParameterDescription
c The color object for which to retrieve the color type.

getColorType

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.

ParameterDescription
c The color object for which to retrieve the color type.

getComponentLock

public Object getComponentLock();

Retrieves a common component lock.

Return Value:

Returns the component lock.

getDialogFont

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.

ParameterDescription
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

getFontMetrics

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.

ParameterDescription
g The Graphics object to use.
f The Font that you obtain the metrics for.

getGlyphOutline

public GlyphOutline getGlyphOutline(FxGraphics g, char ch);

Retrieves a glyph outline for the character.

Return Value:

Returns a GlyphOutline for the character.

ParameterDescription
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

getHostLocationOnScreen

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.

ParameterDescription
host

getNewGraphics

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.

ParameterDescription
g the graphics object that the FxGraphics object is based on.

getNewGraphics

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.

ParameterDescription
c The Component to base the graphics object on.
img The Image to base the graphics object on.

getResourceAsStream

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.

ParameterDescription
cl
resource The name of the resource type.

getSystemFontFlags

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.

getSystemFontHeight

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.

ParameterDescription
id The system font identifier.

getSystemFontName

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.

ParameterDescription
id The identifier of the system font.

getSystemFontStyle

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.

ParameterDescription
id The identifier of the system font.

getSystemLCID

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

setCursor

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.

ParameterDescription
mouse
host The AWT Component host object.
cursorType The type of cursor

setModal

public void setModal(Dialog d, boolean b);

Sets (or resets) the modality of a dialog window.

Return Value:

No return value.

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

setNoActivate

public boolean setNoActivate( Container c, boolean on ) ;

Sets a container to show without activating.

Return Value:

Returns true if successful; otherwise, returns false.

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

setOnTop

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.

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

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