Packages
 In this topic

*Methods

 

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

 


Interface IUIComponent

public interface IUIComponent
{
  // Methods
  public boolean action(Event evt, Object what);
  public void addFocusListener(IUIFocusListener l);
  public void addKeyListener(IUIKeyListener l);
  public void addMouseListener(IUIMouseListener l);
  public void addMouseMotionListener(IUIMouseMotionListener l);
  public void addNotify();
  public void adjustLayoutSize(Dimension oldSize,
        Dimension newSize);
  public boolean contains(int x, int y);
  public boolean contains(Point point);
  public Image createImage(ImageProducer ip);
  public Image createImage(int width, int height);
  public void deliverEvent(Event e);
  public void doLayout();
  public boolean ensureVisible(Rectangle rect);
  public Color getBackground();
  public Rectangle getBounds();
  public Rectangle getBounds(IUIComponent comp);
  public IUIComponent getComponent(int x, int y);
  public IUIComponent getComponent(Point point);
  public IUIComponent getComponentAt(int x, int y);
  public IUIComponent getComponentAt(Point pt);
  public Cursor getCursor();
  public int getFlags();
  public Font getFont();
  public FontMetrics getFontMetrics(Font f);
  public Color getForeground();
  public FxGraphics getGraphics();
  public int getID();
  public int getIndex();
  public Point getLocation();
  public Point getLocation(IUIComponent comp);
  public Point getLocationOnScreen();
  public Dimension getMaximumSize();
  public Dimension getMinimumSize();
  public String getName();
  public IUIContainer getParent();
  public ComponentPeer getPeer();
  public Dimension getPreferredSize();
  public Dimension getPreferredSize(Dimension size);
  public IUIRootContainer getRoot();
  public Dimension getSize();
  public Toolkit getToolkit();
  public boolean gotFocus(Event evt, Object what);
  public boolean handleEvent(Event evt);
  public void invalidate();
  public boolean invalidateAll();
  public boolean isChecked();
  public boolean isEnabled();
  public boolean isEnabled(boolean recurse);
  public boolean isFocused();
  public boolean isHeightRelative();
  public boolean isHot();
  public boolean isIndeterminate();
  public boolean isInvalidating();
  public boolean isKeyable();
  public boolean isKeyable(boolean recurse);
  public boolean isNotified();
  public boolean isPressed();
  public boolean isRedrawing();
  public boolean isSelectable();
  public boolean isSelected();
  public boolean isShowing();
  public boolean isValid();
  public boolean isVisible();
  public boolean isVisible(boolean recurse);
  public boolean isWidthRelative();
  public boolean keyDown(Event evt, int key);
  public boolean keyUp(Event evt, int key);
  public void layout();
  public boolean lostFocus(Event evt, Object what);
  public boolean mouseClicked(Event evt, int x, int y);
  public boolean mouseDown(Event evt, int x, int y);
  public boolean mouseDrag(Event evt, int x, int y);
  public boolean mouseEnter(Event evt, int x, int y);
  public boolean mouseExit(Event evt, int x, int y);
  public boolean mouseMove(Event evt, int x, int y);
  public boolean mouseUp(Event evt, int x, int y);
  public void paint(FxGraphics g);
  public void paintAll(FxGraphics g);
  public boolean postEvent(Event e);
  public boolean prepareImage(Image image, ImageObserver observer);
  public boolean prepareImage(Image image, int width, int height,
        ImageObserver observer);
  public void print(FxGraphics g);
  public void printAll(FxGraphics g);
  public void relayout();
  public void removeFocusListener(IUIFocusListener l);
  public void removeKeyListener(IUIKeyListener l);
  public void removeMouseListener(IUIMouseListener l);
  public void removeMouseMotionListener(IUIMouseMotionListener l);
  public void removeNotify();
  public void repaint();
  public void repaint(long time);
  public void repaint(int x, int y, int width, int height);
  public void repaint(long tm, int x, int y, int width, int height);
  public void requestFocus();
  public void setBackground(Color color);
  public void setBounds(int x, int y, int width, int height);
  public void setBounds(Rectangle r);
  public void setChecked(boolean on);
  public void setCursor(Cursor cursor);
  public void setEnabled(boolean on);
  public void setFlags(int flags);
  public void setFocused(boolean on);
  public void setFont(Font font);
  public void setForeground(Color color);
  public void setHot(boolean on);
  public void setID(int id);
  public void setIndeterminate(boolean on);
  public void setIndex(int index);
  public void setInvalidating(boolean on);
  public void setLocation(int x, int y);
  public void setLocation(Point point);
  public void setName(String name);
  public void setParent(IUIContainer parent);
  public void setPressed(boolean on);
  public void setRedrawing(boolean on);
  public void setSelected(boolean on);
  public void setSize(int width, int height);
  public void setSize(Dimension size);
  public void setValid(boolean valid);
  public void setVisible(boolean show);
  public String toString();
  public void update(FxGraphics g);
  public void validate();
}

This interface defines methods associated with an AFC component. UIComponent implements IUIComponent.

Note The hot-track color is the same color as the button text color. As a result, hot-tracking does not appear to be functional.

Methods

action

public boolean action(Event evt, Object what);

Responds to an action that has occurred within the control (or any of its descendants).

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
what The object that posted the event.

addFocusListener

public void addFocusListener(IUIFocusListener l);

Adds the specified focus listener. The listener receives all focus events generated for the control.

Return Value:

No return value.

ParameterDescription
l The focus listener to be added.

addKeyListener

public void addKeyListener(IUIKeyListener l);

Adds the specified key listener. The listener receives all key events generated for the control.

Return Value:

No return value.

ParameterDescription
l The key listener to be added.

addMouseListener

public void addMouseListener(IUIMouseListener l);

Adds the specified mouse listener. The listener receives all mouse events generated for the control.

Return Value:

No return value.

ParameterDescription
l The mouse listener to be added.

addMouseMotionListener

public void addMouseMotionListener(IUIMouseMotionListener l);

Adds the specified mouse motion listener. The listener receives all mouse motion events generated for the control.

Return Value:

No return value.

ParameterDescription
l The mouse motion listener to be added.

addNotify

public void addNotify();

Called to perform initialization when the graphics context is first available.

Return Value:

No return value.

adjustLayoutSize

public void adjustLayoutSize(Dimension oldSize, Dimension newSize);

Invalidates the control and adjusts its layout size. In the event of an actual change to preferred size, the parent's adjustLayoutSize is called with this component and it's change in preferred size.

Return Value:

No return value.

ParameterDescription
oldSize The previous layout size of the control.
newSize The new layout size of the control.

contains

public boolean contains(int x, int y);

Determines whether the control contains the point identified by the specified coordinates.

Return Value:

Returns true if the control contains the point; otherwise, returns false.

ParameterDescription
x The x coordinate of the point's location in the control's coordinate space.
y The y coordinate of the point's location in the control's coordinate space.

contains

public boolean contains(Point point);

Determines whether the control contains the specified point.

Return Value:

Returns true if the control contains the point; otherwise, returns false.

ParameterDescription
point The location of the point in the control's coordinate space (in pixels).

createImage

public Image createImage(ImageProducer ip);

Creates an image from the specified image producer.

Return Value:

Returns the created image.

ParameterDescription
ip The image producer that will generate the image.

createImage

public Image createImage(int width, int height);

Creates an off-screen image of the specified dimensions.

Return Value:

Returns the created image.

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

deliverEvent

public void deliverEvent(Event e);

Delivers an event to the control.

Return Value:

No return value.

ParameterDescription
e The event.

doLayout

public void doLayout();

Note This method is replaced by layout.

ensureVisible

public boolean ensureVisible(Rectangle rect);

Brings the area identified by the specified rectangle into view.

Return Value:

Returns true if any component was moved or resized to make the rectangle visible; otherwise, returns false.

ParameterDescription
rect The rectangle identifying the area to be made visible.

getBackground

public Color getBackground();

Retrieves the background color of the control, moving up the parent chain as needed, until a background color is found.

Return Value:

Returns a Color object that specifies the background color.

getBounds

public Rectangle getBounds();

Retrieves the bounding rectangle of the control. The coordinates and dimensions of the rectangle are relative to the control's parent.

Return Value:

Returns a Rectangle object identifying the control's bounding area in terms of its parent's coordinate space.

getBounds

public Rectangle getBounds(IUIComponent comp);

Retrieves the bounding rectangle of the control. The coordinates and dimensions of the rectangle are relative to the specified component.

Return Value:

Returns a Rectangle object identifying the control's bounding area, in terms of the coordinate space of the specified component.

ParameterDescription
comp The reference component. The coordinates of the returned Rectangle object are relative to this component. If null, screen coordinates are used.

getComponent

public IUIComponent getComponent(int x, int y);

Retrieves the component that contains the point identified by the specified coordinates.

Return Value:

Returns the control itself, if it contains the point; otherwise, returns null.

ParameterDescription
x The x coordinate of the point's location in the control's coordinate space.
y The y coordinate of the point's location in the control's coordinate space.

getComponent

public IUIComponent getComponent(Point point);

Retrieves the component that contains the specified point.

Return Value:

Returns the control itself, if it contains the point; otherwise, returns null.

ParameterDescription
point The location of the point in the control's coordinate space.

getComponentAt

public IUIComponent getComponentAt(int x, int y);

Note This method is replaced by getComponent.

getComponentAt

public IUIComponent getComponentAt(Point pt);

Note This method is replaced by getComponent.

getCursor

public Cursor getCursor();

Retrieves the control's cursor, moving up the parent chain as needed, until a cursor is found.

Return Value:

Returns a Cursor object containing the cursor.

getFlags

public int getFlags();

Retrieves the user-defined bits currently set for the control.

Return Value:

Returns an integer that specifies the user-defined settings.

getFont

public Font getFont();

Retrieves the font of the control, moving up the parent chain as needed, until a font is found.

Return Value:

Returns a Font object that specifies the font.

getFontMetrics

public FontMetrics getFontMetrics(Font f);

Retrieves the font metrics for the specified font.

Return Value:

Returns the font metrics.

ParameterDescription
f The font.

getForeground

public Color getForeground();

Retrieves the foreground color of the control, moving up the parent chain as needed, until a foreground color is found.

Return Value:

Returns a Color object that specifies the foreground color.

getGraphics

public FxGraphics getGraphics();

Retrieves the graphics context of the control.

Return Value:

Returns the graphics context if it is available; otherwise, returns null.

getID

public int getID();

Retrieves the control's identifier.

Return Value:

Returns the integer associated with the control.

getIndex

public int getIndex();

Retrieves the index of the control within its parent container.

Return Value:

Returns the control's index.

getLocation

public Point getLocation();

Retrieves the location of the control, relative to its parent.

Return Value:

Returns a Point object that specifies the location of the upper-left corner of the control in its parent's coordinate space.

getLocation

public Point getLocation(IUIComponent comp);

Retrieves the location of the control, relative to the specified component.

Return Value:

Returns a Point object that specifies the location of the upper-left corner of the control, in the coordinate space of the specified component.

ParameterDescription
comp The reference component. The coordinates of the returned Point object are relative to this component. If null, screen coordinates are used.

getLocationOnScreen

public Point getLocationOnScreen();

Note This method is replaced by getLocation.

getMaximumSize

public Dimension getMaximumSize();

Retrieves the maximum dimensions (in pixels) for displaying the control.

Return Value:

Returns a Dimension object containing the maximum size.

getMinimumSize

public Dimension getMinimumSize();

Retrieves the minimum size of the control. The minimum size specifies the smallest dimensions (in pixels) that will enable the control to be displayed.

Return Value:

Returns a Dimension object containing the minimum size.

getName

public String getName();

Retrieves the control's name.

Return Value:

Returns a string containing the name of the control.

getParent

public IUIContainer getParent();

Retrieves the control's parent.

Return Value:

Returns the parent container if the control has a parent; otherwise, returns null.

getPeer

public ComponentPeer getPeer();

Retrieves the peer of the control's root container.

Return Value:

Returns the root container's peer.

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred dimensions (in pixels) for displaying the control.

Return Value:

Returns a Dimension object containing the preferred size.

getPreferredSize

public Dimension getPreferredSize(Dimension size);

Retrieves the preferred layout size of the control (in pixels). The Dimension parameter that is passed is used to force the returned preferred size to be larger on a particular axis.

Return Value:

Returns a Dimension object containing the preferred size.

ParameterDescription
size if either width or height is -1, this axis is not to be constrained.

getRoot

public IUIRootContainer getRoot();

Retrieves the first component in the control's chain that implements the IUIRootContainer interface.

Return Value:

Returns the root container, if successful; otherwise, returns null.

getSize

public Dimension getSize();

Retrieves the size (in pixels) of the control.

Return Value:

Returns a Dimension object containing the control's size.

getToolkit

public Toolkit getToolkit();

Retrieves the toolkit associated with the control.

Return Value:

Returns the associated toolkit.

gotFocus

public boolean gotFocus(Event evt, Object what);

Responds to the control (or any of its descendants) receiving input focus.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
what The object that posted the event (typically null).

handleEvent

public boolean handleEvent(Event evt);

Responds to events occurring within the control.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event.

invalidate

public void invalidate();

Note This method is replaced by setValid.

invalidateAll

public boolean invalidateAll();

Invalidates the control and all its child components.

Return Value:

Returns true if the control and its children were invalidated; otherwise, returns false.

isChecked

public boolean isChecked();

Determines whether the control's checked state is set.

Return Value:

Returns true if the control is checked; otherwise, returns false.

isEnabled

public boolean isEnabled();

Determines whether the control's enabled state is set.

Return Value:

Returns true if the control is enabled; otherwise, returns false.

isEnabled

public boolean isEnabled(boolean recurse);

Determines whether the enabled state of the control or of all its ancestors is set.

Return Value:

Returns true if the control and all of its ancestors are enabled (if recurse is true) or if the control alone is enabled (if recurse is false); otherwise, returns false.

ParameterDescription
recurse If true, this method checks the enabled state of the control and each of its ancestors. If false, only the control itself is checked.

isFocused

public boolean isFocused();

Determines whether the control's focus state is set.

Return Value:

Returns true if the control has focus; otherwise, returns false.

isHeightRelative

public boolean isHeightRelative();

Determines if this layout manager uses the height of the container to lay out its children.

Return Value:

Returns true if this layout manager uses the container's height to lay out its children; otherwise, returns false. The default is true. Returning false also means that the container's layout method doesn't need to be called on a vertical resizing.

See Also: isWidthRelative

isHot

public boolean isHot();

Determines whether the control's hot-tracked state is set.

Return Value:

Returns true if the control is hot-tracked; otherwise, returns false.

isIndeterminate

public boolean isIndeterminate();

Determines whether the control's indeterminate state is set.

Return Value:

Returns true if the control is indeterminate; otherwise, returns false.

isInvalidating

public boolean isInvalidating();

Gets the current invalidating state of this object.

Return Value:

Returns true if this object has invalidating enabled; otherwise, returns false (which means it will ignore requests to invalidate).

isKeyable

public boolean isKeyable();

Sets or clears the focus state of the control. This is called when a component receives input focus.

Note This method should not be used. To give a component input focus, call requestFocus.

Return Value:

No return value. public void setFocused(boolean on); /** Determines whether the control can receive keyboard input. true if the control can receive keyboard input; otherwise, returns false.

isKeyable

public boolean isKeyable(boolean recurse);

Determines whether the control and all its ancestors can receive keyboard input.

Return Value:

Returns true if the control and all its ancestors can receive keyboard input (if recurse is true) or if the control alone can receive keyboard input (if recurse is false); otherwise, returns false.

ParameterDescription
recurse If true, this method checks whether the control and each of its ancestors can receive keyboard input. If false, only the control itself is checked.

isNotified

public boolean isNotified();

Determines whether the control's notified state is set.

Return Value:

Returns true if the control is notified; otherwise, returns false.

isPressed

public boolean isPressed();

Determines whether the control's pressed state is set.

Return Value:

Returns true if the control is pressed; otherwise, returns false.

isRedrawing

public boolean isRedrawing();

Determines whether the control will be redrawn when a paint request is made.

Return Value:

Returns true if the redrawing state is set; otherwise, returns false.

isSelectable

public boolean isSelectable();

Determines whether the control's selected state can be set.

Return Value:

Returns true if the control can be selected; otherwise, returns false.

isSelected

public boolean isSelected();

Determines whether the control's selected state is set.

Return Value:

Returns true if the control is selected; otherwise, returns false.

isShowing

public boolean isShowing();

Note This method is replaced by isVisible.

isValid

public boolean isValid();

Determines whether the control is valid.

Return Value:

Returns true if the control is valid; otherwise, returns false.

isVisible

public boolean isVisible();

Determines whether the control's visible state is set.

Return Value:

Returns true if the control is visible; otherwise, returns false.

isVisible

public boolean isVisible(boolean recurse);

Determines whether the visible state of the control or of all its ancestors is set.

Return Value:

Returns true if the control and all of its ancestors are visible (if recurse is true) or if the control alone is visible (if recurse is false); otherwise, returns false.

ParameterDescription
recurse If true, this method checks the visible state of the control and each of its ancestors. If false, only the control itself is checked.

isWidthRelative

public boolean isWidthRelative();

Determines if this layout manager uses the width of the container to lay out its children.

Return Value:

Returns true if this layout manager uses the container's width to lay out the children; otherwise, returns false. (The default is true.) Returning false also means that the container's layout method doesn't need to be called on a horizontal resizing.

See Also: isHeightRelative

keyDown

public boolean keyDown(Event evt, int key);

Responds to a key being pressed when the component (or any of its descendants) has the input focus.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
key The key that was pressed.

keyUp

public boolean keyUp(Event evt, int key);

Responds to a key being released when the control (or any of its descendants) has the input focus.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
key The key that was released.

layout

public void layout();

Lays out the control.

Return Value:

No return value.

lostFocus

public boolean lostFocus(Event evt, Object what);

Responds to the control (or any of it's descendants) losing input focus.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
what The object that posted the event (typically null).

mouseClicked

public boolean mouseClicked(Event evt, int x, int y);

Responds to the control (or any of its descendants) being clicked with the mouse.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
x The x coordinate of the event.
y The y coordinate of the event.

mouseDown

public boolean mouseDown(Event evt, int x, int y);

Responds to the mouse button being pressed over the control (or any of its descendants).

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
x The x coordinate of the event.
y The y coordinate of the event.

mouseDrag

public boolean mouseDrag(Event evt, int x, int y);

Responds to the mouse being dragged into or out of the control (or any of its descendants), while the mouse button is pressed.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
x The x coordinate of the event.
y The y coordinate of the event.

mouseEnter

public boolean mouseEnter(Event evt, int x, int y);

Responds to the mouse pointer entering the control (or any of its descendants).

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
x The x coordinate of the event.
y The y coordinate of the event.

mouseExit

public boolean mouseExit(Event evt, int x, int y);

Responds to the mouse pointer leaving the control (or any of its descendants).

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
x The x coordinate of the event.
y The y coordinate of the event.

mouseMove

public boolean mouseMove(Event evt, int x, int y);

Responds to the mouse pointer moving within the control, or any of the component's descendants, (with the mouse button unpressed).

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
x The x coordinate of the event.
y The y coordinate of the event.

mouseUp

public boolean mouseUp(Event evt, int x, int y);

Responds to the mouse button being released over the control (or any of its descendants).

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
evt The event posted to the control.
x The x coordinate of the event.
y The y coordinate of the event.

paint

public void paint(FxGraphics g);

Draws the control in the specified graphics context.

Return Value:

No return value.

ParameterDescription
g The graphics context.

paintAll

public void paintAll(FxGraphics g);

Draws the control and all its child components, using the specified graphics context.

Return Value:

No return value.

ParameterDescription
g The graphics context.

postEvent

public boolean postEvent(Event e);

Posts an event to the control.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event.

prepareImage

public boolean prepareImage(Image image, ImageObserver observer);

Prepares an image for this component.

Return Value:

Returns true if the image has already been fully prepared; otherwise, returns false.

ParameterDescription
image The image to prepare for component.
observer The observer notified of the image's preparation.

prepareImage

public boolean prepareImage(Image image, int width, int height,
        ImageObserver observer);

Prepares an image of the specified dimension for this component.

Return Value:

Returns true if the image has already been fully prepared; otherwise, returns false.

ParameterDescription
image The image to prepare for component.
width The width of the image (in pixels).
height The height of the image (in pixels).
observer The observer notified of the image's preparation.

print

public void print(FxGraphics g);

Prints the control in the specified graphics context.

Return Value:

No return value.

ParameterDescription
g The graphics context.

printAll

public void printAll(FxGraphics g);

Prints the control and all its child components using the specified graphics context.

Return Value:

No return value.

ParameterDescription
g The graphics context.

relayout

public void relayout();

Schedules the control to be laid out as soon as possible.

Return Value:

No return value.

removeFocusListener

public void removeFocusListener(IUIFocusListener l);

Removes the specified focus listener. The listener no longer receives the control's focus events.

Return Value:

No return value.

ParameterDescription
l The focus listener to be removed.

removeKeyListener

public void removeKeyListener(IUIKeyListener l);

Removes the specified key listener. The listener no longer receives the control's key events.

Return Value:

No return value.

ParameterDescription
l The key listener to be removed.

removeMouseListener

public void removeMouseListener(IUIMouseListener l);

Removes the specified mouse listener. The listener no longer receives the control's mouse events.

Return Value:

No return value.

ParameterDescription
l The mouse listener to be removed.

removeMouseMotionListener

public void removeMouseMotionListener(IUIMouseMotionListener l);

Removes the specified mouse motion listener. The listener no longer receives the control's mouse motion events.

Return Value:

No return value.

ParameterDescription
l The mouse motion listener to be removed.

removeNotify

public void removeNotify();

Called when the graphics context is first unavailable.

Return Value:

No return value.

repaint

public void repaint();

Schedules the control to be redrawn as soon as possible.

Note This is method is synchronous.

Return Value:

No return value.

repaint

public void repaint(long time);

Not currently implemented. Call repaint. Schedules the control to be redrawn after the specified amount of time.

Note This is method is synchronous.

Return Value:

No return value.

ParameterDescription
time The number of milliseconds after which the control is redrawn.

repaint

public void repaint(int x, int y, int width, int height);

Not currently implemented. Call repaint. Schedules the specified rectangle within the control to be redrawn as soon as possible.

Note This is method is synchronous.

Return Value:

No return value.

ParameterDescription
x The x coordinate of the upper-left corner of the rectangle to be redrawn.
y The y coordinate of the upper-left corner of the rectangle to be redrawn.
width The width of the rectangle to be redrawn (in pixels).
height The height of the rectangle to be redrawn (in pixels).

repaint

public void repaint(long tm, int x, int y, int width, int height);

Not currently implemented. Call repaint. Schedules the specified rectangle within the control to be redrawn after the specified amount of time.

Note This is method is synchronous.

Return Value:

No return value.

ParameterDescription
tm The number of milliseconds after which the rectangle is redrawn.
x The x coordinate of the upper-left corner of the rectangle to be redrawn.
y The y coordinate of the upper-left corner of the rectangle to be redrawn.
width The width of the rectangle to be redrawn (in pixels).
height The height of the rectangle to be redrawn (in pixels).

requestFocus

public void requestFocus();

Requests that the control receive the input focus.

Return Value:

No return value.

setBackground

public void setBackground(Color color);

Sets the control's background color.

Return Value:

No return value.

ParameterDescription
color The background color for the control.

setBounds

public void setBounds(int x, int y, int width, int height);

Sets the bounding rectangle of the control according to the specified coordinates and dimensions.

Return Value:

No return value.

ParameterDescription
x The x coordinate for the upper-left corner of the control, relative to the parent.
y The y coordinate for the upper-left corner of the control, relative to the parent.
width The new width of the control (in pixels).
height The new height of the control (in pixels).

setBounds

public void setBounds(Rectangle r);

Sets the bounding rectangle of the control according to the specified Rectangle object.

Return Value:

No return value.

ParameterDescription
r The rectangle identifying the coordinates for the control's upper-left corner and the control's new width and height (in pixels).

setChecked

public void setChecked(boolean on);

Sets or clears the checked state of the control.

Return Value:

No return value.

ParameterDescription
on If true, the checked state is set; otherwise, it is cleared.

setCursor

public void setCursor(Cursor cursor);

Sets the control's cursor.

Return Value:

No return value.

ParameterDescription
cursor The cursor for the control.

setEnabled

public void setEnabled(boolean on);

Sets or clears the enabled state of the control.

Return Value:

No return value.

ParameterDescription
on If true, the enabled state is set; otherwise, it is cleared.

setFlags

public void setFlags(int flags);

Sets the user-defined bits for the control.

Return Value:

No return value.

ParameterDescription
flags The user-defined settings for the control.

setFocused

public void setFocused(boolean on);

Sets or clears the focus state of the control.

Return Value:

Returns true if the focus state was successfully set or cleared; otherwise, returns false.

ParameterDescription
on If true, the focus state is set; otherwise, it is cleared.

setFont

public void setFont(Font font);

Sets the control's font.

Return Value:

No return value.

ParameterDescription
font The font for the control.

setForeground

public void setForeground(Color color);

Sets the control's foreground color.

Return Value:

No return value.

ParameterDescription
color The foreground color for the control.

setHot

public void setHot(boolean on);

Sets or clears the hot-tracked state of the control.

Return Value:

No return value.

ParameterDescription
on If true, the hot-tracked state is set; otherwise, it is cleared.

Remarks:

This method is called by the system when the component should change its hot state. Normally, this is not called directly from applications.

setID

public void setID(int id);

Sets the control's identifier.

Return Value:

No return value.

ParameterDescription
id The value to be associated with the control.

setIndeterminate

public void setIndeterminate(boolean on);

Sets or clears the indeterminate state of the control.

Return Value:

No return value.

ParameterDescription
on If true, the indeterminate state is set; otherwise, it is cleared.

setIndex

public void setIndex(int index);

Sets the index of the control within its parent container.

Return Value:

No return value.

ParameterDescription
index The index for the control.

setInvalidating

public void setInvalidating(boolean on);

Sets the invalidating state of this object.

Return Value:

No return value.

ParameterDescription
on The invalidating state setting.

Remarks:

This method is useful when a large number of changes are being made at the same time to a container. The following sample code demonstrates this usage.


//Turn off invalidating only if it's not already off.
boolean on = isInvalidating();
if (on)
    setInvalidating (false);
//Make all the necessary changes to the container.
if (on)
    setInvalidating (true);

setLocation

public void setLocation(int x, int y);

Sets the location of the control, relative to its parent.

Return Value:

No return value.

ParameterDescription
x The x coordinate for the upper-left corner of the control, relative to the parent.
y The y coordinate for the upper-left corner of the control, relative to the parent.

setLocation

public void setLocation(Point point);

Sets the location of the control, relative to its parent.

Return Value:

No return value.

ParameterDescription
point The upper-left corner of the control, relative to the parent.

setName

public void setName(String name);

Sets the control's name.

Return Value:

No return value.

ParameterDescription
name The name to be associated with the control.

setParent

public void setParent(IUIContainer parent);

Sets the control's parent.

Return Value:

No return value.

ParameterDescription
parent The new parent container of the control.

setPressed

public void setPressed(boolean on);

Sets or clears the pressed state of the control.

Return Value:

No return value.

ParameterDescription
on If true, the pressed state is set; otherwise, it is cleared.

Remarks:

This method is called by the system when the component should change its pressed state. Normally, this is not called directly from applications.

setRedrawing

public void setRedrawing(boolean on);

Sets or clears the redrawing state of the control. If the redrawing state is set, the control will be redrawn when a paint request is made. If the redrawing state is cleared, the control will not be redrawn.

Return Value:

No return value.

ParameterDescription
on If true, the redrawing state is set; otherwise, it is cleared.

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the control.

Return Value:

No return value.

ParameterDescription
on If true, the selected state is set; otherwise, it is cleared.

setSize

public void setSize(int width, int height);

Sets the size of the control, according to the specified dimensions.

Return Value:

No return value.

ParameterDescription
width The new width for the control (in pixels).
height The new height for the control (in pixels).

setSize

public void setSize(Dimension size);

Sets the size of the control, according to the specified Dimension object.

Return Value:

No return value.

ParameterDescription
size The new width and height for the control (in pixels).

setValid

public void setValid(boolean valid);

Sets or clears the valid state of the control.

Return Value:

No return value.

ParameterDescription
valid If true, the control is validated; otherwise, the control is invalidated.

setVisible

public void setVisible(boolean show);

Sets or clears the visible state of the control.

Return Value:

No return value.

ParameterDescription
show If true, the visible state is set; otherwise, it is cleared.

toString

public String toString();

Retrieves a text description of the control.

Return Value:

Returns a string that contains the name of the control's class and the control's name.

update

public void update(FxGraphics g);

Updates the control by filling it with the background color and redrawing the control.

Return Value:

No return value.

ParameterDescription
g The graphics context.

validate

public void validate();

Note This method is replaced by setValid.

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