Package com.ms.ui |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class UIMarquee extends UIViewer implements TimerListener { // Constructors public UIMarquee(Component comp); public UIMarquee(Component comp, int rate); public UIMarquee(Component comp, int rate, int dx, int dy); // Methods public int getRoleCode(); public int getStateCode(); public void timeTriggered(TimerEvent te); }
A class that implements a marquee control. UIMarquee extends UIViewer to display and move another component within its content area. By implementing the TimerListener interface, UIMarquee then scrolls this component in a given direction at a fixed rate.
The following example shows how to construct a UIMarquee object.
// Construct a marquee control that displays the text // "Hello World" and scrolls at a rate of 100 milliseconds. UIMarquee m = new UIMaruqee(new UIText("Hello World"), 100); // Now add the marquee to the container. add(m);
public UIMarquee(Component comp);Creates a marquee control using the specified component for content.
Parameter Description comp The component to be displayed within the marquee control. Remarks:
By default, the component will scroll 10 pixels in the horizontal direction and 0 pixels in the vertical direction, every 75 milliseconds. The timeTriggered method handles the actual scrolling of the component within the marquee.
public UIMarquee(Component comp, int rate);Creates a marquee control using the specified component and rate.
Parameter Description comp The component to be displayed within the marquee control. rate The rate at which to scroll the component. Remarks:
By default, the component will scroll 10 pixels in the horizontal direction and 0 pixels in the vertical direction, at the specified rate. The timeTriggered method handles the actual scrolling of the component within the marquee.
public UIMarquee(Component comp, int rate, int dx, int dy);Creates a marquee control using the specified component, rate, and scroll position.
Parameter Description comp The component to be displayed within the marquee control. rate The rate at which to scroll the component. dx The horizontal increment for the component's scroll position. dy The vertical increment for the component's scroll position. Remarks:
The timeTriggered method handles the actual scrolling of the component within the marquee.
public int getRoleCode();Retrieves the role of the marquee control.
Return Value:
Returns the ROLE_SYSTEM code that best describes the role of the marquee.
Remarks:
This method returns the ROLE_SYSTEM_STATUSBAR code.
public int getStateCode();Retrieves the state of the marquee control.
Return Value:
Returns the combintation of STATE_SYSTEM codes that best describes the state of the marquee.
Remarks:
The returned code contains the STATE_SYSTEM_MARQUEED flag.
public void timeTriggered(TimerEvent te);Scrolls the component within the marquee control.
Return Value:
No return value.
Parameter Description te A TimerEvent object that describes the timer event. Remarks:
This method implements timeTriggered in the TimerListener interface. When the marquee control is created, a repeating timer is started. Whenever the timer expires, timeTriggered is invoked to scroll the component within the marquee control.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.