Packages
 In this topic

*Methods

*Fields

 

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

 


Class FxToolkit

public class FxToolkit
{
  // Fields
  public final static int ACTIVE_CAPTION;
  public final static int ACTIVE_CAPTION_BORDER;
  public final static int ACTIVE_CAPTION_TEXT;
  public final static int APP_WORKSPACE;
  public final static int BORDER_HEIGHT;
  public final static int BORDER_WIDTH;
  public final static int CAPTIONBUTTON_HEIGHT;
  public final static int CAPTIONBUTTON_WIDTH;
  public final static int CONTROL;
  public final static int CONTROL_DK_SHADOW;
  public final static int CONTROL_HIGHLIGHT;
  public final static int CONTROL_LT_HIGHLIGHT;
  public final static int CONTROL_SHADOW;
  public final static int CONTROL_TEXT;
  public final static int CURSOR_HEIGHT;
  public final static int CURSOR_WIDTH;
  public final static int DBLCLK_H_TOLERANCE;
  public final static int DBLCLK_V_TOLERANCE;
  public final static int DESKTOP;
  public final static int EDGE_HEIGHT;
  public final static int EDGE_WIDTH;
  public final static int HOTTRACK;
  public final static int INACTIVE_CAPTION;
  public final static int INACTIVE_CAPTION_BORDER;
  public final static int INACTIVE_CAPTION_TEXT;
  public final static int INFO;
  public final static int INFO_TEXT;
  public final static int MENU;
  public final static int MENU_TEXT;
  public final static int MENUBUTTON_HEIGHT;
  public final static int MENUBUTTON_WIDTH;
  public final static int NUM_METRICS;
  public final static int SCREEN_HEIGHT;
  public final static int SCREEN_WIDTH;
  public final static int SCROLL_HEIGHT;
  public final static int SCROLL_WIDTH;
  public final static int SCROLLBAR;
  public final static int SM_CAPTIONBUTTON_HEIGHT;
  public final static int SM_CAPTIONBUTTON_WIDTH;
  public final static int TEXT;
  public final static int TEXT_HIGHLIGHT;
  public final static int TEXT_HIGHLIGHT_TEXT;
  public final static int TEXT_INACTIVE_TEXT;
  public final static int TEXT_TEXT;
  public final static int WINDOW;
  public final static int WINDOW_BORDER;
  public final static int WINDOW_TEXT;
  public final static int WORKAREA_HEIGHT;
  public final static int WORKAREA_WIDTH;
  public final static int WORKAREA_XSTART;
  public final static int WORKAREA_YSTART;

  // Methods
  public static Image createImage(ImageProducer ip);
  public static Image createImage(int width, int height);
  public final static Frame getHelperFrame();
  public final static UIFrame getHelperUIFrame();
  public final static int getNumSystemColors();
  public final static int getNumSystemMetrics();
  public final static Color getSystemColor(int index);
  public final static IFxSystemInterface getSystemInterface();
  public final static int getSystemMetric(int index);
  public final static Font getWidgetFont(int size);
}

A generic toolkit class that provides both VM-specific support to other AFC classes and helper objects that assist with tasks such as dialog loading and image loading.

The FxToolkit class specifically supports other classes in the AFC as follows:

Provides a system interface for the current platform
. Provides UIHelper. This is a frame object that can be used for things such as dialog loading and image loading, where a helper frame is required.

Methods

createImage

public static Image createImage(ImageProducer ip);

Creates an image based on the given ImageProducer.

Return Value:

Returns an Image object.

ParameterDescription
ip The ImageProducer object to base the image on.

createImage

public static Image createImage(int width, int height);

Creates an image with the specified width and height.

Return Value:

Returns an Image object.

ParameterDescription
width The width of the image (in pixels).
height The height of the image (in pixels).

getHelperFrame

public final static Frame getHelperFrame();

Retrieves a helper java.awt.Frame. This is used in loading images, loading dialogs, and so on.

Return Value:

Returns a Frame object that serves as a helper to other objects.

getHelperUIFrame

public final static UIFrame getHelperUIFrame();

Retrieves a helper frame. This is used in loading images, loading dialogs, and so on.

Return Value:

Returns a UIFrame object that serves as a helper to other objects.

getNumSystemColors

public final static int getNumSystemColors();

Retrieves the current number of system colors available.

Return Value:

Returns the current number of system colors available.

getNumSystemMetrics

public final static int getNumSystemMetrics();

Retrieves the current number of system metrics.

Return Value:

Returns the current number of system metrics.

getSystemColor

public final static Color getSystemColor(int index);

Retrieves a system color in a platform-independent way.

Return Value:

Returns the system Color specified by the index.

ParameterDescription
index The index of the system color to retrieve.

Exceptions:

ArrayOutOfBoundsException if the index is not valid.

getSystemInterface

public final static IFxSystemInterface getSystemInterface();

Retrieves an instance of one of the system interface classes.

Return Value:

Returns a system interface.

Remarks:

This static method returns an instance of an IFxSystemInterface class, based on the current platform. For example, if AFC is running on a JDK 1.1 compliant Virtual Machine, the method returns a system interface for JDK 1.1. These classes are used internally and are not used directly by applications. Use this method to retrieve the system interface before you call any other non-static method in the FxToolkit class.

getSystemMetric

public final static int getSystemMetric(int index);

Retrieves a system metric at the given index in a platform-independent way.

Return Value:

Returns the system metric at the specified index.

ParameterDescription
index The index of the system metric to retrieve.

Exceptions:

ArrayOutOfBoundsException if the index is not valid.

getWidgetFont

public final static Font getWidgetFont(int size);

Retrieves the font that contains the bits of the widget font. On the Win32 platform, this is the Marlett font, but other platforms typically do not define widget, in which case null is returned. In this case, widget glyphs will be created via a standard algorithm.

Return Value:

Returns the widget font if defined; otherwise, returns null.

ParameterDescription
size The size of the font (in points).

Fields

ACTIVE_CAPTION
The array index for the active caption background color.
ACTIVE_CAPTION_BORDER
The array index for the active caption border color.
ACTIVE_CAPTION_TEXT
The array index for the action caption text color.
APP_WORKSPACE
The array index for the application workspace color.
BORDER_HEIGHT
The height of a window (in pixels).
BORDER_WIDTH
The width of a window border (in pixels).
CAPTIONBUTTON_HEIGHT
The height of a caption button.
CAPTIONBUTTON_WIDTH
The width of a caption button.
CONTROL
The array index for the control background color.
CONTROL_DK_SHADOW
The array index for the control dark shadow color.
CONTROL_HIGHLIGHT
The array index for the control highlight color.
CONTROL_LT_HIGHLIGHT
The array index for the control light highlight color.
CONTROL_SHADOW
The array index for the control shadow color.
CONTROL_TEXT
The array index for the control text color.
CURSOR_HEIGHT
The height of the cursor (in pixels).
CURSOR_WIDTH
The width of the cursor (in pixels).
DBLCLK_H_TOLERANCE
Mouse double click horizontal tolerance. This is the maximum distance the mouse can move on its horizontal axis before a selection is invalid.
DBLCLK_V_TOLERANCE
Mouse double click vertical tolerance. This is the maximum distance the mouse can move on its vertical axis before a selection is invalid.
DESKTOP
The array index for the desktop background color.
EDGE_HEIGHT
The height of a 3D window border (in pixels). This is the 3D counterpart to BORDER_HEIGHT.
EDGE_WIDTH
The width of a 3D window border (in pixels). This is the 3D counterpart to BORDER_WIDTH.
HOTTRACK
The array index for the hottrack color.
INACTIVE_CAPTION
The array index for the inactive caption background color.
INACTIVE_CAPTION_BORDER
The array index for the inactive caption border color.
INACTIVE_CAPTION_TEXT
The array index for the inactive caption text color.
INFO
The array index for the info background color.
INFO_TEXT
The array index for the info text color.
MENU
The array index for the menu background color.
MENU_TEXT
The array index for the menu text color.
MENUBUTTON_HEIGHT
The height of a menu button.
MENUBUTTON_WIDTH
The width of a menu button.
NUM_METRICS
The number of system metrics.
SCREEN_HEIGHT
The monitor height (in pixels).
SCREEN_WIDTH
The monitor width (in pixels).
SCROLL_HEIGHT
Scroll bar height.
SCROLL_WIDTH
Scroll bar width.
SCROLLBAR
The array index for the scroll bar background color.
SM_CAPTIONBUTTON_HEIGHT
The height of a small caption button.
SM_CAPTIONBUTTON_WIDTH
The width of a small caption button.
TEXT
The array index for the text background color.
TEXT_HIGHLIGHT
The array index for the text highlight color.
TEXT_HIGHLIGHT_TEXT
The array index for the text highlight text color.
TEXT_INACTIVE_TEXT
The array index for the text inactive text color.
TEXT_TEXT
The array index for the text color.
WINDOW
The array index for the window background color.
WINDOW_BORDER
The array index for the window border color.
WINDOW_TEXT
The array index for the window text color.
WORKAREA_HEIGHT
The height of the work area.
WORKAREA_WIDTH
The width of the work area.
WORKAREA_XSTART
The top-left x coordinate of the work area.
WORKAREA_YSTART
The top-left y coordinate of the work area.

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