Microsoft Application Foundation Classes (AFC)

Welcome
Release Notes
Download the SDK
Articles
Packages
Tools
Microsoft VM
AFC
J/Direct
Java & Native Code
Package Manager
Security
Internationalization

AFC | Welcome! | Next
 | Welcome! | Next

Microsoft Application Foundation Classes

Microsoft Application Foundation Classes (AFC) is a set of Java class libraries that provide user interface components and graphics effects for use in applets and applications using Java. AFC is licensed to be redistributed with the Microsoft Win32 VM for Java. AFC can also be redistributed with AFC102.ZIP for browsers that only support JDK 1.0.2. The following are links to detailed class references and overview articles explaining how to use AFC in your Java applets and applications.

Articles

  • Introduction to AFC
  • Overview of AFC User Interface Controls
  • Using Static, Button, Menu, and Choice Controls
  • The com.ms.fx Package

Class References

  • Package com.ms.fx
  • Package com.ms.ui
  • Package com.ms.ui.event
  • Package com.ms.ui.resource
  • Package com.ms.util.cab

AFC Samples

The AFC samples that are provided with the SDK for Java show how you can use most of the fundamental UI controls and Fx graphics and effects in your applets and applications.


Microsoft Application Foundation Classes for Java

In this topic

Release Notes | Release Notes
Microsoft Application Foundation Classes for Java | Introduction

The Microsoft Application Foundation Classes (AFC) for Java are a comprehensive set of Java class libraries providing user interface controls, graphics and effects classes, and the ability to create and extract cabinet (.cab) files. AFC's UI controls give Java developers a rich set of UI elements from which they can quickly build flexible, modern, and powerful user interfaces for their applications, enhanced by the innovative graphics techniques exposed for the first time by the com.ms.fx graphics and effects classes. Developers can, through the com.ms.util.cab APIs, utilize the Microsoft .cab file packaging and compression technology on any virtual machine.

Written in Java, AFC ensures that applications built using these classes run on the most popular platforms that support Java. The AFC UI controls are defaulted to the Microsoft® Windows® UI, and are also are fully customizable to reflect the needs of application and applet designers. AFC supports Active Accessibility for Java, so any application developed using AFC is automatically accessibility-enabled (where Active Accessibility for Java services exist).

AFC comprises:

  • UI: A rich suite of UI controls, written in Java. UI controls will run in a number of popular browsers and are automatically accessibility-enabled where appropriate platform services exist.

  • Fx: A suite of classes for graphics and effects, written in Java. Fx classes will run in a number of popular browsers.

  • CAB: A suite of Java APIs for creating and extracting cabinet files on any virtual machine.

Known Issues for AFC

  • Platforms and JDK 1.02 compatibility: AFC's UI and Fx classes are JDK 1.02 compatible and run with the Microsoft VM, which ships with Internet Explorer and the Microsoft SDK for Java.

In addition, the SDK for Java contains a redistributable, JDK 1.0.2-compatible version of AFC that has been tested on popular JDK 1.0.2-compatible browsers on Win32 and other platforms. This redistributable component should be used for applets requiring distribution on Internet Explorer 3.0.1 and other popular non-JDK 1.1-compliant platforms.

Full JDK 1.0.2-compatible AFC licensing and redistribution details are included in the End-User License Agreement for the Microsoft SDK for Java version 3.0 pre-release 2. JDK 1.0.2-compatible AFC Release Notes are included with this SDK, and differences between the JDK 1.02 and 1.1-compatible versions of AFC that affect developers are described in the accompanying documentation. In addition, watch www.microsoft.com/java/afc for the latest updates and documents.
  • JDK 1.0.2-compatible AFC platforms: JDK 1.0.2-compatible AFC will function effectively on Internet Explorer Version 3.0 and 4.01 and on Netscape Navigator 3.0.4 and 4.0.3 on Windows 95 and Windows NT 4.0.

    JDK 1.0.2-compatible AFC will also function on Navigator 3.0.4 and 4.0.3 on Solaris platforms.

    Severe painting and performance problems are exhibited when running JDK 1.0.2-compatible AFC on both Internet Explorer 3.0 and Netscape Navigator 3.0.4 and 4.0.3 for the Apple Macintosh as a result of difficulties intrinsic to the Macintosh VM. Microsoft is therefore not licensing JDK 1.0.2-compatible AFC for use on the Apple Macintosh at this time.

    The JDK 1.1-compatible version of AFC will be available with Internet Explorer 4.0 when it is released for Apple Macintosh and Solaris platforms.

    Note Developers may notice variations in the quality of the JDK 1.0.2-compatible AFC implementation when running across VMs and browsers, resulting from compatibility issues and differences in VM implementations.

    See the JDK 1.0.2-compatible AFC Release Notes for more details.

  • JDK 1.1 and 1.0.2 event models: AFC supports both the JDK 1.1 and JDK 1.0.2 event models. Consult the AFC API documentation and articles on www.microsoft.com/java/sdk/30p1/afc/default.htm for implementation details.

  • AWT/ UI interoperability: In this release, bi-directional interoperability between UI and AWT is provided, enabling AWT components to be used in AFC containers and vice versa.

Note As AwtUI and UIAwt objects are intended only to provide a bridge between AWT and AFC, use of AwtUI and UIAwt should be confined to situations where a bridge is necessary and beyond this should be limited to prevent performance degradation and to permit the full benefits of AFC to be realized.
AFC's API documentation and articles on www.microsoft.com/java/sdk/30p1/afc/default.htm give further implementation details.

  • JDK 1.0.2-compatible AFC API Changes: A list of API changes between JDK 1.1-compatible and JDK 1.0.2-compatible AFC will be provided on www.microsoft.com/java/afc/10211diffs.htm.

  • Drag and Drop: Drag and drop does not currently function correctly in AFC. The AFC samples demonstrate a drag and drop workaround which takes advantage of the AFC/AWT bridge in the Viewers Sample Applet sample. Source code for the workaround is provided as part of the sample.

  • Hot tracking has been disabled for this release.

  • FxStyledPen has a supported width of one pixel for this release.

  • UIEdit: Multiple font support and vertical writing are not available in this release. FxFormattedText provides multiple font and vertical writing support, but this functionality is not directly available as part of our UIEdit control.

  • Serialization: AFC's UI package is not serialized by default for this release. It is possible to add this functionality yourself if you require your components to be serialized.

  • Border Layout: In this release of AFC, overridding getPreferredSize() in a Panel will not cause the panel to have that perferred size. The layout manager may shrink the panel to a smaller size.

  • Layout Managers: Some method names in AFC's UILayoutManager class have changed.

From | To
public Dimension minimumLayoutSize(IUIContainer parent) | public Dimension getMinimumSize(IUIContainer parent)
public Dimension preferredLayoutSize(IUIContainer parent) | public Dimension getPreferredSize(IUIContainer parent)
public void layoutContainer(IUIContainer parent) | public void layout(IUIContainer parent, Rectangle rect)


SDK for Java Version 3.0 Pre-Release 2 License Agreement

Other Release Notes

* Installation Instructions

* Redistribution Components

* Microsoft Virtual Machine

* J/Direct
* Security Model
* Known Issues

* Class Libraries

* DirectX3J

* Microsoft AFC

* Tools and Utilities

* Developer Support

* Bug Reporting

Release Notes | Java Home
Introduction | Java Home

END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE

IMPORTANT—READ CAREFULLY: This Microsoft End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation for the Microsoft software product identified above, which includes computer software and may include associated media, printed materials, and "online" or electronic documentation ("SOFTWARE PRODUCT"). By installing, copying, or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, do not install, copy or use the SOFTWARE PRODUCT.

Microsoft APPLICATION FOUNDATION CLASSES FOR JAVA VERSION 1.1

The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.

1. GRANT OF LICENSE. This EULA grants you the following rights

a. Software Product. Microsoft grants to you as an individual, a personal, nonexclusive license to make and use copies of the SOFTWARE for the sole purposes of designing, developing, and testing your software product(s). You may install copies of the SOFTWARE PRODUCT on an unlimited number of computers provided that you are the only individual using the SOFTWARE PRODUCT. If you are an entity, Microsoft grants you the right to designate one individual within your organization to have the right to use the SOFTWARE PRODUCT in the manner provided above.

b. Electronic Documents. Solely with respect to electronic documents included with the SOFTWARE PRODUCT, you may make an unlimited number of copies (either in hardcopy or electronic form), provided that such copies shall be used only for internal purposes and are not republished or distributed to any third party.

c. Storage/Network Use. You may also store or install a copy of the SOFTWARE PRODUCT on a storage device, such as a network server, used only to install or run the SOFTWARE PRODUCT on your other computers over an internal network; however, you must acquire and dedicate a license for each separate computer on which the SOFTWARE PRODUCT is installed or run from the storage device. A license for the SOFTWARE PRODUCT may not be shared or used concurrently on different computers.

d. Special Requirements.

The following also applies to the Microsoft Application Foundation Classes ("AFC"):

Microsoft grants you the right (i) to install AFC in object code form on an unlimited number of Web server computers and allow users to access and download AFC via an HTTP connection into their client-side Web browser cache in order to run applets that rely on AFC functionality, provided that you (A) not use Microsoft's name, logo, or trademarks to market your applet; (B) indemnify, hold harmless, and defend Microsoft from and against any claims or lawsuits, including attorney's fees, that arise or result from the use or distribution of your applets; and (C) load all the files included in AFC onto such server computers; OR (ii) to download and install copies of the SOFTWARE PRODUCT in object code form on your client-side computer for use in conjunction with validly licensed copies of Microsoft Internet Explorer versions 3.0.2 and 4.0 for Microsoft Windows 95 and Windows NT 4.0, Netscape Navigator 3.0.4 for Microsoft Windows 95 and Windows NT 4.0 and Sun Solaris, and Netscape Navigator/Communicator 4.0.3 for Microsoft Windows 95 and Windows NT 4.0 and Sun Solaris; OR (iii) to upload a copy of AFC onto an unlimited number of server computers and allow users to download and install AFC in object code form, provided that you require such users prior to download to agree to the terms of this EULA or another license that is at least as restrictive as this EULA. If you wish to redistribute AFC with a standalone Java application program, you must redistribute the Microsoft virtual machine for Java, which includes AFC. The redistribution rights and obligations associated with the Microsoft virtual machine for Java are described in the license agreement for the Microsoft SDK for Java. Development Tool vendors must obtain a separate license from Microsoft for the right to distribute AFC with their tool products.

2. UPGRADES. If the SOFTWARE PRODUCT is labeled as an upgrade, you must be properly licensed to use a product identified by Microsoft as being eligible for the upgrade in order to use the SOFTWARE PRODUCT. A SOFTWARE PRODUCT labeled as an upgrade replaces and/or supplements the product that formed the basis for your eligibility for the upgrade. You may use the resulting upgraded product only in accordance with the terms of this EULA. If the SOFTWARE PRODUCT is an upgrade of a component of a package of software programs that you licensed as a single product, the SOFTWARE PRODUCT may be used and transferred only as part of that single product package and may not be separated for use on more than one computer.

3. COPYRIGHT. All title and copyrights in and to the SOFTWARE PRODUCT (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE PRODUCT), the accompanying printed materials, and any copies of the SOFTWARE PRODUCT are owned by Microsoft or its suppliers. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE PRODUCT like any other copyrighted material except that you may install the SOFTWARE PRODUCT on a single computer provided you keep the original solely for backup or archival purposes. You may not copy the printed materials accompanying the SOFTWARE PRODUCT.

4. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS

a. Limitations on Reverse Engineering, Decompilation, and Disassembly. You may not reverse engineer, decompile, or disassemble the SOFTWARE PRODUCT, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.

b. Separation of Components. The SOFTWARE PRODUCT is licensed as a single product. Its component parts may not be separated for use on more than one computer.

c. Rental. You may not rent, lease, or lend the SOFTWARE PRODUCT.

d. Support Services. Microsoft provides no support for this SOFTWARE PRODUCT.

e. Software Transfer. You may permanently transfer all of your rights under this EULA, provided you retain no copies, you transfer all of the SOFTWARE PRODUCT (including all component parts, the media and printed materials, any upgrades, this EULA, and, if applicable, the Certificate of Authenticity), and the recipient agrees to the terms of this EULA. If the SOFTWARE PRODUCT is an upgrade, any transfer must include all prior versions of the SOFTWARE PRODUCT.

f. Termination. Without prejudice to any other rights, Microsoft may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the SOFTWARE PRODUCT and all of its component parts.

5. U.S. GOVERNMENT RESTRICTED RIGHTS. The SOFTWARE PRODUCT and documentation are provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 or subparagraphs (c)(1) and (2) of the Commercial Computer Software—Restricted Rights at 48 CFR 52.227-19, as applicable. Manufacturer is Microsoft Corporation/One Microsoft Way/Redmond, WA 98052-6399.

6. EXPORT RESTRICTIONS. You agree that neither you nor your customers intend to or will, directly or indirectly, export or transmit (i) the SOFTWARE or related documentation and technical data or (ii) your software product as described in Section 1(f) of this License (or any part thereof), or process, or service that is the direct product of the SOFTWARE, to any country to which such export or transmission is restricted by any applicable U.S. regulation or statute, without the prior written consent, if required, of the Bureau of Export Administration of the U.S. Department of Commerce, or such other governmental entity as may have jurisdiction over such export or transmission.

7. NOTE ON JAVA SUPPORT. THE SOFTWARE PRODUCT CONTAINS SUPPORT FOR PROGRAMS WRITTEN IN JAVA. JAVA TECHNOLOGY IS NOT FAULT TOLERANT AND IS NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE OR RESALE AS ONLINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATIONS SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF JAVA TECHNOLOGY COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE.

MISCELLANEOUS

If you acquired this product in the United States, this EULA is governed by the laws of the State of Washington.

If you acquired this product in Canada, this EULA is governed by the laws of the Province of Ontario, Canada. Each of the parties hereto irrevocably attorns to the jurisdiction of the courts of the Province of Ontario and further agrees to commence any litigation which may arise hereunder in the courts located in the Judicial District of York, Province of Ontario.

If this product was acquired outside the United States, then local law may apply.

Should you have any questions concerning this EULA, or if you desire to contact Microsoft for any reason, please contact the Microsoft subsidiary serving your country, or write: Microsoft Sales Information Center/One Microsoft Way/Redmond, WA 98052-6399.

If you have a specific question regarding the licensing of redistributables, you may call the Microsoft Technical Sales Information Team at (800) 426-9400 (United States only) or send inquiries via fax to Microsoft SDK for Java Licensing Administrator, (206) 936-7329 (United States only).

LIMITED WARRANTY

LIMITED WARRANTY. To the maximum extent permitted by applicable law, Microsoft and its suppliers disclaim all other warranties, either express or implied, including, but not limited to, implied warranties of merchantability AND fitness for a particular purpose, with regard to the SOFTWARE PRODUCT, and any accompanying hardware. This limited warranty gives you specific legal rights. You may have others, which vary from state/jurisdiction to state/jurisdiction. NOTWITHSTANDING THE FOREGOING, MICROSOFT WARRANTS THAT IT HAS ALL THIRD PARTY LICENSE RIGHTS THAT ARE NECESSARY TO GRANT THE LICENSE RIGHTS SET FORTH HEREIN.

LIMITATION OF LIABILITY. EXCEPT WITH RESPECT TO THE WARRANTY SET FORTH IN THE LAST SENTENCE OF THE "LIMITED WARRANTY" SECTION ABOVE, MICROSOFT’S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY UNDER THIS EULA SHALL NOT EXCEED ONE HUNDRED DOLLARS (US$100.00).

NO LIABILITY FOR CONSEQUENTIAL DAMAGES. To the maximum extent permitted by applicable law, in no event shall Microsoft or its suppliers be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use thE software product, even if Microsoft has been advised of the possibility of such damages. Because some states and jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.

Si vous avez acquis votre produit Microsoft au CANADA, la garantie limitée suivante vous concerne :

GARANTIE LIMITEE

GARANTIE LIMITEE — Sauf pour celles du REDISTRIBUTABLES, qui sont fournies "comme telles", sans aucune garantie quelle qu’elle soit, Microsoft garantit que (a) la performance du LOGICIEL sera substantiellement en conformité avec le(s) manuel(s) de produits qui accompagne(nt) le LOGICIEL pour une période de quatre-vingt-dix (90) jours à compter de la date de réception ; et (b) tout matériel fourni par Microsoft accompagnant le LOGICIEL sera exempt de défaut de matière première ou de vice de fabrication dans des conditions normales d’utilisation et d’entretien pour une période d’un an à compter de la date de réception. Toute garantie implicite concernant le LOGICIEL et le matériel est limitée à quatre-vingt-dix (90) jours et un (1) an, respectivement.

RECOURS DU CLIENT — La seule obligation de Microsoft et votre recours exclusif seront, au choix de Microsoft, soit (a) le remboursement du prix payé ou (b) la réparation ou le remplacement du LOGICIEL ou du matériel qui n’est pas conforme à la Garantie Limitée de Microsoft et qui est retourné à Microsoft avec une copie de votre reçu. Cette Garantie Limitée est nulle si le défaut du LOGICIEL ou du matériel est causé par un accident, un traitement abusif ou une mauvaise application. Tout LOGICIEL de remplacement sera garanti pour le reste de la période de garantie initiale ou pour trente (30) jours, selon laquelle de ces deux périodes est la plus longue.

AUCUNE AUTRE GARANTIE — MICROSOFT DESAVOUE TOUTE AUTRE GARANTIE, EXPRESSE OU IMPLICITE, Y COMPRIS MAIS NE SE LIMITANT PAS AUX GARANTIES IMPLICITES DU CARACTERE ADEQUAT POUR LA COMMERCIALISATION OU UN USAGE PARTICULIER EN CE QUI CONCERNE LE LOGICIEL, LE(S) MANUEL(S) DE PRODUITS, LA DOCUMENTATION ECRITE ET TOUT MATERIEL QUI L’ACCOMPAGNENT. CETTE GARANTIE LIMITEE VOUS ACCORDE DES DROITS JURIDIQUES SPECIFIQUES.

PAS D’OBLIGATION POUR LES DOMMAGES INDIRECTS — MICROSOFT OU SES FOURNISSEURS N’AURONT D’OBLIGATION EN AUCUNE CIRCONSTANCE POUR TOUT AUTRE DOMMAGE QUEL QU’IL SOIT (Y COMPRIS, SANS LIMITATION, LES DOMMAGES ENTRAINES PAR LA PERTE DE BENEFICES, L’INTERRUPTION DES AFFAIRES, LA PERTE D’INFORMATION COMMERCIALE OU TOUTE AUTRE PERTE PECUNIAIRE) DECOULANT DE L’UTILISATION OU DE L’IMPOSSIBILITE D’UTILISATION DE CE PRODUIT MICROSOFT, ET CE, MEME SI MICROSOFT A ETE AVISE DE LA POSSIBILITE DE TELS DOMMAGES. EN TOUT CAS, LA SEULE OBLIGATION DE MICROSOFT EN VERTU DE TOUTE DISPOSITION DE CETTE CONVENTION SE LIMITERA AU MONTANT EN FAIT PAYE PAR VOUS POUR LE LOGICIEL.

La présente Convention est régie par les lois de la province d’Ontario, Canada. Chacune des parties à la présente reconnaît irrévocablement la compétence des tribunaux de la province d’Ontario et consent à instituer tout litige qui pourrait découler de la présente auprès des tribunaux situés dans le district judiciaire de York, province d’Ontario.

Au cas où vous auriez des questions concernant cette licence ou que vous désiriez vous mettre en rapport avec Microsoft pour quelque raison que ce soit, veuillez contacter la succursale Microsoft desservant votre pays, dont l’adresse est fournie dans ce produit, ou écrire à : Microsoft Sales Information Center, One Microsoft Way, Redmond, Washington 98052-6399.


Introduction to AFC

Microsoft® Application Foundation Classes (AFC) is a set of Java class libraries that provide user interface components and graphics effects for use in Java-based applets and applications. AFC is licensed to be redistributed with the Microsoft Win32 VM for Java. AFC can also be redistributed with AFC102.ZIP for browsers that only support JDK 1.0.2. The AFC libraries consist of the following packages:

  • The com.ms.fx package (FX package) provides support for basic graphic elements such as colors, glyphs, fonts, curves, text, and textures.
  • The com.ms.ui package (UI package) provides an application framework and includes many of the high-level user interface controls used by applications—controls such as menus, dialog boxes, list boxes, scroll bars, push buttons, check boxes, edit boxes, and tree controls.
  • The com.ms.ui.event package provides support for the Java 1.1 event model.
  • The com.ms.ui.resource package provides support for using Win32 resource files with Java applications.
  • The com.ms.util.cab package provides access to cabinet file creation and extraction services.

This article provides an introduction to programming with the AFC UI package. It begins with an overview of the architecture of AFC and a description of the relationship between AFC and the Abstract Window Toolkit (AWT). It then presents a sample program that you can use as a starting point for writing programs that use the AFC class library. The article concludes with a description of how to use some basic AFC user interface controls.

Technical Overview

The largest and most important part of AFC is the user interface (UI) package, com.ms.ui. (Often, when people speak of AFC, they are actually referring to the UI package.) This package provides a basic application framework as well as user interface controls. The following diagram shows the class hierarchy of the basic UI package components.

The class hierarchy in the previous diagram is not complete—it doesn't show interface classes that are implemented by many of the AFC classes, and it doesn't show all of the AFC classes (such as layout managers and AWT compatibility classes). The diagram should, however, give you an idea of the basic layout of AFC's class structure.

AFC Component Model

Like AWT, the fundamental elements of AFC are components, containers, and layout managers. Components are the most fundamental of these elements and are usually associated with visual elements—all AFC UI controls are components. Containers are simply components that can contain other components. Layout managers are neither components nor containers; they are objects delegated by containers to calculate the position and size of the various components within the container.

AFC is similar in overall design to AWT—if you're familiar with AWT, you can apply much of what you've learned to working with AFC. AFC does not, however, directly extend the AWT component architecture. Although AFC is based on an architecture that maintains many of the concepts (and method signatures) used by AWT, AFC is designed to support applications that are smaller, run faster, and are more compatible across different Java implementations. The AFC component model is based on the following design features:

  • Lightweight base classes
  • Windowless components
  • Peerless implementation

Lightweight base classes enable UI components to use less data storage—there is no memory wasted on unnecessary fields that are propagated to all of the classes derived from the base classes. This component model allows AFC to support high-capacity containers with a minimum of overhead. For example, consider a table with hundreds of entries that are bound to a database. With AFC, you can create a table entry component that requires only a few bytes of storage. On the other hand, if you create a table entry component by extending the AWT Component class, you'll inherit at least 104 bytes of storage that you probably don't need.

Windowless components yield dramatic increases in performance as well as smaller components. Unlike AWT components, AFC components are not windows and do not have to carry the extra baggage required of components that are windows. Performance is enhanced because AFC does its own window management (such as clipping, moving, and resizing windows) and doesn't have to access native code through peers or other mechanisms.

AFC is implemented without using peer classes—there is no native code required to run AFC on a VM for Java. Because AFC doesn't have to deal with the subtle differences in AWT implementations on different VMs, it can provide a higher degree of cross-platform consistency than AWT.

Note Because AFC components do not extend directly from the AWT Component class, you cannot freely mix AFC and AWT components in a single application. You can, however, use the AFC AWT compatibility classes to include AFC components in an AWT application. You can also use the UIAwtHost class to include AWT components in an AFC application.

AFC Event Model

AFC supports both the JDK 1.02 and the JDK 1.1 event model. AFC applications can use either event model, regardless of the event model supported by the VM used to run the application. There are some differences in the way that AFC and AWT implement event handling—the following list summarizes these differences:

  • AFC propagates 1.1-style events up the containment hierarchy regardless of whether there is a listener attached to the event target. AWT does not propagate events when there is a listener attached.
  • 1.1-style window messages (windowOpened, windowClosed, and so on) are only generated when AFC applications are running on a 1.1 VM—window messages are not generated when applications are running on a 1.02 VM.
  • AFC does not support 1.1-style component events (componentHidden, componentMoved, componentResized, componentShown).
  • AFC does not support the JDK 1.1 technique of dispatching events with the dispatchEvent method. In AFC, events must be posted using the JDK 1.02 postEvent method.

Using the 1.02 Event Model

To handle 1.02-style events, you must override the appropriate UIComponent method for the target object or its container. You can override the general-purpose handleEvent method to handle any event or you can override the event-specific methods in the following list to handle specific events.

  • action
  • gotFocus
  • keyDown
  • keyUp
  • lostFocus
  • mouseClicked
  • mouseDown
  • mouseDrag
  • mouseEnter
  • mouseExit
  • mouseMove
  • mouseUp

The 1.02-style event methods use the AWT Event class to represent events.

Using the 1.1 Event Model

To handle 1.1-style events, you must implement the appropriate event listener interface in the target object or one of its containers. The following is a list of AFC event listener interfaces.

  • IUIActionListener
  • IUIAdjustmentListener
  • IUIContainerListener
  • IUIFocusListener
  • IUIItemListener
  • IUIKeyListener
  • IUIMouseListener
  • IUIMouseMotionListener
  • IUITextListener

The 1.1-style event listeners use the AFC UIEvent class to represent events.

Using AFC Components in AWT Applications

AFC includes a set of classes that enable AFC components to be used as JavaBeans in AWT applications. These classes consist of a bridge layer wrapped around an AFC component. The following illustration shows the relationship between an AFC component, the bridge layer, and an AWT container.

There are corresponding AWT compatibility classes for all AFC UI control classes and several general-purpose classes such as UICanvas and UIPanel. The AWT compatibility classes have the same name as the corresponding AFC classes with the addition of an AwtUI prefix. For example, AwtUIPushButton is the AWT compatibility class for UIPushButton. The AwtUIApplet class is a bit different than the other AWT compatibility classes—it's used to provide a top-level host container for AFC applets.

Note You should only use one layer of AWT compatibility classes to provide a bridge between AWT containers and AFC components. The components contained by an AWT compatibility object must be AFC UI components (extended from IUIComponent).

Using AWT Components in AFC Applications

In addition to the AWT compatibility classes, AFC provides an AWT host control, UIAwtHost, that allows you to include AWT components in an AFC application. The following example shows how to use the host control to include an AWT Button component in a UIPanel object.

// Create an AFC panel and an AWT button
UIPanel p = new UIPanel ();
Button b = new Button ("AWT Button");

// Add button to panel using UIAwtHost bridge
p.add (new UIAwtHost (b));

Note The UIAwtHost bridge cannot be used inside an AFC choice control. If used inside a menu list, the menu list cannot be launched as a pop-up menu.

Events that propagate to the host are retargeted before being propagated up the containment hierarchy—the host becomes the event target for these events. The host control supports event propagation for only one level of containment. Events associated with any component contained by the component being hosted are consumed by the host control and do not propagate further. You can get access to these events by overriding the handleEvent method of the host control.

For example, in the previous sample, the UIPanel object will receive events associated with the AWT Button object. The target (specified in the Event.target field) will be the UIAwtHost object, however, not the Button object. If the Button object is contained by an AWT panel, events associated with the button will be consumed by the host control and will never propagate to the outer UIPanel object.

AFCSkeleton—A Basic AFC Application

AFC-based applications are similar in construction to AWT-based applications. However, because of the way that AFC ties in with AWT, there are some important differences in how you construct applets for the two class libraries. Let's take a look at a basic AFC application. The following is the complete Java source for AFCSkeleton, an AFC application skeleton designed to function as an applet as well as a stand-alone application.

download Download AFCSkeleton sample.

// AFCSkeleton.java

import java.awt.*;
import com.ms.ui.*;
import com.ms.fx.*;

// AWT applet bridge
public class AFCSkeleton extends AwtUIApplet {
  // Create instance of applet implementation
  public AFCSkeleton ()
  {
    super (new AFCSkeletonImplementation ());
  }

  // Stand-alone application entry point
  public static void main(String args[]) {
    // Create a frame to contain applet
    AFCSkeletonFrame f = new AFCSkeletonFrame ("AFC Skeleton");
    f.setVisible (true);
    f.setSize (320, 200);

    // Create applet implementation, add to frame, init
    AFCSkeletonImplementation applet
      = new AFCSkeletonImplementation ();
    f.add (applet);
    applet.init ();
  }

  // Add pass-through methods for scriptable applet methods here
  public String getInfo () {
    return(((AFCSkeletonImplementation)getUIApplet()).getInfo());
  }
}

// Applet implementation
class AFCSkeletonImplementation extends UIApplet {
  // Applet entry point
  public void init() {
    setBackground (FxColor.cyan);

    // Add additional components here
  }

  public String getInfo () {
    String s = "Info about AFCSkeleton.class\r\n";
    s += "Version: 1.0\r\n";
    return s;
  }
}

// Frame to host applet when run as stand-alone application
class AFCSkeletonFrame extends UIFrame {
  public AFCSkeletonFrame(String str) {super (str);}

  public boolean handleEvent (Event e) {
    switch (e.id) {
    case Event.WINDOW_DESTROY:
      // Frame window closed, exit app
      System.exit (0);
      return true;
    default:
      return super.handleEvent (e);
    }
  }
}

The purpose of AFCSkeleton is to illustrate the basic structure of AFC applets and applications. When you run AFCSkeleton as a stand-alone application, you'll see a framed window with a cyan background. The client area of the window will be set to 320 by 200 pixels. When you run it as an applet in a browser, you'll see a cyan rectangle set to the size specified by the APPLET tag.

Note There are many ways to create Java programs that can be run either as a stand-alone application or an applet. The AFCSkeleton example shown in this article is simplified to illustrate the basic minimum requirements of AFC applications.

AFCSkeleton consists of three classes:

  • Class AFCSkeleton is a public class that extends AwtUIApplet. This class provides a bridge to AWT when the program is run as an applet, as well as the main entry point when it is run as a stand-alone application.
  • Class AFCSkeletonImplementation is a private class that extends UIApplet. This class contains the actual implementation of the program.
  • Class AFCSkeletonFrame is a class that extends UIFrame. This class is used to provide a frame window for the program to use when it is run as a stand-alone application.

The Structure of AFC Applets

Applets written for AFC require at least two classes: an AwtUIApplet bridge class to interface with the applet's host and a UIApplet class to provide the actual implementation of the applet. This may seem like a bit of extra work, but the bridge class is typically only a few lines of rote code. The following example shows the code implementing a basic AFC applet.

import com.ms.ui.*;

// Bridge class
public class MyApplet extends AwtUIApplet
{
  // Constructor
  public MyApplet () { super (new MyAppletImplementation ()); }
}

// Implementation class
class MyAppletImplementation extends UIApplet
{
  // Applet entry point
  public void init()
  {
    // Add your components here
  }
}

The bridge class contains a single method: a constructor that creates an instance of the applet's UIApplet implementation class and passes it to the constructor for AwtUIApplet.

Note If any of the applet's methods are to be scriptable, they must be exposed to the host through the AwtUIApplet bridge class.

The applet implementation class is based on the UIApplet class. It can be constructed similarly to the Applet-based class for AWT applets. The basic applet init, start, stop, and destroy methods should be implemented in this class and not in the AwtUIApplet bridge class.

Running AFCSkeleton as an Applet

The following HTML code will run AFCSkeleton as an applet and set its initial size to 320 by 240 pixels:

<applet
  code=AFCSkeleton.class
  id=AFCSkeleton
  width=320
  height=240 >
</applet>

When AFCSkeleton is run as an applet, the entry point is the AFCSkeletonImplementation.init method:

// Applet entry point
public void init()
{
  setBackground (FxColor.cyan);

  // Add additional components here
}

All that happens in init is a call to the setBackground method to set the background of the UIApplet object to cyan. This is where you add the components that transform AFCSkeleton from an shell to a real program. The init method is also called when AFCSkeleton is run as a stand-alone application, so you can place all of your initialization code in a single routine.

AFCSkeleton has one public method, getInfo, that can be called from a browser using a scripting language such as JavaScript or Microsoft® Visual Basic® Scripting Edition. Scriptable public methods must be exposed in the AwtUIApplet bridge class. Calls to these methods should be passed to the implementation class as shown in the following code fragment that implements the getInfo method in the AwtUIApplet bridge class for AFCSkeleton:

public String getInfo ()
{
  return (((AFCSkeletonImplementation)getUIApplet()).getInfo());
}

The key here is to use the getUIApplet method to get a reference to the UIApplet object containing the implementation of the applet's scriptable methods.

Running AFCSkeleton as a Stand-alone Application

When AFCSkeleton is run as a stand-alone application, the entry point is the main method in the AFCSkeleton class:

// Stand-alone application entry point
public static void main(String args[])
{
  // Create a frame to contain applet
  AFCSkeletonFrame f = new AFCSkeletonFrame ("AFC Skeleton");
  f.setVisible (true);
  f.setSize (320, 200);

  // Create applet implementation, add to frame, init
  AFCSkeletonImplementation applet
    = new AFCSkeletonImplementation ();
  f.add (applet);
  applet.init ();
}

The main method is executed only when the program is run as a stand-alone application. Its purpose is to create a frame (UIFrame) that contains an instance of the program as an applet. At first glance, this seems a bit convoluted, but it's actually quite elegant—the frame exists only to provide a container for the applet. When an applet is run in a browser, the browser provides the container.

After creating an AFCSkeletonImplementation object and adding it to the frame object, main calls the init method to initialize the applet. Using this structure allows you to put all of your initialization code in a single initialization method instead of in two separate locations (one for when the program is run as an applet and one for when it's run as a stand-alone application).

There's one more small piece of the puzzle here, the handleEvent method in AFCSkeletonFrame:

public boolean handleEvent (Event e)
{
  switch (e.id)
  {
  case Event.WINDOW_DESTROY:
    // Frame window closed, exit app
    System.exit (0);
    return true;
  default:
    return super.handleEvent (e);
  }
}

The handleEvent method is an AFC UIComponent method that is overridden to intercept and process events. In the case of AFCSkeletonFrame, you need to trap the WINDOW_DESTROY message that is sent when the user attempts to close the window containing the stand-alone application. When handleEvent receives the WINDOW_DESTROY message, it exits the application. All other messages are passed on to the frame's superclass.

Adding AFC Controls

The next step is to add some AFC controls to the skeleton application. AFCExample1 is an application based on AFCSkeleton, with the addition of two buttons and a status bar.

download Download AFCExample1 sample.

The following is a screen shot of AFCExample1 when it runs as a stand-alone application:

Clicking one of the buttons changes the background color of the application to either red or blue. The text in the status bar changes to indicate the change in background color, as well as whenever the mouse cursor passes over a button.

The controls in AFCExample1 are contained by a UIPanel object that is added to the application by the init method. The following is the source for the init method:

// Applet entry point
public void init()
{
  setBackground (FxColor.lightGray);

  setLayout (new UIBorderLayout ());
  add (new AFCExample1Panel ());
  setValid (true);
}

In addition to adding a UIPanel object, init sets the background color and a layout manager for the application. The last thing init does is call the setValid method to force the layout manager to lay out all of the components contained by the application.

Note Neglecting to call setValid to force a component layout operation is a common mistake—if you don't call setValid, your controls often either fail to appear or are arranged improperly when you run your application.

Using Panels to Contain Controls

Panels are very useful for organizing and arranging controls. AFCExample1 includes a class, AFCExample1Panel, that extends UIPanel to provide a container for all of the controls used in the application. The following code fragment shows the class variables and constructor for the AFCExample1Panel class:

private UIPanel p;
private UIPushButton b1, b2;
private UIStatus s;

// Constructor
public AFCExample1Panel ()
{
  setLayout (new UIBorderLayout ());

  // Create panel to contain buttons
  p = new UIPanel ();

  // Create buttons and add to ButtonPanel
  p.add (b1 = new UIPushButton ("Red", UIPushButton.RAISED));
  p.add (b2 = new UIPushButton ("Blue", UIPushButton.RAISED));
  b1.setBackground (FxColor.lightGray);
  b2.setBackground (FxColor.lightGray);

  // Create status bar control
  s = new UIStatus ("This is a UIStatus control.");
  s.setBackground (FxColor.lightGray);

  // Add button panel and status bar to AFCExample1Panel
  add (p, "Center");
  add (s, "South");
}

The first thing the constructor does is create a UIBorderLayout layout manager and call setLayout to set it as the layout manager for the panel. The AFCExample1Panel container has two components managed by the UIBorderLayout layout manager:

  • A UIStatus object that is positioned at the bottom of the AFCExample1Panel container.
  • A UIPanel object that contains two buttons and is positioned at the center of the AFCExample1Panel container.

UIBorderLayout is an AFC layout manager that is similar to AWT's BorderLayout layout manager—it positions components along the four edges and at the center of a container. When you add components to a container that uses the UIBorderLayout layout manager, you specify their positions with keywords similar to compass directions: "North" for the top edge of the container, "South" for the bottom edge, "East" for the right edge, "West" for the left edge, and "Center" for the center. The center component receives the space that remains after the edge components have been positioned.

Handling Control Events

In addition to having a constructor, the AFCExample1Panel class overrides two IUIComponent methods to handle events for the components that it contains. The action method is overridden to handle clicks on the two buttons in the application. The following is the source for the overridden action method:

// Action event handler
public boolean action (Event e, Object o)
{
  if (o == b1)
  {
    p.setBackground (FxColor.red);
    p.repaint ();
    s.setName ("Background color changed to red.");
  }
  else if (o == b2)
  {
    p.setBackground (FxColor.blue);
    p.repaint ();
    s.setName ("Background color changed to blue.");
  }
  return true;
}

The action method determines which button has been clicked, and then performs the following actions:

  • Calls the UIPanel.setBackground method to change the background color of the panel containing the buttons.
  • Calls the UIPanel.repaint method to force a repaint of the panel.
  • Calls the UIStatus.setName method to change the text in the status bar.

The second overridden event-handling method is handleEvent. It is overridden to detect when the mouse cursor moves into the area occupied by a UIPushbutton object. Here's the source for handleEvent:

public boolean handleEvent (Event e)
{
  if ((e.id == Event.MOUSE_ENTER)
   && (e.target instanceof UIPushButton))
  {
    s.setName ("UIPushbutton object: MOUSE_ENTER event.");
    return true;
  }
  else
  {
    return super.handleEvent (e);
  }
}

The handleEvent method looks for a MOUSE_ENTER event on a target that is an instance of a UIPushButton object. All other events are passed on to the handleEvent method of the superclass.

Note The event handling implemented in the AFCExample1 sample described in this article is based on the JDK 1.02 event model. (AFC also supports the JDK 1.1 event model, also called the event delegation or Beans model.)


AFC Skeleton

// AFCSkeleton.java
//
// A minimal AFC application skeleton designed to function
// as an applet or as a stand-alone application.

import java.awt.*;
import com.ms.ui.*;
import com.ms.fx.*;

// Bridge class for AFC applet
public class AFCSkeleton extends AwtUIApplet
{
    // Constructor
    public AFCSkeleton ()
    {
        // Create instance of applet implementation
        super (new AFCSkeletonImplementation ());
    }

    // Stand-alone application entry point
    public static void main(String args[])
    {
        // Create a frame to contain applet
        AFCSkeletonFrame f = new AFCSkeletonFrame ("AFC Skeleton Application");
        f.setVisible (true);
        f.setSize (320, 200);

        // Create instance of applet implementation and add to frame
        AFCSkeletonImplementation applet = new AFCSkeletonImplementation ();
        f.add (applet);

        // Stand-alone application must explicitly call init()
        applet.init ();
    }

    // Add pass-through methods for scriptable applet methods here
    public String getInfo () {return (((AFCSkeletonImplementation) getUIApplet ()).getInfo ());}
}

// Class for applet implementation
class AFCSkeletonImplementation extends UIApplet
{
    // Applet entry point
    public void init()
    {
        setBackground (FxColor.cyan);

        // Add additional components here
    }

    public String getInfo ()
    {
        String s = "Info about AFCSkeleton.class\r\n";
        s += "Version: 1.0\r\n";
        return s;
    }
}

// Stand-alone application only.
class AFCSkeletonFrame extends UIFrame
{
    // Constructor
    public AFCSkeletonFrame(String str)
    {
        super (str);
    }

    public boolean handleEvent (Event e)
    {
        switch (e.id)
        {
        case Event.WINDOW_DESTROY:
            // Frame window closed, exit app
            System.exit (0);
            return true;
        default:
            return super.handleEvent (e);
        }
    }
}


Example1

// AFCExample1.java
//

import java.awt.*;
import com.ms.ui.*;
import com.ms.fx.*;

public class AFCExample1 extends AwtUIApplet
{
    public AFCExample1 ()
    {
        super (new AFCExample1Implementation ());
    }

    // Stand-alone application only: entry point
    public static void main(String args[])
    {
        // Create a frame to contain applet
        AFCExample1Frame f = new AFCExample1Frame ("AFC Example 1");
        f.setVisible (true);
        f.setSize (320, 200);

        // Create instance of applet and add to frame
        AFCExample1Implementation applet = new AFCExample1Implementation ();
        f.add (applet);

        // Stand-alone application must explicitly call init()
        applet.init ();
    }
}

class AFCExample1Implementation extends UIApplet
{
    // Applet entry point
    public void init()
    {
        setBackground (FxColor.lightGray);

        setLayout (new UIBorderLayout ());
        add (new AFCExample1Panel ());
        setValid (true);
    }
}

// Stand-alone application only.
class AFCExample1Frame extends UIFrame
{
    // Constructor
    public AFCExample1Frame(String str)
    {
        super (str);
    }

    public boolean handleEvent (Event e)
    {
        switch (e.id)
        {
        case Event.WINDOW_DESTROY:
            // Frame window closed, exit app
            System.exit (0);
            return true;
        default:
            return super.handleEvent (e);
        }
    }
}

class AFCExample1Panel extends UIPanel
{
    private UIPanel p;
    private UIPushButton b1, b2;
    private UIStatus s;

    // Constructor
    public AFCExample1Panel ()
    {
        setLayout (new UIBorderLayout ());

        // Create panel to contain buttons
        p = new UIPanel ();

        // Create buttons and add to ButtonPanel
        p.add (b1 = new UIPushButton ("Red", UIPushButton.RAISED));
        p.add (b2 = new UIPushButton ("Blue", UIPushButton.RAISED));
        b1.setBackground (FxColor.lightGray);
        b2.setBackground (FxColor.lightGray);

        // Create status bar control
        s = new UIStatus ("This is a UIStatus control.");
        s.setBackground (FxColor.lightGray);

        // Add button panel and status bar to AFCExample1Panel
        add (p, "Center");
        add (s, "South");
    }

    // Action event handler
    public boolean action (Event e, Object o)
    {
        if (o == b1)
        {
            p.setBackground (FxColor.red);
            p.repaint ();
            s.setName ("Background color changed to red.");
        }
        else if (o == b2)
        {
            p.setBackground (FxColor.blue);
            p.repaint ();
            s.setName ("Background color changed to blue.");
        }
        return true;
    }

    public boolean handleEvent (Event e)
    {
        if ((e.id == Event.MOUSE_ENTER) && (e.target instanceof UIPushButton))
        {
            s.setName ("UIPushbutton object: MOUSE_ENTER event.");
            return true;
        }
        else
        {
            return super.handleEvent (e);
        }
    }
}


Overview of AFC User Interface Controls

The com.ms.ui package (UI package) of the Microsoft® Application Foundation Classes (AFC) provides a rich set of user interface controls designed for Java applets and stand-alone Java applications. This article introduces the controls that are available in the UI package. It also covers topics that apply to all UI controls—topics such as creating controls and handling events generated by controls. Subsequent articles in this series provide specific details and examples of how to use each type of control.

AFC UI Controls

The UI package includes classes for the following types of user interface controls:

  • Buttons
  • Menus
  • Choice and list controls
  • Static controls
  • Edit
  • Scroll bars
  • Band and band box controls
  • Status and progress controls
  • Tree controls
  • Tool tip control
  • Viewers (including tab, split, column, scroll, and marquee viewers)
  • Dialog boxes (including message box, property sheet, wizard, find-text, color chooser, and font chooser dialog boxes)

Here's how some of these controls appear on the screen:

This screen includes tab viewer, menu, band box, button, choice, list, edit, tree, and scroll bar controls. If you're familiar with programming graphical user interfaces (GUIs), you're probably familiar with the operation of most of these types of controls. In AFC, the UI controls are designed to be very flexible and easy to use. For example, it's just as easy to construct a menu that contains images as it is to construct a menu that contains text or a menu that contains both text and an image. In fact, the UI package is so flexible that you can create some pretty imaginative controls (like a menu containing a tree control) that may (or may not) be very useful.

There are many classes in the UI package. It might seem confusing which of these classes actually correspond to UI control objects and which classes exist mainly as helper classes used by one or more controls. For some controls, there is a one-to-one correspondence between a class and a control—other controls require you to use more than one class to create them. The following table summarizes the classes in the UI package that correspond to UI control objects.

Control Type | Control Name | Class Name
Button | Push button | UIPushButton
 | Radio button | UIRadioButton
 | Check box | UICheckButton
Choice | Choice | UIChoice, UIEditChoice
 | List | UIList
Menu | Menu | UIMenuButton, UIMenuList, UIMenuItem
Static | Item | UIItem
 | Graphic | UIGraphic
 | Text | UIText
Edit | Edit box | UIEdit
Scroll bar | Scroll bar | UIScrollBar
Band box | Band box | UIBandBox, UIBand
Status | Status | UIStatus
 | Progress | UIProgress
Tree | Tree | UITree
Viewer | Scroll viewer | UIScrollViewer
 | Column viewer | UIColumnViewer
 | Split viewer | UISplitViewer
 | Tab viewer | UITabViewer
 | Marquee | UIMarquee
Tip | Tool tip | UITip
Dialog Box | Message box | UIMessageBox
 | Find-text dialog | UIFindReplaceDialog
 | Color chooser | UIColorDialog
 | Font chooser | UIFontDialog
 | Property sheet | UIPropertyDialog, UIPropertyPage
 | Wizard | UIWizard, UIWizardStep
 | Find text | UIFindReplaceDialog

Note The text, graphic, and item controls can be used to create stand-alone static controls. These controls, however are most often used to represent text and images used by other controls.

In addition to the classes in the preceding list, there is a set of AWT compatibility classes that enable you to use AFC UI controls in AWT containers. The AWT compatibility classes, which have similar names as corresponding AFC classes, use a AwtUI prefix. For example, the AWT compatibility class for the UIPushButton class is AwtUIPushButton.

Note Top-level UI controls such as message boxes, property sheets, and tool tips do not have corresponding AWT compatibility classes because they are not child controls and are not hosted by a container.

Using AFC UI Controls

The paradigm for using AFC UI controls is based on the paradigm for using AWT components. These are the steps required to create an AFC UI control:

  • Create an instance of the control.
  • Use the add method to add the control to a container.

For example, the following line of code creates a new raised-style push button control labeled "Search" and adds the control to its container:

add (new UIPushButton ("Search", UIPushButton.RAISED));

Usually, the code that creates a control appears in the constructor for a panel (UIPanel) or in an object that extends a panel. The add method is a Container method that is inherited by panels.

This example illustrates one implementation of the add method—there are more complex variations of add that enable you to specify additional information when you add components.

Handling Events

AFC UI controls support two event models:

  • The JDK 1.02 event model (action, handleEvent, etc.).
  • The JDK 1.1 event delegation model (addComponentListener, mouseClicked, etc.)

You can use either event model in your AFC UI components, but you shouldn't attempt to mix the two models within a component. All examples in this series of articles use the JDK 1.02 event model.

Using Text and Images in Controls

Creating most AFC controls requires that you supply some text or an image when creating the control. These controls use UIText objects to represent text and UIGraphic objects to represent images. To represent both text and images, the controls use UIItem objects. Controls accept these objects interchangeably, which enables you to create controls that use text, images, or both easily.

Many AFC UI controls have a constructor that takes a String parameter to create a control that contains only text. This is a shortcut, so you don't have to create a separate UIText object just to pass some text to the control.


Using Static, Button, Menu, and Choice Controls

Using AFC User Interface Controls
In this topic

* Static Controls

* Button Controls

* Menu Controls

* Choice and List Controls

AFC | AFC
Using AFC User Interface Controls | AFC

Using Static, Button, Menu, and Choice Controls

This article provides details on how to use the static, button, menu, choice, and list user interface (UI) controls.

Static Controls

Static controls aren't actually controls at all—by definition, they don't accept or respond to user input. But they are an important user interface component and are used as elements of most other user interface controls. For example, the text in a menu control or in a list box is a UIText object, which is a static control. The following diagram shows the class hierarchy of static controls.

There are three basic types of static controls:

  • Static graphic control (UIGraphic), which is used to represent an image.
  • Static text control (UIText), which is used to represent text.
  • Static item control (UIItem), which is used to represent both an image and text.

The following is an illustration of various AFC static controls.

There are a total of eight static controls in this illustration: four static text controls (the label on the left and the three commas), one static graphic control (the folder), and three varieties of static item controls (the print buttons). The following example is the source code for a panel that contains these controls.

class StaticPanel extends UIPanel
{
  // Constructor
  public StaticPanel()
  {
    Toolkit toolkit = getToolkit();
    Image hotprint = toolkit.getImage("HotPrint.gif");
    Image hotfavorites = toolkit.getImage("HotFavorites.gif");

    add(new UIText("Examples of static controls:"));
    add(new UIGraphic(hotfavorites));
    add(new UIText(","));
    add(new UIItem(hotprint, "Print"));
    add(new UIText(","));
    add(new UIItem(hotprint, "Print", 0, UIItem.ABOVE));
    add(new UIText(","));
    add(new UIItem(hotprint, "Print", 0, UIItem.ONLEFT));
  }
}

Button Controls

AFC offers four basic types of buttons:

  • Push buttons (UIPushButton)
  • Radio buttons (UIRadioButton)
  • Check boxes (UICheckButton)
  • Repeat buttons (UIRepeatButton)

Radio buttons are extensions of check boxes—the main difference between them is their appearance. Repeat buttons appear and operate like push buttons. However, instead of firing a single action event when pressed, repeat buttons continue to fire action events until released. The following diagram shows the class hierarchy of button controls.

The following illustration shows the appearance of three types of AFC buttons. The buttons shown here are all text-only buttons—AFC also supports buttons displaying images and buttons displaying text and images.

Here's the code for a class that is a panel that contains the buttons shown in the previous illustration.

class ButtonsPanel extends UIPanel
{
  private UIPushButton pushbutton;
  private UIRadioButton radiobutton;
  private UICheckButton checkbutton;

  // Constructor
  public ButtonsPanel()
  {
    // Create buttons and add to ButtonPanel
    add(pushbutton = new UIPushButton("Push Button",
                                      UIPushButton.RAISED));
    add(radiobutton = new UIRadioButton("Radio Button"));
    add(checkbutton = new UICheckButton("Check Box"));
  }
}

Note that the push button is created with the UIPushButton.RAISED style. If you don't specify the raised style, the push button appears only as text and won't look like a button until it's under the mouse cursor. The following table summarizes the styles that you can use when you create buttons:

Style | Description
Raised (UIPushButton.RAISED) | Button appearance is raised. This style applies only to push buttons.
Toggle (UIButton.TOGGLE) | Button alternates between two states (on and off).
Three-state (UIButton.TRITOGGLE) | Button alternates between three states (on, off, and indeterminate).

To create a button with an image instead of text, supply a UIGraphic object to the button's constructor. To create a button with both text and an image, supply the constructor a UIItem object.

Menu Controls

Like other AFC controls, the AFC menu controls are discrete, stand-alone controls that can be used anywhere in Java programs. There are three basic classes used to create menus:

  • UIMenuItem, which represents a single menu item. A menu item can be text, an image, or another control, such as a check box.
  • UIMenuList, which represents a list of menu items. You can use the UIMenuList.add method to add menu items to a menu list.
  • UIMenuButton, which represents the button that is used to activate the menu. Like the push button control, a menu button can be either the raised or flat style. The default menu button style is raised.

The following diagram shows the class hierarchy of menu controls.

The following illustration shows the appearance of a menu control before and after activation.

The menu includes a check box menu item, a disabled menu item, menu separators, and a cascading menu list. Here's the code for a class that is a panel that contains the menu shown in the previous illustration.

class MenusPanel extends UIPanel
{
  // Constructor
  public MenusPanel()
  {
    // Create a menu list and add some menu items
    UIMenuList mainmenulist = new UIMenuList();
    mainmenulist.add("Menu Item 1");
    mainmenulist.add("Menu Item 2");
    mainmenulist.add(new UILine());
    mainmenulist.add(new UICheckButton("Check Box Menu Item"));
    mainmenulist.add(new UILine());
    UIText disableditem = new UIText("Disabled Menu Item");
    disableditem.setEnabled(false);
    mainmenulist.add(disableditem);
    mainmenulist.add(new UILine());

    // Create a sub menu list and add to main menu
    UIMenuList submenulist = new UIMenuList();
    submenulist.add("Sub Menu Item 1");
    submenulist.add("Sub Menu Item 2");
    mainmenulist.add(new UIMenuItem("Sub Menu Item",
                                    submenulist));

    // Create a menu button for main menu and add to panel
    UIMenuButton menubutton = new UIMenuButton("Menu Button",
                                               mainmenulist);
    add (menubutton);
  }
}

To create a menu separator, add a UILine object to a menu list. To create cascading menus, create a secondary menu list and add it as a menu item to the primary menu list. You can also create menu items with images by using static graphic (UIGraphic) and static item (UIItem) objects as menu items.

Menu Controls Event Handling

Menu controls fire events on the items they contain, not on the actual menu control object. Consider the following code fragment.

UIMenuList menulist = new UIMenuList();
UIText item = new UIText("Apples");
menulist.add(item);

When the user selects the "Apples" menu item, the menu control fires an action event on the UIText object specified by the item parameter.

You can also add textual menu items to menu lists by specifying a string as shown in the following example.

UIMenuList menulist = new UIMenuList();
UIText text = (UIText) menulist.add("Oranges");

In this case, the UIMenuList.add method creates a UIText object from the specified string. When the user selects the "Oranges" menu item, the menu control fires an action event on the UIText object specified by the text parameter.

Choice and List Controls

Choice and list controls enable users to choose one or more items from a list of available choices. Choice controls (UIChoice) are similar to drop-down list boxes in Win32—they display only the currently selected item until they are activated and present a list of available choices. List controls (UIList) display available choices along with the currently selected item. You can also create list controls using the UIList.MULTISELECT selection mode to enable users to select multiple items from the list. The following diagram shows the class hierarchy of choice and list controls.

The following illustration shows the appearance of two choice controls and a list control. The first choice control is shown before activation and the second one is shown after activation.

Here's the code for a class that is a panel that contains a choice control and a list control.

class ChoicePanel extends UIPanel
{
    // Constructor
    public ChoicePanel()
    {
        UIChoice choice = new UIChoice();
        choice.addString("Choice A");
        choice.addString("Choice B");
        choice.addString("Choice C");
        add (choice);

        UIList list = new UIList();
        list.add("List Item A");
        list.add("List Item B");
        list.add("List Item C");
        add(list);
    }
}

Note To create a scroll bar with a list control, you must add the list control to a scroll viewer control (UIScrollViewer).

Choice and List Control Event Handling

Like menu controls, choice and list controls don't fire events directly on the choice or list control objects—they fire events on the objects contained by the controls. Choice controls fire an action event when a user chooses one of the items available in the drop-down list. List controls don't fire events unless a selection is made with a double-click mouse action.


Introduction

The Microsoft com.ms.fx (Fx) package for Java provides graphics and effects classes and interfaces. The Fx package provides a base framework for many other Microsoft packages, and it is a key element in making the Microsoft® Application Foundation Classes™ (AFC) both Java Development Kit (JDK) 1.0.2 and 1.1 compatible. The com.ms.fx package provides the following support:

  • Extensible, cross-platform graphics for the AFC libraries.
  • Support for formatted text in any language and for characters not defined in Unicode.
  • Text rotation and vertical writing support for internationalization (i18n).
  • Support for windowless components and controls.
  • User-configurable texture and Image class factories.
  • A drawing primitives API based on java.awt.Graphics.

This article provides an overview of the basic features of the com.ms.fx package. In addition, it covers programming with the extensible drawing classes, provides an in depth look at the texture and image class factories, and describes integration of various aspects of the Fx package with controls and features from other Microsoft packages.

Package Overview

The Microsoft com.ms.fx package contains classes that fall into several broad categories.

The core classes of the Fx package handle most of the common graphics operations.
FxGraphics | The FxGraphics class is derived from the java.awt.Graphics class and provides an extended graphics object implementation and abstract methods for full cross-platform compatibility.
FxFormattedText | The FxFormattedText class supports formatted text buffers written in any language and drawn in any direction.
Region | The Region class provides a data structure for shape manipulation, and also helps support the windowless architecture in AFC.
FxFont | The FxFont class manages user-defined font objects and is the base for extended font objects in the Fx package.
FxColor | The FxColor class provides both JDK 1.0.2 and JDK 1.1 compatible color objects for AFC, as well as a base for extended color objects in the Fx package.

Classes that extend from FxColor are used with the drawing primitives API provided in the FxGraphics class to increase the flexibility of drawing operations. These extended color classes include the following:

FxFill | FxTexture | FxPen
FxBrushPen | FxRubberPen | FxStyledPen

The com.ms.fx package includes classes that provide a set of consistent, cross-platform system images and icons. These classes include texture and image factory classes that can provide texture and image sets for components in various states. These image and texture classes include the following:

FxStateConfigurableImage | FxStateConfigurableUIImage | FxComponentImage
FxComponentTexture | FxSystemIcon

The text buffer and font classes handle text buffers and drawing, and they rely on a number of supporting low-level Fx classes, which are rarely manipulated directly.

fullTxtRun | txtRun | FxCurve | FxEllipse
OutlinePolygon | OutlineCurve | GlyphOutline | GlyphMetrics
FloatPoint

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

Technical Overview

Extended Color and Font Objects
FxSystemFont, FxSystemIcon, and Texture and Image Class Factories
Internationalization Support
JDK 1.0.2 and 1.1 Support

Extended Color and Font Objects

If you have not done any graphics programming in Java, you will find that it is basic and intuitive using AFC. If you are familiar with graphics programming using the java.awt package, especially the java.awt.Graphics class, the transition to programming with Fx extended color and font objects will be a smooth one.

Graphics operations in Java are performed with a graphics object. Using java.awt, you can obtain this graphics context with the call

Graphics g = this.getGraphics();

and set the graphics context to a specified color, font, paintmode, and so on. The com.ms.fx package provides extended graphics objects, derived from java.awt.Graphics, to overcome limitations imposed by the Graphics class. FxGraphics objects can be used just like a Graphics object, inheriting its drawing API from java.awt.Graphics. The com.ms.ui package supports both paint(Graphics g) and paint(FxGraphics) methods.

Part of the power of the com.ms.fx package is the ability to use extended color and font objects in place of Color or Font within a graphics context. The extended color and font classes included with the com.ms.fx package have special attributes.

For example, the FxPen class provides a drawing object that is multiple pixels wide. This seems relatively simple, but in comparison, the java.awt package provides no way to draw primitives that are multiple pixels wide -- short of coding repetitous drawing operations. The following example draws many ovals, 1 pixel wide, using standard AWT programming. The result is a thick oval, drawn in the current color.

// Override the paint method in an applet
// to draw a thick oval.
public void init{
  setBackground(Color.black);
}

public void paint(Graphics g) {
  for(int x = 2;x<10;x++)
  {
    g.drawOval(x, x, 60-(2*x), 40-(2*x));
  }
}

The same oval can be drawn easily with an FxPen object. You retrieve an extended graphics object by using the static method call, FxGraphics.getExtendedGraphics.

// Override the paint method in an applet to draw a thick oval.
public void init{
    setBackground(new FxPen(8, Color.black));
}

public void paint(FxGraphics g) {
    fxGraf.drawOval( 2, 2, 60, 40);
}

The FxFont and FxColor objects and their derivatives are set to an extended graphics object the same way the java.awt.Font and java.awt.Color objects are. The method calls are the same (setColor, setFont) regardless of the object selected into the graphics context. In this way, the com.ms.fx package is fully compatible with AWT.

The com.ms.fx package is more flexible and powerful, however, because extended color objects are used to construct other extended color objects. The following example shows how you can use multiple extended color objects with an extended graphics object to draw some simple effects.

 // Draw the same oval as before, but this time, use an imported
 // GIF image as a color. First, create an extended graphics object.
fxGraf = FxGraphics.getExtendedGraphics(Graphics gOrig);

// Create an FxTexture object that uses
// a RedImage.gif as a base.
FxTexture fxTex1 = new FxTexture(myRedImage, FxTexture.STRETCH_NONE,
                                 0, 0, -1, -1, false, 255, 0, 0);

// Create an FxPen 8 pixels wide, that uses
// the FxTexture as a drawing color.
FxPen widePen = new FxPen(8, fxTex1);

// Set the drawing color used in the graphics context.
// The FxPen is selected into the context the same way
// a Color is selected.
fxGraf.setColor(widePen);

// Now draw the same oval as before with a pen 8 pixels wide.
// The pen uses a .gif image to draw, or if the image fails to draw,
// the color (255, 0, 0) is used by default.
fxGraf.drawOval(2, 2, 60, 40);

The extended graphics object and extended objects selected as its color and font use callback methods to draw the effects. This enables you to use the same familiar API to draw more powerful graphics.

Callback Methods

In the previous example, both FxPen and FxTexture objects are used instead of a Color object, but the method call

g.drawOval(x, y, width, height);

remains the same. The callback methods are called from the graphics object when it performs a drawing operation, and its selected Color object is an instance of a class derived from FxFill or FxFont. In this case, the FxGraphics object called upon the FxPen.drawOvalCallback method to draw the oval.

All of the callback methods (fillArcCallback, drawLineCallback, and so on) included in the Microsoft com.ms.fx package for Java are used only by the graphics object, not the application. The documentation for these callback methods is included for Java developers who want to extend these objects.

FxSystemFont, FxSystemIcon, and Texture and Image Class Factories

The com.ms.fx package includes a number of classes that provide consistent, cross-platform system images, icons, and access to system fonts.

The FxSystemFont class handles fonts that are reserved for graphical user-interface components such as dialog boxes and menus. These fonts are system-specific, and on platforms other than Microsoft® Win32™, the font retrieved will be a predefined, standard font. The class provides methods to retrieve specific reserved fonts, such as getMessageBoxFont and getSmallCaptionFont. FxSystemFont also provides methods, such as getAttributeList and getStyleVal, to determine attributes associated with a particular system font on a given platform.

The FxSystemIcon class provides a set of standard .gif images that are used in cross-platform dialog boxes. Four images are provided with the com.ms.fx package.

The texture and image class factories, including the FxComponentTexture and FxStateConfigurableUIImage classes, provide sets of component images and textures for AFC controls. These classes are state dependent; the sets of images are provided for corresponding component states.

For example, the FxComponentImage class provides a set of state-dependent images for each of the included component images (the arrow images on scroll bars, check box images, and so on). Not all states are valid for different components, so the class only provides images for states that are valid for the selected component.

The FxStateConfigurableImage class enables developers to create their own state-dependent image factories.

Internationalization Support

The com.ms.fx package provides support for formatted text in any language, characters not defined in the Unicode standard, text rotation, vertical writing, Input Method Editors (IMEs), and other internationalization (i18n) features.

The FxFormattedText class, a formatted text buffer class, is one of the core Fx classes. It provides methods that enable the user to specify text direction, locale, text alignment, word wrap, mnemonic characters, kerning, password characters, as well as normal buffer operations that are inherited from the FxText class. An FxFormattedText object is created from either a String or character array of Unicode characters.

Text rotation and vertical writing are both supported through the FxFormattedText and FxGraphics classes. In particular, text rotation is supported with the FxGraphics.drawString(String str, int x, int y, int a) method. Vertical writing is supported by the setTextDirection and setLocale methods.

The FxCaret class provides a cross-platform caret, similar to the flashing caret in the Microsoft Windows® Notepad application. FxCaret is also used in the com.ms.util.InputMethod package to support Java Input Method Editor composition windows. The Java application uses InputMethodListener.setVisibleComponent to specify where the IME is shown, and the Java application can use InputMethodListener.setPos to set the position of the composition window. The IME is attached to an FxCaret object, and every time the FxCaret is shown or moved, the FxCaret object calls setPos to set the position of the IME composition window.

JDK 1.0.2 and 1.1 Support

The Microsoft Application Foundation Classes are designed not only to be a cross-platform solution, but to be both JDK 1.1 and JDK 1.0.2 compatible. The com.ms.fx package provides graphics support for both 1.1 and 1.0.2 VMs.

One limitation of the JDK 1.0.2 is that the java.awt.Color class is declared final (in JDK 1.1 it is not). Many of the classes in the com.ms.fx package extend the java.awt.Color class in JDK 1.1, but can't extend Color in 1.0.2. In order to provide the functionality of the com.ms.fx package and the AFC for 1.0.2 VMs, the com.ms.fx extended color classes are derived from the com.ms.fx.BaseColor class. The BaseColor class is a public class, but it is never used directly in applets or applications. The following diagram shows the extended color class hierarchy using both JDK 1.0.2 and 1.1 color models:

The BaseColor class is derived directly from Object in 1.0.2 because java.awt.Color is declared final. It provides the same basic functionality, so there are really no effective differences using an FxColor in 1.0.2.

For graphics-related code to compile and run under both JDK 1.0.2 and JDK 1.1 Virtual Machines, you need to design your code with the following limitations in mind.

Extended Color Limitations Using 1.0.2 The com.ms.ui package does not support the setBackground(FxColor) operation when running on JDK 1.0.2-based VMs. You can work around this limitation by overriding the update() method and selecting the color into the graphics object before clearing the background and calling paint().
You can't set textures as the background colors of components under 1.0.2 VMs. You can implement this by overriding the update method in extended color classes, as the following example shows.
public class MyCanvas
{
  FxColor myTexture;

  public void update(FxGraphics g)
  {
    g.setColor(myTexture);
    g.fillRect(0, 0, getSize().width, getSize().height);
    paint(g);
  }
}
Compiling Extended Colors for JDK 1.0.2 VMs The extended color classes are easy to use and select into a graphics context when writing JDK 1.1 compliant code with the AFC libraries. But because the java.awt.Color+ class is final in 1.0.2, some graphics-related AFC code will not compile in 1.0.2.

For example, if you were writing an application that uses an FxPen to draw wide lines, you might create the FxPen object and select it into a graphics context as shown in the following example.

FxPen pen1 = new FxPen(5, 255, 0, 124);

// Set the color of the graphics object.
fxg.setColor(pen1);

This does not compile under 1.0.2 because FxColor (and therefore FxPen) is derived from Object, not from Color. Any time you want to use extended color objects under JDK 1.0.2, you must select them into a graphics context using the the FxColor.getColor method.

FxPen pen2 = new FxPen(5, 124, 255, 0);
FxTexture mytex = new FxTexture(someImage,
                                FxTexture.STRETCH_NONE,
                                0, 0, -1, -1, false, 0,
                                10, 70);

fxg.setColor(FxColor.getColor(pen2));
panel.setForeground(mytex.getColor());

Integration

Integration with the com.ms.ui Package

The classes in the com.ms.fx are used extensively throughout the com.ms.ui (UI) package. The following list briefly discusses how some of the Fx classes are used throughout UI.
FxColor | The FxColor class is used in UI classes such as UIColorDialog, UIComponent and UIScroll to set text background colors and shading and to retrieve colors that are lighter or darker than the original colors for edges and effects.
FxSystemFont | The FxSystemFont class is used in many UI classes to retrieve message box and menu fonts, with the getMessageBoxFont and getMenuFont methods.
FxSystemIcon | The FxSystemIcon class is used in the UIMessageBox class to provide system images for message boxes.
FxToolkit | The FxToolkit class is used extensively throughout both the com.ms.fx and com.ms.ui packages. It provides platform-independent methods for retrieving low-level information. For example, controls can use reserved colors and platform-specific metrics using the getSystemColor and getSystemMetric methods. The system interface returns a platform-independent graphics object that takes care of differences in the various platforms. The Dialog.setModal() method (which is not available within JDK 1.0.2) is set using the FxToolkit.getSystemInterface().setDialog() method. The FxToolkit class is used in the UIDrawText, UIEdit, UIPropertyPage, and UIMenuItem classes.
FxComponentImage | The FxComponentImage class is used in UI classes such as UIChoice, UIExpandButton, and UIRadioButton to provide a set of images for the component's possible states.
FxFormattedText | The FxFormattedText class is used in UIDrawText to perform operations on formatted text buffers.


About com.ms.fx

In this topic

* Package Overview

* Callback Methods in this Documentation

* Classes

* Interfaces

* Hierarchy

Packages | Next
Package com.ms.fx | Next

About com.ms.fx

The Microsoft com.ms.fx graphics package provides graphics and effects classes and interfaces. These classes include support for formatted text in any language, characters found outside Unicode, and extensible objects, which are objects derived from java.awt.Color and java.awt.Font that make drawing and text operations more flexible.

Package Overview

The Microsoft com.ms.fx package for Java is more powerful and flexible than standard graphics packages because it provides the user with the following features:

Extensible drawing and font objects
A drawing API that's familiar
Support for text layout and formatting in any language
Support for windowless controls
Support for consistent, cross-platform system fonts and images

The Microsoft com.ms.fx package allows you to select color and font objects into a graphics context as you normally would. In this way it is fully java.awt compatible, but the package is not limited to only system-defined standards. You can select an extensible drawing or font object (for example, an object derived from the FxFont or FxFill classes) into a graphics context the same way you select a Color or Font, and the application calls on the graphics object to perform its standard operations seamlessly.

The com.ms.fx package provides a drawing API that's based on and extends the java.awt.Graphics API. The FxGraphics class includes drawing primitives like drawLine, draw3DRect, and drawString.

The FxFormattedText class supports formatted text buffers written in any language and drawn in any text direction. The ability to format text in any language, coupled with Java language Unicode support and the development of Input Method Editors (IMEs), makes Java the choice for multilingual communication.

The Region class provides support for windowless controls throughout the Application Foundation Classes.

The FxSystemFont, FxSystemIcon, and FxToolkit classes make cross-platform development of standard dialog boxes and other controls easier. The com.ms.fx package comes with four standard .gif file system images that are used throughout the Application Foundation Classes for message box and dialog box controls.

Callback Methods in this Documentation

The Java application need only work with the standard java.awt or com.ms.fx methods when using a com.ms.fx object. The application uses FxColor and FxPen objects as it does Colors, or FxFont objects as it does Font objects. The callback methods are called from the graphics object when it performs a drawing operation, and its selected Color object is an instance of a class derived from FxFill or FxFont.

All the callback methods (fillArcCallback, drawLineCallback and so on) included in the Microsoft com.ms.fx package for Java are used only by the graphics object, not the application. The documentation of these callback methods is included for Java developers who want to extend these objects.

The dx[] and dy[] array parameters in the callback methods are always arrays of inter-character spacing values on the x and y axes (inter-character spacing is measured in pixels).
You will find these callback methods in the following classes:
FxFont | FxOutlineFont
FxFill | FxTexture
FxPen | FxBrushPen | FxRubberPen | FxStyledPen

Classes

Class FloatPoint
This class defines a point on the screen and is used by FxOutlineFont for glyph outlines.
Class fullTxtRun
This class manages extended text runs, used when a more complete set of values are needed to define the text.
Class FxBrushPen
This class provides separate pen and brush components for drawing and filling operations.
Class FxCaret
This is a cross-platform class that manages a caret object.
Class FxColor
This class handles extended, user-definable color objects.
Class FxComponentImage
This class is a class factory that provides a set of consistent, cross-platform images that are used by the com.ms.ui classes for Graphical User Interface(GUI) display components.
Class FxComponentTexture
This class is a class factory that provides a set of consistent, cross-platform FxTexture objects that are used by the com.ms.ui classes for Graphical User Interface(GUI) display components.
Class FxCurve
This class serves as a base for basic curve objects.
Class FxEllipse
This class creates and manages ellipse objects.
Class FxFill
This class defines and manages extended fill objects.
Class FxFont
This class produces user-defined font objects.
Class FxFontMetrics
This class manages extended font metrics objects.
Class FxFormattedText
This class provides text layout and formatting for text in any language.
Class FxGraphicMetaFile
This class plays Microsoft® Windows® metafiles.
Class FxGraphics
This class encapsulates an extended graphics object.
Class FxMapFont
This class ensures that a string can be drawn with a given font.
Class FxMapFontMappingSection
This class represents a subsection of an FxMapFont text buffer.
Class FxOutlineFont
This class produces user-defined outline font objects.
Class FxPen
This class supplies a general drawing pen object whose color and line width can be specified.
Class FxRubberPen
This class provides a rubber pen (typically, a pen that draws a shape or line after a drag-and-release mouse event and erases its previous drawing operation when performing a new one).
Class FxStateConfigurableImage
This class is a class factory, providing a set of Image objects that are associated with system states.
Class FxStateConfigurableUIImage
This class is a class factory that provides a set of images for different user interface component states.
Class FxStyledPen
This class provides a drawing pen object with specifiable style.
Class FxSystemFont
This class handles system fonts (system-specific fonts that are used in graphical user interface components such as dialog boxes and menus).
Class FxSystemIcon
This class provides static image types used in the Application Foundation Classes.
Class FxText
This class performs basic insertion and deletion operations on a text buffer.
Class FxTexture
This class uses images, including .gif and .jpeg file formats, to fill shapes and draw graphics effects.
Class FxToolkit
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.
Class GlyphMetrics
This class defines the outline metrics of a character.
Class GlyphOutline
This class holds the outline information of a character.
Class OutlineCurve
This class, which defines the curves of an outline, is used by the OutlinePolygon class to define curves of character outlines.
Class OutlinePolygon
This class, which defines a polygon outline, is used by the GlyphOutline class to supply an array of outlines that comprise a character.
Class Region
This class is a data structure that represents arbitary shapes, and is used to support windowless controls in the Application Foundation Classes.
Class txtRun
This class manages text runs generated by the FxFormattedText class.

Interfaces

Interface IFxGraphicsConstants
This interface defines the constants used by the FxGraphics class.
Interface IFxShape
This interface defines methods for objects that represent a geometric shape.
Interface IFxSystemInterface
This interface defines methods used to determine system graphics and font properties.
Interface IFxTextCallback
The callback interface of FxFormattedText updates the owner object and enables it to modify text runs.
Interface IFxTextConstants
This interface contains constants used in the text processing classes.
Interface IFxTextureUpdate
This interface defines a callback method that is used when a texture is complete.
Interface PeerConstants
This interface defines basic color and text out constants used throughout the com.ms.fx package.

Hierarchy

Object
  |
  +--FloatPoint
  |
  +--txtRun
  |  |
  |  +--fullTxtRun
  |
  +--FxCaret (TimerListener)
  |
  +--FxCurve (IFxShape)
  |  |
  |  +--FxEllipse (IFxShape)
  |
  +--FxText
  |  |
  |  +--FxFormattedText (IFxTextConstants, IFxGraphicsConstants, IFxLocaleFormatting)
  |
  +--FxGraphicMetaFile
  |
  +--FxMapFont
  |
  +--FxMapFontMappingSection
  |
  +--FxStateConfigurableImage
  |  |
  |  +--FxStateConfigurableUIImage
  |     |
  |     +--FxComponentImage
  |     |
  |     +--FxComponentTexture
  |
  +--FxSystemIcon
  |
  +--FxToolkit
  |
  +--GlyphMetrics
  |
  +--GlyphOutline
  |
  +--OutlineCurve
  |
  +--OutlinePolygon
  |
  +--Region (Cloneable)

BaseColor
  |
  +--FxColor
     |
     +--FxFill
        |
        +--FxBrushPen
        |
        +--FxPen
        |  |
        |  +--FxRubberPen
        |  |
        |  +--FxStyledPen
        |
        +--FxTexture (ImageObserver)

Font
  |
  +--FxFont
     |
     +--FxOutlineFont
     |
     +--FxSystemFont

FontMetrics
  |
  +--FxFontMetrics

Graphics
  |
  +--FxGraphics (IFxGraphicsConstants, IFxTextConstants, PeerConstants)

IFxGraphicsConstants
IFxShape
IFxSystemInterface
IFxTextCallback
IFxTextConstants
IFxTextureUpdate
PeerConstants


Class FloatPoint

public class FloatPoint
{
  // Fields
  public float x;
  public float y;

  // Constructors
  public FloatPoint(float x, float y);
}

This class defines a point on the screen and is used by FxOutlineFont for glyph outlines.

Constructors

FloatPoint

public FloatPoint(float x, float y);

Creates a floating point with specified x and y coordinates.

Parameter | Description
x | The x coordinate of an (x,y) pair that comprises a point on the screen.
y | The y coordinate of an (x,y) pair that comprises a point on the screen.

Fields

x
An x coordinate.
y
A y coordinate.


Class fullTxtRun

public class fullTxtRun extends txtRun
{
  // Fields
  public int dx[];
  public int dy[];
  public int height;
  public int width;
  public int x;
  public int y;

  // Constructors
  public fullTxtRun();
  public fullTxtRun(txtRun r);
}

This class manages extended text runs, used when a more complete set of values are needed to define the text. Text runs are generated by an FxFormattedText object.

Note Formatted text holds runs of text that are built up every time the ensureNotDirty method of the FxFormattedText class is called (the first run in a block is always an extended one). This formatting determines how the text is placed on the screen. An applet or application can override these values by implementing the IFxTextCallback interface and manipulating the runs when the methods are called.

txtRun
  |
  +--fullTxtRun

Constructors

fullTxtRun

public fullTxtRun();

Creates an extended text run with an EXTENDED_RUN flag. The x, y, and width fields must be defined when a fullTxtRun object is created, but the dx[], dy[] and height fields are optional. Generally, height is used only with vertical writing.

fullTxtRun

public fullTxtRun(txtRun r);

Creates an extended text run by using the contents of a txtRun object, while setting an EXTENDED_RUN flag. The x, y, and width fields must be defined when a fullTxtRun object is created, but the dx[], dy[] and height fields are optional. Generally, height is used only with vertical writing.

Parameter | Description
r | The txtRun object to use for content.

Fields

dx[]
The horizontal advance values of the characters (can be null).
dy[]
The vertical advance values of the characters (can be null).
height
The height of the text in this run. Generally, the height field is used in vertical writing.
width
The width of the text in this run.
x
The x coordinate of the starting position of the text run.
y
The y coordinate of the starting position of the text run.


Class FxBrushPen

public class FxBrushPen extends FxFill
{
  // Constructors
  public FxBrushPen( FxColor edge, FxColor fill);
  public FxBrushPen(Color edge, Color fill);

  // Methods
  public boolean draw3DRectCallback(FxGraphics g, int x, int y, int
        width, int height, boolean raised);
  public boolean drawArcCallback(FxGraphics g, int x, int y,
        int width, int height, int startAngle, int arcAngle);
  public boolean drawBytesCallback(FxGraphics g, byte data[],
        int offset, int length, int x, int y, Rectangle r,
        int options, int dx[], int dy[]);
  public boolean drawCharsCallback(FxGraphics g, char data[],
        int offset, int length, int x, int y, Rectangle r,
        int options, int dx[], int dy[]);
  public boolean drawLineCallback(FxGraphics g, int x1, int y1, int
        x2, int y2);
  public boolean drawOvalCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean drawRectCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean drawRoundRectCallback(FxGraphics g, int x, int y,
        int width, int height, int arcWidth, int arcHeight);
  public boolean drawScanLinesCallback(FxGraphics g,
        boolean xChanging, int points[], int offset, int nPoints);
  public boolean drawStringCallback(FxGraphics g, String str,
        int x, int y, Rectangle r, int options, int dx[],
        int dy[]);
  public boolean fill3DRectCallback(FxGraphics g, int x, int y, int
        width, int height, boolean raised);
  public boolean fillArcCallback(FxGraphics g, int x, int y,
        int width, int height, int startAngle, int arcAngle);
  public boolean fillOvalCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean fillPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean fillRectCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean fillRoundRectCallback(FxGraphics g, int x, int y,
        int width, int height, int arcWidth, int arcHeight);
}

This class provides separate pen and brush components for drawing and filling operations.

The main constructor takes two colors. The first color, edge, is used by the pen component for all drawing operations and the second color, fill, is used by the brush component for all fill operations.

Note The callback methods used in this and other classes that are derived from FxColor are used internally only. A graphics object that has an FxBrushPen object selected into it may perform similar internal operations as one that uses an FxPen, with the added flexibility of being able to switch between colors for drawing and fill operations. For more information on the use of callback methods in the com.ms.fx package, see the overview information at the beginning of this package.

BaseColor
  |
  +--FxColor
    |
    +--FxFill
      |
      +--FxBrushPen

Constructors

FxBrushPen

public FxBrushPen( FxColor edge, FxColor fill);

Creates an FxBrushPen object with specified edge and fill colors. This constructor is included for JDK 1.0.2 compatibility and is used if the edge and fill parameters are objects that extend from FxColor.

Parameter | Description
edge | The color of the edge or outline (the pen).
fill | The color of the fill (the brush).

FxBrushPen

public FxBrushPen(Color edge, Color fill);

Creates an FxBrushPen object with specified edge and fill colors. This constructor is called if the edge and fill parameters are objects that extend from java.awt.Color.

Parameter | Description
edge | The color of the edge or outline (the pen).
fill | The color of the fill (the brush).

Methods

draw3DRectCallback

public boolean draw3DRectCallback(FxGraphics g, int x, int y, int width,
        int height, boolean raised);

Draws a three-dimensional rectangle in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if draw3DRect is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false

Parameter | Description
g | The graphics object used.
x | The x coordinate of the location where the rectangle is drawn.
y | The y coordinate of the location where the rectangle is drawn.
width | The width of the rectangle.
height | The height of the rectangle.
raised | Determines whether the edge of the three-dimensional rectangle has a raised or sunken edge.

Overrides:

draw3DRectCallback(FxGraphics,int,int,int,int,boolean) in FxFill.

drawArcCallback

public boolean drawArcCallback(FxGraphics g, int x, int y, int width,
        int height, int startAngle, int arcAngle);

Draws an arc centered on the given (x, y) coordinates in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawArc is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The x coordinate of the arc's origin.
y | The y coordinate of the arc's origin.
width | The width of the arc.
height | The height of the arc.
startAngle | The starting angle of the arc.
arcAngle | The angle of the arc.

Overrides:

drawArcCallback(FxGraphics,int,int,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawArc, com.ms.fx.FxFill.drawArcCallback

drawBytesCallback

public boolean drawBytesCallback(FxGraphics g, byte data[], int offset, int
        length, int x, int y, Rectangle r, int options, int dx[], int dy[]);

Draws an array of bytes in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawBytes is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object used.
data | The array of bytes.
offset | The offset used.
length | The length of the array used.
x | The x coordinate of the location where the bytes should be drawn.
y | The y coordinate of the location where the bytes should be drawn.
r | The optional rectangle used for clipping and opaquing.
options | The options for this method.
dx | An array of dx values.
dy | An array of dy values.

Overrides:

drawBytesCallback(FxGraphics,byte[],int,int,int,int,Rectangle,int,int[],int[]) in FxFill.

See Also: com.ms.fx.FxGraphics.drawBytes, com.ms.fx.FxFill.drawBytesCallback

drawCharsCallback

public boolean drawCharsCallback(FxGraphics g, char data[], int offset, int
        length, int x, int y, Rectangle r, int options, int dx[], int dy[]);

Draws an array of characters in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawChars is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object used.
data | The array of characters that are drawn.
offset | The offset used.
length | The length of the array used.
x | The x coordinate of the location where the characters are drawn.
y | The y coordinate of the location where the characters are drawn.
r | The optional rectangle used for clipping and opaquing.
options | The options of this method
dx | An array of dx values.
dy | An array of dy values.

Overrides:

drawCharsCallback(FxGraphics,char[],int,int,int,int,Rectangle,int,int[],int[]) in FxFill.

See Also: com.ms.fx.FxGraphics.drawChars, com.ms.fx.FxFill.drawCharsCallback

drawLineCallback

public boolean drawLineCallback(FxGraphics g, int x1, int y1, int x2,
        int y2);

Draws a line in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawLine is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false

Parameter | Description
g | The graphics object.
x1 | The x coordinate of the starting point of the line.
y1 | The y coordinate of the starting point of the line.
x2 | The x coordinate of the ending point of the line.
y2 | The y coordinate of the ending point of the line.

Overrides:

drawLineCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawLine, com.ms.fx.FxFill.drawLineCallback

drawOvalCallback

public boolean drawOvalCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws an oval in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawOval is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The upper-left x coordinate of the oval's bounding rectangle.
y | The upper-left y coordinate of the oval's bounding rectangle.
width | The width of the oval (in pixels).
height | The height of the oval (in pixels).

Overrides:

drawOvalCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawOval, com.ms.fx.FxFill.drawOvalCallback

drawPolygonCallback

public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws a polygon in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawPolygon is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
xPoints | An array that contains the polygon's x coordinates.
yPoints | An array that contains the polygon's y coordinates.
nPoints | The number of points in the polygon.

Overrides:

drawPolygonCallback(FxGraphics,int[],int[],int) in FxFill.

See Also: java.awt.Graphics.drawPolygon, com.ms.fx.FxFill.drawPolygonCallback

drawRectCallback

public boolean drawRectCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws a rectangle in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRect is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The x coordinate of the rectangle's starting point.
y | The y coordinate of the rectangle's starting point.
width | The width of the rectangle, in pixels.
height | The height of the rectangle, in pixels.

Overrides:

drawRectCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawRect, com.ms.fx.FxFill.drawRectCallback

drawRoundRectCallback

public boolean drawRoundRectCallback(FxGraphics g, int x, int y, int width,
        int height, int arcWidth, int arcHeight);

Draws an rectangle with rounded edges in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRoundRect is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The x coordinate of the rectangle's starting point.
y | The y coordinate of the rectangle's starting point.
width | The width of the rectangle, in pixels.
height | The height of the rectangle, in pixels.
arcWidth | The arc width of the rectangle's rounded edges.
arcHeight | The arc height of the rectangle's rounded edges.

Overrides:

drawRoundRectCallback(FxGraphics,int,int,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawRoundRect, com.ms.fx.FxFill.drawRoundRectCallback

drawScanLinesCallback

public boolean drawScanLinesCallback(FxGraphics g, boolean xChanging,
        int points[], int offset, int nPoints);

Draws scan lines in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawScanLines is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
xChanging | The direction (horizontal or vertical) that the lines are drawn.
points | An array of points. If xChanging is true, the points are organized as [x1, x2, y, x1, x2, y, ...] in the array. However, if xChanging is false, the points are organized as [x, y1, y2, x, y1, y2, ...].
offset | The offset used.
nPoints | The number of points in the array.

Overrides:

drawScanLinesCallback(FxGraphics,boolean,int[],int,int) in FxFill.

See Also: com.ms.fx.FxGraphics.drawScanLines, com.ms.fx.FxFill.drawScanLinesCallback

drawStringCallback

public boolean drawStringCallback(FxGraphics g, String str, int x, int y,
        Rectangle r, int options, int dx[], int dy[]);

Draws a string in the specified edge color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawString is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object used.
str | The string that is drawn.
x | The x coordinate of the location where the string should be drawn.
y | The y coordinate of the location where the string should be drawn.
r | The optional rectangle used for clipping and opaquing.
options | The options of this method.
dx | An array of dx values.
dy | An array of dy values.

Overrides:

drawStringCallback(FxGraphics,String,int,int,Rectangle,int,int[],int[]) in FxFill.

See Also: com.ms.fx.FxGraphics.drawString, com.ms.fx.FxFill.drawStringCallback

fill3DRectCallback

public boolean fill3DRectCallback(FxGraphics g, int x, int y, int width,
        int height, boolean raised);

Draws a filled three-dimensional rectangle in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fill3DRect is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object used.
x | The x coordinate of the location where the rectangle is drawn.
y | The y coordinate of the location where the rectangle is drawn.
width | The width of the rectangle, in pixels.
height | The height of the rectangle, in pixels.
raised | Determines whether the three-dimensional rectangle has a raised or sunken edge.

Overrides:

fill3DRectCallback(FxGraphics,int,int,int,int,boolean) in FxFill.

fillArcCallback

public boolean fillArcCallback(FxGraphics g, int x, int y, int width,
        int height, int startAngle, int arcAngle);

Draws a filled arc centered on the given (x, y) coordinates in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillArc is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object used.
x | The x coordinate of the arc's origin.
y | The y coordinate of the arc's origin.
width | The width of the arc, in pixels.
height | The height of the arc, in pixels.
startAngle | The starting angle of the arc.
arcAngle | The angle of the arc.

Overrides:

fillArcCallback(FxGraphics,int,int,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillArc, com.ms.fx.FxFill.fillArcCallback

fillOvalCallback

public boolean fillOvalCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws a filled oval in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillOval is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The upper-left x coordinate of the oval.
y | The upper-left y coordinate of the oval.
width | The width of the oval, in pixels.
height | The height of the oval, in pixels.

Overrides:

fillOvalCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillOval, com.ms.fx.FxFill.fillOvalCallback

fillPolygonCallback

public boolean fillPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws a filled polygon in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillPolygon is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
xPoints | An array that contains the polygon's x coordinates.
yPoints | An array that contains the polygon's y coordinates.
nPoints | The number of points in the polygon.

Overrides:

fillPolygonCallback(FxGraphics,int[],int[],int) in FxFill.

See Also: java.awt.Graphics.fillPolygon, com.ms.fx.FxFill.fillPolygonCallback

fillRectCallback

public boolean fillRectCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws a filled rectangle in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillRect is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The upper-left x coordinate of the rectangle.
y | The upper-left y coordinate of the rectangle.
width | The width of the rectangle, in pixels.
height | The height of the rectangle, in pixels.

Overrides:

fillRectCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillRect, com.ms.fx.FxFill.fillRectCallback

fillRoundRectCallback

public boolean fillRoundRectCallback(FxGraphics g, int x, int y, int width,
        int height, int arcWidth, int arcHeight);

Draws a filled rectangle with rounded edges in the specified fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillRoundRect is called and an FxBrushPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The upper-left x coordinate of the rectangle.
y | The upper-left y coordinate of the rectangle.
width | The width of the rectangle, in pixels.
height | The height of the rectangle, in pixels.
arcWidth | The arc width of the rectangle's rounded edges.
arcHeight | The arc height of the rectangle's rounded edges.

Overrides:

fillRoundRectCallback(FxGraphics,int,int,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillRoundRect, com.ms.fx.FxFill.fillRoundRectCallback


Class FxCaret

public class FxCaret implements TimerListener
{
  // Constructors
  public FxCaret(Component c, int w, int h);
  public FxCaret(IUIComponent c, int w, int h);

  // Methods
  public int getHeight();
  public int getWidth();
  public void hide();
  public boolean isVisible();
  public void setInputMethod( InputMethodListener ime );
  public void setPos(Point p);
  public void setPos(int px, int py);
  public void show();
  public void timeTriggered(TimerEvent te);
}

This is a cross-platform class that manages a caret object.

The caret can also connect to an Input Method Editor (IME). Use the setInputMethod method to associate an InputMethodListener object with the FxCaret object. When you call the show and setPos methods, the IME's composition window is displayed.

Constructors

FxCaret

public FxCaret(Component c, int w, int h);

Creates a caret and links it to a java.awt Component. Initially, the caret object is invisible.

Parameter | Description
c | The component where the caret should be displayed. This is passed to the setVisibleComponent method, and the font used in this component is passed to the setFont method. The attached IME then uses the component's font, and the composition window appears in a position near the caret.
w | The width of the caret (in pixels).
h | The height of the caret (in pixels).

FxCaret

public FxCaret(IUIComponent c, int w, int h);

Creates a caret and links it to a com.ms.ui.IUIComponent. Initially, the caret object is invisible.

Parameter | Description
c | The component where the caret is displayed. This is passed to the setVisibleComponent method, and the font used in this component is passed to the setFont method. The attached IME then uses the component's font, and the composition window appears in a position near the caret.
w | The width of the caret (in pixels).
h | The height of the caret (in pixels).

Methods

getHeight

public int getHeight();

Retrieves the current height of the caret.

Return Value:

Returns the height of the caret (in pixels).

getWidth

public int getWidth();

Retrieves the current width of the caret.

Return Value:

Returns the width of the caret (in pixels).

hide

public void hide();

Hides the caret, if it is visible.

Return Value:

No return value.

isVisible

public boolean isVisible();

Retrieves the visible state of the caret.

Return Value:

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

setInputMethod

public void setInputMethod( InputMethodListener ime );

Sets the InputMethodListener for an FxCaret object. The FxCaret displays the composition window of the InputMethodListener near the caret.

Return Value:

No return value.

Parameter | Description
ime | the InputMethodListener to be set.

Remarks:

You must set an InputMethodListener before you call the show method. The font of the composition window is dependent on the attached component.

setPos

public void setPos(Point p);

Sets the caret position, relative to the owning component's upper-left corner.

Return Value:

No return value.

Parameter | Description
p | The Point that defines the caret's position.

setPos

public void setPos(int px, int py);

Sets the caret position, relative to the owning component's upper-left corner.

Return Value:

No return value.

Parameter | Description
px | The x coordinate for the caret.
py | The y coordinate for the caret.

show

public void show();

Displays the caret, if it is not already visible. The caret can be active in only one component at a time.

Return Value:

No return value.

timeTriggered

public void timeTriggered(TimerEvent te);

This method is called when a timer linked to the caret has expired.

Return Value:

No return value.

Parameter | Description
te | A TimerEvent that describes the event.


Class FxColor

public class FxColor extends BaseColor
{
  // Constructors
  public FxColor(int r, int g, int b);
  public FxColor(int rgb);
  public FxColor(float r, float g, float b);

  // Methods
  public Color brightenColor(int nPercent);
  public Color darkenColor(int nPercent);
  public Color getDarkShadow();
  public Color getHilight();
  public Color getLightHilight();
  public Color getShadow();
}

This class handles extended, user-definable color objects.

BaseColor
  |
  +--FxColor

Constructors

FxColor

public FxColor(int r, int g, int b);

Creates a color with the specified red, green, and blue values in the range of 0 through 255. The actual color used in rendering depends on finding the best match, given the color space available for a specific output device.

Parameter | Description
r | The red component of the color.
g | The green component of the color.
b | The blue component of the color.

See Also: java.awt.image.ColorModel.getRed, java.awt.image.ColorModel.getGreen, java.awt.image.ColorModel.getBlue, java.awt.image.ColorModel.getRGB

FxColor

public FxColor(int rgb);

Creates a color with the specified combined RGB value. The actual color used in rendering depends on finding the best match, given the color space available for a specific output device.

Parameter | Description
rgb | The combined RGB components.

See Also: java.awt.image.ColorModel.getRed, java.awt.image.ColorModel.getGreen, java.awt.image.ColorModel.getBlue, java.awt.image.ColorModel.getRGB

FxColor

public FxColor(float r, float g, float b);

Creates a color with the specified red, green, and blue values in the range of 0.0 to 1.0. The actual color used in rendering depends on finding the best match, given the color space available for a specific output device.

Parameter | Description
r | The red component of the color.
g | The green component of the color.
b | The blue component of the color.

See Also: java.awt.image.ColorModel.getRed, java.awt.image.ColorModel.getGreen, java.awt.image.ColorModel.getBlue, java.awt.image.ColorModel.getRGB

Methods

brightenColor

public Color brightenColor(int nPercent);

Retrieve a new color, which is a highlighted version of the current color.

Return Value:

Returns a Color that is nPercent brighter than the current color.

Parameter | Description
nPercent | The relative brightness for the new color.

darkenColor

public Color darkenColor(int nPercent);

Retrieves a new color, which is a darkened version of the current color.

Return Value:

Returns a Color that is nPercent darker than the current color.

Parameter | Description
nPercent | The relative darkness for the new color.

getDarkShadow

public Color getDarkShadow();

Retrieves the dark shadow of the current color.

Return Value:

Currently, this method returns Color.black.

getHilight

public Color getHilight();

Retrieves a new color, which is the highlight for the current color.

Return Value:

Returns a brighter Color.

getLightHilight

public Color getLightHilight();

Retrieves a new color, which is a highlighted version of the current color.

Return Value:

Currently, this method returns the same color as the current color.

getShadow

public Color getShadow();

Retrieves a new color, which is the shadow of the current color. The shadow is approximately one-third darker than the current color.

Return Value:

Returns a darker Color.


Class FxComponentImage

public abstract class FxComponentImage extends FxStateConfigurableUIImage
{
  // Fields
  public final static int CHECK_BOX;
  public final static int DOWN_ARROW;
  public final static int EXPAND_BOX;
  public final static int LEFT_ARROW;
  public final static int RADIO_BUTTON;
  public final static int RIGHT_ARROW;
  public final static int UP_ARROW;

  // Constructors
  public FxComponentImage(int states[]);

  // Methods
  public void drawChar(Graphics g, String s, int x, int y,
        int size);
  public static FxComponentImage getFactory(int idx);
  public Image getImage(Dimension size, int state);
  public Image getImage(Dimension size, IUIComponent comp);
  public Image getImage(Dimension size, int state, Color backColor,
        Color foreColor);
  public int getStateID(int state);
  public Font getWidgetFont(int c);
  public static void setFactory(int idx, FxComponentImage factory);
}

This class is a class factory that provides a set of consistent, cross-platform images that are used by the com.ms.ui classes for Graphical User Interface(GUI) display components. The class provides a consistent set of images, regardless of the underlying platform, but can be configured to the underlying platform (if required).

The following example shows how to create an FxComponentImage class factory, and then associate it with a component image.

// Create an object that contains images for the
various states of a
// check box component image.
int states[] = { FxStateConfigurableUIImage.CHECKED,
                 FxStateConfigurableUIImage.INDETERMINATE };
FxComponentImage fxci = new FxComponentImage(states);

// You must specify what type of component image you want
// to create the class factory for, with the setFactory method.
fxci.setFactory (FxComponentImage.CHECK_BOX, this);

By default, the FxComponentImage class creates seven kinds of image class factories. The following table lists these factory styles.
RADIO_BUTTON | CHECK_BOX | EXPAND_BOX
LEFT_ARROW | RIGHT_ARROW
UP_ARROW | DOWN_ARROW

The FxComponentImage objects provide a set of state-dependant images for each component image, depending on what states the image may have. For example, a LEFT_ARROW component image cannot have an INDETERMINATE state, so an image for this state is not provided in the LEFT_ARROW class factory.

You can use the static getFactory method to get the default class factory for an image that the FxComponentImage class provides. You can use the getImage method to retrieve the image for a specified state. The following example shows how to create a default factory for a CHECK_BOX image.

FxToolkit.getSystemInterface() ; // Initialize FxToolkit.

// Retrieve the default class factory for CHECK_BOX provided by FxComponentImage.
FxComponentImage fxi = FxComponent.getFactory(FxComponentImage.CHECK_BOX);

// Retrieve the image with dimension 20x20 of a selected check box.
Image checkedImg =
     fxi.getImage(new Dimension(20, 20), FxStateConfigurableUIImage.CHECKED);

// This will draw a selected check box at (50,50) with dimension 20x20.
g.drawImage( checkedImg, 50, 50, this );

FxStateConfigurableImage
  |
  +--FxStateConfigurableUIImage
    |
    +--FxComponentImage

Constructors

FxComponentImage

public FxComponentImage(int states[]);

Creates an FxComponentImage class factory using the specified array of component states.

Parameter Description
states The component states. This can be one or an array of the following states, depending on the image.
HOT PRESSED CHECKED INDETERMINATE ENABLED

Methods

drawChar

public void drawChar(Graphics g, String s, int x, int y, int size);

Draws a character using the graphics object's current font and color.

Return Value:

No return value.

Parameter | Description
g | The graphics object to use.
s | The string to draw.
x | The x coordinate of the location where the string should be drawn.
y | The y coordinate of the location where the string should be drawn.
size | The size of the character (in points).

getFactory

public static FxComponentImage getFactory(int idx);

Retrieves the FxComponentImage object associated with the component image at the specified index.

Return Value:

Returns the texture factory associated with the component image.

Parameter Description
idx The index of the component image. This can be any one of the following images.
RADIO_BUTTON CHECK_BOX EXPAND_BOX
LEFT_ARROW RIGHT_ARROW UP_ARROW DOWN_ARROW

Exceptions:

ArrayIndexOutOfBoundsException if the index of the component image idx is not valid.

getImage

public Image getImage(Dimension size, int state);

Retrieves a system image with the specified Dimension and state.

Return Value:

Returns the Image object that corresponds to the specified state.

Parameter | Description
size | The size of the image.
state The image is associated with a specific state. This may be one of the following states.
HOT PRESSED CHECKED INDETERMINATE ENABLED

getImage

public Image getImage(Dimension size, IUIComponent comp);

Retrieves a system image from a component, with the specified Dimension. The image retrieved depends on the foreground, background, and state of the component.

Return Value:

Returns the requested system image.

Parameter | Description
size | The image size.
comp | The component to obtain the image from.

getImage

public Image getImage(Dimension size, int state, Color backColor,
        Color foreColor);

Retrieves a system image with the specified Dimension, state, and user-specified colors.

Return Value:

Returns the Image object that corresponds to the specified state.

Parameter | Description
size | The size of the image.
state The image is associated with a specific state. This may be one of the following states.
HOT PRESSED CHECKED INDETERMINATE ENABLED
backColor | The specified background color of the image.
foreColor | The specified foreground color of the image.

getStateID

public int getStateID(int state);

Retrieves the state's array index for the specified state. This method is used by the getImage method.

Return Value:

Returns either the HOT or ENABLED state identifier, or a combination of the two. This method is used specifically for these two states, and other states are masked in the return value.

Parameter | Description
state | The state to retrieve the array index for.

getWidgetFont

public Font getWidgetFont(int c);

Retrieves the font the FxComponentImage image set uses, if available, to cleanly draw scalable images. If the font is not available, the method calls back to the class (by default, there is no widget font except for the system defined images, which use the Marlett font).

Return Value:

Returns the font that the image set uses.

Parameter | Description
c | The size of the requested font.

setFactory

public static void setFactory(int idx, FxComponentImage factory);

Sets an FxComponentImage factory for the specified component image.

Return Value:

No return value.

Parameter | Description
idx The component image or images to set the factory for. This can be any one of the following images.
RADIO_BUTTON CHECK_BOX EXPAND_BOX
LEFT_ARROW RIGHT_ARROW UP_ARROW DOWN_ARROW
factory | The FxComponentImage class factory to associate with the component image.

Exceptions:

ArrayIndexOutOfBoundsException if the index of the component image idx is not valid.

Fields

CHECK_BOX
A check box image.
DOWN_ARROW
A down-arrow glyph used in a scroll bar or combo box drop-down button.
EXPAND_BOX
An expanding box image.
LEFT_ARROW
A left-arrow glyph used in horizontal scroll bars.
RADIO_BUTTON
A radio button image.
RIGHT_ARROW
A right-arrow glyph used in horizontal scroll bars.
UP_ARROW
An up-arrow glyph used in a scroll bar or combo box drop-down button.


Class FxComponentTexture

public class FxComponentTexture extends FxStateConfigurableUIImage
{
  // Constructors
  public FxComponentTexture(int states[]);
  public FxComponentTexture(int states[], FxTexture tx[]);
  public FxComponentTexture(int states[], Image img[]);

  // Methods
  public Image getImage(int state);
  public FxTexture getTexture(int state);
}

This class is a class factory that provides a set of consistent, cross-platform FxTexture objects that are used by the com.ms.ui classes for Graphical User Interface(GUI) display components. The difference between this and the similar FxComponentImage class is that you can manipulate stretch factors and other attributes of the FxTexture objects (while Image objects remain static).

For more information on the use of the texture and image class factories, refer to the FxComponentImage.

FxStateConfigurableImage
  |
  +--FxStateConfigurableUIImage
    |
    +--FxComponentTexture

Constructors

FxComponentTexture

public FxComponentTexture(int states[]);

Creates an FxComponentTexture texture factory with the specified states.

Parameter Description
states An array of states used to create the texture. These may be the following.
ENABLED HOT PRESSED CHECKED INDETERMINATE

FxComponentTexture

public FxComponentTexture(int states[], FxTexture tx[]);

Creates an FxComponentTexture texture factory with the specified states and FxTexture objects.

Parameter | Description
states An array of states used to create the texture. These may be the following.
ENABLED HOT PRESSED CHECKED INDETERMINATE
tx | An array of FxTexture objects to base the component textures on.

FxComponentTexture

public FxComponentTexture(int states[], Image img[]);

Creates an FxComponentTexturetexture factory with the specified states and Image objects.

Parameter | Description
states An array of states used to create the texture. These may be the following.
ENABLED HOT PRESSED CHECKED INDETERMINATE
img | An array of Image objects to base the component textures on.

Methods

getImage

public Image getImage(int state);

Retrieves the Image object with the given state from the component texture factory.

Return Value:

Returns the Image object associated with the state.

Parameter Description
state An state associated with the component texture. These may be one of the following.
ENABLED HOT PRESSED CHECKED INDETERMINATE

getTexture

public FxTexture getTexture(int state);

Retrieves the FxTexture object with the given state from the component texture factory.

Return Value:

Returns the FxTexture object associated with the state.

Parameter Description
state An state associated with the component texture. These may be one of the following.


Class FxCurve

public abstract class FxCurve implements IFxShape
{
}

This class serves as a base for basic curve objects.

The FxEllipse class is derived from FxCurve.


Class FxEllipse

public class FxEllipse extends FxCurve implements IFxShape
{
  // Constructors
  public FxEllipse(int x, int y, int w, int h);

  // Methods
  public boolean contains(Point p);
  public void draw(FxGraphics g);
  public int getBorderLength();
  public Rectangle getBounds();
  public Point getOrigin();
  public Point getPoint(int nPels);
  public int[] getPointAndAngle(int pt);
  public int getPointAngle(int idx);
  protected Point getPointPos(int nPels);
  public boolean includes(Point p);
  public boolean setOrigin(Point p);
  public void translate(int deltaX, int deltaY);
  public void updateBounds(int x, int y);
}

This class creates and manages ellipse objects.

FxCurve
  |
  +--FxEllipse

Constructors

FxEllipse

public FxEllipse(int x, int y, int w, int h);

Creates a definable ellipse object by using the same parameters as those used in the Graphics class.

Parameter | Description
x | The upper-left x coordinate of the ellipse's bounding rectangle.
y | The upper-left y coordinate of the ellipse's bounding rectangle.
w | The width of the ellipse (in pixels).
h | The height of the ellipse (in pixels).

Methods

contains

public boolean contains(Point p);

Determines whether the specified point is within the curve's boundary. (This is supported by java.awt objects).

Return Value:

Returns false.

Parameter | Description
p | The point to check.

Remarks:

Currently, this method is not implemented.

draw

public void draw(FxGraphics g);

Draws the ellipse, one quadrant at a time.

Return Value:

No return value.

Parameter | Description
g | The graphic object to use.

getBorderLength

public int getBorderLength();

Retrieves the length of the border.

Return Value:

Returns the length of the entire border (in pixels).

getBounds

public Rectangle getBounds();

Retrieves the bounds of the ellipse.

Return Value:

Returns the bounding rectangle of the ellipse.

getOrigin

public Point getOrigin();

Retrieves the origin that was used.

Return Value:

Returns the point that was used as the origin.

getPoint

public Point getPoint(int nPels);

Retrieves a point along the curve that is a specified number of pixels from its origin.

Return Value:

Returns the point located at the specified position along the curve.

Parameter | Description
nPels | The distance from the origin of the curve (in pixels).

getPointAndAngle

public int[] getPointAndAngle(int pt);

Retrieves a point on a curve and the angle of the line that is perpendicular to the curve at that point.

Return Value:

Returns an array of integers that contain the point and angle. Currently returns null.

Parameter | Description
pt | The point to calculate the angles from.

Remarks:

Currently, this method is not implemented.

getPointAngle

public int getPointAngle(int idx);

Retrieves the angle of the line that is perpendicular to the curve at the point indicated.

Return Value:

Returns the angle of the line that is perpendicular to the curve at the point indicated. Currently returns 0.

Parameter | Description
idx | The point to calculate the angle from.

Remarks:

Currently, this method is not implemented.

getPointPos

protected Point getPointPos(int nPels);

Retrieves a point from a given position.

Return Value:

Returns the Point of the given position.

Parameter | Description
nPels | The distance from the origin of the curve (measured in pixels).

includes

public boolean includes(Point p);

Determines whether the specified point is on the curve.

Return Value:

Returns false.

Parameter | Description
p | The point to check.

Remarks:

Currently, this method is not implemented.

setOrigin

public boolean setOrigin(Point p);

Sets a new origin for the curve.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
p | The point to set as the new origin.

translate

public void translate(int deltaX, int deltaY);

Translates the vertices by (deltaX, deltaY).

Return Value:

No return value.

Parameter | Description
deltaX | The distance that the x coordinates move.
deltaY | The distance that the y coordinates move.

updateBounds

public void updateBounds(int x, int y);

Updates the bounding rectangle to fit the point defined by the x and y coordinates.

Return Value:

No return value.

Parameter | Description
x | The x coordinate of the point.
y | The y coordinate of the point.

Remarks:

Currently, this method is not implemented.


Class FxFill

public abstract class FxFill extends FxColor
{
  // Constructors
  public FxFill();
  public FxFill(int rgb);
  public FxFill(int r, int g, int b);

  // Methods
  public boolean draw3DRectCallback(FxGraphics g, int x, int y, int
        width, int height, boolean raised);
  public boolean drawArcCallback(FxGraphics g, int x, int y,
        int width, int height, int startAngle, int arcAngle);
  public boolean drawBytesCallback(FxGraphics g, byte data[],
        int offset, int length, int x, int y, Rectangle r,
        int options, int dx[], int dy[]);
  public boolean drawCharsCallback(FxGraphics g, char data[],
        int offset, int length, int x, int y, Rectangle r,
        int options, int dx[], int dy[]);
  public boolean drawLineCallback(FxGraphics g, int x1, int y1, int
        x2, int y2);
  public boolean drawOvalCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean drawPolylineCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean drawRectCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean drawRoundRectCallback(FxGraphics g, int x, int y,
        int width, int height, int arcWidth, int arcHeight);
  public boolean drawScanLinesCallback(FxGraphics g,
        boolean xChanging, int points[], int offset, int nPoints);
  public boolean drawStringCallback(FxGraphics g, String str,
        int x, int y, Rectangle r, int options, int dx[],
        int dy[]);
  public boolean fill3DRectCallback(FxGraphics g, int x, int y, int
        width, int height, boolean raised);
  public boolean fillArcCallback(FxGraphics g, int x, int y,
        int width, int height, int startAngle, int arcAngle);
  public boolean fillOvalCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean fillPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean fillRectCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean fillRoundRectCallback(FxGraphics g, int x, int y,
        int width, int height, int arcWidth, int arcHeight);
}

This class defines and manages extended fill objects.

The FxFill class is derived from FxColor and serves as one of the base classes for com.ms.fx extended graphics objects. These objects include FxTexture and FxPen, and its derivatives. Objects derived from FxFill are selected into a graphics context the same way a Color object is selected. When an FxGraphics object calls a method that uses the features of this extended color object, the call is processed through a callback method. These callback methods are onlyused internally and are not intended to be used directly by applications.

The callback method's boolean return values indicate only whether a call has successfully been processed. If the method returns false, default colors are used to perform the drawing operation. For more information on the use of callback methods in the com.ms.fx package, see the overview information at the beginning of this package.

Warning Any method in this class should not be called directly on the graphics object, as this will result in an endless loop.

BaseColor
  |
  +--FxColor
    |
    +--FxFill

Constructors

FxFill

public FxFill();

Creates an FxFill object with a default color.

FxFill

public FxFill(int rgb);

Creates an FxFill object with a specified color.

Parameter | Description
rgb | The RGB (red, green, and blue) color used as a default.

FxFill

public FxFill(int r, int g, int b);

Creates a FxFill object with the specified color components.

Parameter | Description
r | The red component of the color.
g | The green component of the color.
b | The blue component of the color.

Methods

draw3DRectCallback

public boolean draw3DRectCallback(FxGraphics g, int x, int y, int width,
        int height, boolean raised);

Draws a three-dimensional rectangle when called by an FxGraphics object.

Note This method is called by FxGraphics if draw3DRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object used.
x | The x coordinate of the location where the rectangle is drawn.
y | The y coordinate of the location where the rectangle is drawn.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).
raised | Determines if the three-dimensional edge of the rectangle is raised or sunken.

See Also: com.ms.fx.FxGraphics.draw3DRect

drawArcCallback

public boolean drawArcCallback(FxGraphics g, int x, int y, int width,
        int height, int startAngle, int arcAngle);

Draws an arc centered on the given (x, y) coordinates when called by an FxGraphics object.

Note This method is called by FxGraphics if drawArc is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object used.
x | The x coordinate of the arc's origin.
y | The y coordinate of the arc's origin.
width | The width of the arc (in pixels).
height | The height of the arc (in pixels).
startAngle | The starting angle of the arc.
arcAngle | The angle of the arc.

See Also: java.awt.Graphics.drawArc

drawBytesCallback

public boolean drawBytesCallback(FxGraphics g, byte data[], int offset, int
        length, int x, int y, Rectangle r, int options, int dx[], int dy[]);

Draws an array of bytes when called by an FxGraphics object.

Note This method is called by FxGraphics if drawBytes is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
data | The array of bytes.
offset | The offset used.
length | The length of the array used.
x | The x coordinate of the point where the bytes are drawn.
y | The y coordinate of the point where the bytes are drawn.
r | The optional rectangle used for clipping and opaquing.
options | The options for this method.
dx | An array of dx values.
dy | An array of dy values.

See Also: java.awt.Graphics.drawBytes

drawCharsCallback

public boolean drawCharsCallback(FxGraphics g, char data[], int offset, int
        length, int x, int y, Rectangle r, int options, int dx[], int dy[]);

Draws an array of characters when called by an FxGraphics object.

Note This method is called by FxGraphics if drawChars is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
data | The array of characters to be drawn.
offset | The offset to use.
length | The length of the array used.
x | The x coordinate of the point where the characters are drawn.
y | The y coordinate of the point where the characters are drawn.
r | The optional rectangle for clipping and opaquing.
options | The options for this method.
dx | An array of dx values.
dy | An array of dy values.

See Also: com.ms.fx.FxGraphics.drawChars

drawLineCallback

public boolean drawLineCallback(FxGraphics g, int x1, int y1, int x2,
        int y2);

Draws a line when called by an FxGraphics object.

Note This method is called by FxGraphics if drawLine is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x1 | The x coordinate of the starting point of the line.
y1 | The y coordinate of the starting point of the line.
x2 | The x coordinate of the ending point of the line.
y2 | The y coordinate of the ending point of the line.

See Also: java.awt.Graphics.drawLine

drawOvalCallback

public boolean drawOvalCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws an oval when called by an FxGraphics object.

Note This method is called by FxGraphics if drawOval is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The x coordinate of the upper-left part of the oval.
y | The y coordinate of the upper-left part of the oval.
width | The width of the oval (in pixels).
height | The height of the oval (in pixels).

See Also: java.awt.Graphics.drawOval

drawPolygonCallback

public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws a polygon when called by an FxGraphics object.

Note This method is called by FxGraphics if drawPolygon is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise returns false.

Parameter | Description
g | The graphics object.
xPoints | An array that contains the polygon's x coordinates.
yPoints | An array that contains the polygon's y coordinates.
nPoints | The number of points in the polygon.

See Also: java.awt.Graphics.drawPolygon

drawPolylineCallback

public boolean drawPolylineCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws multiple lines at once when called by an FxGraphics object.

Note This method is called by FxGraphics if drawPolygon is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise returns false.

Parameter | Description
g | The graphics object.
xPoints | An array containing the lines' x coordinates.
yPoints | An array containing the lines' y coordinates.
nPoints | The number of points generated by the arrays of coordinates.

See Also: java.awt.Graphics.drawPolyline

drawRectCallback

public boolean drawRectCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws a rectangle when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The x coordinate of the rectangle's starting point.
y | The y coordinate of the rectangle's starting point.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).

See Also: java.awt.Graphics.drawRect

drawRoundRectCallback

public boolean drawRoundRectCallback(FxGraphics g, int x, int y, int width,
        int height, int arcWidth, int arcHeight);

Draws an rectangle with rounded edges when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRoundRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The x coordinate of the rectangle's starting point.
y | The y coordinate of the rectangle's starting point.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).
arcWidth | The arc width of the rectangle's rounded edges.
arcHeight | The arc height of the rectangle's rounded edges.

See Also: java.awt.Graphics.drawRoundRect

drawScanLinesCallback

public boolean drawScanLinesCallback(FxGraphics g, boolean xChanging,
        int points[], int offset, int nPoints);

Draws scan lines when called by an FxGraphics object.

Note This method is called by FxGraphics if drawScanLines is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
xChanging | The direction the line should be drawn, either horizontally or vertically.
points | An array of points.
offset | The offset to use.
nPoints | The number of points in the array.

See Also: com.ms.fx.FxGraphics.drawScanLines

drawStringCallback

public boolean drawStringCallback(FxGraphics g, String str, int x, int y,
        Rectangle r, int options, int dx[], int dy[]);

Draws a graphical representation of a string when called by an FxGraphics object.

Note This method is called by FxGraphics if drawString is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
str | The string that is drawn.
x | The x coordinate of the location where the string is drawn.
y | The y coordinate of the location where the string should be drawn.
r | The optional rectangle used for clipping and opaquing.
options | The options of this method.
dx | An array of dx values.
dy | An array of dy values.

See Also: com.ms.fx.FxGraphics.drawString

fill3DRectCallback

public boolean fill3DRectCallback(FxGraphics g, int x, int y, int width,
        int height, boolean raised);

Draws a filled three-dimensional rectangle when called by an FxGraphics object.

Note This method is called by FxGraphics if fill3DRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object to use.
x | The x coordinate of the location where the rectangle is drawn.
y | The y coordinate of the location where the rectangle is drawn.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).
raised | Determines if the three-dimensional edge is raised or sunken.

See Also: com.ms.fx.FxGraphics.fill3DRect

fillArcCallback

public boolean fillArcCallback(FxGraphics g, int x, int y, int width,
        int height, int startAngle, int arcAngle);

Draws a filled arc centered on the given (x, y) coordinates when called by an FxGraphics object.

Note This method is called by FxGraphics if fillArc is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The x coordinate of the arc's origin.
y | The y coordinate of the arc's origin.
width | The width of the arc (in pixels).
height | The height of the arc (in pixels).
startAngle | The starting angle of the arc.
arcAngle | The angle of the arc.

See Also: java.awt.Graphics.fillArc

fillOvalCallback

public boolean fillOvalCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws a filled oval when called by an FxGraphics object.

Note This method is called by FxGraphics if fillOval is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The x coordinate of the upper-left corner of the oval.
y | The y coordinate of the upper-left corner of the oval.
width | The width of the oval (in pixels).
height | The height of the oval (in pixels).

See Also: java.awt.Graphics.fillOval

fillPolygonCallback

public boolean fillPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws a filled polygon when called by an FxGraphics object.

Note This method is called by FxGraphics if fillPolygon is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
xPoints | The x coordinate of the upper-left corner of the oval.
yPoints | The y coordinate of the upper-left corner of the oval.
nPoints | The number of points in the polygon.

See Also: java.awt.Graphics.fillPolygon

fillRectCallback

public boolean fillRectCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws a filled rectangle when called by an FxGraphics object.

Note This method is called by FxGraphics if fillRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The x coordinate of the upper-left corner of the oval.
y | The y coordinate of the upper-left corner of the oval.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).

See Also: java.awt.Graphics.fillRect

fillRoundRectCallback

public boolean fillRoundRectCallback(FxGraphics g, int x, int y, int width,
        int height, int arcWidth, int arcHeight);

Draws a filled rectangle with rounded edges color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillRoundRect is called and an FxFill object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The x coordinate of the upper-left corner of the oval.
y | The y coordinate of the upper-left corner of the oval.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).
arcWidth | The arc width of the rectangle's rounded edges.
arcHeight | The arc height of the rectangle's rounded edges.

See Also: java.awt.Graphics.fillRoundRect


Class FxFont

public class FxFont extends Font
{
  // Fields
  public static final int ANTIALIAS;
  public static final int EMBEDDED;
  public static final int ROTATABLE;
  public static final int STRIKEOUT;
  public static final int UNDERLINE;

  // Constructors
  public FxFont();
  public FxFont(String name, int style, int size);
  public FxFont(String name, int style, int size, int flags);

  // Methods
  public boolean drawBytesCallback(FxGraphics g, byte data[],
        int offset, int length, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[]);
  public boolean drawCharsCallback(FxGraphics g, char data[],
        int offset, int length, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[],
        boolean meta);
  public boolean drawOutlineCharCallback(FxGraphics g, int xOrig,
        int yOrig, GlyphOutline go);
  public boolean drawStringCallback(FxGraphics g, String str,
        int x, int y, Rectangle optionRect, int options,
        int dx[], int dy[]);
  public static String[] getAttributeList();
  public static String[] getAttributeList(String faceName);
  public FxFont getEmboldenedFont();
  public int getFlags();
  public static int getFlagsVal(String face, String attribute);
  public static Font getFont(String face, Vector v, int size);
  public static Font getFont(String face, int style, int size,
        int flags);
  public static String[] getFontList();
  public FontMetrics getFontMetricsCallback(FxGraphics g);
  public GlyphOutline getGlyphOutlineCallback(FxGraphics g,
        char ch);
  public static int getStyleVal(String face, String attribute);
  public void setBackgroundCallback(Color c);
  public void setColorCallback(Color c);
  public void setFontCallback(FxGraphics g);
}

This class produces user-defined font objects.

The FxFont class is one of several extensible classes that are included in the com.ms.fx package. FxFont objects can be used for font objects that are selected into an extended graphics context in the same way that FxTexture and FxPen are used for color objects.

The FxFont class provides methods that you can construct custom fonts with and a base that you can derive new font classes from (for example, FxOutlineFont).

Note The callback methods in this documentation are only used internally and are not meant to be called directly. They are included so that font-derived classes can extend the callback functionality. For more information on callback methods, see the com.ms.fx package overview information.

Font
  |
  +--FxFont

Constructors

FxFont

public FxFont();

Constructs a generic font. This is the constructor used by JavaBeans objects.

FxFont

public FxFont(String name, int style, int size);

Constructs an FxFont object.

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, measured in points.

FxFont

public FxFont(String name, int style, int size, int flags);

Constructs an FxFont object with specified 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, measured in points.
flags | The font flags, which can be either STRIKEOUT, UNDERLINE, or EMBEDDED.

Methods

drawBytesCallback

public boolean drawBytesCallback(FxGraphics g, byte data[], int offset, int
        length, int x, int y, Rectangle optionRect, int options, int dx[],
        int dy[]);

Draws an array of bytes when called by an FxGraphics object.

Note This method is called by FxGraphics if drawBytes is called and an FxFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphic object used.
data | The array of bytes that is drawn.
offset | The offset used.
length | The length of the array used.
x | The x coordinate of the location where the bytes are drawn.
y | The y coordinate of the location where the bytes are drawn.
optionRect | The optional rectangle used for clipping or opaquing.
options | This may be CHAR_OPAQUE, CHAR_CLIP, or CHAR_KERNING (not implemented).
dx | The array of dx values.
dy | The array of dy values.

See Also: com.ms.fx.FxGraphics.drawBytes

drawCharsCallback

public boolean drawCharsCallback(FxGraphics g, char data[], int offset, int
        length, int x, int y, Rectangle optionRect, int options, int dx[],
        int dy[], boolean meta);

Draws an array of characters when called by an FxGraphics object.

Note This method is called by FxGraphics if drawChars is called and if an FxFont object is the selected font.

The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
data | The array of characters that is drawn.
offset | The offset that is used.
length | The length of the array used.
x | The x coordinate of the location where the characters are drawn.
y | The y coordinate of the location where the characters are drawn.
optionRect | The optional rectangle used for clipping or opaquing.
options | This may be CHAR_OPAQUE, CHAR_CLIP, or CHAR_KERNING (not implemented).
dx | The array of dx values.
dy | The array of dy values.
meta

See Also: com.ms.fx.FxGraphics.drawChars

drawOutlineCharCallback

public boolean drawOutlineCharCallback(FxGraphics g, int xOrig, int yOrig,
        GlyphOutline go);

Draws an outline character when called by an FxGraphics object.

Note This method is called by FxGraphics to draw an outline character and an FxFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphic object used.
xOrig | The x coordinate of the character.
yOrig | The y coordinate of the character.
go | The GlyphOutline that is used.

drawStringCallback

public boolean drawStringCallback(FxGraphics g, String str, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[]);

Draws a string when this method is called by an FxGraphics object.

Note This method is called by FxGraphics if drawString is called and an FxFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false

Parameter | Description
g | The graphic object used.
str | The string that is drawn.
x | The x coordinate of the location where the string is drawn.
y | The y coordinate of the location where the string is drawn.
optionRect | The optional rectangle used for clipping or opaquing.
options | The options set for the method.
dx | The array of dx values.
dy | The array of dy values.

See Also: com.ms.fx.FxGraphics.drawString

getAttributeList

public static String[] getAttributeList();

Retrieves a list of the generic attributes that the font supports.

Return Value:

Returns the list of attributes that the font supports.

getAttributeList

public static String[] getAttributeList(String faceName);

Retrieves a list of the attributes that the font supports.

Return Value:

Returns the font attributes include the following:
"Bold" | "Italic" | "Underline"
"Strikeout" | "Anti-Aliased" | "Rotatable"

Parameter | Description
faceName | The name of the font.

getEmboldenedFont

public FxFont getEmboldenedFont();

Retrieves a bold version of the current font. Typically, a bold font is used in default titles, default buttons on a UIButtonBar, and other emphasized text.

Return Value:

Returns a bold version of the current font. If the font is already bold, the method returns without performing an operation.

getFlags

public int getFlags();

Retrieves any extra flags set for the FxFont object.

Return Value:

Returns the flags that are currently set.

getFlagsVal

public static int getFlagsVal(String face, String attribute);

Retrieves a value for the flags of the given face name.

Return Value:

Returns a value for the flags.

Parameter | Description
face | The name of the font.
attribute | A string that contains the attributes (for example, "Rotatable") of the font.

getFont

public static Font getFont(String face, Vector v, int size);

Retrieves a font if an exact match is made, given the face, vector, and size.

Return Value:

Returns a Font object that matches the given parameters.

Parameter | Description
face | The font's face name ("Helvetica", for example).
v | A list of style names.
size | The size of the font, in points.

getFont

public static Font getFont(String face, int style, int size, int flags);

Retrieves a font if an exact match is made, given the face, style, size, and flags.

Return Value:

Returns a Font object that matches the given parameters.

Parameter | Description
face | The font's face name ("Helvetica", for example).
style | The font's style.
size | The size of the font, in points.
flags | Can be one or a combination of the following: EMBEDDED, STRIKEOUT, or UNDERLINE.

getFontList

public static String[] getFontList();

Retrieves a list of the faces that the font supports.

Return Value:

Returns the list of faces as an array of String objects.

getFontMetricsCallback

public FontMetrics getFontMetricsCallback(FxGraphics g);

Retrieves the font metrics when called by an FxGraphics object.

Note This method is called by FxGraphics if getFontMetrics is called when an FxFont object is the selected font. The object returned must be derived from the FontMetrics class. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

Returns the FontMetrics of the font

Parameter | Description
g | The graphic object used.

See Also: java.awt.Graphics.getFontMetrics

getGlyphOutlineCallback

public GlyphOutline getGlyphOutlineCallback(FxGraphics g, char ch);

Retrieves a glyph outline for the character.

Return Value:

Returns a character glyph outline.

Parameter | Description
g | The graphic object used.
ch | The character that the glyph outline is found for.

getStyleVal

public static int getStyleVal(String face, String attribute);

Retrieves a value for the style flags of the given face name.

Return Value:

Returns a value for the font's style flags.

Parameter | Description
face | The name of the font.
attribute | A string that contains the attributes (for example, "Rotatable") of the font.

setBackgroundCallback

public void setBackgroundCallback(Color c);

Sets the text background color when called by an FxGraphics object.

Note This method is called by FxGraphics if setTextBackgroundColor is called and an FxFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality. Currently, this method is not implemented.

Return Value:

No return value.

Parameter | Description
c | The background color.

See Also: com.ms.fx.FxGraphics.setTextBackground

setColorCallback

public void setColorCallback(Color c);

Sets the foreground color of the font when called by an FxGraphics object.

Note This method is called by FxGraphics if setColor is called and an FxFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

No return value.

Parameter | Description
c | The foreground color.

See Also: com.ms.fx.FxGraphics.setColor

setFontCallback

public void setFontCallback(FxGraphics g);

Sets the font used by the extended graphics context when called by an FxGraphics object.

Note This method is called by FxGraphics if setFont is called when an FxFont object is the selected font. The method selects the current font for use as the native graphics font object. This approach enables the object to do any device-specific operation. The default action is to pass the font back and use it as a native font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

No return value.

Parameter | Description
g | The graphic object used.

See Also: com.ms.fx.FxGraphics.setFont

Fields

ANTIALIAS
Indicates the font object is anti-aliased. (Anti-aliasing is the smoothing of diagonal lines and curves.)
EMBEDDED
Indicates that the new font is linked to a privately-embedded font.
ROTATABLE
Indicates that the font object can be rotated.
STRIKEOUT
Indicates that the font object is struck out.
UNDERLINE
Indicates that the font object is underlined.


Class FxFontMetrics

public abstract class FxFontMetrics extends FontMetrics
{
  // Fields
  public final static int CHAR_KERNING;

  // Constructors
  public FxFontMetrics(Font font);
  public FxFontMetrics(Font font, Graphics g);

  // Methods
  public boolean canDrawOutline();
  public int charsWidth(char data[], int off, int len, int options,
        int dx[]);
  public void charsWidth(int start, int len, int options, int dx[]);
  public int getAveCharWidth();
  public String getFace();
  public static synchronized FontMetrics getFontMetrics(Font font);
  public static synchronized FontMetrics getFontMetrics(Graphics g,
        Font font);
  public int getMaxAdvance();
  public int stringWidth(String str, int options, int dx[]);
}

This class manages extended font metrics objects.

FontMetrics
  |
  +--FxFontMetrics

Constructors

FxFontMetrics

public FxFontMetrics(Font font);

Calculates the metrics of the given font.

Parameter | Description
font | The Font object that the metrics are calculated for.

FxFontMetrics

public FxFontMetrics(Font font, Graphics g);

Calculates the metrics of the given font, based on the Graphics object that is currently using the font.

Parameter | Description
font | The font object that the metrics are calculated for.
g | The graphics context that the font is associated with.

Methods

canDrawOutline

public boolean canDrawOutline();

Determines whether the font can be drawn in outline mode.

Return Value:

Returns true if the font can be drawn in outline mode; otherwise, returns false.

charsWidth

public int charsWidth(char data[], int off, int len, int options, int dx[]);

Retrieves the widths of characters in the specified character array fragment (in pixels).

Return Value:

Returns the width of the given character array.

Parameter | Description
data | The character array to measure.
off | The offset in the array to start measuring from.
len | The number of offsets to measure.
options | Determines if CHAR_KERNING is used.
dx | If dx is non-null, it will be filled in with the widths of the characters, starting from off, not necessarily from zero.

Exceptions:

NullPointerException if the character array is null.

charsWidth

public void charsWidth(int start, int len, int options, int dx[]);

Retrieves the widths of a range of Unicode characters, measured in the current font (in pixels).

Return Value:

No return value.

Parameter | Description
start | The offset in the array to start measuring from.
len | The number of offsets to measure.
options | Determines if CHAR_KERNING is used.
dx | If dx is non-null, it will be filled in with the widths of the characters.

getAveCharWidth

public int getAveCharWidth();

Retrieves the average character width for the current font (in pixels).

Return Value:

Returns the average character width.

getFace

public String getFace();

Retrieves the name of the font face that is indicated by the FxFontMetrics object. If there is no font face that matches the name of the font indicated by the object, the method returns the name of the font face that best fits the other attributes of the object.

Return Value:

Returns the name of the font face indicated by the FxFontMetrics object.

getFontMetrics

public static synchronized FontMetrics getFontMetrics(Font font);

Retrieves the font metrics for a given font on the current platform.

Return Value:

Returns a FontMetrics object that defines the font metrics.

Parameter | Description
font | The font for which the platform-specific metrics are calculated for.

Remarks: Use this method to create an FxFontMetrics object as well as a FontMetrics object based on the given parameters. You should not simply derive an FxFontMetrics from a FontMetrics. For example,

 FxFontMetrics ffm = (FxFontMetrics)FxFontMetrics.getFontMetrics(myFont);

getFontMetrics

public static synchronized FontMetrics getFontMetrics(Graphics g,
        Font font);

Retrieves the font metrics for a given font, drawn in the given graphics context.

Return Value:

Returns a FontMetrics object that defines the font metrics.

Parameter | Description
font | The font that the metrics are calculated for.
g | The graphics object that the font is currently selected into.

Remarks: Use this method to create an FxFontMetrics object as well as a FontMetrics object based on the given parameters. You should not simply derive an FxFontMetrics from a FontMetrics. For example,

 FxFontMetrics ffm = (FxFontMetrics)FxFontMetrics.getFontMetrics(myFont);

getMaxAdvance

public int getMaxAdvance();

Retrieves the maximum advance width of any character in the current font (in pixels).

Return Value:

Returns the maximum amount that the current point is moved from one character to the next in a line of text. Returns -1 if the max advance is not known.

stringWidth

public int stringWidth(String str, int options, int dx[]);

Retrieves the width of the specified string, measured in the current font.

Return Value:

Returns the width of the given string.

Parameter | Description
str | The string to measure.
options | Determines if CHAR_KERNING is used.
dx | If dx is non-null, it will be filled in with the widths of the characters in the string.

Fields

CHAR_KERNING
The extended width functions use kerning.


Class FxFormattedText

public class FxFormattedText extends FxText implements
            IFxTextConstants, IFxGraphicsConstants,
            IFxLocaleFormatting
{
  // Constructors
  public FxFormattedText();
  public FxFormattedText(String newBuff);
  public FxFormattedText(char newBuff[]);
  public FxFormattedText(char newBuff[], int offset, int length);

  // Methods
  public FxFormattedText dropTail(int iStart);
  public synchronized void ensureNotDirty( Graphics g );
  public Rectangle getBounding();
  public Point getClosestOffset(int scrnX, int scrnY);
  public Font getFont();
  public int getHeight();
  public int getHorizAlign();
  public boolean getKerning();
  public Locale getLocale();
  public boolean getLocaleFormattingOverride();
  public boolean getMnemonicDrawing();
  public Point getNextStartPoint();
  public int getOffsetFromPos(int scrnX, int scrnY, int flags);
  public IFxShape getOutline();
  public char getPasswordChar();
  public Point getScrnLocation(int index) ;
  public Point getStartPoint();
  public String getText();
  public int getTextDirection();
  public int getVertAlign();
  public int getWidth();
  public int getWordWrap();
  public void insert(char key, int iPos);
  public void insert(char key[], int iPos);
  public void insert(char key[], int offs, int len, int iPos);
  public boolean isBodyLocationDetermined();
  public boolean isDirty();
  public void paint(FxGraphics g, int startPos, int length,
        int opaquing);
  public void paint(Graphics g);
  public void remove(int iPos, int numberToRemove);
  public void setBounding(Rectangle r, boolean bRetainCurrPoint);
  public void setCallback(IFxTextCallback c);
  public void setFont(Font f);
  public void setHorizAlign(int h);
  public void setKerning(boolean useKerning);
  public void setLocale(Locale locale);
  public void setLocaleFormattingOverride(boolean override);
  public void setMnemonicDrawing(boolean mnem);
  public void setOutline(IFxShape outline);
  public void setPasswordChar(char c);
  public void setStartPoint(int x, int y);
  public void setStartPoint(Point p);
  public void setStartPointAtOrigin();
  public void setTabs(int newTabs[]);
  public void setText(char newBuff[], int offset, int len);
  public void setText(char newBuff[]);
  public void setText(String s);
  public void setTextDirection(int dir);
  public void setVertAlign(int v);
  public void setWordWrap(int ww);
  public Rectangle shrinkBound(boolean reset);
}

This class provides text layout and formatting for text in any language. FxFormattedText is used by UI and edit controls where features, such as text alignment and text direction, must be specified by the user.

You can draw FxFormattedText buffers directly with either paint methods. UIDrawText also uses FxFormattedText internally.

This class supports vertical writing.

FxText
  |
  +--FxFormattedText

Constructors

FxFormattedText

public FxFormattedText();

Creates and initiates an empty text buffer.

FxFormattedText

public FxFormattedText(String newBuff);

Creates a text buffer that is based on a specific string.

Parameter | Description
newBuff | The string that the new buffer is based on.

FxFormattedText

public FxFormattedText(char newBuff[]);

Creates and initializes a new text buffer, based on an specific array of characters. This constructor copies characters to the new buffer from the base offset of the character array. The FxFormattedText(char, int, int) constructor, however, enables character array manipulation that starts from a specified offset in the character array.

Parameter | Description
newBuff | The array of characters that the new buffer is based on.

FxFormattedText

public FxFormattedText(char newBuff[], int offset, int length);

Creates and initializes a new text buffer, based on a character array.

Parameter | Description
newBuff | The character array that the new text buffer is based on.
offset | The offset used in the specified character array.
length | The length of the character array that is copied to the new text buffer.

Methods

dropTail

public FxFormattedText dropTail(int iStart);

Retrieves an FxFormattedText buffer with the same attributes as the current buffer. The text from the offset iStart onward is removed.

Return Value:

Returns an FxFormattedText buffer with the text from iStart to the end of the buffer cropped.

Parameter | Description
iStart | The starting point of the text that is removed.

ensureNotDirty

public synchronized void ensureNotDirty( Graphics g );

Updates text block formatting according to the specified graphics context.

Return Value:

No return value.

Parameter | Description
g | The graphics object used to draw the text buffer.

Remarks:

This method must be called before widths, heights, and other parameters can be retrieved.

getBounding

public Rectangle getBounding();

Retrieves the current bounding box that is associated with the text.

Return Value:

Returns the Rectangle that is used as the bounding box.

See Also: setBounding

getClosestOffset

public Point getClosestOffset(int scrnX, int scrnY);

Finds the closest character to the screen location.

This method is used when isBodyLocationDetermined returns false, which indicates that the exact screen location of a character cannot be determined.

Return Value:

Returns the point where the closest character was found.

Parameter | Description
scrnX | The x coordinate of the screen location.
scrnY | The y coordinate of the screen location.

Remarks:

The x coordinate of the Point returned is equal to the offset idx into the text buffer, while the y coordinate of the Point is y = match param --> (x-x1)2 + (y-y1)2. This is returned so that all formats in a UIEdit object get the chance to pick the character position.

getFont

public Font getFont();

Retrieves the current font that is used with the FxFormattedText buffer. If no font is specified when this method is called, a default font is returned.

Return Value:

Returns the font that is used.

See Also: setFont

getHeight

public int getHeight();

Retrieves the height of a line of text in the current font (in pixels).

Return Value:

Returns the height of the text.

Remarks:

This method takes into account the standard leading (inter-line space) between the regular ascent and descent of a line of text. (The ascent is the distance from the baseline of the text to the top of most characters in a specific font. Similarly, the descent is the distance from the baseline to the bottom of most characters in a specific font.)

getHorizAlign

public int getHorizAlign();

Retrieves the horizontal alignment of the text.

Return Value:

Returns the horizontal alignment.

See Also: setHorizAlign, setVertAlign, getVertAlign

getKerning

public boolean getKerning();

Determines whether kerning is in use.

Return Value:

Returns true if kerning is currently used to format text; otherwise, returns false.

See Also: setKerning

getLocale

public Locale getLocale();

Retrieves the java.util.Locale that the text is based on.

Return Value:

Returns the current java.util.Locale.

See Also: setLocale

getLocaleFormattingOverride

public boolean getLocaleFormattingOverride();

Determines whether text formatting override features are based on locale.

Return Value:

Returns true if the locale determines overriding features; otherwise, returns false.

See Also: setLocaleFormattingOverride

getMnemonicDrawing

public boolean getMnemonicDrawing();

Determines whether text uses underlining for hot key tracking. This method is available for backward compatibility; the underlined character must be preceded by an ampersand.

Return Value:

Returns true if underlines are set; otherwise, returns false.

See Also: setMnemonicDrawing

getNextStartPoint

public Point getNextStartPoint();

Retrieves the next position to draw after the text.

Return Value:

Returns the point that is the next position to draw after the text.

Remarks:

This method, which is useful for tying multiple sentences together, is used by the FxFormattedText class. Be aware that if the text ends on a hard return, the Point object must refer to the next line.

getOffsetFromPos

public int getOffsetFromPos(int scrnX, int scrnY, int flags);

Retrieves the offset of the character that is closest to a specific screen location.

Return Value:

Returns the closest offset if successful; otherwise, returns -1.

Parameter | Description
scrnX | The x coordinate of the screen location to check.
scrnY | The y coordinate of the screen location to check.
flags | The flags controlling the method.

Remarks:

This method is used by the edit classes (including UIDrawText, UIEdit, and FxFormattedText) to find which character is closest to the caret. The flags are the same as those for opaquing text drawing. If there are dy arrays, this method will fail and return -1. If a failure occurs, use the getClosestOffset method to determine the offset in an array that is nearest to a given screen location.

See Also: getClosestOffset

getOutline

public IFxShape getOutline();

Retrieves the outline of the shape.

Return Value:

Returns the shape that is used as the outline.

See Also: setOutline

getPasswordChar

public char getPasswordChar();

Retrieves the character used to mask user text input.

Return Value:

Returns the password character. If no password character is specified, zero (cast as a char) is returned.

getScrnLocation

public Point getScrnLocation(int index) ;

Finds the screen location of a particular character. If the character index given is not valid for the current character buffer, the method returns null.

Return Value:

Returns the screen location of the character.

Parameter | Description
index | The index of the character for which the screen location is being retrieved.

getStartPoint

public Point getStartPoint();

Retrieves the current specified starting point for drawing the text.

Return Value:

Returns the point where the text starts.

See Also: setStartPoint

getText

public String getText();

Retrieves the current text in the text buffer as a String object.

Return Value:

Returns a string that contains the current text in the buffer.

See Also: com.ms.fx.FxFormattedText.setText

getTextDirection

public int getTextDirection();

Retrieves the current text direction.

Return Value:

Returns the current text direction.

See Also: setTextDirection

getVertAlign

public int getVertAlign();

Retrieves the vertical alignment for the text.

Return Value:

Returns the vertical alignment.

See Also: setVertAlign

getWidth

public int getWidth();

Retrieves the width of the entire buffer if it is one long string.

Return Value:

Returns the advance width of the character buffer, in number of characters.

getWordWrap

public int getWordWrap();

Retrieves the word-wrapping functionality.

Return Value:

Returns the word-wrapping functionality.

See Also: setWordWrap

insert

public void insert(char key, int iPos);

Inserts a single character into the buffer.

Return Value:

No return value.

Parameter | Description
key | The character to insert.
iPos | The position in the buffer where the character is inserted.

Overrides:

insert(char,int) in FxText.

insert

public void insert(char key[], int iPos);

Inserts an array of characters into the buffer.

Return Value:

No return value.

Parameter | Description
key | The array of characters to insert.
iPos | The position where the characters are inserted.

Overrides:

insert(char[],int) in FxText.

insert

public void insert(char key[], int offs, int len, int iPos);

Inserts an array of characters into the buffer.

Return Value:

No return value.

Parameter | Description
key | The source array of characters to insert.
offs | The specified offset in the source array.
len | The length of the character array fragment starting from offs.
iPos | The position in the buffer where the characters are to be inserted.

Overrides:

insert(char[],int,int,int) in FxText.

isBodyLocationDetermined

public boolean isBodyLocationDetermined();

Checks if there are definable start, body, and end screen positions.

Return Value:

Returns true if the exact screen location of a character is determined. In this event, you can use the getScrnLocation method. If the return value is false, use the getClosestOffset method to determine the offset nearest to the specified screen coordinates.

See Also: getScrnLocation, getClosestOffset

isDirty

public boolean isDirty();

Determines whether the text needs reformatting before any other operations may be performed on the buffer. Use the ensureNotDirty method to reformat the text.

Return Value:

Returns true if there is a pending update for the text.

paint

public void paint(FxGraphics g, int startPos, int length, int opaquing);

Paints the selected characters in the text block.

Return Value:

No return value.

Parameter | Description
g | The graphics object to use.
startPos | The starting character position.
length | The length of the character array.
opaquing Used only if the graphics object has a text background color set and the text has a bounding box. Can be a combination of the following values:
0
Don't opaque.
IFxTextConstants.OPAQUE_PRIOR
Opaque everything prior to the starting character position, startPos.
IFxTextConstants.OPAQUE_BODY
Fill out the lines painted between the character position startPos and the screen position NextPos.
IFxTextConstants.OPAQUE_POST
Opaque everything after the screen position NextPos.

paint

public void paint(Graphics g);

Paints the text block.

Return Value:

No return value.

Parameter | Description
g | The graphics object to use.

remove

public void remove(int iPos, int numberToRemove);

Deletes characters from a buffer. This may be a single character; if so, numberToRemove is 1.

Return Value:

No return value.

Parameter | Description
iPos | The starting position of the characters to remove.
numberToRemove | The number of characters to remove.

Overrides:

remove(int,int) in FxText.

setBounding

public void setBounding(Rectangle r, boolean bRetainCurrPoint);

Sets the bounding box. If there isn't a bounding box, the text is drawn in a single line.

Return Value:

No return value.

Parameter | Description
r | The rectangle to set as the bounding box.
bRetainCurrPoint | If false, the alignment is processed as in UIDrawText and the current point is lost. If the alignments are set to tdScriptDefault, right-to-left/top-to-bottom and so on, will be incorporated.

Remarks:

See the rules for setCurrPoint.

setCallback

public void setCallback(IFxTextCallback c);

Sets the callback interface.

Return Value:

No return value.

Parameter | Description
c | The callback interface to associate with the current object.

Remarks:

This method allows applications to make final modifications to the layout after all script processing has been done.

setFont

public void setFont(Font f);

Sets the font for the buffer.

Return Value:

No return value.

Parameter | Description
f | The font to set.

setHorizAlign

public void setHorizAlign(int h);

Sets the horizontal alignment for the text.

Return Value:

No return value.

Parameter Description
h The horizontal alignment. It may be one those that are shown in the following table.
htaCenter | htaLeft | htaRight
htaJustified | htaStretch or | htaScriptDefault

Remarks:

Some of the vertical and horizontal alignment values are script and locale dependant. Although all values are valid, the ensureNotDirty method may use default values (htaLeft and vtaTop) if the horizontal or vertical alignment are not appropriate for the current locale or script direction.

See Also: setVertAlign, getVertAlign

setKerning

public void setKerning(boolean useKerning);

Sets whether the text buffer, when formatted, will use kerning.

Return Value:

No return value.

Parameter | Description
useKerning | Set to true if you want the text, when formatted, to use kerning.

Remarks:

Currently, this method is not implemented.

See Also: getKerning

setLocale

public void setLocale(Locale locale);

Sets the locale for the text.

Return Value:

No return value.

Parameter Description
locale The current java.util.Locale. Locale can also control vertical writing directions, when used with the Locale.JAPANESE_VERTICAL, Locale.SIMPLIFIED_CHINESE_VERTICAL, Locale.KOREAN_VERTICAL, and Locale.TRADITIONAL_CHINESE_VERTICAL locale constants.

Note The JAPANESE_VERTICAL, and other similar constants, are Microsoft additions to the java.util.Locale class. When used with the setLocale method, their effect is the same as using the setTextDirection method.

For example, the setLocale(Locale.KOREAN_VERTICAL) method has the same effect as calling setTextDirection(IFxTextConstants.tdTB_RL).

Remarks:

This method determines which locale handler is used for formatting, word-breaking, and other operations.

See Also: getLocale

setLocaleFormattingOverride

public void setLocaleFormattingOverride(boolean override);

Sets whether the locale will determine overriding features for text formatting. For example, if the locale is Japan, and the text direction is set to tdJapanTradNormal, pure vertical writing will not occur, but the punctuation will be moved, and so on.

Return Value:

No return value.

Parameter | Description
override | Set to true if the locale should determine the override features.

Remarks:

Currently, this method is not implemented.

See Also: getLocaleFormattingOverride

setMnemonicDrawing

public void setMnemonicDrawing(boolean mnem);

Sets whether the text displays underlines for hot key tracking.

Return Value:

No return value.

Parameter | Description
mnem | Set to true to enable mnemonic drawing.

See Also: getMnemonicDrawing

setOutline

public void setOutline(IFxShape outline);

Sets the outline that the text will wrap around.

Return Value:

No return value.

Parameter | Description
outline | The shape to use as the outline.

Remarks:

When a shape is used, the meanings of the parameters for the block change. The horizontal text alignment becomes the reference for where the text is located on the shape (left, center, and so on). The vertical text alignment becomes a reference for whether the text sits above, on, or below the shape. Opaquing has no effect when a shape is in use, as opaquing cannot be determined.

See Also: getOutline

setPasswordChar

public void setPasswordChar(char c);

Displays all characters using the same base character. One common use for this is to set the character echoed when password text is entered.

Return Value:

No return value.

Parameter | Description
c | The base character to use for all echoed text.

See Also: getPasswordChar

setStartPoint

public void setStartPoint(int x, int y);

Sets the start point of the text.

Return Value:

No return value.

Parameter | Description
x | The x coordinate of the start point.
y | The y coordinate of the start point.

Remarks:

If there is no bounding box associated with the text, this is the (x,y) position and the text will be drawn relative to the position using the alignment flags.

If there is a bounding box, the (x,y) position is used to set the start point within the bounding box, and the box is used for limiting the text. Although you can set the (x,y) point outside the bounding box, the start of the text will not be drawn.

See Also: setBounding, getBounding

setStartPoint

public void setStartPoint(Point p);

Sets the start point for the text, using a Point object instead of a specified (x,y) coordinate.

Return Value:

No return value.

Parameter | Description
p | The starting point for the text.

Remarks:

If no bounding box is associated with the text, the start point is the (x,y) screen position and the text will be drawn relative to the position according to the alignment flags.

If a bounding box exists, the (x,y) position sets the start point within the bounding box, and the box is used for limiting the text. Although you can set the (x,y) point outside the bounding box, the start of the text will not be drawn.

See Also: getBounding, setBounding

setStartPointAtOrigin

public void setStartPointAtOrigin();

Resets the current specified starting point when a bounding box is associated with text. The horizontal and vertical text alignment flags control where the point is reset. If no bounding box is associated with the buffer, an (x,y) point of (0,0) is set.

Return Value:

No return value.

setTabs

public void setTabs(int newTabs[]);

Sets the tabs for the FxFormattedText block.

Return Value:

No return value.

Parameter | Description
newTabs | An array of tab positions.

setText

public void setText(char newBuff[], int offset, int len);

Replaces the text in the buffer with that of a character array, starting at a specified offset.

Return Value:

No return value.

Parameter | Description
newBuff | A character array.
offset | The specified offset in newBuff.
len | The length of the character array.

Overrides:

setText(char[],int,int) in FxText.

setText

public void setText(char newBuff[]);

Replaces the text in the buffer with that of a character array.

Return Value:

No return value.

Parameter | Description
newBuff | A character array.

Overrides:

setText(char[]) in FxText.

setText

public void setText(String s);

Replaces the text in the buffer with the contents of a string.

Return Value:

No return value.

Parameter | Description
s | The string to place in the buffer.

Overrides:

setText(String) in FxText.

setTextDirection

public void setTextDirection(int dir);

Sets the text flow direction. The direction can be one of those shown in the following table.
tdLR_TB tdTB_LR tdTB_RL tdLatinNormal

The direction can also be an angle value of 0 to 360 (where the angle value 0 represents "East" if you use a BorderLayout layout manager).

Return Value:

No return value.

Parameter | Description
dir | The direction that the text should flow.

setVertAlign

public void setVertAlign(int v);

Sets the vertical alignment for the text. This may be one of the alignments shown in the following table.
vtaCenter | vtaTop | vtaBottom
vtaBaseline | vtaStretch or | vtaScriptDefault

Return Value:

No return value.

Parameter | Description
v | The vertical alignment.

Remarks:

Some of the vertical and horizontal alignment values are script and locale dependant. Although all values are valid, the ensureNotDirty method may use default values (htaLeft and vtaTop) if the horizontal or vertical alignments are not appropriate for the current locale or script direction.

See Also: setHorizAlign

setWordWrap

public void setWordWrap(int ww);

Sets the word-wrapping functionality. This may be one of the following:

wwWrap
wwKeepWordIntact
wwVirtualRectEnd
wwVirtualRectSide
wwCleanEdges

Return Value:

No return value.

Parameter | Description
ww | The word-wrapping value to set.

shrinkBound

public Rectangle shrinkBound(boolean reset);

Shrinks the bounding rectangle to the minimum size that still contains all the text. If no text is currently in the bounding rectangle, the rectangle shrinks completely.

Return Value:

Returns the new bounding rectangle if reset is true.

Parameter | Description
reset | If true, the bounding rectangle of the object will reflect the change; otherwise, the result will be returned, but the bounding rectangle will not be updated.

Remarks:

The direction of shrinkage will depend on the text direction (for example, the upper left corner will not necessarily remain at (0,0)).


Class FxGraphicMetaFile

public class FxGraphicMetaFile
{
  // Constructors
  public FxGraphicMetaFile();
  public FxGraphicMetaFile(InputStream is)
        throws FileNotFoundException;
  public FxGraphicMetaFile(String filename)
        throws FileNotFoundException;

  // Methods
  public void enumerate() throws AWTException;
  public void play(Graphics g, int x, int y, int w, int h);
  public void play(Component comp);
  public void play(Image img);
}

This class plays Microsoft® Windows® metafiles.

Constructors

FxGraphicMetaFile

public FxGraphicMetaFile();

Creates an uninitialized FxGraphicMetaFile object.

Remarks:

Currently, this constructor is not implemented.

FxGraphicMetaFile

public FxGraphicMetaFile(InputStream is) throws FileNotFoundException;

Creates a playable metafile from an InputStream.

Parameter | Description
is | An InputStream used to create the metafile.

Exceptions:

FileNotFoundException if a FileInputStream object is passed and the specified filename is not valid or cannot be found.

FxGraphicMetaFile

public FxGraphicMetaFile(String filename) throws FileNotFoundException;

Creates a playable metafile.

Parameter | Description
filename | A name for the metafile that you create.

Exceptions:

FileNotFoundException if the filename is not valid.

Methods

enumerate

public void enumerate() throws AWTException;

Enumerates all records in the metafile, which loads up the vectors used in playback.

Note the following records are not supported by the FxGraphicMetaFile class.
META_SETPIXEL | META_ROUNDRECT | META_FLOODFILL
META_PATBLT | META_BITBLT | META_STRETCHBLT
META_POLYPOLYGON | META_SETDIBTODEV | META_SETSTRETCHBLTMODE
META_STRETCHDIB | META_DIBBITBLT | META_CREATEBITMAPINDIRECT
META_DIBSTRETCHBLT | META_EXTFLOODFILL | META_CREATEBITMAP

Return Value:

No return value.

Exceptions:

AWTException

play

public void play(Graphics g, int x, int y, int w, int h);

Plays the metafile on the given graphics object.

Return Value:

No return value.

Parameter | Description
g | The graphics object to use with the metafile.
x | The upper-left x coordinate of the graphics object.
y | The upper-left y coordinate of the graphics object.
w | The width of the graphics (in pixels).
h | The height of the graphics (in pixels).

Exceptions:

FileNotFoundException if the filename is not valid, or the file cannot be found.

play

public void play(Component comp);

Plays the metafile on the given component.

Return Value:

No return value.

Parameter | Description
comp | The component to use with the metafile.

play

public void play(Image img);

Plays the metafile on the given Image object.

Return Value:

No return value.

Parameter | Description
img | The image to use with the metafile.


Class FxGraphics

public abstract class FxGraphics extends Graphics implements
            IFxGraphicsConstants, IFxTextConstants,
            PeerConstants
{
  // Methods
  public void draw3DRect(int x, int y, int width, int height,
        boolean raised);
  public abstract void drawBezier(int xOrig, int yOrig,
        int values[], int nPoints);
  public boolean drawBorder(Rectangle rect, int edge, int flags);
  public void drawChars(char data[], int offset, int length, int x,
        int y);
  public void drawChars(char data[], int offset, int length, int x,
        int y, Rectangle optionRect, int options, int dx[], int
        dy[]);
  protected abstract void drawCharsWithoutFxFont(char data[],
        int offset, int length, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[]);
  public boolean drawEdge(Rectangle inRect, int edge, int flags);
  public abstract boolean drawImage(Image img, int dx1, int dy1,
        int dx2, int dy2, int sx1, int sy1, int sx2, int sy2,
        ImageObserver observer);
  public abstract boolean drawImage(Image img, int dx1, int dy1,
        int dx2, int dy2, int sx1, int sy1, int sx2, int sy2,
        Color bgcolor, ImageObserver observer);
  public void drawOutlineChar(int xOrig, int yOrig,
        GlyphOutline go);
  public abstract void drawOutlinePolygon(int xOrig, int yOrig,
        OutlinePolygon op);
  public abstract void drawPixels(int pels[], int len);
  public abstract void drawPolyline(int xPoints[], int yPoints[],
        int nPoints);
  public abstract void drawScanLines(boolean xChanging,
        int points[], int offset, int nPoints);
  public void drawString(String str, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[]);
  public void drawString(String str, int x, int y);
  public void drawString(String str, int x, int y, int a);
  public FxFormattedText drawStringFormatted(String s, Rectangle r,
        int hta, int vta, int ww, boolean bordered, int
        tabOrigin, int tabs[], IFxShape outline, boolean mnem);
  protected abstract void drawStringWithoutFxFont(String str,int x,
        int y, Rectangle optionRect, int options, int[] dx,int[]
        dy);
  public void drawT2Curve(FloatPoint pta, FloatPoint ptb,
        FloatPoint ptc, int xOrig, int yOrig);
  public abstract void excludeClip(int x, int y, int w, int h);
  public void fill3DRect(int x, int y, int width, int height,
        boolean raised);
  public Shape getClip();
  public abstract Rectangle getClipBounds();
  public abstract Region getClipRegion();
  public static FxGraphics getExtendedGraphics(Graphics g);
  public static FxGraphics getExtendedGraphics(Component c,
        Image img);
  public abstract GlyphOutline getGlyphOutline(char ch);
  public Color getTextBackgroundColor();
  public abstract Point getTranslation();
  public abstract void intersectClip(int x, int y, int w, int h);
  public abstract void setClip(Region r);
  public abstract void setClip(int x, int y, int width, int height);
  public abstract void setClip(Shape clip);
  public abstract void setColor( FxColor c );
  public void setTextBackgroundColor( FxColor c);
  public void setTextBackgroundColor( Color c);
}

This class encapsulates an extended graphics object.

The FxGraphics class is one of the core classes of the com.ms.fx package. It provides both an extended graphics object implementation and abstract methods for full cross-platform compatibility. (These methods are implemented either in a graphic object's peer or native windowing system.)

Any graphics object, whether AWT or AFC, performs operations with the same basic premise: You can assign a color and font style to the object, and then draw text and shapes with that color and font. The following example shows how you create an instance of the FxGraphics class with the getExtendedGraphics method. The object is created with default font and color.

// Create an extended graphics object.
FxGraphics fxg = FxGraphics.getExtendedGraphics(Graphics gOriginal);

You can use either the default color and font that the graphics object was created with for drawing operations, or you can call the setColor and setFont methods to set these attributes independently.

 // Set the color and font of the graphics object.
fxg.setColor(Color.red);
fxg.setFont("Helvetica");

The graphics object is used to draw both text and various shapes. Generally, the shapes that may be drawn are either an outline shape or a shape that is filled with a specified color. With the com.ms.fx package, you are provided with classes that extend the flexibility of drawing operations. These classes enable you to use images for background and foreground drawing (FxTexture), pens that may be several pixels wide (FxPen), and pens that enable users to select different background fill colors and foreground drawing colors (FxBrushPen).

In the following example, the graphics object is used to perform several drawing operations, using some standard drawing methods.

// Draw a line from the top-left corner of the canvas object to a point 100
// pixels down and 100 pixels across. A red diagonal line, 1 pixel wide, results.
fxg.drawLine(0, 0, 100, 100);

// Draw a filled red circle with the fillOval method.
fxg.fillOval(0, 0, 50, 50);

These are very simple examples, but by using the extended objects in the fx package, you can draw more complex and compelling graphics. An instance of the FxTexture class may be selected into a graphics context in the same way a color is selected, and then used as a background or foreground color. Similarly, you can create an FxPen using the same FxTexture, and draw lines and shapes of varying thickness. The following example demonstrates how to link the attributes of these objects together and use them to draw.

// Create an FxTexture based on an Image object. The fifth and sixth
// parameters indicate that the image should be drawn over a surface dimension
// that is 200 pixels wide and 300 high. The color (255, 0, 0) is used as a
// default color should the image fail to be drawn.
FxTexture myTex = new FxTexture(anImage, FxTexture.STRETCH_ALL,
                                0, 0, 200, 300, false, 255, 0, 0);

// An FxPen object can now be created based on the FxTexture object.
FxPen myWidePen = new FxPen(10, myTex);

// The FxPen object, in turn, may be selected into the graphics object
// the same way a Color is selected in the previous example.
fxg.setColor(myWidePen);

Now any drawing operation with the current graphics object are performed by drawing the Image (stretched across the surface) with a pen that is 10 pixels wide. The drawing method calls are the same as before, as all the objects described use internal callback methods to perform their operations. As a result, you can draw the same line and circle, with very different results, without altering the graphics' method calls.

The FxGraphics class provides a drawing API inherited from the java.awt.Graphics class. The drawImage methods draw images either within a given bounding rectangle, or a full image at a specified screen location. Scaling options and transparent pixel drawing may be specified by the user. The shape and line drawing methods (drawLine, fillOval) are simple and intuitive, yet powerful when used with extended pen and texture objects. The text drawing methods (drawChars, drawString) draw graphical representations of String objects and character arrays.

The FxGraphics class supports the following drawing primitives:
draw3DRect | drawArc | drawLine | drawOval
drawPolygon | drawRect | drawRoundRect | fill3DRect
fillArc | fillOval | fillPolygon | fillRect
fillRoundRect | drawChars | drawString | drawStringFormatted

The FxGraphics class supports the JDK 1.0.2 and JDK 1.1 clipping methods, as well as new methods for setting clip regions:
excludeClip | clipRect | getClipBounds
setClip(3 methods) | intersectClip

Graphics
  |
  +--FxGraphics

Methods

draw3DRect

public void draw3DRect(int x, int y, int width, int height, boolean raised);

Draws a three-dimensional rectangle with a specified edge style.

Return Value:

No return value.

Parameter | Description
x | The x coordinate of the rectangle's upper-left corner.
y | The y coordinate of the rectangle's upper-left corner.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).
raised | Determines either a raised or sunken edge.

drawBezier

public abstract void drawBezier(int xOrig, int yOrig, int values[],
        int nPoints);

Draws a Bezier curve.

Return Value:

No return value.

Parameter | Description
xOrig | The x coordinate of the origin for the curve.
yOrig | The y coordinate of the origin for the curve.
values | An array of (x,y) pairs of coordinates used to draw the curve.
nPoints | The number of points in the curve.

drawBorder

public boolean drawBorder(Rectangle rect, int edge, int flags);

Draws the border of a three-dimensional rectangle.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
rect | The rectangle to use.
edge The edge to use. This may be one of the following edge styles.
BDR_RAISEDOUTER BDR_RAISEDINNER BDR_SUNKENOUTER BDR_SUNKENINNER
flags | The specified border flags. For a complete listing of all border flags, see IFxGraphicsConstants.

drawChars

public void drawChars(char data[], int offset, int length, int x, int y);

Draws a given character array in the current graphics context.

Return Value:

No return value.

Parameter | Description
data | The array of characters to be drawn.
offset | The offset to use.
length | The length of the array used.
x | The x coordinate of the point where the characters are drawn.
y | The y coordinate of the point where the characters are drawn.

drawChars

public void drawChars(char data[], int offset, int length, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[]);

Draws a given character array with the given clipping rectangle or opaquing rectangle. Clipping or opaquing are only performed for the current operation.

Return Value:

No return value.

Parameter | Description
data | The array of characters to be drawn.
offset | The offset to use.
length | The length of the array used.
x | The x coordinate of the point where the characters are drawn.
y | The y coordinate of the point where the characters are drawn.
optionRect | The optional rectangle used for clipping or opaquing.
options | The options for this method.
dx | An array of destination x coordinates.
dy | An array of destination y coordinates.

drawCharsWithoutFxFont

protected abstract void drawCharsWithoutFxFont(char data[], int offset, int
        length, int x, int y, Rectangle optionRect, int options, int dx[],
        int dy[]);

Uses a native peer graphics object to draw the given character array using the supplied advancement lists. This method is used by an FxFont object if it needs to be able to draw and then process. This method is implemented for the Microsoft Virtual Machine in the com.ms.awt.GraphicsX class.

Return Value:

No return value.

Parameter | Description
str | The string to draw.
x | The x coordinate of the point where the string is drawn.
y | The y coordinate of the point where the string is drawn.
optionRect | The optional rectangle used for clipping and opaquing.
options | The options for this method.
dx | An array of destination x-values.
dy | An array of destination y-values.

See Also: com.ms.fx.FxGraphics

drawEdge

public boolean drawEdge(Rectangle inRect, int edge, int flags);

Draws the edges of a three-dimensional rectangle.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
inRect | The rectangle to use.
edge | The edge to use. For a complete listing of all edge styles, see IFxGraphicsConstants.
flags | The specified edge style.

drawImage

public abstract boolean drawImage(Image img, int dx1, int dy1, int dx2, int
        dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer);

Draws as much of the specified area in the image as is currently available. For more information on this abstract method, see the appropriate Graphics.drawImage method.

Return Value:

Returns immediately in all cases, even if the entire area of the image has not yet been scaled, dithered, and converted for the output device.

Parameter | Description
img | The Image object to draw.
dx1 | The x coordinate of the first corner of the destination rectangle.
dy1 | The y coordinate of the first corner of the destination rectangle.
dx2 | The x coordinate of the second corner of the destination rectangle.
dy2 | The y coordinate of the second corner of the destination rectangle.
sx1 | The x coordinate of the first corner of the source rectangle.
sy1 | The y coordinate of the first corner of the source rectangle.
sx2 | The x coordinate of the second corner of the source rectangle.
sy2 | The y coordinate of the second corner of the source rectangle.
observer | The object to be notified as more of the image is scaled and converted.

drawImage

public abstract boolean drawImage(Image img, int dx1, int dy1, int dx2, int
        dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor,
        ImageObserver observer);

Draws as much of the specified area in the image as is currently available. Transparent pixels are drawn in the specified background color. For more information on this abstract method, see the appropriate Graphics.drawImage method.

Return Value:

Returns immediately in all cases, even if the entire area of the image has not yet been scaled, dithered, and converted for the output device.

Parameter | Description
img | The Image object to draw.
dx1 | The x coordinate of the first corner of the destination rectangle.
dy1 | The y coordinate of the first corner of the destination rectangle.
dx2 | The x coordinate of the second corner of the destination rectangle.
dy2 | The y coordinate of the second corner of the destination rectangle.
sx1 | The x coordinate of the first corner of the source rectangle.
sy1 | The y coordinate of the first corner of the source rectangle.
sx2 | The x coordinate of the second corner of the source rectangle.
sy2 | The y coordinate of the second corner of the source rectangle.
bgcolor | The background color to use.
observer | The object to be notified as more of the image is scaled and converted.

drawOutlineChar

public void drawOutlineChar(int xOrig, int yOrig, GlyphOutline go);

Draws an outline character.

Return Value:

No return value.

Parameter | Description
xOrig | The x coordinate of the character.
yOrig | The y coordinate of the character.
go | The GlyphOutline to use.

drawOutlinePolygon

public abstract void drawOutlinePolygon(int xOrig, int yOrig,
        OutlinePolygon op);

Draws an outline polygon of a character.

Return Value:

No return value.

Parameter | Description
xOrig | The horizontal starting point for the shape.
yOrig | The vertical starting point for the shape.
op | The OutlinePolygon to draw.

See Also: com.ms.fx.OutlinePolygon

drawPixels

public abstract void drawPixels(int pels[], int len);

Draws a given list of pixels.

Return Value:

No return value.

Parameter | Description
pels | An array of pixels.
len | The length of the array.

drawPolyline

public abstract void drawPolyline(int xPoints[], int yPoints[],
        int nPoints);

Draws multiple lines at one time.

Return Value:

No return value.

Parameter | Description
xPoints | An array of x coordinates.
yPoints | An array of y coordinates.
nPoints | The number of points used to draw the lines.

drawScanLines

public abstract void drawScanLines(boolean xChanging, int points[],
        int offset, int nPoints);

Draws fast lines, either horizontally or vertically.

Return Value:

No return value.

Parameter | Description
xChanging | The direction that the line is drawn, either vertically or horizontally.
points | An array of points.
offset | The offset to use.
nPoints | The number of points in the array.

drawString

public void drawString(String str, int x, int y, Rectangle optionRect,
        int options, int dx[], int dy[]);

Draws the given string using the supplied advancement lists.

Return Value:

No return value.

Parameter | Description
str | The string to draw.
x | The x coordinate of the point where the string is drawn.
y | The y coordinate of the point where the string is drawn.
optionRect | The optional rectangle used for clipping and opaquing.
options | The options for this method.
dx | An array of destination x-values.
dy | An array of destination y-values.

drawString

public void drawString(String str, int x, int y);

Draws the given string.

Return Value:

No return value.

Parameter | Description
str | The string to draw.
x | The x coordinate of the point where the string is drawn.
y | The y coordinate of the point where the string is drawn.

drawString

public void drawString(String str, int x, int y, int a);

Rotates and draws a string at the specified angle of rotation.

Return Value:

No return value.

Parameter | Description
str | The string to draw.
x | The x coordinate of the point where the string is drawn.
y | The y coordinate of the point where the string is drawn.
a | The angle at which the text is drawn. An angle of 0 degrees draws standard tdLatinNormal text normally, while an angle of 180 degrees would rotate and draw this same string upside down. The range for this field is 0 to 359.

drawStringFormatted

public FxFormattedText drawStringFormatted(String s, Rectangle r, int hta,
        int vta, int ww, boolean bordered, int tabOrigin, int tabs[],
        IFxShape outline, boolean mnem);

Draws a formatted text string.

Return Value:

Returns an FxFormattedText object, which is a formatted text string.

Parameter | Description
s | The string to draw.
r | The bounding rectangle.
hta The horizontal text alignment. This may be one of the following hta values.
htaLeft | htaCenter | htaRight | htaStretch
htaJustified | htaScriptDefault
vta The vertical text alignment. This may be one of the following vta values.
vtaTop | vtaCenter | vtaBaseline | vtaBottom
vtaStretch | vtaScriptDefault
ww A word wrap value. This may be one of the following word wrap values.
wwCleanEdges | wwKeepWordIntact | wwNone
wwVirtualRectEnd | wwVirtualRectSide | wwWrap
bordered | Determines whether the string is bordered.
tabOrigin | Set tabs are relative to this position in the text string.
tabs | The tab stops.
outline | The outline for the formatted text. (The value may be null.)
mnem | Set this value to true if mnemonic drawing is used.

See Also: getMnemonicDrawing, setMnemonicDrawing

drawStringWithoutFxFont

protected abstract void drawStringWithoutFxFont(String str,int x, int y,
        Rectangle optionRect, int options, int[] dx,int[] dy);

Uses a native peer graphics object to draw the given string using the supplied advancement lists. This method is implemented for the Microsoft Virtual Machine in the com.ms.awt.GraphicsX class.

Return Value:

No return value.

Parameter | Description
str | The string to draw.
x | The x coordinate of the point where the string is drawn.
y | The y coordinate of the point where the string is drawn.
optionRect | The optional rectangle used for clipping and opaquing.
options | The options for this method.
dx | An array of destination x-values.
dy | An array of destination y-values.

See Also: com.ms.awt.GraphicsX

drawT2Curve

public void drawT2Curve(FloatPoint pta, FloatPoint ptb, FloatPoint ptc, int
        xOrig, int yOrig);

Draws a true type (T2, TT) curve, which is a three-point Bezier curve that uses TrueType fonts, for part of a glyph outline.

Return Value:

No return value.

Parameter | Description
pta | Point a on the T2 curve.
ptb | Point b on the T2 curve.
ptc | Point c on the T2 curve.
xOrig | The x coordinate of the origin for the curve.
yOrig | The y coordinate of the origin for the curve.

See Also: com.ms.fx.GlyphOutline

excludeClip

public abstract void excludeClip(int x, int y, int w, int h);

Excludes the clipping area from the specified rectangle.

Return Value:

No return value.

Parameter | Description
x | The upper-left x coordinate of the rectangle to exclude from the clipping area.
y | The upper-left y coordinate of the rectangle to exclude from the clipping area.
w | The width of the rectangle (in pixels).
h | The height of the rectangle (in pixels).

fill3DRect

public void fill3DRect(int x, int y, int width, int height, boolean raised);

Draws a filled three-dimensional rectangle with the specified edge style and current color.

Return Value:

No return value.

Parameter | Description
x | The x coordinate of the rectangle upper-left corner.
y | The y coordinate of the rectangle upper-left corner.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).
raised | Determines either a raised or sunken edge.

getClip

public Shape getClip();

Retrieves the current clipping area.

Return Value:

Returns a Shape that defines the clipping area.

getClipBounds

public abstract Rectangle getClipBounds();

Retrieves the bounds of the current clipping area.

Return Value:

Returns a Rectangle describing the current clipping area.

getClipRegion

public abstract Region getClipRegion();

Retrieves the clipping area as a Region.

Return Value:

Returns the region that defines the clipping area.

getExtendedGraphics

public static FxGraphics getExtendedGraphics(Graphics g);

Retrieves an extended graphics object based on a java.awt.Graphics object. This allows the extended object to be used with any set of class libraries.

Return Value:

Returns an extended graphics object.

Parameter | Description
g | A base graphics object.

getExtendedGraphics

public static FxGraphics getExtendedGraphics(Component c, Image img);

Retrieves an extended graphics object, using a Component and an optional image as a base. This method enables the extended objects to be used with any set of class libraries.

Return Value:

Returns an extended graphics object.

Parameter | Description
c | The component that the graphics object is based on.
img | The image that the graphics object is based on. The parameter value may be null, and if so, an image is created based on the Component c.

getGlyphOutline

public abstract GlyphOutline getGlyphOutline(char ch);

Retrieves the outline of the character in the currently selected font.

Return Value:

Returns an OutlinePolygon object. If however, the font is not an outline font, null is returned.

Parameter | Description
ch | The character outline that is requested.

getTextBackgroundColor

public Color getTextBackgroundColor();

Retrieves the text background color.

Return Value:

Returns the background color. If no background color is currently set, null is returned.

Remarks:

This method is used for opaquing text.

getTranslation

public abstract Point getTranslation();

Retrieves the origin Point used in a translate operation on a graphics context after the translation is complete.

Return Value:

Returns the origin for the translation.

intersectClip

public abstract void intersectClip(int x, int y, int w, int h);

Sets the current clipping area to the intersection of the current clipping area and the given rectangle.

Return Value:

No return value.

Parameter | Description
x | The upper-left x coordinate of the rectangle that specifies the area that may overlap the current clipping area.
y | The upper-left y coordinate of the rectangle that specifies the area that may overlap the current clipping area.
w | The width of the rectangle (in pixels).
h | The height of the rectangle (in pixels).

setClip

public abstract void setClip(Region r);

Sets the clipping area to the specified region.

Return Value:

No return value.

Parameter | Description
r | The Region to set the clipping area to.

setClip

public abstract void setClip(int x, int y, int width, int height);

Sets the clipping area to the specified rectangle.

Return Value:

No return value.

Parameter | Description
x | The x coordinate of the upper-left corner of the clipping rectangle.
y | The y coordinate of the upper-left corner of the clipping rectangle.
width | The width of the clipping rectangle (in pixels).
height | The height of the clipping rectangle (in pixels).

setClip

public abstract void setClip(Shape clip);

Sets the clipping area to the specified Shape.

Return Value:

No return value.

Parameter | Description
clip | The shape of the clipping area.

setColor

public abstract void setColor( FxColor c );

Sets the current graphics context's color for drawing operations. This method is included for JDK 1.0.2 compatibility.

Return Value:

No return value.

Parameter | Description
c | The FxColor that is used in drawing operations.

setTextBackgroundColor

public void setTextBackgroundColor( FxColor c);

Sets the text background color. This method is included for JDK 1.0.2 compatibility.

Return Value:

No return value.

Parameter | Description
c | The color to set the background to.

Remarks:

This method is used for opaquing text.

setTextBackgroundColor

public void setTextBackgroundColor( Color c);

Sets the text background color.

Return Value:

No return value.

Parameter | Description
c | The color to set the background to.

Remarks:

This method is used for opaquing text.


Class FxMapFont

public class FxMapFont
{
  // Constructors
  public FxMapFont(String s, Font f);

  // Methods
  public FxMapFontMappingSection getMappingSection();
  public int getNumMappingSections();
  public boolean isComplete();
}

This class ensures that a string can be drawn with a given font. If the string can't be drawn with the chosen font, other fonts are suggested for defined substrings.

Constructors

FxMapFont

public FxMapFont(String s, Font f);

Takes a string and base font and prepares the font mapping.

Parameter | Description
s | The string to map.
f | The base font that the string is mapped with.

Methods

getMappingSection

public FxMapFontMappingSection getMappingSection();

Acquires a FxMapFontMappingSection run. This is a defined substring of the FxMapFont buffer where font mapping operations are performed.

Return Value:

Returns an FxMapFontMappingSection object.

Remarks:

Currently returns null.

See Also: com.ms.fx.MapFontMappingSection

getNumMappingSections

public int getNumMappingSections();

Determines how many maps are required.

Return Value:

Returns the number of mapping sections that are required to map the text buffer.

isComplete

public boolean isComplete();

Determines if the string may be drawn with the given font.

Return Value:

Returns false.

Remarks:

Currently, this method is not implemented.


Class FxMapFontMappingSection

public class FxMapFontMappingSection
{
  // Fields
  public Font f;
  public int length;
  public int startPos;

  // Constructors
  public FxMapFontMappingSection(Font f, int startPos, int length);
}

This class represents a subsection of an FxMapFont text buffer. The FxMapFont class ensures that a text buffer can be drawn in a given font, and sections the text buffer into FxMapFontMappingSection objects. Each FxMapFontMappingSection substring is mapped to its parent buffer by its startPos and length fields.

Constructors

FxMapFontMappingSection

public FxMapFontMappingSection(Font f, int startPos, int length);

Creates a substring of the FxMapFont buffer.

Parameter | Description
f | The specified font.
startPos | The starting location of the original string.
length | The length of the subsection in the original string.

Fields

f
The recommended font.
length
The length of the subsection of the original FxMapFont string.
startPos
The starting location in the original string. FxMapFont


Class FxOutlineFont

public class FxOutlineFont extends FxFont
{
  // Fields
  protected Color backColor;
  protected Color color;

  // Constructors
  public FxOutlineFont();
  public FxOutlineFont(String name, int style, int size);
  public FxOutlineFont(String name, int style, int size, int flags);

  // Methods
  public boolean drawBytesCallback(FxGraphics g, byte data[],
        int offset, int length, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[]);
  public boolean drawCharsCallback(FxGraphics g, char data[],
        int offset, int length, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[]);
  public boolean drawOutlineChar(FxGraphics g, int xOrig,
        int yOrig, GlyphOutline go);
  public boolean drawStringCallback(FxGraphics g, String str,
        int x, int y, Rectangle optionRect, int options,
        int dx[], int dy[]);
  public static String[] getAttributeList();
  public static String[] getAttributeList(String faceName);
  public static int getFlagsVal(String face, String attribute);
  public static Font getFont(String face, Vector v, int size);
  public static Font getFont(String face, int style, int size,
        int flags);
  public static String[] getFontList();
  public GlyphOutline getGlyphOutlineCallback(FxGraphics g,
        char ch);
  public static int getStyleVal(String face, String attribute);
  public void setBackgroundCallback(Color c);
  public void setColorCallback(Color c);
}

This class produces user-defined outline font objects. FxOutlineFont specifically uses GlyphMetrics, GlyphOutline, OutlineCurve, and OutlinePolygon objects to perform its operations on fonts.

Note FxOutlineFont is derived from FxFont and may be selected into a graphics context the same way that a Font is selected. Like other extended objects in the com.ms.fx package, FxOutlineFont performs all its operations for an FxGraphics object internally by using callback methods. For more information on the callback methods in this documentation, see the beginning of this package.

Font
  |
  +--FxFont
    |
    +--FxOutlineFont

Constructors

FxOutlineFont

public FxOutlineFont();

Constructs a generic font.

This is the constructor used by JavaBeans objects.

FxOutlineFont

public FxOutlineFont(String name, int style, int size);

Creates an FxOutlineFont object with the specified style and size.

Parameter | Description
name | The font's name.
style | The font's style.
size | The font's size (in points).

FxOutlineFont

public FxOutlineFont(String name, int style, int size, int flags);

Creates an FxOutlineFont object with the specified style, size, and flags.

Parameter | Description
name | The font's name.
style | The font's style.
size | The font's size (in points).
flags This parameter can be one or a combination of the following flags:
OUTLINE | STRIKEOUT | UNDERLINE
ROTATABLE | ANTIALIAS

Methods

drawBytesCallback

public boolean drawBytesCallback(FxGraphics g, byte data[], int offset, int
        length, int x, int y, Rectangle optionRect, int options, int dx[],
        int dy[]);

Draws an array of bytes when called by an FxGraphics object.

Note This method is called by FxGraphics if drawBytes is called and an FxOutlineFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. This method is made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object to use.
data | The array of bytes.
offset | The offset to use.
length | The length of the array used.
x | The x coordinate of the location where the bytes are drawn.
y | The y coordinate of the location where the bytes are drawn.
optionRect | An optional rectangle used for clipping or opaquing.
options | The options used for this method.
dx | An array of dx values.
dy | An array of dy values.

Overrides:

drawBytesCallback(FxGraphics,byte[],int,int,int,int,Rectangle,int,int[],int[]) in FxFont.

See Also: com.ms.fx.FxFont.drawBytesCallback, com.ms.fx.FxGraphics.drawBytes

drawCharsCallback

public boolean drawCharsCallback(FxGraphics g, char data[], int offset, int
        length, int x, int y, Rectangle optionRect, int options, int dx[],
        int dy[]);

Draws an array of characters when called by an FxGraphics object.

Note This method is called by FxGraphics if drawChars is called and an FxOutlineFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
data | The array of characters.
offset | The offset.
length | The length of the array used.
x | The x coordinate of the location where the characters are drawn.
y | The y coordinate of the location where the characters are drawn.
optionRect | An optional rectangle used for clipping or opaquing.
options | The options used for this method.
dx | An array of dx values.
dy | An array of dy values.

See Also: com.ms.fx.FxFont.drawCharsCallback, com.ms.fx.FxGraphics.drawChars

drawOutlineChar

public boolean drawOutlineChar(FxGraphics g, int xOrig, int yOrig,
        GlyphOutline go);

Draws an outline character.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
xOrig | The x coordinate of the location to draw the character.
yOrig | The y coordinate of the location to draw the character.
go | The outline character to draw.

drawStringCallback

public boolean drawStringCallback(FxGraphics g, String str, int x, int y,
        Rectangle optionRect, int options, int dx[], int dy[]);

Draws a string when called by an FxGraphics object.

Note This method is called by FxGraphics if drawString is called and an FxOutlineFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
str | The string to draw.
x | The x coordinate of the location where the bytes are drawn.
y | The y coordinate of the location where the bytes are drawn.
optionRect | An optional rectangle used for clipping or opaquing.
options | The options used for this method.
dx | An array of dx values.
dy | An array of dy values.

Overrides:

drawStringCallback(FxGraphics,String,int,int,Rectangle,int,int[],int[]) in FxFont.

See Also: com.ms.fx.FxFont.drawStringCallback, com.ms.fx.FxGraphics.drawString

getAttributeList

public static String[] getAttributeList();

Retrieves a list of the generic attributes that the font supports.

Return Value:

Returns the list of attributes that the font supports.

Overrides:

getAttributeList() in FxFont.

getAttributeList

public static String[] getAttributeList(String faceName);

Retrieves a list of the attributes that the font supports.

Return Value:

Returns null.

Parameter | Description
faceName | The font's name.

Remarks:

Currently, this method is not implemented.

Overrides:

getAttributeList(String) in FxFont.

getFlagsVal

public static int getFlagsVal(String face, String attribute);

Retrieves a value of the flags of the given face name.

Return Value:

Returns 0.

Parameter | Description
face | The font's name.
attribute | A string that contains the attributes of the font (for example, "Rotatable").

Remarks:

Currently, this method is not implemented.

Overrides:

getFlagsVal(String,String) in FxFont.

getFont

public static Font getFont(String face, Vector v, int size);

Retrieves a font if an exact match is made when given the face, vector, and size.

Return Value:

Returns null.

Parameter | Description
face | The font's face name ("Helvetica", for example).
v | A list of style names.
size | The size of the font (in points).

Remarks:

Currently, this method is not implemented.

Overrides:

getFont(String,Vector,int) in FxFont.

getFont

public static Font getFont(String face, int style, int size, int flags);

Retrieves a font if an exact match is made when given the face, style, size and flags.

Return Value:

Returns a Font object that matches the given parameters.

Parameter | Description
face | The font's face name ("Helvetica", for example).
style | The font's style.
size | The size of the font (in points).
flags | The font's flags. This parameter can be one or a combination of the following: EMBEDDED, STRIKEOUT, or UNDERLINE.

Overrides:

getFont(String,int,int,int) in FxFont.

getFontList

public static String[] getFontList();

Retrieves a list of the faces that the font supports.

Return Value:

Returns null.

Remarks:

Currently, this method is not implemented.

Overrides:

getFontList() in FxFont.

getGlyphOutlineCallback

public GlyphOutline getGlyphOutlineCallback(FxGraphics g, char ch);

Retrieves a glyph outline of the character.

Note The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes may extend the callback functionality.

Return Value:

Returns a character GlyphOutline object.

Parameter | Description
g | The graphics object to use.
ch | The character, whose outline is requested.

Overrides:

getGlyphOutlineCallback(FxGraphics,char) in FxFont.

getStyleVal

public static int getStyleVal(String face, String attribute);

Retrieves a value for the style flags of the given face name.

Return Value:

Returns 0.

Parameter | Description
face | The font's name.
attribute | A string that contains the attributes of the font (for example, "Rotatable").

Remarks:

Currently, this method is not implemented.

Overrides:

getStyleVal(String,String) in FxFont.

setBackgroundCallback

public void setBackgroundCallback(Color c);

Sets the text background color when called by an FxGraphics object.

Note This method is called by FxGraphics if setTextBackground is called and an FxOutlineFont(IntelliFont) object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

No return value.

Parameter | Description
c | The background color.

Overrides:

setBackgroundCallback(Color) in FxFont.

See Also: com.ms.fx.FxGraphics.setTextBackground

setColorCallback

public void setColorCallback(Color c);

Sets the foreground color of the font when called by an FxGraphics object.

Note This method is called by FxGraphics if setColor is called and an FxOutlineFont object is the selected font. The callback methods are used internally and are not intended to be called by applications. It is made public so that derived classes can extend the callback functionality.

Return Value:

No return value.

Parameter | Description
c | The foreground color.

Overrides:

setColorCallback(Color) in FxFont.

See Also: java.awt.Graphics.setColor

Fields

backColor
The background color.
color
The foreground color.


Class FxPen

public class FxPen extends FxFill
{
  // Constructors
  public FxPen();
  public FxPen(int width, int rgb);
  public FxPen(int width, int r, int g, int b);
  public FxPen(int width, FxColor c);
  public FxPen(int width, Color c);

  // Methods
  public boolean drawLineCallback(FxGraphics g, int x1, int y1, int
        x2, int y2);
  public boolean drawOvalCallback(FxGraphics g, int x, int y,
        int w, int h);
  public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean drawRectCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean drawRoundRectCallback(FxGraphics g, int x, int y,
        int width, int height, int arcWidth, int arcHeight);
  public boolean drawScanLinesCallback(FxGraphics g,
        boolean xChanging, int points[], int offset, int nPoints);
  public boolean fillRectCallback(FxGraphics g, int x, int y,
        int width, int height);
  public int getWidth();
  public void setWidth(int w);
}

This class supplies a general drawing pen object whose color and line width can be specified. The FxPen object is a wide pen (that is, used for lines more than a pixel wide. Lines and curves that are one pixel wide may be drawn without using a pen object.)

Be aware that the line drawing calculations for lines are done in this class. For other curves, however, the calculations are done in the ShapeX derived routines. The following example shows how to construct and use an FxPen object.

// Create an FxPen with the default base color (0, 0, 0).
// Use the setWidth method to set or modify a pen's
// width (measured in pixels) after construction.
FxPen fxp1 = new FxPen();
fxp1.setWidth(5);

// Create an red FxPen object that is 5 pixels wide.
FxPen fxp2 = new FxPen(5, 255, 0, 0);

// You can also use Color objects to construct an FxPen.
FxPen fxp3 = new FxPen(5, Color.red);

Note FxPen objects perform all their operations through callback methods that are called when an FxGraphics object is called to perform a drawing operation, and the graphics color is an FxPen object. FxPen objects can perform any of the basic operations that you would expect of a variable-width pen. If a drawChars or drawString operation is called, however, the appropriate callback method in FxFill will be called and return false. For more information about the use of callback methods in the com.ms.fx package, see the overview information at the beginning of this package.

BaseColor
  |
  +--FxColor
    |
    +--FxFill
      |
      +--FxPen

Constructors

FxPen

public FxPen();

Creates a pen with a default base color and a width of one pixel.

FxPen

public FxPen(int width, int rgb);

Creates a pen with a specified base color (RGB) and width.

Parameter | Description
width | The width of the pen (in pixels).
rgb | The base color to use.

FxPen

public FxPen(int width, int r, int g, int b);

Creates a pen with a specified base color and width.

Parameter | Description
width | The width of the pen (in pixels).
r | The red component of the color.
g | The green component of the color.
b | The blue component of the color.

FxPen

public FxPen(int width, FxColor c);

Creates a pen with a specified base color and width.This constructor is included for JDK 1.0.2 compatibility.

Parameter | Description
width | The width of the pen (in pixels).
c | The base Color. This parameter may also be one of the extended FxColor types, including FxColor, FxFill, and FxTexture.

FxPen

public FxPen(int width, Color c);

Creates a pen with a specified base color and width.

Parameter | Description
width | The width of the pen (in pixels).
c | The base Color. This parameter may also be one of the extended FxColor types, including FxColor, FxFill, and FxTexture.

Methods

drawLineCallback

public boolean drawLineCallback(FxGraphics g, int x1, int y1, int x2,
        int y2);

Draws a wide line when called by an FxGraphics object.

Note This method is called by FxGraphics if drawLine is called and an FxPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x1 | The x coordinate of the starting point of the line.
y1 | The y coordinate of the starting point of the line.
x2 | The x coordinate of the ending point of the line.
y2 | The y coordinate of the ending point of the line.

Overrides:

drawLineCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawLine, com.ms.fx.FxFill.drawLineCallback

drawOvalCallback

public boolean drawOvalCallback(FxGraphics g, int x, int y, int w, int h);

Draws an oval when called by an FxGraphics object.

Note This method is called by FxGraphics if drawOval is called and an FxPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The upper-left x coordinate of the oval's bounding rectangle.
y | The upper-left y coordinate of the oval's bounding rectangle.
w | The width of the oval's bounding rectangle (in pixels).
h | The height of the oval's bounding rectangle (in pixels).

Overrides:

drawOvalCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawOval, com.ms.fx.FxFill.drawOvalCallback

drawPolygonCallback

public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws an polygon when called by an FxGraphics object.

Note This method is called by FxGraphics if drawPolygon is called and an FxPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
xPoints | An array containing the polygon's x coordinates.
yPoints | An array containing the polygon's y coordinates.
nPoints | The number of points in the polygon.

Overrides:

drawPolygonCallback(FxGraphics,int[],int[],int) in FxFill.

See Also: java.awt.Graphics.drawPolygon, com.ms.fx.FxFill.drawPolygonCallback

drawRectCallback

public boolean drawRectCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws an rectangle when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRect is called and an FxPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The upper-left x coordinate of the rectangle.
y | The upper-left y coordinate of the rectangle.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).

Overrides:

drawRectCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawRect, com.ms.fx.FxFill.drawRectCallback

drawRoundRectCallback

public boolean drawRoundRectCallback(FxGraphics g, int x, int y, int width,
        int height, int arcWidth, int arcHeight);

Draws an rectangle with rounded edges when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRoundRect is called and an FxPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The upper-left x coordinate of the rectangle.
y | The upper-left y coordinate of the rectangle.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).
arcWidth | The arc width of the rectangle's rounded edges.
arcHeight | the arc height of the rectangle's rounded edges.

Overrides:

drawRoundRectCallback(FxGraphics,int,int,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.drawRoundRect, com.ms.fx.FxFill.drawRoundRectCallback

drawScanLinesCallback

public boolean drawScanLinesCallback(FxGraphics g, boolean xChanging,
        int points[], int offset, int nPoints);

Draws scan lines when called by an FxGraphics object.

Note This method is called by FxGraphics if drawScanLines is called and an FxPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
xChanging | The direction the line should be drawn, either horizontally or vertically.
points | An array of points.
offset | The offset to use.
nPoints | The number of points in the array.

Overrides:

drawScanLinesCallback(FxGraphics,boolean,int[],int,int) in FxFill.

See Also: com.ms.fx.FxGraphics.drawScanLines, com.ms.fx.FxFill.drawScanLinesCallback

fillRectCallback

public boolean fillRectCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws a filled rectangle with rounded edges when called by an FxGraphics object.

Note This method is called by FxGraphics if fillRoundRect is called and an FxPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; returns false if a fill color has not been specified.

Parameter | Description
g | The graphics object.
x | The upper-left x coordinate of the rectangle.
y | The upper-left y coordinate of the rectangle.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).

Overrides:

fillRectCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillRect, com.ms.fx.FxFill.fillRectCallback

getWidth

public int getWidth();

Retrieves the pen's width.

Return Value:

Returns the pen's width (in pixels).

See Also: setWidth

setWidth

public void setWidth(int w);

Sets the pen's width.

Parameter | Description
w | The pen's width (in pixels).

Remarks:

The width of the pen may be changed only after the pen has been created.


Class FxRubberPen

public class FxRubberPen extends FxPen
{
  // Constructors
  public FxRubberPen(Color c);
  public FxRubberPen(FxColor c);

  // Methods
  public void drawLast(FxGraphics g);
  public boolean drawLineCallback(FxGraphics g, int x1, int y1, int
        x2, int y2);
  public boolean drawOvalCallback(FxGraphics g, int x1, int y1, int
        w, int h);
  public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean drawRectCallback(FxGraphics g, int x1, int y1, int
        w, int h);
  public boolean drawRoundRectCallback(FxGraphics g, int x1,
        int y1, int w, int h, int aw, int ah);
}

This class provides a rubber pen (typically, a pen that draws a shape or line after a drag-and-release mouse event and erases its previous drawing operation when performing a new one). Rubber pen objects are used in graphics applications where a non-permanent pen is needed as a template for operations with another permanent pen.

The FxRubberPen object is not actually dependant on mouse events, as arrow keys may also direct the pen. Although a pen will erase its previous operation before performing a new one, you can use more than one FxRubberPen at a time.

Note The callback methods used in this and other classes that are derived from FxColor are used internally only. An FxRubberPen object is selected into a graphics context the same way a Color is selected and will perform the operations that the graphics object requires. For more information on the use of callback methods in the com.ms.fx package, see the overview information at the beginning of this package.

The following examples show you how to create and use an FxRubberPen object.

 // Create an FxRubberPen by either using a Color or FxColor
// object. If a Color or FxColor is used, the pen draws lines that
// are one pixel wide. You can use an FxPen object, however, as the
// selected color to draw wider lines.

FxRubberPen fxrp1 = new FxRubberPen(Color.blue);

FxRubberPen fxrp2 = new FxRubberPen(new FxPen(5, Color.blue));

// Set the rubber pen as the current graphics object's color,
// and then draw any supported primitives as you normally would.

fxGraf.setColor(fxrp2);
fxGraf.drawLine(1, 1, 30, 40);
fxGraf.drawPolygon(xPtsArray, yPtsArray, numPts);

// Note that it's easy to create the object and set the graphics on one line.
// The following example sets the graphics object's color as a red
// FxRubberPen that is 10 pixels wide.
fxGraf.setColor( new FxRubberPen( new FxPen( 10, 255, 0 ,0)));

BaseColor
  |
  +--FxColor
    |
    +--FxFill
      |
      +--FxPen
        |
        +--FxRubberPen

Constructors

FxRubberPen

public FxRubberPen(Color c);

Creates a rubber pen object with a specified. Color

Parameter | Description
c | The FxRubberPen. The color specified is the background color required for the banding.

FxRubberPen

public FxRubberPen(FxColor c);

Creates a rubber pen object with a specified FxColor.

Parameter | Description
c | The FxRubberPen. The color specified is the background color required for the banding.

Methods

drawLast

public void drawLast(FxGraphics g);

Erases the last action performed by the pen.

Return Value:

No return value.

Parameter | Description
g | The graphics object to use.

drawLineCallback

public boolean drawLineCallback(FxGraphics g, int x1, int y1, int x2,
        int y2);

Draws a temporary line when called by an FxGraphics object.

Note This method is called by FxGraphics if drawLine is called and an FxRubberPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object to use.
x1 | The x coordinate of the starting point of the line.
y1 | The y coordinate of the starting point of the line.
x2 | The x coordinate of the ending point of the line.
y2 | The y coordinate of the ending point of the line.

Overrides:

drawLineCallback(FxGraphics,int,int,int,int) in FxPen.

See Also: java.awt.Graphics.drawLine, com.ms.fx.FxFill.drawLineCallback

drawOvalCallback

public boolean drawOvalCallback(FxGraphics g, int x1, int y1, int w, int h);

Draws a temporary ellipse when called by an FxGraphics object.

Note This method is called by FxGraphics if drawOval is called and if an FxRubberPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object to use.
x1 | The upper-left x coordinate of the oval's bounding rectangle
y1 | The upper-left y coordinate of the oval's bounding rectangle.
w | The width of the oval (in pixels).
h | The height of the oval (in pixels).

Overrides:

drawOvalCallback(FxGraphics,int,int,int,int) in FxPen.

See Also: java.awt.Graphics.drawOval, com.ms.fx.FxFill.drawOvalCallback

drawPolygonCallback

public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws a temporary polygon when called by an FxGraphics object.

Note This method is called by FxGraphics if drawPolygon is called and if an FxRubberPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object to use.
xPoints | An array containing the polygon's x coordinates.
yPoints | An array containing the polygon's y coordinates.
nPoints | The number of points in the polygon.

Overrides:

drawPolygonCallback(FxGraphics,int[],int[],int) in FxPen.

See Also: java.awt.Graphics.drawPolygon, com.ms.fx.FxFill.drawPolygonCallback

drawRectCallback

public boolean drawRectCallback(FxGraphics g, int x1, int y1, int w, int h);

Draws a temporary rectangle when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRect is called and if an FxRubberPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object to use.
x1 | The upper-left x coordinate of the rectangle.
y1 | The upper-left y coordinate of the rectangle.
w | The width of the rectangle (in pixels).
h | The height of the rectangle (in pixels).

Overrides:

drawRectCallback(FxGraphics,int,int,int,int) in FxPen.

See Also: java.awt.Graphics.drawRect, com.ms.fx.FxFill.drawRectCallback

drawRoundRectCallback

public boolean drawRoundRectCallback(FxGraphics g, int x1, int y1, int w,
        int h, int aw, int ah);

Draws a temporary rectangle with rounded edges when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRoundRect is called and if an FxRubberPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object to use.
x1 | The upper-left x coordinate of the rectangle.
y1 | The upper-left y coordinate of the rectangle.
w | The width of the rectangle (in pixels).
h | The height of the rectangle (in pixels).
aw | The arc width of the rectangle rounded edges.
ah | the arc height of the rectangle rounded edges.

Overrides:

drawRoundRectCallback(FxGraphics,int,int,int,int,int,int) in FxPen.

See Also: java.awt.Graphics.drawRoundRect, com.ms.fx.FxFill.drawRoundRectCallback


Class FxStateConfigurableImage

public class FxStateConfigurableImage
{
  // Constructors
  public FxStateConfigurableImage(int states[]);
  public FxStateConfigurableImage(int states[], Image images[]);
  public FxStateConfigurableImage();

  // Methods
  public void addImage(int state, Image img);
  public Image getImage(int state);
  public int getStateID(int state);
  public int[] getStates();
  public void setImage(int state, Image img);
}

This class is a class factory, providing a set of Image objects that are associated with system states.

Constructors

FxStateConfigurableImage

public FxStateConfigurableImage(int states[]);

Creates an FxStateConfigurableImage class factory with the specified states.

Parameter | Description
states | An array of states with which to create the class factory.

FxStateConfigurableImage

public FxStateConfigurableImage(int states[], Image images[]);

Creates an FxStateConfigurableImage class factory with the specified states.

Parameter | Description
states | An array of states with which to create the class factory.
images | An array of Image objects to associate with the states.

FxStateConfigurableImage

public FxStateConfigurableImage();

The default constructor.

Remarks:

Currently, this constructor is not implemented.

Methods

addImage

public void addImage(int state, Image img);

Adds a new state and its associated image to the FxStateConfigurableImage class factory.

Return Value:

No return value.

Parameter | Description
state | The new state to add to the class factory object.
img | The image to associate with the state.

getImage

public Image getImage(int state);

Retrieves a system image that is associated with the specified state.

Return Value:

Returns the requested system image. If no image is associated with the specified state, null is returned.

Parameter | Description
state | The state to retrieve the image for.

getStateID

public int getStateID(int state);

Retrieves the states array index for the specified state. This method is used by the getImage method.

Return Value:

Returns the array index of the state. If the states array does not contain this state, -1 is returned.

Parameter | Description
state | The state to retrieve the array index for.

getStates

public int[] getStates();

Retrieves the FxStateConfigurableImage object's current states array.

Return Value:

Returns the current states array.

setImage

public void setImage(int state, Image img);

Associates a new image with the specified state.

Return Value:

No return value.

Parameter | Description
state | The state that the image is associated with.
img | The image to set for the state.


Class FxStateConfigurableUIImage

public abstract class FxStateConfigurableUIImage extends FxStateConfigurableImage
{
  // Fields
  public static final int CHECKED;
  public static final int ENABLED;
  public static final int HOT;
  public static final int INDETERMINATE;
  public static final int PRESSED;

  // Constructors
  public FxStateConfigurableUIImage(int states[]);

  // Methods
  public static int getImageState(IUIComponent comp);
}

This class is a class factory that provides a set of images for different user interface component states.

FxStateConfigurableImage
  |
  +--FxStateConfigurableUIImage

Constructors

FxStateConfigurableUIImage

public FxStateConfigurableUIImage(int states[]);

Creates a FxStateConfigurableUIImage class factory with the specified states.

Parameter Description
states An array of states used to create the configurable image. The states can include the following.
ENABLED HOT PRESSED CHECKED INDETERMINATE

Methods

getImageState

public static int getImageState(IUIComponent comp);

Retrieves the state from a UIComponent so that the appropriate image can be used.

Return Value:

Returns the state of the component.

Parameter | Description
comp | The component to retrieve the state from.

Fields

CHECKED
A checked state flag.
ENABLED
An enabled state flag.
HOT
A hot state flag.
INDETERMINATE
The third state of a three way checkbox.
PRESSED
A pressed state flag.


Class FxStyledPen

public class FxStyledPen extends FxPen
{
  // Fields
  public final static int DASH;
  public final static int DOT;
  public final static int PLAIN;

  // Constructors
  public FxStyledPen(int style, int width);
  public FxStyledPen(int style, int width, Color c);
  public FxStyledPen(int style, int width, FxColor c);
  public FxStyledPen(int style, int width, int r, int g, int b);
  public FxStyledPen(int style, int width, int rgb);

  // Methods
  public boolean drawLineCallback(FxGraphics g, int x1, int y1, int
        x2, int y2);
  public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean drawRectCallback(FxGraphics g, int x, int y,
        int width, int height);
}

This class provides a drawing pen object with specifiable style. Although variable line width is also specifiable, it is not supported for the Microsoft SDK for Java version 3.0 pre-release 2. The FxStyledPen is used for dotted and dashed lines, and basic shapes.

An FxStyledPen is selected into a graphics context the same way that a Color object is selected, and performs all its operations internally using callback methods. For more information on the use of callback methods in the com.ms.fx package, see the com.ms.fx package overview information.

The following example shows how to create and use an FxStyledPen object.

// Create an FxStyledPen object that draws dotted lines.
FxStyledPen fxsp1 = new FxStyledPen(FxStyledPen.DOT, 1);

// Set the color of an extended graphics object
// to use the styled pen.
fxgraf.setColor(fxsp1);

// You can draw dotted lines and rectangles
// using standard drawing API calls.
fxgraf.drawLine(0, 0, 100, 100);
    // or
fxgraf.drawRect(1, 1, 50, 50);

BaseColor
  |
  +--FxColor
    |
    +--FxFill
      |
      +--FxPen
        |
        +--FxStyledPen

Constructors

FxStyledPen

public FxStyledPen(int style, int width);

Creates an FxStyledPen object with the specified style and width, and a default color.

Parameter | Description
style The style of the pen. This parameter may be one of the following three pen styles.
PLAIN DOT DASH

The PLAIN style draws the same effect as an FxPen object.

width | The width of the pen (in pixels). Currently, FxStyledPen only supports lines one pixel wide.

FxStyledPen

public FxStyledPen(int style, int width, Color c);

Creates an FxStyledPen object with the specified style, width, and color.

Parameter | Description
style The style of the pen. This parameter may be one of the following three pen styles.
PLAIN DOT DASH

The PLAIN style draws the same effect as an FxPen object.

width | The width of the pen (in pixels). Currently, FxStyledPen only supports lines one pixel wide.
c | The Color of the pen.

FxStyledPen

public FxStyledPen(int style, int width, FxColor c);

Creates an FxStyledPen object with the specified style, width, and color.

Parameter | Description
style The style of the pen. This parameter may be one of the following three pen styles.
PLAIN DOT DASH

The PLAIN style draws the same effect as an FxPen object.

width | The width of the pen (in pixels). Currently, FxStyledPen only supports lines one pixel wide.
c | The FxColor of the pen.

FxStyledPen

public FxStyledPen(int style, int width, int r, int g, int b);

Creates an FxStyledPen object with the specified style, width, and color.

Parameter | Description
style The style of the pen. This parameter may be one of the following three pen styles.
PLAIN DOT DASH

The PLAIN style draws the same effect as an FxPen object.

width | The width of the pen (in pixels). Currently, FxStyledPen only supports lines one pixel wide.
r | The red component of the color of the pen.
g | The green component of the color of the pen.
b | The blue component of the color of the pen.

FxStyledPen

public FxStyledPen(int style, int width, int rgb);

Creates an FxStyledPen object with the specified style, width, and color.

Parameter | Description
style The style of the pen. This parameter may be one of the following three pen styles.
PLAIN DOT DASH

The PLAIN style draws the same effect as an FxPen object.

width | The width of the pen (in pixels). Currently, FxStyledPen only supports lines one pixel wide.
rgb | The RGB value for the color of the pen.

Methods

drawLineCallback

public boolean drawLineCallback(FxGraphics g, int x1, int y1, int x2,
        int y2);

Draws a plain, dotted, or dashed line when called by an FxGraphics object.

Note This method is called by FxGraphics if drawLine is called and an FxStyledPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x1 | The x coordinate of the starting point of the line.
y1 | The y coordinate of the starting point of the line.
x2 | The x coordinate of the ending point of the line.
y2 | The y coordinate of the ending point of the line.

Overrides:

drawLineCallback(FxGraphics,int,int,int,int) in FxPen.

See Also: java.awt.Graphics.drawLine, com.ms.fx.FxFill.drawLineCallback

drawPolygonCallback

public boolean drawPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws a plain, dotted, or dashed polygon when called by an FxGraphics object.

Note Currently, this callback is not implemented. It is called by FxGraphics if drawPolygon is called and an FxStyledPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
xPoints | An array containing the polygon's x coordinates.
yPoints | An array containing the polygon's y coordinates.
nPoints | The number of points in the polygon.

Overrides:

drawPolygonCallback(FxGraphics,int[],int[],int) in FxPen.

See Also: java.awt.Graphics.drawPolygon, com.ms.fx.FxFill.drawPolygonCallback

drawRectCallback

public boolean drawRectCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws an plain, dotted, or dashed rectangle when called by an FxGraphics object.

Note This method is called by FxGraphics if drawRect is called and an FxStyledPen object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object.
x | The upper-left x coordinate of the rectangle.
y | The upper-left y coordinate of the rectangle.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).

Overrides:

drawRectCallback(FxGraphics,int,int,int,int) in FxPen.

See Also: java.awt.Graphics.drawRect, com.ms.fx.FxFill.drawRectCallback

Fields

DASH
A pen style that indicates the pen draws a dashed line.
DOT
A pen style that indicates the pen draws a dotted line.
PLAIN
A pen style that indicates the pen draws a solid line (effectively, is an FxPen).


Class FxSystemFont

public final class FxSystemFont extends FxFont
{
  // Methods
  public static String[] getAttributeList();
  public static String[] getAttributeList(String faceName);
  public static Font getCaptionFont();
  public static int getFlagsVal(String face, String attribute);
  public static Font getFont(String face, Vector v, int size);
  public static Font getFont(String face, int style, int size,
        int flags);
  public static String[] getFontList();
  public static Font getIconTitleFont();
  public static Font getMenuFont();
  public static Font getMessageBoxFont();
  public static Font getSmallCaptionFont();
  public static Font getStatusFont();
  public static int getStyleVal(String face, String attribute);
  public static Font matchFaceToFont(String face);
}

This class handles system fonts (system-specific fonts that are used in graphical user interface components such as dialog boxes and menus). This class is cross-platform, but on platforms other than Microsoft® Win32®, FxSystemFont will default to the use of predefined standard fonts.

Font
  |
  +--FxFont
    |
    +--FxSystemFont

Methods

getAttributeList

public static String[] getAttributeList();

Retrieves a list of the generic attributes that the font supports.

Return Value:

Returns null.

Remarks:

Currently, this method is not implemented.

Overrides:

getAttributeList() in FxFont.

getAttributeList

public static String[] getAttributeList(String faceName);

Retrieves a list of the attributes that the font supports.

Return Value:

Returns null.

Parameter | Description
faceName | The font's name.

Remarks:

Currently, this method is not implemented.

Overrides:

getAttributeList(String) in FxFont.

getCaptionFont

public static Font getCaptionFont();

Retrieves the system caption font.

Return Value:

Returns the caption font.

getFlagsVal

public static int getFlagsVal(String face, String attribute);

Retrieves a value for the flags of the given face name.

Return Value:

Returns 0.

Parameter | Description
face | The font's name.
attribute | A string that contains the attributes of the font (for example, "Rotatable").

Remarks:

Currently, this method is not implemented.

Overrides:

getFlagsVal(String,String) in FxFont.

getFont

public static Font getFont(String face, Vector v, int size);

Retrieves a font if an exact match is made with the given face, vector, and size.

Return Value:

Returns a Font object that matches the given parameters.

Parameter | Description
face | The font's face name ("Helvetica", for example).
v | A list of style names.
size | The size of the font (in points). Currently, font size is not used in finding a match.

Overrides:

getFont(String,Vector,int) in FxFont.

getFont

public static Font getFont(String face, int style, int size, int flags);

Retrieves a font if an exact match is made with the given face, style, size and flags.

Return Value:

Returns a Font object that matches the given parameters.

Parameter | Description
face | The font's face name ("Helvetica", for example).
style | The font's style.
size | The size of the font (in points).
flags | This parameter can be one or a combination of the following: EMBEDDED, STRIKEOUT, or UNDERLINE.

Overrides:

getFont(String,int,int,int) in FxFont.

getFontList

public static String[] getFontList();

Retrieves a list of the faces that the font supports.

Return Value:

Returns the list of faces as an array of String objects.

Overrides:

getFontList() in FxFont.

getIconTitleFont

public static Font getIconTitleFont();

Retrieves the Icon Title system font.

Return Value:

Returns the Icon Title font.

getMenuFont

public static Font getMenuFont();

Retrieves the Menu system font.

Return Value:

Returns the Menu font.

getMessageBoxFont

public static Font getMessageBoxFont();

Retrieves the Message Box system font.

Return Value:

Returns the Message Box font.

getSmallCaptionFont

public static Font getSmallCaptionFont();

Retrieves the Small Caption system font.

Return Value:

Returns the Small Caption font.

getStatusFont

public static Font getStatusFont();

Retrieves the Status system font.

Return Value:

Returns the Status font.

getStyleVal

public static int getStyleVal(String face, String attribute);

Retrieves a value for the style flags of the given face name.

Return Value:

Returns 0.

Parameter | Description
face | The font's name.
attribute | A string that contains the attributes of the font (for example, "Rotatable").

Remarks:

Currently, this method is not implemented.

Overrides:

getStyleVal(String,String) in FxFont.

matchFaceToFont

public static Font matchFaceToFont(String face);

This method is used in the getAttributeList and getFont methods, and matches the given face to the current font object.

Return Value:

Returns a font object that best matches the given face.

Parameter | Description
face | A font's face name.


Class FxSystemIcon

public class FxSystemIcon
{
  // Fields
  public static FxSystemIcon exclamationIcon;
  public static FxSystemIcon informationIcon;
  public static FxSystemIcon questionIcon;
  public static FxSystemIcon stopIcon;

  // Methods
  public synchronized Image getImage();
}

This class provides static image types used in the Application Foundation Classes.

Four image files are included with the com.ms.fx package:
exclamation.gif | question.gif
stop.gif | information.gif

Methods

getImage

public synchronized Image getImage();

Retrieves the image identifier, based on the type and state.

Note State is not used for icon images.

Return Value:

Returns an Image based on the image identifier.

Fields

exclamationIcon
The image is used Win32 platform in message boxes when a warning message is displayed. The excalmation.gif image is included with the com.ms.fx package.
informationIcon
The image is used in Win32 message boxes when an information message is displayed. The information.gif image is included with the com.ms.fx package.
questionIcon
The system question-mark image used in Win32 message boxes to query users. The question.gif is included in the com.ms.fx package to enhance backwards compatibility with Win32. For more information on the use of this image, see The Windows Interface Guidelines for Software Design.
stopIcon
An image used in Microsoft® Win32® message boxes when a critical message is displayed. The stop.gif image is included with the com.ms.fx package.


Class FxText

public class FxText
{
  // Fields
  public char buffer[];
  public int nBuffSize;
  public int nChars;

  // Constructors
  public FxText();
  public FxText(String newBuff);
  public FxText(char newBuff[]);
  public FxText(char newBuff[], int offset, int length);

  // Methods
  public void append(char key);
  public void append(char key[]);
  public void append(char key[], int offs, int len);
  public void ensureResize(int amountNeeded);
  public char getChar(int idx);
  public int getLength();
  public int getWordBreak( int iChar );
  public void insert(char key, int iPos);
  public void insert(char key[], int offs, int keyLen, int iPos);
  public void insert(char key[], int iPos);
  public boolean isDelimiter(int iPos);
  public boolean isWhite(int i);
  public boolean isWhite(int i, boolean treatLFasWhite);
  public void remove(int iPos, int numberToRemove);
  public void setText(char newBuff[]);
  public void setText(String s);
  public void setText(char newBuff[], int offset, int nCharsNew);
}

This class performs basic insertion and deletion operations on a text buffer. The FxText class is similar to the java.lang.StringBuffer class, but there is no synchronization on the buffer in the FxText class, which makes it much more efficient. FxText buffers, which are designed to be plugged into UI components, are the basis for FxFormattedText.

As with the StringBuffer class, append and insert are the principle operations of the FxText class, and the setText method allows buffer substitution.

Warning Because the FxTextclass has no synchronization, it is not thread safe and should not be used in multithreaded applications. To avoid a possible conflict with multiple threads, synchronize the FxFormattedTextobject.

Constructors

FxText

public FxText();

Creates an empty text buffer.

FxText

public FxText(String newBuff);

Creates a text buffer based on a string.

Parameter | Description
newBuff | The string that the new text buffer is based on.

FxText

public FxText(char newBuff[]);

Creates a text buffer based on a character array.

Parameter | Description
newBuff | The array of characters that the new text buffer is based on.

FxText

public FxText(char newBuff[], int offset, int length);

Creates a text buffer based on a portion of a character array.

Parameter | Description
newBuff | The array of characters that the new text buffer is based on.
offset | The offset to use.
length | The length of the array to be used.

Methods

append

public void append(char key);

Appends a character to the end of the buffer.

Return Value:

No return value.

Parameter | Description
key | The character to append.

append

public void append(char key[]);

Appends an array of characters to the end of the buffer.

Return Value:

No return value.

Parameter | Description
key | The array of characters to append.

append

public void append(char key[], int offs, int len);

Appends an array of characters, or a subsection of an array, to the end of the buffer.

Return Value:

No return value.

Parameter | Description
key | The array of characters to append.
offs | The offset of the array to copy from.
len | The length of the array or length of the array subsection to copy.

ensureResize

public void ensureResize(int amountNeeded);

Ensures that the current text buffer has enough room to handle any changes. If the buffer is too small, a larger text buffer is created by using the amountNeeded parameter. Use this method before insert, append, and setText operations to check bounds on a text buffer.

Return Value:

No return value.

Parameter | Description
amountNeeded | The number of characters needed for expanded text buffer operations.

getChar

public char getChar(int idx);

Retrieves the character at the given location.

Return Value:

Returns the character at position idx.

Parameter | Description
idx | The index of the character in an array.

getLength

public int getLength();

Retrieves the number of characters in the buffer.

Return Value:

Returns the number of characters in the buffer.

getWordBreak

public int getWordBreak( int iChar );

Retrieves the number of characters in the next word.

Return Value:

Returns the number of characters in the next word.

Parameter | Description
iChar | The location to start searching for the next word.

Remarks:

The next word includes leading white space, but not trailing white space.

insert

public void insert(char key, int iPos);

Inserts a single character into the buffer.

Return Value:

No return value.

Parameter | Description
key | The character to insert.
iPos | The position in the buffer to insert the character.

insert

public void insert(char key[], int offs, int keyLen, int iPos);

Inserts an array of characters or an array fragment into the buffer.

Return Value:

No return value.

Parameter | Description
key | The array of characters to insert.
offs | The offset in the array or array fragment to start from.
keyLen | The length of the character array fragment.
iPos | The position in the buffer to insert the character.

insert

public void insert(char key[], int iPos);

Inserts an array of characters into the buffer.

Return Value:

No return value.

Parameter | Description
key | The array of characters to insert.
iPos | The position in the buffer to insert the characters.

isDelimiter

public boolean isDelimiter(int iPos);

Checks if the character is a delimiter.

Return Value:

Returns true if it is a delimiter; otherwise, returns false.

Parameter | Description
iPos | The character position to check.

isWhite

public boolean isWhite(int i);

Determines if a character is a white space.

Return Value:

Returns true if it is a white space; otherwise, returns false.

Parameter | Description
i | The offset in buffer.

isWhite

public boolean isWhite(int i, boolean treatLFasWhite);

Determines if a character is a white space and whether to treat line feed characters as white spaces.

Return Value:

Returns true if it is considered white space; otherwise, returns false.

Parameter | Description
i | The offset in buffer.
treatLFasWhite | Set this value to true if a line feed character should be treated as a white space.

Remarks:

This method is useful for marking the end of a line of text.

remove

public void remove(int iPos, int numberToRemove);

Deletes one or more characters in the text buffer.

Return Value:

No return value.

Parameter | Description
iPos | The position at which to start the deletion.
numberToRemove | The number of characters to remove.

setText

public void setText(char newBuff[]);

Replaces the text in the sentence with that of a character array.

Return Value:

No return value.

Parameter | Description
newBuff[] | A character array.

setText

public void setText(String s);

Replaces the text in the sentence with that of a specified string.

Return Value:

No return value.

Parameter | Description
s | The string that replaces the text buffer.

setText

public void setText(char newBuff[], int offset, int nCharsNew);

Replaces the text in the sentence with that of a character array, starting at a specified offset.

Return Value:

No return value.

Parameter | Description
newBuff | A character array.
offset | The specified starting offset.
nCharsNew | The length of the new character array.

Fields

buffer[]
The buffer containing the sentence.
nBuffSize
The current maximum size of the buffer (in characters).
nChars
The number of characters in the buffer.


Class FxTexture

public class FxTexture extends FxFill implements ImageObserver
{
  // Fields
  public final static int DRAW_BL;
  public final static int DRAW_BOTTOM;
  public final static int DRAW_BR;
  public final static int DRAW_CENTER;
  public final static int DRAW_LEFT;
  public final static int DRAW_RIGHT;
  public final static int DRAW_TL;
  public final static int DRAW_TOP;
  public final static int DRAW_TR;
  public final static int REPEAT_PIN;
  public final static int SNAP_EDGES;
  public final static int STRETCH_ALL;
  public final static int STRETCH_MIDDLE;
  public final static int STRETCH_NONE;
  public final static int STRETCH_OUTER;

  // Constructors
  public FxTexture(Image i);
  public FxTexture(Image i, int s, int l, int t, int r, int b,
        boolean p, int red, int green, int blue);
  public FxTexture(Image i, int s, int l, int t, int r, int b,
        boolean p, Color base);
  public FxTexture(Image i, int s, int l, int t, int r, int b,
        boolean p, FxFill base);
  public FxTexture(Image i, int s, int l, int t, int r, int b,
        boolean p);

  // Methods
  public boolean drawScanLinesCallback(FxGraphics g,
        boolean xChanging, int points[], int offset, int nPoints);
  public boolean fillArcCallback(FxGraphics g, int x, int y,
        int width, int height, int startAngle, int arcAngle);
  public boolean fillOvalCallback(FxGraphics g, int x, int y,
        int width, int height);
  public boolean fillPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);
  public boolean fillRectCallback(FxGraphics g, int xStart,
        int yStart, int width, int height);
  public boolean fillRoundRectCallback(FxGraphics g, int x, int y,
        int width, int height, int arcWidth, int arcHeight);
  public int getBottomAxis();
  public Image getImage();
  public Rectangle getInner();
  public int getLeftAxis();
  public boolean getPinOrigin();
  public int getRightAxis();
  public boolean getSnapDraw();
  public int getStretch();
  public int getTopAxis();
  public int getUpdatedAreasMask();
  public boolean imageUpdate(Image img, int infoflags, int x,
        int y, int width, int height);
  public void setAxis(int l, int t, int r, int b);
  public void setPinOrigin(boolean b);
  public void setSnapDraw(boolean b);
  public void setStretch(int s);
  public void setUpdateCallback(IFxTextureUpdate tu);
  public void setUpdatedAreasMask(int mask);
  public Dimension size();
}

This class uses images, including .gif and .jpeg file formats, to fill shapes and draw graphics effects. An FxTexture may be used for both foreground drawing colors and background colors.

To select an image as a background, use the Component.setBackground(Color c) or the UIComponent.setBackground(Color color) method and pass the FxTexture as the Color object. If the image cannot be drawn, a default RGB color, Color, or FxFill will be used instead.

To select an image as a foreground color, select the FxTexture object into a drawing object, such as FxPen, FxRubberPen, or FxBrushPen. A graphics object will perform the same operations with FxTexture or FxPen that it does with a Color object.

Note The callback methods used in this and other classes that are derived from FxColor and FxFill are used internally only; they are not for use directly by applications. For more information on the use of callback methods in the com.ms.fx package, see the overview information at the beginning of this article.

The following example shows you how to construct several different FxTexture objects.

// In many cases, you will use an FxTexture as a simple background
// fill. In these cases, where you do not want the image stretched in
// any way, you can use the following constructs.

fxt = new FxTexture(img[TEXTURE], FxTexture.STRETCH_NONE,
                    0,0,-1,-1, false, Color.red);

// The first parameter is an imported image to base the texture on. The
// second parameter handles image stretching. When you want the image
// drawn normally, use STRETCH_NONE. If you want the image stretched
// across a surface, you can use either STRETCH_MIDDLE, STRETCH_OUTER,
// or STRETCH_ALL. The third and fourth parameters set the starting
// location of the image relative to the drawing canvas (in this case, the
// location is point 0,0). The fifth and sixth parameters set the width and height
// of the image drawn on the canvas. Set these values to -1 to specify that
// the image is drawn to its normal dimension (if you use STRETCH_NONE, you
// will always set these to -1). Set the seventh parameter to true if
// you want a texture pinned. The final parameter sets a color to use
// in case the image fails to draw. This can be a Color, a set of
// (r,g,b) values, or an FxFill object.

// In some cases, you may want to use the default backup color when creating
// an FxTexture. The default color is white.

fxt = new FxTexture(img[TEXTURE], FxTexture.STRETCH_NONE,
                    0,0,-1,-1, false);

// FxTexture objects can be selected into a graphics context
// the same way a Color is selected. This makes it easy to
// use textures as backgrounds for any component.

setBackground(new FxTexture(img[TEXTURE], FxTexture.STRETCH_NONE,
                             0,0,-1,-1,false, 100, 100, 100));

// In cases where you want an image stretched across a surface, you
// can force the texture to be drawn in a specified pixel dimension,
// regardless of what the original dimension of the image is. In the
// following example, the original image is stretched to 300 pixels
// wide by 100 pixels high.

fxt = new FxTexture(img[TEXTURE], FxTexture.STRETCH_ALL,
                    0,0,300,100, false, Color.cyan);

An FxGraphics object draws supported primitives with the same method calls you use when drawing with Color objects.

// Draw primitives using an FxTexture object.

fxGraf.setColor(fxt);

fxGraf.fillOval(varX, varY, variableWidth, variableHeight);
// or
fxGraf.fillPolygon(xPntArray, yPntArray, numPts);

The FxTexture class supports drawing partial textures according to a nine-rectangle grid. The following example shows how you can draw partial textures using the setUpdatedAreasMask method.

// Set an IFxTextureUpdate object for the texture. This
// interface supports the textureUpdated method.

fxt.setUpdateCallback(ifxtu);

// Set the visible areas drawing mask for the texture. This is a mask that
// defines which areas of the texture are drawn.

fxt.setUpdatedAreasMask(FxTexture.DRAW_TL + FxTexture.DRAW_TR +
                        FxTexture.DRAW_BL + FxTexture.DRAW_BR);

BaseColor
  |
  +--FxColor
    |
    +--FxFill
      |
      +--FxTexture

Constructors

FxTexture

public FxTexture(Image i);

Constructs a texture by using a given image. If the image cannot be drawn, the default color (0,0,0) is used instead.

Parameter | Description
i | The image object to use as the base of the texture.

FxTexture

public FxTexture(Image i, int s, int l, int t, int r, int b, boolean p, int
        red, int green, int blue);

Constructs a texture with a specific default color.

Parameter | Description
i | The image object to use as the basis of the texture.
s The value that handles image stretching. This value may be one of the following:
STRETCH_NONE
STRETCH_MIDDLE
STRETCH_OUTER
STRETCH_ALL
l | The left boundary.
t | The top boundary.
r | The right boundary. Set this value to -1 if the right boundary is the full width of the image.
b | The bottom boundary. Set this value to -1 if the bottom boundary is the full height of the image.
p | Set this value to true if the image should be pinned.
red | The amount of red in the color. The color (r,g,b) is used in the event that the texture cannot be drawn by using the given image.
green | The amount of green in the color.
blue | The amount of blue in the color.

FxTexture

public FxTexture(Image i, int s, int l, int t, int r, int b, boolean p,
        Color base);

Constructs a texture with a specific default Color object.

Parameter | Description
i | The image object to use as the basis of the texture.
s The value that handles image stretching. This value may be one of the following:
STRETCH_NONE
STRETCH_MIDDLE
STRETCH_OUTER
STRETCH_ALL
l | The left boundary.
t | The top boundary.
r | The right boundary. Set this value to -1 if the right boundary is the full width of the image.
b | The bottom boundary. Set this value to -1 if the bottom boundary is the full height of the image.
p | Set this value to true if the image should be pinned.
base | The Color object to use as the default should the texture fail to draw with the given image.

FxTexture

public FxTexture(Image i, int s, int l, int t, int r, int b, boolean p,
        FxFill base);

Constructs a texture by using a given image. In the event the image cannot be drawn, an FxFill object is used instead.

Parameter | Description
i | The image object.
s The value that handles image stretching. This value may be one of the following:
STRETCH_NONE
STRETCH_MIDDLE
STRETCH_OUTER
STRETCH_ALL
l | The left boundary.
t | The top boundary.
r | The right boundary. Set this value to -1 if the right boundary is the full width of the image.
b | The bottom boundary. Set this value to -1 if the bottom boundary is the full height of the image.
p | Set this value to true if the image is pinned.
base | The FxFill object to use as the base should the texture fail to draw using the given image.

FxTexture

public FxTexture(Image i, int s, int l, int t, int r, int b, boolean p);

Constructs a texture using an image as a base for the texture. In the event the image cannot be drawn, the default color (0,0,0) is used instead.

Parameter | Description
i | The image object.
s The value that handles image stretching. This may be one of the following:
STRETCH_NONE
STRETCH_MIDDLE
STRETCH_OUTER
STRETCH_ALL
l | The left boundary.
t | The top boundary.
r | The right boundary. Set this value to -1 if the right boundary is the full width of the image.
b | The bottom boundary. Set this value to -1 if the bottom boundary is the full height of the image.
p | Set this value to true if the image should be pinned.

Methods

drawScanLinesCallback

public boolean drawScanLinesCallback(FxGraphics g, boolean xChanging,
        int points[], int offset, int nPoints);

Draws scan lines by using an image as a fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if drawScanLines is called and if an FxTexture object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object used to draw the scan lines.
xChanging | The direction the line should be drawn (horizontally or vertically).
points | An array of points (expressed in x,y coordinates).
offset | The offset to use.
nPoints | The number of points in the array.

Overrides:

drawScanLinesCallback(FxGraphics,boolean,int[],int,int) in FxFill.

See Also: com.ms.fx.FxGraphics.drawScanLines, com.ms.fx.FxFill.drawScanLinesCallback

fillArcCallback

public boolean fillArcCallback(FxGraphics g, int x, int y, int width,
        int height, int startAngle, int arcAngle);

Draws a filled arc centered on the given (x,y) coordinates by using an image as a fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillArc is called and an FxTexture object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns false.

Parameter | Description
g | The graphics object used to draw the filled arc.
x | The x coordinate of the arc's origin.
y | The y coordinate of the arc's origin.
width | The width of the arc (in pixels).
height | The height of the arc (in pixels).
startAngle | The starting angle of the arc.
arcAngle | The angle of the arc.

Overrides:

fillArcCallback(FxGraphics,int,int,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillArc, com.ms.fx.FxFill.fillArcCallback

fillOvalCallback

public boolean fillOvalCallback(FxGraphics g, int x, int y, int width,
        int height);

Draws a filled oval by using an image as a fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillOval is called and if an FxTexture object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns false.

Parameter | Description
g | The graphics object used to draw the filled oval.
x | The upper-left x coordinate of the oval's bounding rectangle.
y | The upper-left y coordinate of the oval's bounding rectangle.
width | The width of the oval (in pixels).
height | The height of the oval (in pixels).

Overrides:

fillOvalCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillOval, com.ms.fx.FxFill.fillOvalCallback

fillPolygonCallback

public boolean fillPolygonCallback(FxGraphics g, int xPoints[],
        int yPoints[], int nPoints);

Draws a filled polygon by using an image as a fill color when called by an FxGraphics object.

Note Called by FxGraphics if fillPolygon is called and if an FxTexture object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns false.

Parameter | Description
g | The graphics object to use to draw the filled polygon.
xPoints | An array containing the polygon x coordinates.
yPoints | An array containing the polygon y coordinates.
nPoints | The number of points in the polygon.

Overrides:

fillPolygonCallback(FxGraphics,int[],int[],int) in FxFill.

See Also: java.awt.Graphics.fillPolygon, com.ms.fx.FxFill.fillPolygonCallback

fillRectCallback

public boolean fillRectCallback(FxGraphics g, int xStart, int yStart,
        int width, int height);

Draws a filled rectangle by using an image as a fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillRect is called and if an FxTexture object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
g | The graphics object used to draw the filled rectangle.
xStart | The upper-left x coordinate of the rectangle.
yStart | The upper-left y coordinate of the rectangle.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).

Overrides:

fillRectCallback(FxGraphics,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillRect, com.ms.fx.FxFill.fillRectCallback

fillRoundRectCallback

public boolean fillRoundRectCallback(FxGraphics g, int x, int y, int width,
        int height, int arcWidth, int arcHeight);

Draws a filled rectangle with rounded edges by using an image as a fill color when called by an FxGraphics object.

Note This method is called by FxGraphics if fillRoundRect is called and an FxTexture object is the selected color. The callback methods are used internally and are not intended to be called by applications. They are made public so that derived classes can extend the callback functionality.

Return Value:

Returns false.

Parameter | Description
g | The graphics object.
x | The upper-left x coordinate of the rectangle.
y | The upper-left y coordinate of the rectangle.
width | The width of the rectangle (in pixels).
height | The height of the rectangle (in pixels).
arcWidth | The arc width of the rectangle's rounded edges.
arcHeight | The arc height of the rectangle's rounded edges.

Overrides:

fillRoundRectCallback(FxGraphics,int,int,int,int,int,int) in FxFill.

See Also: java.awt.Graphics.fillRoundRect, com.ms.fx.FxFill.fillRoundRectCallback

getBottomAxis

public int getBottomAxis();

Retrieves the bottom bound for the stretch and repeat factors.

Return Value:

Returns the bottom bound for the stretch and repeat factors.

getImage

public Image getImage();

Retrieves the image being used by the FxTexture object.

Return Value:

Returns the Image. If no image is currently associated with the FxTexture object, the method returns null.

getInner

public Rectangle getInner();

Retrieves the bounds of the inner Rectangle of the texture.

Return Value:

Returns the inner Rectangle of the texture.

getLeftAxis

public int getLeftAxis();

Retrieves the left bound for the stretch and repeat factors.

Return Value:

Returns the left bound for the stretch and repeat factors.

getPinOrigin

public boolean getPinOrigin();

Checks whether the image is pinned.

Return Value:

Returns true if the image is pinned; otherwise, returns false.

getRightAxis

public int getRightAxis();

Retrieves the right bound for the stretch and repeat factors.

Return Value:

Returns the right bound for the stretch and repeat factors.

getSnapDraw

public boolean getSnapDraw();

Checks whether partial images should be repeated.

Return Value:

Returns true if partial images should be repeated; otherwise, returns false.

getStretch

public int getStretch();

Checks if the image is stretched across the surface rather than being repeated.

Return Value:

Returns a value that determines if the image is stretched.

getTopAxis

public int getTopAxis();

Retrieves the top bound for the stretch and repeat factors.

Return Value:

Returns the top bound for the stretch and repeat factors.

getUpdatedAreasMask

public int getUpdatedAreasMask();

Retrieves a drawing mask for the currently visible areas.

Return Value:

Returns a mask for the currently visible areas.

See Also: setUpdatedAreasMask

imageUpdate

public boolean imageUpdate(Image img, int infoflags, int x, int y,
        int width, int height);

Determines when an image can be drawn. This method is called when information requested about the image becomes available.

Return Value:

Returns true if the image can be drawn; otherwise, returns false.

Parameter | Description
img | The image object.
infoflags | The flags controlling the method. Set this value to zero to use the default values for the ImageObserver object.
x | The x coordinate of the image's starting point.
y | The y coordinate of the image's starting point.
width | The width of the image (in pixels).
height | The height of the image (in pixels).

See Also: java.awt.image.ImageObserver

setAxis

public void setAxis(int l, int t, int r, int b);

Sets the bounds for the stretch and repeat factors.

Return Value:

No return value.

Parameter | Description
l | The left bound.
t | The top bound.
r | The right bound.
b | The bottom bound.

setPinOrigin

public void setPinOrigin(boolean b);

Sets whether the image should be pinned.

Return Value:

No return value.

Parameter | Description
b | Set to true if the image should be pinned.

setSnapDraw

public void setSnapDraw(boolean b);

Determines whether partial images should be repeated.

Return Value:

No return value.

Parameter | Description
b | Set to true if partial images should be repeated across a surface.

setStretch

public void setStretch(int s);

Sets the stretch or the repeat value.

Return Value:

No return value.

Parameter | Description
s | The value that determines if the image is stretched or repeated.

setUpdateCallback

public void setUpdateCallback(IFxTextureUpdate tu);

Sets an IFxTextureUpdate callback instance. The IFxTextureUpdate.textureUpdated callback method is called with the nine UIGridLayout or UIGridBagLayout grid areas after every drawing operation. If one of the grid's lines is not set, the corresponding rectangles will be removed from the Rectangle array.

Return Value:

No return value.

Parameter | Description
tu | The IFxTextureUpdate callback interface to set for the texture.

setUpdatedAreasMask

public void setUpdatedAreasMask(int mask);

Sets a mask for the currently visible areas. You can set this mask so that only certain areas of an FxTexture are drawn.

Return Value:

No return value.

Parameter Description
mask The mask for the visible areas. This can be one or a combination of the following masks.
DRAW_TL DRAW_TOP DRAW_TR
DRAW_LEFT DRAW_CENTER DRAW_RIGHT
DRAW_BL DRAW_BOTTOM DRAW_TR

See Also: getUpdateAreasMask

size

public Dimension size();

Retrieves the size of the Image that is associated with the texture.

Return Value:

Returns the Dimension of the image.

Fields

DRAW_BL
The value used in setVisibleArea to draw the lower-left corner of a grid.
DRAW_BOTTOM
The value used in setVisibleArea to draw the bottom row of a grid.
DRAW_BR
The value used in setVisibleArea to draw the lower-right corner of a grid.
DRAW_CENTER
The value used in setVisibleArea to draw the center of a grid.
DRAW_LEFT
The value used in setVisibleArea to draw the left bar of a grid.
DRAW_RIGHT
The value used in setVisibleArea to draw the right bar of a grid.
DRAW_TL
The value used in setVisibleArea to draw the upper-left corner of a grid.
DRAW_TOP
The value used in setVisibleArea to draw the top row of a grid.
DRAW_TR
The value used in setVisibleArea to draw the upper-right corner of a grid.
REPEAT_PIN
When repeating, tie the bitmap to the logical corner (0,0) instead of the upper-left corner of the requested area.
SNAP_EDGES
When repeating, if the draw operation results in a partial drawing of an edge, shrink the image to fix exactly.
STRETCH_ALL
When filling onto a surface, the texture is stretched to fit.
STRETCH_MIDDLE
When filling onto a surface, only the middle area is stretched to fit. The border areas will retain their original dimensions.
STRETCH_NONE
No stretching is done to fill the required area on the target surface. The image contained within the texture is repeated to fill the space. If this flag is set, any guidelines will be ignored.
STRETCH_OUTER
When filling onto a surface, only the middle area is repeated to fit. The border areas will be stretched to fit the surface.


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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.


Class GlyphMetrics

public class GlyphMetrics
{
  // Fields
  public int blackBoxX;
  public int blackBoxY;
  public int cellIncX;
  public int cellIncY;
  public Point glyphOrigin;
}

This class defines the outline metrics of a character.

Fields

blackBoxX
The width of the smallest rectangle that completely encloses the glyph (its black box).
blackBoxY
The height of the smallest rectangle that completely encloses the glyph (its black box).
cellIncX
The horizontal distance from the origin of the current character cell to the origin of the next character cell.
cellIncY
The vertical distance from the origin of the current character cell to the origin of the next character cell.
glyphOrigin
The x and y coordinates of the top-left corner of the smallest rectangle that completely encloses the glyph.


Class GlyphOutline

public class GlyphOutline
{
  // Fields
  public GlyphMetrics gm;
  public OutlinePolygon polygons[];

  // Constructors
  public GlyphOutline();
}

This class holds the outline information of a character.

Constructors

GlyphOutline

public GlyphOutline();

Creates and initializes an outline object.

Fields

gm
The base GlyphMetrics of the polygon outline.
polygons[]
An array of outlines that comprise the character.


Class OutlineCurve

public class OutlineCurve
{
  // Fields
  public FloatPoint points[];
  public final static int PRIM_LINE;
  public final static int PRIM_QSPLINE;
  public int type;
}

This class, which defines the curves of an outline, is used by the OutlinePolygon class to define curves of character outlines.

Fields

points[]
Indicates the array of coordinates that define the curve.
PRIM_LINE
Indicates that the curve is a polyline.
PRIM_QSPLINE
Indicates that the curve is a Bezier spline.
type
Indicates the type of curve. This field may be PRIM_LINE or PRIM_QSPLINE.


Class OutlinePolygon

public class OutlinePolygon
{
  // Fields
  public OutlineCurve curves[];
  public FloatPoint fxStart;
  public final static int OUTLINE_POLYBEZIER;
  public final static int OUTLINE_TRUETYPE;
  public final static int OUTLINE_UNDEFINED;
  public int type;

  // Constructors
  public OutlinePolygon();
  public OutlinePolygon(int theType);
}

This class, which defines a polygon outline, is used by the GlyphOutline class to supply an array of outlines that comprise a character.

Constructors

OutlinePolygon

public OutlinePolygon();

Creates a OutlinePolygon object with its type set to OUTLINE_UNDEFINED.

OutlinePolygon

public OutlinePolygon(int theType);

Creates an OutlinePolygon object and initializes the the character outline type.

Parameter | Description
theType | The type of curves used in the outline polygon. This may be OUTLINE_TRUETYPE, OUTLINE_POLYBEZIER, or OUTLINE_UNDEFINED.

Fields

curves[]
The curves on the outline.
fxStart
A floating point that serves as the starting point of the outline.
OUTLINE_POLYBEZIER
Indicates that the outline is comprised of Bezier curves that have two control points.
OUTLINE_TRUETYPE
A constant indicating that the outline curves are three-point Bezier. (This means that the Bezier curves have one control point and two end points. This type of curve is used by FontX outline fonts.)
OUTLINE_UNDEFINED
Indicates that the outline is of a system-undefined type.
type
The type of the character outline.


Class Region

public class Region implements Cloneable
{
  // Fields
  final public static int AND;
  final public static int COMPLEX;
  final public static int DIFF;
  final public static int EMPTY;
  final public static int OR;
  final public static int SIMPLE;
  final public static int XOR;

  // Constructors
  public Region();
  public Region(int x, int y, int width, int height);
  public Region(Rectangle rect);
  public Region(Region other);
  public Region(Region srcA, Region srcB, int operation)
        throws IllegalArgumentException;
  public Region(Rectangle rectA, Rectangle rectsB[], int operation)
        throws IllegalArgumentException;
  public Region(Rectangle rectA, Rectangle rectsB[], int count, int
        operation) throws IllegalArgumentException;

  // Methods
  public final Object clone();
  public final Region combine(Region other, int operation)
        throws IllegalArgumentException;
  public final Region combine(Rectangle rect, int operation) throws
        IllegalArgumentException;
  public final int complexity();
  public final boolean contains(int x, int y);
  public final boolean contains(Point pt);
  public final Region copy(Region other)
        throws IllegalArgumentException;
  public final Region empty();
  public final boolean equals(Region other);
  public final boolean equals(Object other);
  public final boolean fillBounds(Rectangle rect);
  public final Rectangle getBounds();
  public final int[][] getGeometry();
  public final int hashCode();
  public final boolean intersects(int x, int y, int width,
        int height);
  public final boolean intersects(Rectangle rect);
  public final Region invert() throws IllegalArgumentException;
  public final boolean isEmpty();
  public final Region offset(int deltaX, int deltaY);
  public final Region offset(Point delta);
  public final Region set(int x, int y, int width, int height);
  public final Region set(Rectangle rect);
  public final String toString();
}

This class is a data structure that represents arbitary shapes, and is used to support windowless controls in the Application Foundation Classes.

Constructors

Region

public Region();

Constructs an empty region.

Region

public Region(int x, int y, int width, int height);

Creates a rectangular region.

Parameter | Description
x | The region's upper-left x coordinate.
y | The region's upper-left y coordinate.
width | The width of the region (in pixels).
height | The height of the region (in pixels).

Region

public Region(Rectangle rect);

Creates a region from a Rectangle.

Parameter | Description
rect | The rectangle used to initialize the region.

Region

public Region(Region other);

Creates a region with geometry identical to the given Region parameter.

Parameter | Description
other | The Region to copy from.

Region

public Region(Region srcA, Region srcB, int operation)
        throws IllegalArgumentException;

Creates a region that is the combination of two other regions.

Parameter | Description
srcA | The first source region.
srcB | The second source region.
operation The operation used to combine the source regions. These operations may be one of the following:
AND
Produces the intersection of the source operands.
OR
Produces the union of the source operands.
XOR
Produces the exclusive OR of the source operands.
DIFF
Subtracts one or more source operands from another.

Exceptions:

IllegalArgumentException

Region

public Region(Rectangle rectA, Rectangle rectsB[], int operation)
        throws IllegalArgumentException;

Creates a region from an arbitrary set of rectangles.

Parameter | Description
rectA | The first source rectangle.
rectsB | An array of additional source rectangles.
operation The operation used to combine the rectangles. These operations may be one of the following:
AND
Produces the intersection of the source operands.
OR
Produces the union of the source operands.
XOR
Produces the exclusive OR of the source operands.
DIFF
Subtracts one or more source operands from another.

Exceptions:

IllegalArgumentException

Region

public Region(Rectangle rectA, Rectangle rectsB[], int count,
        int operation) throws IllegalArgumentException;

Creates a region from an arbitrary set of rectangles.

Parameter | Description
rectA | The first source rectangle.
rectsB | An array of additional source rectangles.
count | The number of rectangles.
operation The operation used to combine the rectangles. These operations may be one of the following:
AND
Produces the intersection of the source operands.
OR
Produces the union of the source operands.
XOR
Produces the exclusive OR of the source operands.
DIFF
Subtracts one or more source operands from another.

Exceptions:

IllegalArgumentException

Methods

clone

public final Object clone();

Creates a clone of the region.

Return Value:

Returns a copy of the region.

combine

public final Region combine(Region other, int operation)
        throws IllegalArgumentException;

Combines the region with another region.

Return Value:

Returns the Region combined with the one specified by other.

Parameter | Description
other | The region to combine the current region with.
operation The operation used to combine the regions. This operation may be one of the following:
AND
Produces the intersection of the source operands.
OR
Produces the union of the source operands.
XOR
Produces the exclusive OR of the source operands.
DIFF
Subtracts one or more source operands from another.

Exceptions:

IllegalArgumentException

combine

public final Region combine(Rectangle rect, int operation)
        throws IllegalArgumentException;

Combines the region with a specified rectangle.

Return Value:

Returns the Region combined with the rectangle specified by rect.

Parameter | Description
rect | The rectangle to combine the region with.
operation The operation used to combine the shapes. This operation may be one of the following:
AND
Produces the intersection of the source operands.
OR
Produces the union of the source operands.
XOR
Produces the exclusive OR of the source operands.
and DIFF
Subtracts one or more source operands from another.

Exceptions:

IllegalArgumentException

complexity

public final int complexity();

Retrieves the complexity of the region.

Return Value:

Returns an integer describing the region's complexity.

Remarks:

A region's complexity is either EMPTY, SIMPLE or COMPLEX. An EMPTY region contains no space and has no bounds. A SIMPLE region describes a rectangular shape equal to its bounding box. A COMPLEX region describes a nonrectangular shape.

contains

public final boolean contains(int x, int y);

Determines whether the specified point lies within the region.

Return Value:

Returns true if the specified position is inside the region; otherwise, returns false.

Parameter | Description
x | The x coordinate of the point to test.
y | The y coordinate of the point to test.

contains

public final boolean contains(Point pt);

Determines whether the specified Point lies within the region.

Return Value:

Returns true if the specified point is inside the region; otherwise, returns false.

Parameter | Description
pt | The point to test.

copy

public final Region copy(Region other) throws IllegalArgumentException;

Copies the geometry of another region to the current region.

Return Value:

Returns the Region with a copy of other's geometry.

Parameter | Description
other | The region to copy from.

Exceptions:

IllegalArgumentException

empty

public final Region empty();

Empties a region.

Return Value:

Returns the Region emptied and set to null.

equals

public final boolean equals(Region other);

Tests a region for equality with another region.

Return Value:

Returns true if the geometry of the two regions are identical; otherwise, return false.

Parameter | Description
other | The region to compare the current region with.

equals

public final boolean equals(Object other);

Tests a region for equality with another object.

Return Value:

Returns true if the geometry's of the two regions are identical; otherwise, returns false.

Parameter | Description
other | The Object to compare with.

fillBounds

public final boolean fillBounds(Rectangle rect);

Fills the rectangle with the region's bounds.

Return Value:

Returns true if the region is not empty and the rectangle is filled; otherwise, returns false.

Parameter | Description
rect | The rectangle to be filled in.

Remarks:

The design of Rectangle prevents it from representing all possible rectangles in integer space.

getBounds

public final Rectangle getBounds();

Retrieves the bounding rectangle of the region.

Return Value:

Returns a Rectangle identifying the bounding box; returns null if the region is empty.

Remarks:

The design of Rectangle prevents it from representing all possible rectangles in integer space.

getGeometry

public final int[][] getGeometry();

Retrieves a description of the geometry of the region.

Return Value:

Returns a description of the region's geometry.

Remarks:

The description of the region's geometry is a two-dimensional array (an array of arrays of ints). Each sub-array represents a horizontal strip of the region's geometry. The first two values in a strip represent its upper and lower coordinates. The remaining values in the strip are pairs of coordinates that identify the left and right bounds of space inside the region.

hashCode

public final int hashCode();

Computes a hash code of the region's geometry.

Return Value:

Returns an integer hash code based on the current geometry of the region.

intersects

public final boolean intersects(int x, int y, int width, int height);

Determines whether the specified rectangle intersects a Region

Return Value:

Returns true if the rectangle intersects a Region.

Parameter | Description
x | The upper-left x coordinate of the given rectangle.
y | The upper-left y coordinate of the given rectangle.
width | The rectangle width (in pixels).
height | The rectangle height (in pixels).

intersects

public final boolean intersects(Rectangle rect);

Determines whether the specified rectangle intersects a Region.

Return Value:

Returns true if the rectangle intersects a Region; otherwise, returns false.

Parameter | Description
rect | The Rectangle to test.

invert

public final Region invert() throws IllegalArgumentException;

Inverts the region.

Return Value:

Returns the inverted region.

Exceptions:

IllegalArgumentException

isEmpty

public final boolean isEmpty();

Tests whether a region is empty.

Return Value:

Returns true if the region is empty; otherwise, returns false.

offset

public final Region offset(int deltaX, int deltaY);

Translates a region through space.

Return Value:

Returns the offset Region.

Parameter | Description
deltaX | The distance to translate in x.
deltaY | The distance to translate in y.

Remarks:

The Region is not actually offset within this method; rather, the offsets are stored for later computation. This is efficient for operations in which you need to temporarily offset a Region, and then reset it back at a later time. Using this technique with the offset method, you won't incur the overhead of translating an entire region twice.

offset

public final Region offset(Point delta);

Translates a region through space.

Return Value:

Returns the offset Region.

Parameter | Description
delta | The distance to translate in x and y.

Remarks:

The Region is not actually offset within this method; rather, the offsets are stored for later computation. This is efficient for operations in which you need to temporarily offset a Region, and then reset it back at a later time. Using this technique with the offset method, you won't incur the overhead of translating an entire region twice.

set

public final Region set(int x, int y, int width, int height);

Makes the region a simple rectangular region.

Return Value:

Returns a Region as a rectangle.

Parameter | Description
x | The region's upper-left x coordinate.
y | The region's upper-left y coordinate.
width | The width of the region (in pixels).
height | The height of the region (in pixels).

set

public final Region set(Rectangle rect);

Makes the region a simple rectangular region.

Return Value:

Returns a Region as a rectangle.

Parameter | Description
rect | The Rectangle that defines the region's new geometry.

toString

public final String toString();

Generates a string identifying the region.

Return Value:

Returns a String identifying the region.

Fields

AND
Produces the intersection of the source operands. This operation is used in the Region.combine method, as well as the Region class-combining constructors.
COMPLEX
Denotes a region with complex geometry. This is one of the values that may be returned from Region.complexity.
DIFF
Subtracts one or more source operands from another. This operation is used in the Region.combine method, as well as the Region class' combining constructors.
EMPTY
Denotes an empty region. This is one of the values that may be returned from Region.complexity.
OR
Produces the union of the source operands. This operation is used in the Region.combine method, as well as the Region class' combining constructors.
SIMPLE
Denotes a simple rectangular region. This is one of the values that may be returned from Region.complexity.
XOR
Produces the exclusive OR of the source operands. This operation is used in the Region.combine method, as well as the Region class' combining constructors.


Class txtRun

public class txtRun
{
  // Fields
  public int chars;
  public final static int EXTENDED_RUN;
  public int flags;
  public final static int HAS_TABS;
  public int idx;
  public txtRun next;
  public final static int RESET_X;
  public final static int VERT_ROTATED_RUN;

  // Constructors
  public txtRun();

  // Methods
  public int[] getGlyphIndices(int offs, int len);
}

This class manages text runs generated by the FxFormattedText class.

Note Formatted text holds runs of text built up every time the ensureNotDirty method of the FxFormattedText class is called. This formatting determines how the text is placed on the screen. The application may override these values by implementing the IFxTextCallback interface and manipulating the runs when the methods are called.

Constructors

txtRun

public txtRun();

Creates an empty text run.

Methods

getGlyphIndices

public int[] getGlyphIndices(int offs, int len);

Retrieves the glyph index values for the text run.

Return Value:

Returns Unicode values if the font does not support glyph indices.

Parameter | Description
offs | The offset to use from the buffer in FxText.
len | The length of the array.

Remarks:

This method enables you to access glyphs not represented in Unicode, such as combined characters in languages such as Hebrew and Arabic. It is also used for fonts with multiple representations of a glyph. Currently, this method returns null.

Fields

chars
The number of characters the run covers.
EXTENDED_RUN
Text run flag denoting an extended run. This flag is used by the fullTxtRun class.
flags
Text run flags, which may be EXTENDED_RUN, HAS_TABS, RESET_X, or VERT_ROTATED_RUN.
HAS_TABS
The text run flag denoting a text run that contains tabs.
idx
The index into the buffer held by the controlling FxFormattedText class.
next
A link to the next run in the list.
RESET_X
Text run flag that indicates the previous x is ignored and x is set to the origin.
VERT_ROTATED_RUN
Text run flag that indicates that non-CJK characters (those characters which are not in the range of Unicode Unified Ideographs) are drawn at 270 degrees. This is used in vertical writing.


Interface IFxGraphicsConstants

public interface IFxGraphicsConstants
{
  // Fields
  public static final int BDR_FLAT;
  public static final int BDR_INNER;
  public static final int BDR_OUTER;
  public static final int BDR_RAISED;
  public static final int BDR_RAISEDINNER;
  public static final int BDR_RAISEDOUTER;
  public static final int BDR_SUNKEN;
  public static final int BDR_SUNKENINNER;
  public static final int BDR_SUNKENOUTER;
  public static final int BF_ADJUST;
  public static final int BF_BOTTOM;
  public static final int BF_BOTTOMLEFT;
  public static final int BF_BOTTOMRIGHT;
  public static final int BF_DIAGONAL;
  public static final int BF_DIAGONAL_ENDBOTTOMLEFT;
  public static final int BF_DIAGONAL_ENDBOTTOMRIGHT;
  public static final int BF_DIAGONAL_ENDTOPLEFT;
  public static final int BF_DIAGONAL_ENDTOPRIGHT;
  public static final int BF_FLAT;
  public static final int BF_LEFT;
  public static final int BF_MIDDLE;
  public static final int BF_RECT;
  public static final int BF_RIGHT;
  public static final int BF_SOFT;
  public static final int BF_TOP;
  public static final int BF_TOPLEFT;
  public static final int BF_TOPRIGHT;
  public final static int CHAR_CLIP;
  public final static int CHAR_KERNING;
  public final static int CHAR_OPAQUE;
  public static final int EDGE_BUMP;
  public static final int EDGE_ETCHED;
  public static final int EDGE_RAISED;
  public static final int EDGE_SUNKEN;
}

This interface defines the constants used by the FxGraphics class.

Fields

BDR_FLAT
A flat border style.
BDR_INNER
An inner border style.
BDR_OUTER
An outer border style.
BDR_RAISED
A raised border style.
BDR_RAISEDINNER
A raised inner border style.
BDR_RAISEDOUTER
A raised outer border style.
BDR_SUNKEN
A sunken border style.
BDR_SUNKENINNER
A sunken inner border style.
BDR_SUNKENOUTER
A sunken outer border style.
BF_ADJUST
The border flag that adjusts a rectangle to be the rectangle remaining after the borders are drawn.
BF_BOTTOM
The bottom of the border rectangle.
BF_BOTTOMLEFT
The bottom and left side of the border rectangle.
BF_BOTTOMRIGHT
The bottom and right side of the border rectangle.
BF_DIAGONAL
The border flag for a diagonal.
BF_DIAGONAL_ENDBOTTOMLEFT
A diagonal border. The end point is the bottom-left corner of the rectangle; the origin is top-right corner.
BF_DIAGONAL_ENDBOTTOMRIGHT
A diagonal border. The end point is the bottom-right corner of the rectangle; the origin is top-left corner.
BF_DIAGONAL_ENDTOPLEFT
A diagonal border. The end point is the top-left corner of the rectangle; the origin is bottom-right corner.
BF_DIAGONAL_ENDTOPRIGHT
A diagonal border. The end point is the top-right corner of the rectangle; the origin is bottom-left corner.
BF_FLAT
A border flag for a flat border.
BF_LEFT
The left side of the border rectangle.
BF_MIDDLE
The border flag for the middle area of a border.
BF_RECT
The entire border rectangle.
BF_RIGHT
The right side of the border rectangle.
BF_SOFT
The border flag for a soft border.
BF_TOP
The top of the border rectangle.
BF_TOPLEFT
The top and left side of the border rectangle.
BF_TOPRIGHT
The top and right side of the border rectangle.
CHAR_CLIP
The clipping used in character drawing operations.
CHAR_KERNING
The kerning used in character drawing operations.
CHAR_OPAQUE
The opaquing used in character drawing operations.
EDGE_BUMP
A bumped edge (the opposite of an etched edge) style.
EDGE_ETCHED
An etched edge style.
EDGE_RAISED
A raised edge style.
EDGE_SUNKEN
A sunken edge style.


Interface IFxShape

public interface IFxShape extends Shape
{
  // Methods
  public boolean contains(Point p);
  public void draw(FxGraphics g);
  public int getBorderLength();
  public Rectangle getBounds();
  public Point getOrigin();
  public Point getPoint(int pt);
  public int[] getPointAndAngle(int pt);
  public int getPointAngle(int pt);
  public boolean includes(Point p);
  public boolean setOrigin(Point p);
  public void translate(int deltaX, int deltaY);
  public void updateBounds(int x, int y);
}

This interface defines methods for objects that represent a geometric shape.

Shape
  |
  +--IFxShape

Methods

contains

public boolean contains(Point p);

Determines whether a specific Point lies on or within the curve.

Return Value:

Returns true if the point is on or within the curve; otherwise, returns false.

Parameter | Description
p | The point to be tested.

Remarks:

If this is a closed shape, the method will return true for points contained within the curve.

draw

public void draw(FxGraphics g);

Draws a curve with the current graphics.

Return Value:

No return value.

Parameter | Description
g | The graphics object to use.

getBorderLength

public int getBorderLength();

Retrieves the length of the entire border of the shape.

Return Value:

Returns the length of the border.

Remarks:

For example, the border length of a circle is its circumference, and the border length of a rectangle is ((y1 - y2) x 2) + ((x1 - x2) x 2), and so on.

getBounds

public Rectangle getBounds();

Retrieves the bounding box of the shape.

Return Value:

Returns a Rectangle that defines the bounding box of the shape.

getOrigin

public Point getOrigin();

Locates the origin of a curve.

Return Value:

Returns the point used as the origin.

Remarks:

Use this method to locate the origin of a curve and use the returned Point as a basis for the getPoint method.

getPoint

public Point getPoint(int pt);

Locates a point that is n pixels from the origin of the curve.

Return Value:

Returns the point that is n pixels from the origin.

Parameter | Description
pt | The point to locate.

getPointAndAngle

public int[] getPointAndAngle(int pt);

Retrieves the coordinates and angle of the base of the normal vector at the requested point.

Return Value:

Returns an array of three integers: the x, y, and degrees values.

Parameter | Description
pt | The point to calculate the vector from.

getPointAngle

public int getPointAngle(int pt);

Locates the angle of the normal vector at this point.

Return Value:

Returns the angle of the normal vector at point pt.

Parameter | Description
pt | The point to calculate the angle from.

includes

public boolean includes(Point p);

Determines whether the specified point is on the curve.

Return Value:

Returns true if the point is on the curve; otherwise, returns false.

Parameter | Description
p | The point to be tested.

Remarks:

If the curve represents a closed area, the method will not return true for a point within the enclosed boundaries. Under these circumstances, the contains method should be used.

setOrigin

public boolean setOrigin(Point p);

Sets a new origin for the curve.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
p | The point to set as the new origin.

Remarks:

If the point is not on the curve, the curve may not be set to the new origin. The origin, which is used for plotting operations on the curve, is not equivalent to the point nearest the origin (0,0).

translate

public void translate(int deltaX, int deltaY);

Translates the vertices by deltaX and deltaY.

Return Value:

No return value.

Parameter | Description
deltaX | The amount to move the x coordinates.
deltaY | The amount to move the y coordinates.

updateBounds

public void updateBounds(int x, int y);

Updates the boundaries.

Return Value:

No return value.

Parameter | Description
x | The new x coordinate of the boundary.
y | The new y coordinate of the boundary.


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.

Parameter | Description
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.

Parameter | Description
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.

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

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.

Parameter | Description
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.

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

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.

Parameter Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

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.

setNoActivate

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.

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.

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.


Interface IFxTextCallback

public interface IFxTextCallback
{
  // Methods
  public abstract void endTextPaint(Graphics g);
  public abstract void endTextUpdate(Graphics g, txtRun runs);
}

The callback interface of FxFormattedText updates the owner object and enables it to modify text runs.

Methods

endTextPaint

public abstract void endTextPaint(Graphics g);

This method is called when FxFormattedText ends text painting.

Return Value:

No return value.

Parameter | Description
g | The graphic object used.

endTextUpdate

public abstract void endTextUpdate(Graphics g, txtRun runs);

This method is called when the FxFormattedText.ensureNotDirty has finished text updates.

Return Value:

No return value.

Parameter | Description
g | The graphic object used.
runs | The text run to end updates for.


Interface IFxTextConstants

public interface IFxTextConstants
{
  // Fields
  public static final char BKSP;
  public static final char CR;
  public static final char DEL;
  public static final int DIRLAYOUT;
  public static final int htaCenter;
  public static final int htaJustified;
  public static final int htaLeft;
  public static final int htaRight;
  public static final int htaScriptDefault;
  public static final int htaStretch;
  public static final char LF;
  public final static int OPAQUE_BODY;
  public final static int OPAQUE_POST;
  public final static int OPAQUE_PRIOR;
  public static final int SCRIPT_DEF;
  public static final char TAB;
  public static final int tdBT_LR;
  public static final int tdBT_RL;
  public static final int tdHebrewNormal;
  public static final int tdJapanTradNormal;
  public static final int tdLatinNormal;
  public static final int tdLeftToRightReading;
  public static final int tdLR_BT;
  public static final int tdLR_TB;
  public static final int tdMongolianNormal;
  public static final int tdRightToLeftReading;
  public static final int tdRL_BT;
  public static final int tdRL_TB;
  public static final int tdScriptDefault;
  public static final int tdTB_LR;
  public static final int tdTB_RL;
  public static final int tdVisualLayout;
  public static final int VISUAL_DEF;
  public static final int vtaBaseline;
  public static final int vtaBottom;
  public static final int vtaCenter;
  public static final int vtaScriptDefault;
  public static final int vtaStretch;
  public static final int vtaTop;
  public static final int wwCleanEdges;
  public static final int wwKeepWordIntact;
  public static final int wwMask;
  public static final int wwNone;
  public static final int wwTypeMask;
  public static final int wwVirtualRectEnd;
  public static final int wwVirtualRectSide;
  public static final int wwWrap;
}

This interface contains constants used in the text processing classes.

Fields

BKSP
A backspace.
CR
A carriage return.
DEL
A delete.
DIRLAYOUT
The direction layout.
htaCenter
The text is horizontally aligned to the center.
htaJustified
The horizontal text alignment is justified (currently not implemented).
htaLeft
The text is horizontally aligned to the left.
htaRight
The text is horizontally aligned to the right.
htaScriptDefault
The script default horizontal text alignment.
htaStretch
Horizontal text alignment stretch (currently not implemented).
LF
A line feed.
OPAQUE_BODY
Used by FxFormattedText objects to opaque the body of the text.
OPAQUE_POST
Used by FxFormattedText objects for opaquing text after the current textposition.
OPAQUE_PRIOR
Used by FxFormattedText objects for opaquing text prior to the current text position.
SCRIPT_DEF
The script default.
TAB
A tab.
tdBT_LR
The text direction is from bottom to top and from left to right.
tdBT_RL
The text direction is from bottom to top and from right to left.
tdHebrewNormal
The text direction is Hebrew Normal (right to left and top to bottom).
tdJapanTradNormal
Text direction is Japanese Traditional Normal (bottom to top and left to right).
tdLatinNormal
The text direction is Latin Normal (left to right and top to bottom).
tdLeftToRightReading
The text is read from left to right.
tdLR_BT
The text direction is from left to right and from bottom to top.
tdLR_TB
The text direction is from left to right and top to bottom (tdLatinNormal is an example of this).
tdMongolianNormal
The text direction is Mongolian Normal (bottom to top and right to left).
tdRightToLeftReading
The text is read from right to left.
tdRL_BT
The text direction is from right to left and from bottom to top.
tdRL_TB
The text direction is from right to left and from top to bottom.
tdScriptDefault
The default text direction for the current location.
tdTB_LR
The text direction is from top to bottom and from left to right.
tdTB_RL
The text direction is from top to bottom and from right to left.
tdVisualLayout
The current language uses a visual layout different from the logical layout. This is significant for languages such as Hebrew, which are read from right to left.
VISUAL_DEF
The visual default.
vtaBaseline
The text is vertically aligned to the baseline.
vtaBottom
The text is vertically aligned to the bottom.
vtaCenter
The text is vertically aligned to the center.
vtaScriptDefault
The script default vertical text alignment.
vtaStretch
The vertical text alignment stretch (currently not implemented).
vtaTop
The text is vertically aligned to the top.
wwCleanEdges
The word wrap wraps by using clean edges.
wwKeepWordIntact
The word wrap keeps words intact.
wwMask
The word wrap bitmask.
wwNone
The word wrap is not used.
wwTypeMask
The word wrap uses a type mask.
wwVirtualRectEnd
The word wrap wraps the end by using a virtual rectangle.
wwVirtualRectSide
The word wrap wraps the side by using a virtual rectangle.
wwWrap
The word wrap is used.


Interface IFxTextureUpdate

public interface IFxTextureUpdate
{
  // Methods
  public void textureUpdated(FxGraphics g,
        Rectangle updatedRects[], int drawingMask);
}

This interface defines a callback method that is used when a texture is complete.

Methods

textureUpdated

public void textureUpdated(FxGraphics g, Rectangle updatedRects[],
        int drawingMask);

Updates a texture with the given graphics object and array of Rectangle objects that represent areas of the texture to update.

Return Value:

No return value.

Parameter | Description
g | The FxGrpahics object to use.
updatedRects | An array of Rectangles that define which parts of the texture need to be drawn.
drawingMask The drawing mask for the texture. This can be one or a combination of the following masks.
DRAW_TL | DRAW_TOP | DRAW_TR
DRAW_LEFT | DRAW_CENTER | DRAW_RIGHT
DRAW_BL | DRAW_BOTTOM | DRAW_TR

See Also: com.ms.fx.FxTexture


Interface PeerConstants

public interface PeerConstants
{
  // Fields
  public final static int COLORTYPE_NONE;
  public final static int COLORTYPE_NORMAL;
  public final static int COLORTYPE_SYSCOLOR;
  public final static int COLORTYPE_TEXTURE;
  public final static int COLORTYPE_UNKNOWN;
  public final static int ETO_CLIPPED;
  public final static int ETO_OPAQUE;
  public final static int ETO_WIDECHAR;
}

This interface defines basic color and text out constants used throughout the com.ms.fx package.

Fields

COLORTYPE_NONE
No color type is defined.
COLORTYPE_NORMAL
The color is a normal color type.
COLORTYPE_SYSCOLOR
The color is a reserved system color.
COLORTYPE_TEXTURE
The color is a texture color type (for example, an FxTexture object).
COLORTYPE_UNKNOWN
An unknown color type.
ETO_CLIPPED
An Extended Text Out constant that specifies that text is clipped to a rectangle.
ETO_OPAQUE
An Extended Text Out constant that specifies that the current background color fills the rectangle.
ETO_WIDECHAR
An Extended Text Out constant that specifies that the text is comprised of wide characters.


About com.ms.ui

The com.ms.ui package provides cross-platform access to user interface controls.

Classes

Class AwtUIApplet
This class is a bridge class that is used in conjunction with the UIApplet class to enable an AFC applet to run in an AWT environment.
Class AwtUIBand
This class implements the functionality of a UIBand object in an AWT-based control.
Class AwtUIBandBeanInfo
This class is for internal use only.
Class AwtUIBandBox
This class implements the functionality of a UIBandBox object in an AWT-based control.
Class AwtUIBandBoxBeanInfo
This class is for internal use only.
Class AwtUIButton
This class implements the functionality of a UIButton object in an AWT-based control.
Class AwtUICheckButton
This class implements the functionality of a UICheckButton object in an AWT-based control.
Class AwtUICheckButtonBeanInfo
This class is for internal use only.
Class AwtUIChoice
This class implements the functionality of a UIChoice object in an AWT-based control.
Class AwtUIChoiceBeanInfo
This class is for internal use only.
Class AwtUIColumnViewer
This class implements the functionality of a UIColumnViewer object in an AWT-based control.
Class AwtUIControl
This class implements an abstract AWT-based control that hosts a UI control.
Class AwtUIControlBeanInfo
This class is for internal use only.
Class AwtUIDrawText
This class implements the functionality of a UIDrawText object in an AWT-based control.
Class AwtUIDrawTextBeanInfo
This class is for internal use only.
Class AwtUIEdit
This class implements the functionality of a UIEdit object in an AWT-based control.
Class AwtUIEditBeanInfo
This class is for internal use only.
Class AwtUIGraphic
This class implements the functionality of a UIGraphic object in an AWT-based control.
Class AwtUIGraphicBeanInfo
This class is for internal use only.
Class AwtUIHost
This class links AWT with AFC.
Class AwtUIList
This class implements the functionality of a UIList object in an AWT-based control.
Class AwtUIListBeanInfo
This class is for internal use only.
Class AwtUIMarquee
This class implements the functionality of a UIMarquee object in an AWT-based control.
Class AwtUIMarqueeBeanInfo
This class is for internal use only.
Class AwtUIMenuList
This class implements the functionality of a UIMenuList object in an AWT-based control.
Class AwtUIPanel
This class implements the functionality of a UIPanel object in an AWT-based container.
Class AwtUIProgress
This class implements the functionality of a UIProgress object in an AWT-based control.
Class AwtUIProgressBeanInfo
This class is for internal use only.
Class AwtUIPushButton
This class implements the functionality of a UIPushButton object in an AWT-based control.
Class AwtUIPushButtonBeanInfo
This class is for internal use only.
Class AwtUIRadioButton
This class implements the functionality of a UIRadioButton object in an AWT-based control.
Class AwtUIRadioButtonBeanInfo
This class is for internal use only.
Class AwtUIRepeatButton
This class implements the functionality of a UIRepeatButton object in an AWT-based control.
Class AwtUIRepeatButtonBeanInfo
This class is for internal use only.
Class AwtUIScrollBar
This class implements the functionality of a UIScrollBar object in an AWT-based control.
Class AwtUIScrollBarBeanInfo
This class is for internal use only.
Class AwtUIScrollViewer
This class implements the functionality of a UIScrollViewer object in an AWT-based control.
Class AwtUISplitViewer
This class implements the functionality of a UISplitViewer object in an AWT-based control.
Class AwtUIStatus
This class implements the functionality of a UIStatus object in an AWT-based control.
Class AwtUIStatusBeanInfo
This class is for internal use only.
Class AwtUITabList
This class implements the functionality of a UITabList object in an AWT-based control.
Class AwtUITabListBeanInfo
This class is for internal use only.
Class AwtUITabViewer
This class implements the functionality of a UITabViewer object in an AWT-based control.
Class AwtUIText
This class implements the functionality of a UIText object in an AWT-based control.
Class AwtUITextBeanInfo
This class is for internal use only.
Class AwtUITree
This class implements the functionality of a UITree object in an AWT-based control.
Class AwtUITreeBeanInfo
This class is for internal use only.
Class UIApplet
This class provides a container for implementing an applet.
Class UIAwtHost
This class is an AWT host control that enables AWT-based components to be used in AFC containers.
Class UIBand
This class implements a moveable band of buttons.
Class UIBandBox
This class implements a band box control.
Class UIBandThumb
This class implements a band thumb control.
Class UIBarLayout
This class implements a layout manager for a bar object.
Class UIBorderLayout
This class implements an extended border layout manager.
Class UIButton
This class implements an abstract button control.
Class UIButtonBar
This class implements a container for a set of UIPushButton objects.
Class UICanvas
This class implements a canvas control.
Class UICardLayout
This class is a layout manager used to place components on top of one another, showing only one of them at any given time (similar to cascading windows).
Class UICheckButton
This class implements a check box button control.
Class UICheckGroup
This class implements a group box control for a list of UICheckButton objects.
Class UIChoice
This class implements a choice control (combo box).
Class UIColorDialog
This class displays a dialog window from which the user can select a color.
Class UIColumnHeader
This class manages column headers.
Class UIColumnViewer
This class implements a scrollable column viewer control.
Class UIComponent
This class implements a stateless component.
Class UIContainer
This class implements a stateless container.
Class UIContextMenu
This class implements a context menu or shortcut menu that manages a vector of buttons, one of which is a default.
Class UIDialog
This class implements a dialog window.
Class UIDialogMapping
This class maps pixels to dialog logical units (DLUs).
Class UIDragDrop
This class implements the beginDrag drag-and-drop API for AFC objects.
Class UIDrawText
This class manages the display of read-only text.
Class UIEdit
This class implements an edit control.
Class UIEditChoice
This class implements an editable choice control (combo box).
Class UIExpandButton
This class implements the expand button of a tree control.
Class UIFindReplaceDialog
This class implements a find-and-replace dialog window.
Class UIFixedFlowLayout
This class implements a fixed-width flow layout manager.
Class UIFlowLayout
This class implements an extended flow layout manager.
Class UIFontDialog
This class displays a dialog window from which the user can select a font.
Class UIFrame
This class implements a frame.
Class UIGraphic
This class implements a static graphic control.
Class UIGridBagConstraints
This class is used to specify constraint values for components laid out using the UIGridBagLayout class.
Class UIGridBagLayout
This class implements a frame manager with a row by column format or grid for placing components.
Class UIGridLayout
This class implements an extended grid layout manager.
Class UIGroup
This class implements a group box control.
Class UIHeaderRow
This class implements a header row.
Class UIItem
This class implements a static item control that displays both a graphical image and text.
Class UILayoutManager
This class implements an abstract layout manager with default keyboard handling.
Class UILine
This class implements painting a single separator line.
Class UIList
This class implements a list control.
Class UIMarquee
This class implements a marquee control.
Class UIMenuButton
This class implements a menu button control.
Class UIMenuItem
This class implements a menu item control.
Class UIMenuLauncher
This class implements an abstract menu launcher control.
Class UIMenuList
This class implements a menu list control.
Class UIMessageBox
This class implements a message box window.
Class UIPanel
This class implements a container for multiple components.
Class UIProgress
This class implements a progress monitoring control.
Class UIPropertyDialog
This class implements a property dialog window.
Class UIPropertyPage
This class implements an abstract property page.
Class UIPushButton
This class implements a push button control.
Class UIRadioButton
This class implements a radio button control.
Class UIRadioGroup
This class implements a group box control for a list of UIRadioButton objects.
Class UIRepeatButton
This class implements a repeating push button control.
Class UIRoot
This class is for internal use only.
Class UIRow
This class implements a row control.
Class UIRowLayout
This class implements a layout manager for a row of objects or columns.
Class UIScroll
This class implements a scroll track control.
Class UIScrollBar
This class implements a scroll bar control.
Class UIScrollThumb
This class implements a scroll thumb control.
Class UIScrollViewer
This class implements a scroll viewer control.
Class UISelector
This class implements an abstract selector control.
Class UISingleContainer
This class implements a container for a single header component.
Class UISlider
This class implements a slider control.
Class UISpinner
This class implements a spinner control and its buttons.
Class UISpinnerEdit
This class implements a spin box control with its associated buttons and edit box.
Class UISplitLayout
This class implements a layout manager for a split viewer control.
Class UISplitViewer
This class implements a split viewer control.
Class UIStateComponent
This class implements a component having different states.
Class UIStateContainer
This class implements a container having different states.
Class UIStatic
This class implements an abstract static control.
Class UIStatus
This class implements a status bar control.
Class UITab
This class implements a tab control.
Class UITabLayout
This class implements a layout manager for a collection of tab controls and their pages.
Class UITabList
This class manages a collection of tabs.
Class UITabListLayout
This class implements a layout manager for a collection of tab controls.
Class UITabViewer
This class implements a tab viewer control.
Class UIText
This class implements a static text control.
Class UIThreePanelLayout
This class implements a layout manager for three panels, consisting of an image, a content component, and a set of buttons.
Class UIThumb
This class implements a thumb control.
Class UITip
This class is for internal use only.
Class UITree
This class implements a tree control.
Class UITreeLayout
This class implements a layout manager for tree nodes.
Class UIVerticalFlowLayout
This class implements a vertical flow layout manager.
Class UIViewer
This class implements a viewer control.
Class UIWindow
This class implements a top-level window.
Class UIWinEvent
This class implements a window event notification method.
Class UIWizard
This class implements a wizard dialog box that maintains a history.
Class UIWizardStep
This class implements a wizard page.

Interfaces

Interface IAwtUIAdjustable
This interface extends the Adjustable interface so that AFC classes may implement its functionality for both JDK 1.1 and JDK 1.0.2-compatible Virtual Machines.
Interface IAwtUIItemSelectable
This interface extends the ItemSelectable interface so that AFC classes may implement its functionality for both JDK 1.1 and JDK 1.0.2-compatible Virtual Machines.
Interface IUIAccessible
This interface is used to access control information that could otherwise be retrieved only by viewing the graphical user interface (GUI).
Interface IUIBand
This interface is used to retrieve and set properties of band objects.
Interface IUIComponent
This interface defines methods associated with an AFC component.
Interface IUIContainer
This interface defines methods associated with a container class.
Interface IUILayoutManager
This interface defines methods associated with layout managers.
Interface IUIMenuLauncher
This interface is used to launch and cancel a pop-up menu.
Interface IUIPosition
This interface is used to expose a spatial position.
Interface IUIPropertyPage
This interface defines methods associated with property pages.
Interface IUIRootContainer
This interface is used by all root containers.
Interface IUIScroll
This interface defines methods for scrolling within a range.
Interface IUISelector
This interface is used to manage the selection of child components.
Interface IUITree
This interface defines methods associated with tree nodes.
Interface IUIWizardStep
This interface is used to display properties of wizard pages.
Interface IWinEvent
This interface defines methods associated with a window event class.

Hierarchy

Object
  |
  +--UILayoutManager (IUILayoutManager)
  |  |
  |  +--UIBarLayout
  |  |
  |  +--UIBorderLayout
  |  |
  |  +--UICardLayout
  |  |
  |  +--UIFixedFlowLayout
  |  |
  |  +--UIFlowLayout
  |  |
  |  +--UIGridBagLayout
  |  |
  |  +--UIGridLayout
  |  |
  |  +--UIRowLayout
  |  |
  |  +--UISplitLayout
  |  |
  |  +--UITabLayout
  |  |
  |  +--UITabListLayout
  |  |
  |  +--UIThreePanelLayout
  |  |
  |  +--UITreeLayout
  |  |
  |  +--UIVerticalFlowLayout
  |
  +--UIComponent (IUIComponent, IUIAccessible, ImageObserver, Cloneable)
  |  |
  |  +--UIStateComponent
  |  |  |
  |  |  +--UICanvas
  |  |     |
  |  |     +--UIAwtHost
  |  |     |
  |  |     +--UIDrawText (IFxTextConstants, IFxGraphicsConstants)
  |  |     |  |
  |  |     |  +--UIEdit
  |  |     |
  |  |     +--UIStatic
  |  |     |  |
  |  |     |  +--UIGraphic
  |  |     |  |
  |  |     |  +--UIItem
  |  |     |  |
  |  |     |  +--UIText
  |  |     |
  |  |     +--UILine
  |  |
  |  +--UIContainer (IUIContainer)
  |     |
  |     +--UIStateContainer
  |        |
  |        +--UIPanel
  |        |  |
  |        |  +--UIApplet
  |        |  |
  |        |  +--UIGroup
  |        |  |  |
  |        |  |  +--UICheckGroup
  |        |  |     |
  |        |  |     +--UIRadioGroup
  |        |  |
  |        |  +--UIChoice (IUISelector)
  |        |  |  |
  |        |  |  +--UIEditChoice (IUITextListener)
  |        |  |
  |        |  +--UIScrollViewer (IUIPosition)
  |        |  |  |
  |        |  |  +--UIColumnViewer
  |        |  |
  |        |  +--UIRow
  |        |  |  |
  |        |  |  +--UIHeaderRow
  |        |  |
  |        |  +--UISelector (IUISelector, TimerListener)
  |        |  |  |
  |        |  |  +--UIList
  |        |  |  |  |
  |        |  |  |  +--UIMenuList
  |        |  |  |     |
  |        |  |  |     +--UIBand (IUIBand)
  |        |  |  |     |
  |        |  |  |     +--UIBandBox
  |        |  |  |
  |        |  |  +--UITabList
  |        |  |  |
  |        |  |  +--UITree (IUITree)
  |        |  |
  |        |  +--UIViewer (IUIPosition, TimerListener)
  |        |  |  |
  |        |  |  +--UIMarquee (TimerListener)
  |        |  |
  |        |  +--UIPropertyPage (IUIPropertyPage)
  |        |  |
  |        |  +--UIRoot (IUIRootContainer, TimerListener)
  |        |  |  |
  |        |  |  +--UIWindow
  |        |  |     |
  |        |  |     +--UIDialog
  |        |  |     |  |
  |        |  |     |  +--UIColorDialog
  |        |  |     |  |
  |        |  |     |  +--UIFindReplaceDialog
  |        |  |     |  |
  |        |  |     |  +--UIFontDialog
  |        |  |     |  |
  |        |  |     |  +--UIMessageBox (TimerListener)
  |        |  |     |  |
  |        |  |     |  +--UIPropertyDialog
  |        |  |     |  |
  |        |  |     |  +--UIWizard
  |        |  |     |
  |        |  |     +--UIFrame
  |        |  |     |
  |        |  |     +--UITip
  |        |  |
  |        |  +--UIScroll (IUIScroll, IUIPosition)
  |        |  |  |
  |        |  |  +--UIScrollBar
  |        |  |  |
  |        |  |  +--UISlider
  |        |  |  |
  |        |  |  +--UISpinner
  |        |  |     |
  |        |  |     +--UISpinnerEdit
  |        |  |
  |        |  +--UISplitViewer
  |        |  |
  |        |  +--UITabViewer
  |        |
  |        +--UISingleContainer
  |           |
  |           +--UIThumb
  |           |  |
  |           |  +--UIBandThumb
  |           |  |
  |           |  +--UIScrollThumb
  |           |     |
  |           |     +--UIColumnHeader
  |           |
  |           +--UIButton
  |           |  |
  |           |  +--UICheckButton
  |           |  |  |
  |           |  |  +--UIRadioButton
  |           |  |
  |           |  +--UIPushButton
  |           |     |
  |           |     +--UIExpandButton
  |           |     |
  |           |     +--UIRepeatButton (TimerListener)
  |           |
  |           +--UIMenuLauncher (IUIMenuLauncher)
  |           |  |
  |           |  +--UIContextMenu
  |           |  |
  |           |  +--UIMenuButton
  |           |  |
  |           |  +--UIMenuItem
  |           |
  |           +--UIStatus
  |           |  |
  |           |  +--UIProgress
  |           |
  |           +--UITab
  |
  +--UIDialogMapping
  |
  +--UIDragDrop
  |
  +--UIGridBagConstraints (Cloneable)
  |
  +--UIWinEvent
  |
  +--UIWizardStep (IUIWizardStep)

Applet
  |
  +--AwtUIApplet

SimpleBeanInfo
  |
  +--AwtUIBandBeanInfo
  |
  +--AwtUIBandBoxBeanInfo
  |
  +--AwtUICheckButtonBeanInfo
  |
  +--AwtUIChoiceBeanInfo
  |
  +--AwtUIControlBeanInfo
  |
  +--AwtUIDrawTextBeanInfo
  |
  +--AwtUIEditBeanInfo
  |
  +--AwtUIGraphicBeanInfo
  |
  +--AwtUIListBeanInfo
  |
  +--AwtUIMarqueeBeanInfo
  |
  +--AwtUIProgressBeanInfo
  |
  +--AwtUIPushButtonBeanInfo
  |
  +--AwtUIRadioButtonBeanInfo
  |
  +--AwtUIRepeatButtonBeanInfo
  |
  +--AwtUIScrollBarBeanInfo
  |
  +--AwtUIStatusBeanInfo
  |
  +--AwtUITabListBeanInfo
  |
  +--AwtUITextBeanInfo
  |
  +--AwtUITreeBeanInfo

Panel
  |
  +--AwtUIHost
     |
     +--AwtUIControl
        |
        +--AwtUIBand
        |
        +--AwtUIBandBox
        |
        +--AwtUIButton
        |  |
        |  +--AwtUICheckButton (IAwtUIItemSelectable)
        |  |
        |  +--AwtUIPushButton
        |  |
        |  +--AwtUIRadioButton (IAwtUIItemSelectable)
        |  |
        |  +--AwtUIRepeatButton
        |
        +--AwtUIChoice (IAwtUIItemSelectable)
        |
        +--AwtUIColumnViewer (IAwtUIItemSelectable)
        |
        +--AwtUIDrawText
        |
        +--AwtUIEdit
        |
        +--AwtUIGraphic
        |
        +--AwtUIList (IAwtUIItemSelectable)
        |
        +--AwtUIMarquee
        |
        +--AwtUIMenuList (IAwtUIItemSelectable)
        |
        +--AwtUIPanel
        |
        +--AwtUIProgress
        |
        +--AwtUIScrollBar (IAwtUIAdjustable)
        |
        +--AwtUIScrollViewer
        |
        +--AwtUISplitViewer
        |
        +--AwtUIStatus
        |
        +--AwtUITabList (IAwtUIItemSelectable)
        |
        +--AwtUITabViewer
        |
        +--AwtUIText
        |
        +--AwtUITree (IAwtUIItemSelectable)

Vector
  |
  +--UIButtonBar

IAwtUIAdjustable
IAwtUIItemSelectable
IUIAccessible
IUIBand
IUIComponent
IUIContainer
IUILayoutManager
IUIMenuLauncher
IUIPosition
IUIPropertyPage
IUIRootContainer
IUIScroll
IUISelector
IUITree
IUIWizardStep
IWinEvent


Class AwtUIApplet

public class AwtUIApplet extends Applet
{
  // Constructors
  public AwtUIApplet(UIApplet applet);

  // Methods
  public IUIRootContainer getRoot();
  public UIApplet getUIApplet();
}

This class is a bridge class that is used in conjunction with the UIApplet class to enable an AFC applet to run in an AWT environment. See the UIApplet class overview for an example showing how to use these classes to create AFC applets.

If any of an applet's methods are to be scriptable, they must be exposed to the applet's host in this class and implemented in the UIApplet class.

Applet
  |
  +--AwtUIApplet

Constructors

AwtUIApplet

public AwtUIApplet(UIApplet applet);

Creates an applet using the specified UIApplet object as the implementation of the applet.

Parameter | Description
applet | The implementation of the applet.

See Also: setLayout

Methods

getRoot

public IUIRootContainer getRoot();

Retrieves the root container of the applet.

Return Value:

Returns the IUIRootContainer object associated with the applet.

getUIApplet

public UIApplet getUIApplet();

Retrieves the UIApplet associated with the AwtUIApplet.

Return Value:

Returns the UIApplet object associated with the applet.


Class AwtUIBand

public class AwtUIBand extends AwtUIControl
{
  // Constructors
  public AwtUIBand();
  public AwtUIBand(String name);
  public AwtUIBand(String name, int style);

  // Methods
  public IUIComponent getBase();
  public int getStyle();
  public boolean isBreak();
  public boolean isDragBreak();
  public void setBreak(boolean on);
  public void setDragBreak(boolean on);
  public void setStyle(int style);
}

This class implements the functionality of a UIBand object in an AWT-based control. An AwtUIBand control is an AwtUIHost component whose associated root container holds a UIBand object. By hosting this object, an AwtUIBand control integrates AFC with AWT. Although an AwtUIBand control is fully compatible with AWT, a UIBand control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIBand

Constructors

AwtUIBand

public AwtUIBand();

Creates an AWT-based band control with no content.

AwtUIBand

public AwtUIBand(String name);

Creates an AWT-based band control with the specified text.

Parameter | Description
name | The text to be displayed on the band control.

AwtUIBand

public AwtUIBand(String name, int style);

Creates an AWT-based band control with the specified text and style.

Parameter | Description
name | The text to be displayed on the band control.
style | The style of the band control. Specify any bitwise combination of UIBand.BREAK and UIBand.DRAGBREAK.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIBand object associated with the band control.

Remarks:

When the AWT-based band control is first created, it is associated with a UIBand object.

getStyle

public int getStyle();

Retrieves the current style of the control.

Return Value:

Returns an integer containing the current style setting. For a list of possible values, see setStyle.

isBreak

public boolean isBreak();

Determines whether the BREAK attribute is set in the control's style.

Return Value:

Returns true if the style includes BREAK; otherwise, returns false.

isDragBreak

public boolean isDragBreak();

Determines whether the DRAGBREAK attribute is set in the control's style.

Return Value:

Returns true if the style includes DRAGBREAK; otherwise, returns false.

setBreak

public void setBreak(boolean on);

Sets or clears the BREAK attribute in the control's style.

Return Value:

No return value.

Parameter | Description
on | If true, the BREAK attribute is set; otherwise, it is cleared.

setDragBreak

public void setDragBreak(boolean on);

Sets or clears the DRAGBREAK attribute in the control's style.

Return Value:

No return value.

Parameter | Description
on | If true, the DRAGBREAK attribute is set; otherwise, it is cleared.

setStyle

public void setStyle(int style);

Sets the current style of the control.

Return Value:

No return value.

Parameter | Description
style | The style of the band control. Specify any bitwise combination of UIBand.BREAK and UIBand.DRAGBREAK.

Exceptions:

IllegalArgumentException if an undefined style was specified.


Class AwtUIBandBeanInfo

public class AwtUIBandBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIBandBeanInfo


Class AwtUIBandBox

public class AwtUIBandBox extends AwtUIControl
{
  // Constructors
  public AwtUIBandBox();

  // Methods
  public void addActionListener(ActionListener l);
  public IUIComponent getBase();
  public boolean getMoveable(int i);
  public int getRowCount();
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  public synchronized void removeActionListener(ActionListener l);
}

This class implements the functionality of a UIBandBox object in an AWT-based control. An AwtUIBandBox control is an AwtUIHost component whose associated root container holds a UIBandBox object. By hosting this object, an AwtUIBandBox control integrates AFC with AWT. Although an AwtUIBandBox control is fully compatible with AWT, a UIBandBox control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIBandBox

Constructors

AwtUIBandBox

public AwtUIBandBox();

Creates an AWT-based band box control.

Methods

addActionListener

public void addActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the button is based on.

Return Value:

Returns the UIBandBox object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIBandBox object.

getMoveable

public boolean getMoveable(int i);

Determines whether the band at the specified index is moveable.

Return Value:

Returns true if the band can be moved; otherwise, returns false.

Parameter | Description
i | The zero-based index of the band.

getRowCount

public int getRowCount();

Determines the number of rows in the control.

Return Value:

Returns the number of rows.

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
action event | processActionEvent
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

removeActionListener

public synchronized void removeActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener


Class AwtUIBandBoxBeanInfo

public class AwtUIBandBoxBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIBandBoxBeanInfo


Class AwtUIButton

public abstract class AwtUIButton extends AwtUIControl
{
  // Constructors
  public AwtUIButton();

  // Methods
  public int getStyle();
  public boolean keyDown(Event e, int key);
  public boolean keyUp(Event e, int key);
  public boolean mouseUp(Event e, int x, int y);
  public void setLabel(String name);
  public void setStyle(int style);
}

This class implements the functionality of a UIButton object in an AWT-based control. The following classes extend AwtUIButton and allow you to create AWT-based buttons.

  • AwtUICheckButton
  • AwtUIPushButton
  • AwtUIRadioButton
  • AwtUIRepeatButton

While an AwtUIButton control is fully compatible with AWT, a UIButton control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIButton

Constructors

AwtUIButton

public AwtUIButton();

Creates an AWT-based button control.

Methods

getStyle

public int getStyle();

Retrieves the button's current style settings.

Return Value:

Returns an integer containing the current style settings. For a list of possible styles, see setStyle.

keyDown

public boolean keyDown(Event e, int key);

Determines whether the SPACEBAR or the ENTER key is being pressed, and if so, sets the pressed state.

Return Value:

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

Parameter | Description
e | The event posted to the button control.
key | The key that has been pressed.

Remarks:

This method is called when the button has focus and a key is pressed. If the key being pressed is the SPACEBAR or the ENTER key, the button's pressed state is set. If the ESC key is being pressed, the button's pressed state is cleared.

For more information about states, see the UIStateContainer overview.

See Also: keyUp

keyUp

public boolean keyUp(Event e, int key);

Determines whether the SPACEBAR or the ENTER key is being released, and if so, generates an action event.

Return Value:

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

Parameter | Description
e | The event posted to the button control.
key | The key that has been released.

Remarks:

This method is called when the button has focus and a key is released. If the key being released is the SPACEBAR or the ENTER key, an action event is generated. The keyUp method also clears the button's pressed state, which was previously set by keyDown.

For more information about states, see the UIStateContainer overview.

See Also: keyDown

mouseUp

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

Determines whether the button control's pressed state is set, and if so, generates an action event.

Return Value:

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

Parameter | Description
e | The event posted to the button control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

The pressed state is set when the mouse button is pressed over the control. When the mouse button is released, mouseUp then clears the pressed state and generates an action event.

setLabel

public void setLabel(String name);

Sets the content of the button to the specified name.

Return Value:

No return value.

Parameter | Description
name | The string to be displayed by the button.

setStyle

public void setStyle(int style);

Sets the button's current style.

Return Value:

No return value.

Parameter | Description
style | The style of the button. You can pass UIButton.TOGGLE or UIButton.TRITOGGLE, or you can set any bit in the mask 0xFF000000.

Exceptions:

IllegalArgumentException if an undefined style was specified.

See Also: getStyle


Class AwtUICheckButton

public class AwtUICheckButton extends AwtUIButton implements
            IAwtUIItemSelectable
{
  // Constructors
  public AwtUICheckButton();
  public AwtUICheckButton(String name);
  public AwtUICheckButton(String name, int style);
  public AwtUICheckButton(IUIComponent comp);
  public AwtUICheckButton(IUIComponent comp, int style);

  // Methods
  public void addItemListener(ItemListener l);
  public IUIComponent getBase();
  protected void processHostEvent(AWTEvent e);
  protected void processItemEvent(ItemEvent e);
  public void removeItemListener(ItemListener l);
}

This class implements the functionality of a UICheckButton object in an AWT-based control. An AwtUICheckButton control is an AwtUIHost component whose associated root container holds a UICheckButton object. By hosting this object, an AwtUICheckButton control integrates AFC with AWT. Although an AwtUICheckButton control is fully compatible with AWT, a UICheckButton control is optimized for performance and size.

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.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIButton
        |
        +--AwtUICheckButton

Constructors

AwtUICheckButton

public AwtUICheckButton();

Creates an AWT-based check box button with no content.

Remarks:

By default, the button's style is set to TOGGLE.

AwtUICheckButton

public AwtUICheckButton(String name);

Creates an AWT-based check box button with the specified text.

Parameter | Description
name | The text to be displayed with the check box image.

Remarks:

By default, the button is hot-tracked and its style is set to TOGGLE. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

AwtUICheckButton

public AwtUICheckButton(String name, int style);

Creates an AWT-based check box button with the specified text and style.

Parameter | Description
name | The text to be displayed with the check box image.
style | The style of the button. Possible values include UIButton.TOGGLE or UIButton.TRITOGGLE.

Remarks:

By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

AwtUICheckButton

public AwtUICheckButton(IUIComponent comp);

Creates an AWT-based check box button with the specified component.

Parameter | Description
comp | The component to be displayed with the check box image.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. By default, the button's style is set to TOGGLE.

AwtUICheckButton

public AwtUICheckButton(IUIComponent comp, int style);

Creates an AWT-based check box button with the specified component and style.

Parameter | Description
comp | The component to be displayed with the check box image.
style | The style of the button. Possible values include UIButton.TOGGLE or UIButton.TRITOGGLE.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

addItemListener

public void addItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the button is based on.

Return Value:

Returns the UICheckButton object associated with the button control.

Remarks:

When the AWT-based button is first created, it is associated with a UICheckButton object.

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
item event | processItemEvent
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

removeItemListener

public void removeItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener


Class AwtUICheckButtonBeanInfo

public class AwtUICheckButtonBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUICheckButtonBeanInfo


Class AwtUIChoice

public class AwtUIChoice extends AwtUIControl implements
            IAwtUIItemSelectable
{
  // Constructors
  public AwtUIChoice();

  // Methods
  public IUIComponent add(IUIComponent comp);
  public Component add(Component comp);
  public void addItem(String s);
  public void addItemListener(ItemListener l);
  public void addSelectedIndex(int index);
  public void addSelectedIndex(int index, boolean notify);
  public void addSelectedIndices(int indices[]);
  public void addSelectedIndices(int indices[], boolean notify);
  public void addSelectedItem(IUIComponent comp);
  public void addSelectedItem(IUIComponent comp, boolean notify);
  public void addSelectedItems(IUIComponent comps[]);
  public void addSelectedItems(IUIComponent comps[],
        boolean notify);
  public IUIComponent addString(String s);
  public IUIComponent getAnchorItem();
  public IUIComponent getBase();
  public IUIComponent getExtensionItem();
  public int getSelectedIndex();
  public int[] getSelectedIndices();
  public IUIComponent getSelectedItem();
  public IUIComponent[] getSelectedItems();
  public Object[] getSelectedObjects();
  public int getSelectionMode();
  public int getStyle();
  public String getValueText();
  protected void processHostEvent(AWTEvent e);
  protected void processItemEvent(ItemEvent e);
  public synchronized void removeItemListener(ItemListener l);
  public void removeSelectedIndex(int index);
  public void removeSelectedIndex(int index, boolean notify);
  public void removeSelectedIndices(int indices[]);
  public void removeSelectedIndices(int indices[], boolean notify);
  public void removeSelectedItem(IUIComponent comp);
  public void removeSelectedItem(IUIComponent comp, boolean notify);
  public void removeSelectedItems(IUIComponent comps[]);
  public void removeSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setAnchorItem(IUIComponent comp);
  public void setExtensionItem(IUIComponent comp);
  public void setSelectedIndex(int index);
  public void setSelectedIndex(int index, boolean notify);
  public void setSelectedIndices(int indices[]);
  public void setSelectedIndices(int indices[], boolean notify);
  public void setSelectedItem(IUIComponent comp);
  public void setSelectedItem(IUIComponent comp, boolean notify);
  public void setSelectedItems(IUIComponent comps[]);
  public void setSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setSelectionMode(int selMode);
  public void setStyle(int style);
  public void setValueText(String s);
}

This class implements the functionality of a UIChoice object in an AWT-based control. An AwtUIChoice control is an AwtUIHost component whose associated root container holds a UIChoice object. By hosting this object, an AwtUIChoice control integrates AFC with AWT. Although an AwtUIChoice control is fully compatible with AWT, a UIChoice control is optimized for performance and size.

Note Only IUISelector.SINGLESELECT mode is supported in UIChoice.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIChoice

Constructors

AwtUIChoice

public AwtUIChoice();

Creates an empty AWT-based choice control.

Remarks:

Call add, addItem, or addString to add items to the control's pop-up list.

Methods

add

public IUIComponent add(IUIComponent comp);

Adds the specified UI component to the end of the control's pop-up list.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The UI component to be added to the control.

Overrides:

add(IUIComponent) in AwtUIControl.

See Also: addString, addItem

add

public Component add(Component comp);

Adds the specified AwtUI component to the end of the control's pop-up list. Pure AWT components cannot be added.

Return Value:

Returns the control itself.

Parameter | Description
comp | The AwtUI component to be added to the control.

Overrides:

add(Component) in AwtUIControl.

Exceptions:

IllegalArgumentException if a pure AWT component was added.

See Also: addString, addItem

addItem

public void addItem(String s);

Adds the specified text to the end of the control's pop-up list.

Return Value:

No return value.

Parameter | Description
s | The text to be added to the control.

See Also: add, addString

addItemListener

public void addItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

addSelectedIndex

public void addSelectedIndex(int index);

Selects the component at the specified index, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.

See Also: removeSelectedIndex

addSelectedIndex

public void addSelectedIndex(int index, boolean notify);

Selects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.
notify | If true, list select events will be generated.

See Also: removeSelectedIndex

addSelectedIndices

public void addSelectedIndices(int indices[]);

Selects the components at the specified indices, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.

See Also: removeSelectedIndices

addSelectedIndices

public void addSelectedIndices(int indices[], boolean notify);

Selects the components at the specified indices without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.
notify | If true, list select events will be generated.

See Also: removeSelectedIndices

addSelectedItem

public void addSelectedItem(IUIComponent comp);

Selects the specified component without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.

See Also: removeSelectedItem

addSelectedItem

public void addSelectedItem(IUIComponent comp, boolean notify);

Selects the specified component without affecting other selections. Optionally generates list select events.

Return Value:

No return value

Parameter | Description
comp | The component to be selected.
notify | If true, list select events will be generated.

See Also: removeSelectedItem

addSelectedItems

public void addSelectedItems(IUIComponent comps[]);

Selects the specified components without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be selected.

See Also: removeSelectedItems

addSelectedItems

public void addSelectedItems(IUIComponent comps[], boolean notify);

Selects the specified components without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be selected.
notify | If true, list select events will be generated.

See Also: removeSelectedItems

addString

public IUIComponent addString(String s);

Adds the specified text to the end of the control's pop-up list.

Return Value:

Returns the text component that was added.

Parameter | Description
s | The text to be added to the control.

See Also: add, addItem

getAnchorItem

public IUIComponent getAnchorItem();

Retrieves the component that is the current anchor in extend select mode by calling UIChoice.getAnchorItem.

Return Value:

Returns the component that is the anchor.

See Also: setAnchorItem

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIChoice object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIChoice object.

getExtensionItem

public IUIComponent getExtensionItem();

Retrieves the item to which a selection, in EXTENDEDSELECT mode, last extended from the anchor. This method calls UIChoice.getExtensionItem.

Return Value:

Returns the extension item.

See Also: setExtensionItem, com.ms.ui.UIChoice.getExtensionItem

getSelectedIndex

public int getSelectedIndex();

Retrieves the index of the choice control's currently selected item.

Return Value:

Returns the index of the selected component.

See Also: setSelectedIndex

getSelectedIndices

public int[] getSelectedIndices();

Retrieves the zero-based indices of all currently selected items.

Return Value:

Returns an array of the indices of the selected items, if an item is selected; otherwise, returns -1.

See Also: setSelectedIndices

getSelectedItem

public IUIComponent getSelectedItem();

Retrieves the control's currently selected item.

Return Value:

Returns the selected component.

See Also: setSelectedItem, setSelectedItem

getSelectedItems

public IUIComponent[] getSelectedItems();

Retrieves all currently selected items.

Return Value:

Returns an array of the selected components, if a component is selected; otherwise, returns null.

See Also: setSelectedItems

getSelectedObjects

public Object[] getSelectedObjects();

Retrieves the selected items in the control.

Return Value:

Returns the currently selected item.

Remarks:

This method implements getSelectedObjects in the IAwtUIItemSelectable interface. Only one item in the control can be selected at a time.

getSelectionMode

public int getSelectionMode();

Retrieves the current selection mode.

Return Value:

Returns the current mode.

See Also: setSelectionMode

getStyle

public int getStyle();

Retrieves the current style of the control.

Return Value:

Returns an integer containing the current style setting. For a list of possible values, see setStyle.

getValueText

public String getValueText();

Retrieves the current value text.

Return Value:

No return value.

Parameter | Description
s | The string containing the current text value.

See Also: setValueText

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
item event | processItemEvent
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

removeItemListener

public synchronized void removeItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener

removeSelectedIndex

public void removeSelectedIndex(int index);

Deselects the component at the specified index without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.

See Also: addSelectedIndex

removeSelectedIndex

public void removeSelectedIndex(int index, boolean notify);

Deselects the component at the specified index without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

See Also: addSelectedIndex

removeSelectedIndices

public void removeSelectedIndices(int indices[]);

Deselects the components at the specified indices without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.

See Also: addSelectedIndices

removeSelectedIndices

public void removeSelectedIndices(int indices[], boolean notify);

Deselects the components at the specified indices without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

See Also: addSelectedIndices

removeSelectedItem

public void removeSelectedItem(IUIComponent comp);

Deselects the specified component without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.

See Also: addSelectedItem

removeSelectedItem

public void removeSelectedItem(IUIComponent comp, boolean notify);

Deselects the specified component without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

See Also: addSelectedItem

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[]);

Deselects the specified components without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be deselected.

See Also: addSelectedItems

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[], boolean notify);

Deselects the specified components without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

See Also: addSelectedItems

setAnchorItem

public void setAnchorItem(IUIComponent comp);

Sets the item used as an anchor in EXTENDSELECT mode by calling UIChoice.setAnchorItem. You cannot set the anchor item to null.

Note Resetting the anchor automatically sets the current extension item to null. If the extension item is intended to set both to specific items, call setAnchorItem, followed by setExtensionItem.

Setting the anchor in an IUISelector other than the outermost position, has no effect.

Return Value:

No return value.

Parameter | Description
comp | The component that will be the new anchor.

Exceptions:

IllegalArgumentException if the component is not a child of the selector, or if the component is null.

See Also: getAnchorItem, com.ms.ui.UIChoice.setAnchorItem

setExtensionItem

public void setExtensionItem(IUIComponent comp);

Sets the item to which a selection, in EXTENDEDSELECT mode, extends from an anchor.

Note This method calls UIChoice.setExtensionItem .

Return Value:

No return value.

Parameter | Description
comp | The component that will be the new extension item.

Exceptions:

IllegalArgumentException if comp is not a child of the selector.

See Also: getExtensionItem, com.ms.ui.UIChoice.setExtensionItem

setSelectedIndex

public void setSelectedIndex(int index);

Sets the selection to the component at the specified index. By default, a list select event is not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.

Remarks:

This method clears any previous selection.

See Also: getSelectedIndex

setSelectedIndex

public void setSelectedIndex(int index, boolean notify);

Sets the selection to the component at the specified index, and optionally generates a list select event.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.
notify | If true, a list select event will be generated.

Remarks:

This method clears any previous selection.

See Also: getSelectedIndex

setSelectedIndices

public void setSelectedIndices(int indices[]);

Sets the selection to the components at the specified indices. By default, list select events are not gerenated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.

Remarks:

This method clears any previous selection.

See Also: getSelectedIndices

setSelectedIndices

public void setSelectedIndices(int indices[], boolean notify);

Sets the selection to the components at the specified indices, and optionally generates list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method clears any previous selection.

See Also: getSelectedIndices

setSelectedItem

public void setSelectedItem(IUIComponent comp);

Sets the control's currently selected item.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.

See Also: getSelectedItem

setSelectedItem

public void setSelectedItem(IUIComponent comp, boolean notify);

Sets the selection to the specified component, and optionally generates a list select event.

Return Value:

No return value.

Parameter | Description
comp | The item to be selected.
notify | If true, a list select event will be generated.

Remarks:

This method clears any previous selection.

See Also: getSelectedItem

setSelectedItems

public void setSelectedItems(IUIComponent comps[]);

Sets the selection to the specified components. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected.

Remarks:

This method clears any previous selection.

See Also: getSelectedItems

setSelectedItems

public void setSelectedItems(IUIComponent comps[], boolean notify);

Sets the selection to the specified components, and optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected.
notify | If true, list select events will be generated.

Remarks:

This method clears any previous selection.

See Also: getSelectedItems

setSelectionMode

public void setSelectionMode(int selMode);

Sets the current selection mode.

Return Value:

No return value.

Parameter | Description
selMode | The selection mode.

Exceptions:

IllegalArgumentException if a mode other than IUISelector.SINGLESELECT is used.

See Also: getSelectionMode

setStyle

public void setStyle(int style);

Sets the current style for the control. To restore the default style, call setStyle(0).

Return Value:

No return value.

Parameter | Description
style | The style of the control. You can pass THICK to specify using a thick border around the choice and its elements.

Exceptions:

IllegalArgumentException if an undefined style was specified.

setValueText

public void setValueText(String s);

Sets the current text value. This method searches through the items in the choice list using the given string as a prefix. It attempts to find a matching item.

Return Value:

No return value.

Parameter | Description
s | The string to set.

See Also: getValueText


Class AwtUIChoiceBeanInfo

public class AwtUIChoiceBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIChoiceBeanInfo


Class AwtUIColumnViewer

public class AwtUIColumnViewer extends AwtUIControl implements
            IAwtUIItemSelectable
{
  // Constructors
  public AwtUIColumnViewer();
  public AwtUIColumnViewer(Object columns[], IUIComponent list);

  // Methods
  public IUIComponent add(Object columns[]);
  public IUIComponent add(Object columns[], int index);
  public IUIComponent add(Object columns[], Object constraints);
  public IUIComponent add(Object columns[], Object constraints, int
        index);
  public void addActionListener(ActionListener l);
  public void addItemListener(ItemListener l);
  public IUIComponent getBase();
  public int getOrderIndex(int index);
  public int getWidth(int index);
  public int[] getWidths();
  public void moveColumn(int from, int to);
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  protected void processItemEvent(ItemEvent e);
  public synchronized void removeActionListener(ActionListener l);
  public synchronized void removeItemListener(ItemListener l);
  public void setWidth(int index, int width);
  public void setWidths(int width);
  public void setWidths(int widths[]);
}

This class implements the functionality of a UIColumnViewer object in an AWT-based control. An AwtUIColumnViewer control is an AwtUIHost component whose associated root container holds a UIColumnViewer object. By hosting this object, an AwtUIColumnViewer control integrates AFC with AWT. Although an AwtUIColumnViewer control is fully compatible with AWT, a UIColumnViewer control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIColumnViewer

Constructors

AwtUIColumnViewer

public AwtUIColumnViewer();

Creates an AWT-based column viewer control with no column headers or content.

AwtUIColumnViewer

public AwtUIColumnViewer(Object columns[], IUIComponent list);

Creates an AWT-based column viewer control using an array of objects for headers and a component list for content.

Parameter | Description
columns | The array of column objects.
list | The component list.

Methods

add

public IUIComponent add(Object columns[]);

Adds an Object array to the end of a UIColumnViewer object's contained list.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

Parameter | Description
columns | An array of objects to add to the column viewer.

add

public IUIComponent add(Object columns[], int index);

Adds an Object array to the UIColumnViewer object's contained list, at a specified index.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

Parameter | Description
columns | An array of objects to add to the column viewer.
index | The position of the row object when added to the list. Set this value to -1 if the row is added to the end of the list.

add

public IUIComponent add(Object columns[], Object constraints);

Adds an Object array to the end of a UIColumnViewer object's contained list.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

Parameter | Description
columns | An array of objects to add to the column viewer.
constraints | The layout constraints of the content container for the column viewer.

add

public IUIComponent add(Object columns[], Object constraints, int index);

Adds an Object array to the UIColumnViewer object's contained list, at a specified insertion index.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

Parameter | Description
columns | An array of objects to add to the column viewer.
constraints | The layout constraints of the content container for the column viewer.
index | The position of the row object when added to the list.

addActionListener

public void addActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

addItemListener

public void addItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIColumnViewer object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIColumnViewer object.

getOrderIndex

public int getOrderIndex(int index);

Retrieves the order of the column at the specified index.

Return Value:

Returns the zero-based order of the column.

Parameter | Description
index | The zero-based index of the column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

getWidth

public int getWidth(int index);

Retrieves the current width of the column at the specified index.

Return Value:

Returns the width (in pixels) of the specified column.

Parameter | Description
index | The zero-based index of the column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: setWidth

getWidths

public int[] getWidths();

Retrieves the current widths (in pixels) for all the columns.

Return Value:

Returns an array of the widths for each of the columns.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: setWidths

moveColumn

public void moveColumn(int from, int to);

Moves a column from one location to another.

Return Value:

No return value.

Parameter | Description
from | The zero-based index that identifies the column to move.
to | The zero-based index that identifies where the column is moving to.

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
action event | processActionEvent
item event | processItemEvent
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

removeActionListener

public synchronized void removeActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener

removeItemListener

public synchronized void removeItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener

setWidth

public void setWidth(int index, int width);

Sets the width of the column at the specified index.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the column.
width | The new width (in pixels) for the column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: getWidth

setWidths

public void setWidths(int width);

Sets the widths of all columns to the specified width

Return Value:

No return value.

Parameter | Description
width | The new width (in pixels) for each column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: getWidths

setWidths

public void setWidths(int widths[]);

Sets all the column widths to the specified widths (in pixels).

Return Value:

No return value.

Parameter | Description
widths | The array of new widths for each column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: getWidths


Class AwtUIControl

public abstract class AwtUIControl extends AwtUIHost
{
  // Constructors
  public AwtUIControl();
  public AwtUIControl(IUIComponent comp);

  // Methods
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int index);
  public IUIComponent add(String name, IUIComponent comp);
  public IUIComponent add(IUIComponent comp, Object constraints);
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public Component add(Component comp);
  public Component add(Component comp, int index);
  public Component add(String name, Component comp);
  public void add(Component comp, Object constraints);
  public void add(Component comp, Object constraints, int index);
  public void addNotify();
  public abstract IUIComponent getBase();
  public int getID();
  public String getName();
  public boolean isChecked();
  public boolean isFocused();
  public boolean isHot();
  public boolean isIndeterminate();
  public boolean isKeyable();
  public boolean isPressed();
  public boolean isSelectable();
  public boolean isSelected();
  public boolean postEvent(Event evt);
  public void remove(IUIComponent comp);
  public void removeAll();
  public void setChecked(boolean on);
  public void setFocused(boolean on);
  public void setHot(boolean on);
  public void setID(int id);
  public void setIndeterminate(boolean on);
  public void setLayout(LayoutManager mgr);
  public void setName(String name);
  public void setPressed(boolean on);
  public void setSelected(boolean on);
}

This class implements an abstract AWT-based control that hosts a UI control. The following classes extend AwtUIControl and allow you to integrate AFC with AWT.

AwtUIBand | AwtUIBandBox | AwtUIButton
AwtUICheckButton | AwtUIChoice | AwtUIColumnViewer
AwtUIDrawText | AwtUIEdit | AwtUIGraphic
AwtUIList | AwtUIMarquee | AwtUIMenuList
AwtUIPanel | AwtUIProgress | AwtUIPushButton
AwtUIRadioButton | AwtUIRepeatButton | AwtUIScrollBar
AwtUIScrollViewer | AwtUISplitViewer | AwtUIStatus
AwtUITabList | AwtUITabViewer | AwtUIText
AwtUITree

Although an AwtUI control is completely compatibile with AWT, a UI control is smaller in size and provides better performance.

For more information about how AWT-based controls in AFC host other components, see the AwtUIHost overview.

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.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl

Constructors

AwtUIControl

public AwtUIControl();

Creates an abstract AWT-based control.

AwtUIControl

public AwtUIControl(IUIComponent comp);

Creates an abstract AWT-based control using the specified component.

Parameter | Description
comp | The component to be displayed by the control.

Methods

add

public IUIComponent add(IUIComponent comp);

Adds the specified UI component to the control.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The UI component to be added.

Overrides:

add(IUIComponent) in AwtUIHost.

add

public IUIComponent add(IUIComponent comp, int index);

Adds the specified UI component to the control at the specified index.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The UI component to be added.
index | The zero-based index at which to insert the component, or -1 to add the component at the end.

Overrides:

add(IUIComponent,int) in AwtUIHost.

add

public IUIComponent add(String name, IUIComponent comp);

Adds the specified UI component to the control, according to the specified layout location.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
name | The layout name identifying where to add the component. This value depends on the layout manager of the component.
comp | The UI component to be added.

Overrides:

add(String,IUIComponent) in AwtUIHost.

add

public IUIComponent add(IUIComponent comp, Object constraints);

Adds the specified UI component to the control, according to the specified layout constraints.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The UI component to be added.
constraints | The layout constraints identifying where to add the component. This value depends on the layout manager of the component.

Overrides:

add(IUIComponent,Object) in AwtUIHost.

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds the specified UI component to the control, according to the specified layout constraints and index.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The UI component to be added.
constraints | The layout constraints identifying where to add the component. This value depends on the layout manager of the component.
index | The zero-based index at which to insert the component, or -1 to add the component at the end.

Overrides:

add(IUIComponent,Object,int) in AwtUIHost.

add

public Component add(Component comp);

Adds the specified AwtUI component to the control. Pure AWT components cannot be added.

Return Value:

Returns the control itself.

Parameter | Description
comp | The AwtUI component to be added.

Exceptions:

IllegalArgumentException if a pure AWT component was added.

add

public Component add(Component comp, int index);

Adds the specified AwtUI component to the control at the specified index. Pure AWT components cannot be added.

Return Value:

Returns the control itself.

Parameter | Description
comp | The AwtUI component to be added.
index | The zero-based index at which to insert the component, or -1 to add the component at the end.

Exceptions:

IllegalArgumentException if a pure AWT component was added.

add

public Component add(String name, Component comp);

Adds the specified AwtUI component to the control, according to the specified layout location. Pure AWT components cannot be added.

Return Value:

Returns the control itself.

Parameter | Description
name | The layout name identifying where to add the component. This value depends on the layout manager of the underlying UI object.
comp | The AwtUI component to be added.

Exceptions:

IllegalArgumentException if a pure AWT component was added.

add

public void add(Component comp, Object constraints);

Adds the specified AwtUI component to the control, according to the specified layout constraints. Pure AWT components cannot be added.

Return Value:

No return value.

Parameter | Description
comp | The AwtUI component to be added.
constraints | The layout constraints identifying where to add the component. This value depends on the layout manager of the underlying UI object.

Exceptions:

IllegalArgumentException if a pure AWT component was added.

add

public void add(Component comp, Object constraints, int index);

Adds the specified AwtUI component to the control, according to the specified layout constraints and index. Pure AWT components cannot be added.

Return Value:

No return value.

Parameter | Description
comp | The AwtUI component to be added.
constraints | The layout constraints identifying where to add the component. This value depends on the layout manager of the underlying UI object.
index | The zero-based index at which to insert the component, or -1 to add the component at the end.

Exceptions:

IllegalArgumentException if a pure AWT component was added.

addNotify

public void addNotify();

Determines whether the control's reparent state is set, and if so, clears this state. (A control is reparented if its underlying UI component has been extracted.)

Return Value:

No return value.

Overrides:

addNotify() in AwtUIHost.

See Also: isReparent

getBase

public abstract IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UI object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UI object.

getID

public int getID();

Retrieves the control's identifier.

Return Value:

Returns the integer associated with the control.

getName

public String getName();

Retrieves the identifying name of the component.

Return Value:

Returns the string name.

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.

isFocused

public boolean isFocused();

Determines whether the component's focus state is set.

Return Value:

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

See Also: setFocused

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.

isKeyable

public boolean isKeyable();

Determines whether the control can receive keyboard input.

Return Value:

Returns true if the control can receive keyboard input; 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.

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.

postEvent

public boolean postEvent(Event evt);

Posts the specified event.

Return Value:

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

Parameter | Description
evt | The event.

Overrides:

postEvent(Event) in AwtUIHost.

remove

public void remove(IUIComponent comp);

Removes the specified component from the associated root container.

Return Value:

No return value.

Parameter | Description
comp | The component to be removed.

Overrides:

remove(IUIComponent) in AwtUIHost.

See Also: removeAll, add

removeAll

public void removeAll();

Removes all components from the container, including the header component.

Return Value:

No return value.

Overrides:

removeAll() in AwtUIHost.

setChecked

public void setChecked(boolean on);

Sets or clears the checked state of the control.

Return Value:

No return value.

Parameter | Description
on | If true, the checked state is set; otherwise, it is cleared.

setFocused

public void setFocused(boolean on);

Sets or clears the focus state of the component.

Return Value:

No return value.

Parameter | Description
on | If true, the focus state is set; otherwise, it is cleared.

Remarks:

This method is automatically invoked when the component receives or loses focus.

See Also: isFocused

setHot

public void setHot(boolean on);

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

Return Value:

No return value.

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

setID

public void setID(int id);

Set the control's identifier.

Return Value:

No return value.

Parameter | Description
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.

Parameter | Description
on | If true, the indeterminate state is set; otherwise, it is cleared.

setLayout

public void setLayout(LayoutManager mgr);

Sets the control's layout manager.

Return Value:

No return value.

Parameter | Description
mgr | The new layout manager to be used.

setName

public void setName(String name);

Sets the name of the control.

Return Value:

No return value.

Parameter | Description
name | The name to be associated with the control.

setPressed

public void setPressed(boolean on);

Sets or clears the pressed state of the control.

Return Value:

No return value.

Parameter | Description
on | If true, the pressed 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.

Parameter | Description
on | If true, the selected state is set; otherwise, it is cleared.


Class AwtUIControlBeanInfo

public class AwtUIControlBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIControlBeanInfo


Class AwtUIDrawText

public class AwtUIDrawText extends AwtUIControl
{
  // Constructors
  public AwtUIDrawText();
  public AwtUIDrawText(String newBuff);
  public AwtUIDrawText(char newBuff[]);

  // Methods
  public IUIComponent getBase();
  public int getCharFromScreen(int scrnX, int scrnY);
  public int getCharFromScreen(Point scrnPos);
  public Point getCharLocation(int iPos);
  public int getLength();
  public IFxShape getOutline();
  public String getValueText();
  public int getWordWrap();
  public boolean isAutoResizable();
  public boolean isBordered();
  public boolean isSingleLine();
  public void setAutoResizable(boolean auto);
  public void setBordered(boolean b);
  public void setHorizAlign(int h);
  public void setOutline(IFxShape outline);
  public void setRefresh(boolean r);
  public void setSingleLine(boolean sl);
  public void setValueText(String s);
  public void setValueText(char newBuff[], int offset, int len);
  public void setVertAlign(int v);
  public void setWordWrap(int ww);
}

This class implements the functionality of a UIDrawText object in an AWT-based control. An AwtUIDrawText control is an AwtUIHost component whose associated root container holds a UIDrawText object. By hosting this object, an AwtUIDrawText control integrates AFC with AWT. Although an AwtUIDrawText control is fully compatible with AWT, a UIDrawText control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIDrawText

Constructors

AwtUIDrawText

public AwtUIDrawText();

Creates an empty, read-only AWT-based text control.

AwtUIDrawText

public AwtUIDrawText(String newBuff);

Creates a read-only AWT-based text control with the specified string.

Parameter | Description
newBuff | The text for the control.

AwtUIDrawText

public AwtUIDrawText(char newBuff[]);

Creates a read-only AWT-based text control with the specified character buffer.

Parameter | Description
newBuff | Contains the text for the control.

Methods

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIDrawText object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIDrawText object.

getCharFromScreen

public int getCharFromScreen(int scrnX, int scrnY);

Retrieves the character at the specified coordinates.

Return Value:

Returns the index of the character at the specified position. If there is no character at that position, the character returned will be the last one on the nearest line.

Parameter | Description
scrnX | The x coordinate, in pixels.
scrnY | The y coordinate, in pixels.

getCharFromScreen

public int getCharFromScreen(Point scrnPos);

Retrieves the character at the specified point.

Return Value:

Returns the index of the character at the specified position. If there is no character at that position, the character returned will be the last one on the nearest line.

Parameter | Description
scrnPos | The coordinates of the point, in pixels.

getCharLocation

public Point getCharLocation(int iPos);

Retrieves the position that the character would be drawn at if drawn alone. Typically, this is used for placing the caret.

Return Value:

Returns a Point object that contains the client coordinates of the character.

Parameter | Description
iPos | The index of the character to query.

getLength

public int getLength();

Retrieves the length of the text in the control.

Return Value:

Returns the number of characters in the control.

getOutline

public IFxShape getOutline();

Retrieves the outline along which text is drawn. For example, if the outline is an ellipse, the text that the AwtUIDrawText object is created with is drawn along the outline of the ellipse.

Return Value:

Returns an IFxShape object that specifies the outline.

See Also: setOutline

getValueText

public String getValueText();

Retrieves the text in the control.

Return Value:

Returns a String object that contains the text of the control.

See Also: setValueText

getWordWrap

public int getWordWrap();

Retrieves the word wrapping style.

Return Value:

Returns the word wrapping style. For a list of possible values, see setWordWrap.

isAutoResizable

public boolean isAutoResizable();

Determines whether the bounding box of the control's text will automatically adjust to the size of the control when the control is resized or reshaped.

Return Value:

Returns true if the auto-resize attribute is set; otherwise, returns false.

See Also: setAutoResizable

isBordered

public boolean isBordered();

Determines whether the control has a border.

Return Value:

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

See Also: setBordered

isSingleLine

public boolean isSingleLine();

Retrieves the control's single line attribute.

Return Value:

Returns false if the control's text can be displayed on multiple lines; otherwise, returns true.

setAutoResizable

public void setAutoResizable(boolean auto);

Sets the control's auto-resize attribute.

Return Value:

No return value.

Parameter | Description
auto | If true, the bounding box of the control's text will automatically adjust to the size of the control when the control is resized or reshaped.

See Also: isAutoResizable

setBordered

public void setBordered(boolean b);

Sets or clears the control's border. The border is a rectangle with sides that are one pixel wide and the same color as the text.

Return Value:

No return value.

Parameter | Description
b | If true, the control has a border; otherwise, it does not.

See Also: isBordered

setHorizAlign

public void setHorizAlign(int h);

Sets the horizontal alignment of the control's text.

Return Value:

No return value.

Parameter Description
h The horizontal alignment. You can pass one of the following values, defined by the IFxTextConstants interface.
  • htaLeft
  • htaCenter
  • htaRight
  • htaJustified
  • htaStretch
  • htaScriptDefault

setOutline

public void setOutline(IFxShape outline);

Sets an outline that the text buffer is drawn along.

Return Value:

No return value.

Parameter | Description
outline | An IFxShape object that specifies the outline.

See Also: getOutline

setRefresh

public void setRefresh(boolean r);

Sets the refresh flag. Use this method to prevent unnecessary repaints when setting attributes for a control.

Return Value:

No return value.

Parameter | Description
r | If true, the control will update itself whenever a parameter is changed. If false, the control will not update itself.

Remarks:

Using this method only prevents painting when APIs that change the control directly are called (for example, if you call several methods in sequence, such as setForeground, setBackground, and setWordWrap). It does not prevent painting on normal system updates.

setSingleLine

public void setSingleLine(boolean sl);

Changes the control's single line attribute.

Return Value:

No return value.

Parameter | Description
sl | Set to false if the control's text is displayed on multiple lines. Otherwise, the text is displayed on a single line.

setValueText

public void setValueText(String s);

Sets the text in the control.

Return Value:

No return value.

Parameter | Description
s | A String object that specifies the new text.

See Also: getValueText

setValueText

public void setValueText(char newBuff[], int offset, int len);

Sets the text in the control.

Return Value:

No return value.

Parameter | Description
newBuff | The array of characters that contains the text.
offset | The offset of the newBuff text buffer where the text starts.
len | The length of the text.

See Also: getValueText

setVertAlign

public void setVertAlign(int v);

Sets the vertical alignment of the control's text.

Return Value:

No return value.

Parameter Description
v The vertical alignment. You can pass one of the following values, defined by the IFxTextConstants interface.
  • vtaTop
  • vtaCenter
  • vtaBottom
  • vtaBaseline
  • vtaStretch

setWordWrap

public void setWordWrap(int ww);

Sets the word wrapping style.

Return Value:

No return value.

Parameter Description
ww The style of word wrapping. You can pass one of the following values, defined by the IFxTextConstants interface.
  • wwNone
  • wwWrap
  • wwKeepWordIntact
  • wwVirtualRectEnd
  • wwVirtualRectSide
  • wwCleanEdges
  • wwMask


Class AwtUIDrawTextBeanInfo

public class AwtUIDrawTextBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIDrawTextBeanInfo


Class AwtUIEdit

public class AwtUIEdit extends AwtUIControl
{
  // Constructors
  public AwtUIEdit();
  public AwtUIEdit(String newBuff);
  public AwtUIEdit(char newBuff[]);

  // Methods
  public void addActionListener(ActionListener l);
  public void addTextListener(TextListener l);
  public int append(char key);
  public void clear();
  public IUIComponent getBase();
  public int getCharFromScreen(int scrnX, int scrnY);
  public int getCharFromScreen(Point scrnPos);
  public Point getCharLocation(int iPos);
  public int getLength();
  public int getMaxBufferSize();
  public IFxShape getOutline();
  public char getPasswordChar();
  public String getSelectedText();
  public String getText();
  public int getWordWrap();
  public int insert(char key, int iPos);
  public boolean isAutoResizable();
  public boolean isBordered();
  public boolean isReadOnly();
  public boolean isSingleLine();
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  protected void processTextEvent(TextEvent e);
  public void remove(int iPos, int numberToRemove);
  public synchronized void removeActionListener(ActionListener l);
  public synchronized void removeTextListener(TextListener l);
  public void selectAll();
  public void setAutoResizable(boolean auto);
  public void setBordered(boolean b);
  public void setHorizAlign(int h);
  public void setMaxBufferSize(int newMax);
  public void setOutline(IFxShape outline);
  public void setPasswordChar(char c);
  public void setReadOnly(boolean ro);
  public void setRefresh(boolean r);
  public void setSingleLine(boolean sl);
  public void setText(String s);
  public void setText(char newBuff[], int offset, int len);
  public void setVertAlign(int v);
  public void setWordWrap(int ww);
  public void showCaret();
  public void showCaret(int iPos);
  public boolean tabbable();
}

This class implements the functionality of a UIEdit object in an AWT-based control. An AwtUIEdit control is an AwtUIHost component whose associated root container holds a UIEdit object. By hosting this object, an AwtUIEdit control integrates AFC with AWT. Although an AwtUIEdit control is fully compatible with AWT, a UIEdit control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIEdit

Constructors

AwtUIEdit

public AwtUIEdit();

Creates an empty AWT-based edit control.

AwtUIEdit

public AwtUIEdit(String newBuff);

Creates an AWT-based edit control with the specified string.

Parameter | Description
newBuff | The text of the control.

AwtUIEdit

public AwtUIEdit(char newBuff[]);

Creates an AWT-based edit control with the specified character buffer.

Parameter | Description
newBuff | The text of the control.

Methods

addActionListener

public void addActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

addTextListener

public void addTextListener(TextListener l);

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

Return Value:

No return value.

Parameter | Description
l | The text listener to be added.

See Also: removeTextListener

append

public int append(char key);

Appends a character to the end of the text in the control.

Return Value:

Returns the number of characters added.

Parameter | Description
key | The character to be appended.

clear

public void clear();

Deletes all the text from the edit control.

Return Value:

No return value.

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIEdit object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIEdit object.

getCharFromScreen

public int getCharFromScreen(int scrnX, int scrnY);

Retrieves the character at the specified coordinates.

Return Value:

Returns the index of the character at the specified position. If there is no character at that position, the character returned will be the last one on the nearest line.

Parameter | Description
scrnX | The x coordinate, in pixels.
scrnY | The y coordinate, in pixels.

getCharFromScreen

public int getCharFromScreen(Point scrnPos);

Retrieves the character at the specified point.

Return Value:

Returns the index of the character at the specified position. If there is no character at that position, the character returned will be the last one on the nearest line.

Parameter | Description
scrnPos | The coordinates of the point, in pixels.

getCharLocation

public Point getCharLocation(int iPos);

Retrieves the position that the character would be drawn at if drawn alone. This is typically used for placing the caret.

Return Value:

Returns a Point object that contains the client coordinates of the character.

Parameter | Description
iPos | The index of the character to query.

getLength

public int getLength();

Retrieves the length of the text in the control.

Return Value:

Returns the number of characters in the control.

getMaxBufferSize

public int getMaxBufferSize();

Retrieves the maximum number of characters that the control can hold.

Return Value:

Returns the maximum number of characters that the control can hold.

getOutline

public IFxShape getOutline();

Retrieves the outline along which text is drawn. For example, if the outline is an ellipse, the text that the AwtUIEdit object is created with is drawn along the outline of the ellipse.

Return Value:

Returns an IFxShape object that specifies the outline.

See Also: setOutline

getPasswordChar

public char getPasswordChar();

Retrieves the character that the control displays for password characters.

Return Value:

Returns the character that the control displays for password characters.

getSelectedText

public String getSelectedText();

Retrieves the selected text in the control.

Return Value:

Returns a String object that contains the selected text of the control.

getText

public String getText();

Retrieves the text in the control.

Return Value:

Returns a String object that contains the text of the control.

getWordWrap

public int getWordWrap();

Retrieves the word wrap style.

Return Value:

Returns the word wrap style. For a list of possible values, see setWordWrap.

insert

public int insert(char key, int iPos);

Inserts a character into the text in the control at the specified position.

Return Value:

Returns the number of characters inserted.

Parameter | Description
key | The character to be inserted.
iPos | The character index where the character will be inserted.

isAutoResizable

public boolean isAutoResizable();

Determines whether the bounding box of the control's text will automatically adjust to the size of the control when the control is resized or reshaped.

Return Value:

Returns true if the auto-resize attribute is set; otherwise, returns false.

See Also: setAutoResizable

isBordered

public boolean isBordered();

Determines whether the control has a border.

Return Value:

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

See Also: setBordered

isReadOnly

public boolean isReadOnly();

Determines whether the control is read-only.

Return Value:

Returns true if the READONLY style is set; otherwise, returns false.

isSingleLine

public boolean isSingleLine();

Retrieves the control's single line attribute.

Return Value:

Returns false if the control text can be displayed on multiple lines; otherwise, returns true.

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addsXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
action event | processActionEvent
text event | processTextEvent
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processTextEvent

protected void processTextEvent(TextEvent e);

Processes text events.

Return Value:

No return value.

Parameter | Description
e | The text event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processTextEvent to ensure the default event processing continues normally.

See Also: addTextListener

remove

public void remove(int iPos, int numberToRemove);

Deletes one or more characters from the edit control.

Return Value:

No return value.

Parameter | Description
iPos | The character index where the characters will be deleted.
numberToRemove | The number of characters that will be deleted.

removeActionListener

public synchronized void removeActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener

removeTextListener

public synchronized void removeTextListener(TextListener l);

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

Return Value:

No return value.

Parameter | Description
l | The text listener to be removed.

See Also: addTextListener

selectAll

public void selectAll();

Selects all of the text in the control.

Return Value:

No return value.

setAutoResizable

public void setAutoResizable(boolean auto);

Sets the control's auto-resize attribute.

Return Value:

No return value.

Parameter | Description
auto | If true, the bounding box of the control's text will automatically adjust to the size of the control when the control is resized or reshaped.

See Also: isAutoResizable

setBordered

public void setBordered(boolean b);

Sets or clears the control's border.

Return Value:

No return value.

Parameter | Description
b | If true, the control has a border; otherwise, it does not.

See Also: isBordered

setHorizAlign

public void setHorizAlign(int h);

Sets the horizontal alignment of the control's text.

Return Value:

No return value.

Parameter Description
h The horizontal alignment. You can pass one of the following values, defined by the IFxTextConstants interface.
  • htaLeft
  • htaCenter
  • htaRight
  • htaJustified
  • htaStretch
  • htaScriptDefault

setMaxBufferSize

public void setMaxBufferSize(int newMax);

Sets the maximum number of characters that the control can hold.

Return Value:

No return value.

Parameter | Description
newMax | The new maximum number of characters that the control can hold.

setOutline

public void setOutline(IFxShape outline);

Sets an outline that the text buffer is drawn along.

Return Value:

No return value.

Parameter | Description
outline | An IFxShape object that specifies the outline.

See Also: getOutline

setPasswordChar

public void setPasswordChar(char c);

Sets the character that is displayed in the control when a password is entered.

Return Value:

No return value.

Parameter | Description
c | The character that will be displayed in place of password characters. If the value is zero, the password character is cleared.

setReadOnly

public void setReadOnly(boolean ro);

Changes the read-only attribute of the control.

Return Value:

No return value.

Parameter | Description
ro | If true, the READONLY style is set; otherwise, it is cleared.

setRefresh

public void setRefresh(boolean r);

Sets the refresh flag.

Return Value:

No return value.

Parameter | Description
r | If true, the control will update itself whenever a parameter is changed. If false, the control will not update itself.

setSingleLine

public void setSingleLine(boolean sl);

Changes the control's single line attribute.

Return Value:

No return value.

Parameter | Description
sl | Set to false if the control's text is displayed on multiple lines. Otherwise, the text is displayed on a single line.

setText

public void setText(String s);

Sets the text in the control.

Return Value:

No return value.

Parameter | Description
s | A String object that specifies the new text.

setText

public void setText(char newBuff[], int offset, int len);

Replaces the text in the sentence with the specified array of characters.

Return Value:

No return value.

Parameter | Description
newBuff | The array of characters to replace the text with.
offset | The offset to use.
len | The length of the array used.

setVertAlign

public void setVertAlign(int v);

Sets the vertical alignment of the control's text.

Return Value:

No return value.

Parameter Description
v The vertical alignment. You can pass one of the following values, defined by the IFxTextConstants interface.
  • vtaTop
  • vtaCenter
  • vtaBottom
  • vtaBaseline
  • vtaStretch

setWordWrap

public void setWordWrap(int ww);

Sets the word wrap style.

Return Value:

No return value.

Parameter Description
ww The word wrap style. You can pass one of the following values, defined by the IFxTextConstants interface.
  • wwNone
  • wwWrap
  • wwKeepWordIntact
  • wwVirtualRectEnd
  • wwVirtualRectSide
  • wwCleanEdges
  • wwMask

showCaret

public void showCaret();

Shows the caret at the current position.

Return Value:

No return value.

showCaret

public void showCaret(int iPos);

Positions and displays the caret at the specified position.

Return Value:

No return value.

Parameter | Description
iPos | The character index where the caret will be positioned.

tabbable

public boolean tabbable();

Determines whether the control can be navigated to by pressing the TAB key.

Return Value:

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


Class AwtUIEditBeanInfo

public class AwtUIEditBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIEditBeanInfo


Class AwtUIGraphic

public class AwtUIGraphic extends AwtUIControl
{
  // Constructors
  public AwtUIGraphic();
  public AwtUIGraphic(Image image);
  public AwtUIGraphic(Image image, int justify);

  // Methods
  public IUIComponent getBase();
  public Rectangle getContentBounds();
  public Image getImage();
  public boolean imageUpdate(Image image, int flags, int x, int y,
        int width, int height);
  public void setImage(Image image);
}

This class implements the functionality of a UIGraphic object in an AWT-based control. An AwtUIGraphic control is an AwtUIHost component whose associated root container holds a UIGraphic object. By hosting this object, an AwtUIGraphic control integrates AFC with AWT. although an AwtUIGraphic control is fully compatible with AWT, a UIGraphic control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIGraphic

Constructors

AwtUIGraphic

public AwtUIGraphic();

Creates an AWT-based graphic control with no image.

AwtUIGraphic

public AwtUIGraphic(Image image);

Creates an AWT-based graphic control with the specified image.

Parameter | Description
image | The image to be displayed within the control.

Remarks:

By default, the image is aligned both horizontally and vertically.

AwtUIGraphic

public AwtUIGraphic(Image image, int justify);

Creates an AWT-based graphic control with the specified image and style.

Parameter | Description
image | The image to be displayed within the control.
justify | The alignment and style of the control. You can pass any bitwise combination of an alignment flag and a style flag. For a list of possible flags, see the UIStatic.setFlags method.

Remarks:

If a vertical alignment is not specified, VCENTER is used by default. Similarly, if a horizontal alignment is not specified, HCENTER is used.

Exceptions:

IllegalArgumentException if more than one vertical alignment, more than one horizontal alignment, or an undefined style was specified.

Methods

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIGraphic object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIGraphic object.

getContentBounds

public Rectangle getContentBounds();

Retrieves the bounding rectangle of the control's contents.

Return Value:

Returns a Rectangle object that defines the content area within the control's coordinate space.

getImage

public Image getImage();

Retrieves the control's image.

Return Value:

Returns the Image object displayed within the control.

See Also: setImage

imageUpdate

public boolean imageUpdate(Image image, int flags, int x, int y, int width,
        int height);

Incrementally draws the control's image as the bits become available.

Return Value:

Returns true if more information is needed to draw the full image; otherwise, returns false.

Parameter | Description
image | The control's image.
flags | The flags that specify the status of the image that is being loaded. You can pass any bitwise combination of the fields that are defined in the ImageObserver interface.
x | The x coordinate of the image.
y | The y coordinate of the image.
width | The width of the image (in pixels).
height | The height of the image (in pixels).

setImage

public void setImage(Image image);

Sets the control's image.

Return Value:

No return value.

Parameter | Description
image | The image to be displayed within the control.

See Also: getImage


Class AwtUIGraphicBeanInfo

public class AwtUIGraphicBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIGraphicBeanInfo


Class AwtUIHost

public class AwtUIHost extends Panel
{
  // Constructors
  public AwtUIHost();
  public AwtUIHost(IUIComponent comp);

  // Methods
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int index);
  public IUIComponent add(String name, IUIComponent comp);
  public IUIComponent add(IUIComponent comp, Object constraints);
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public synchronized void addComponentListener(
        ComponentListener l);
  public synchronized void addContainerListener(
        ContainerListener l);
  public synchronized void addFocusListener(FocusListener l);
  public synchronized void addKeyListener(KeyListener l);
  public synchronized void addMouseListener(MouseListener l);
  public synchronized void addMouseMotionListener(
        MouseMotionListener l);
  public void addNotify();
  public void disable();
  protected final void disableHostEvents(long eventsToDisable);
  public void enable();
  protected final void enableHostEvents(long eventsToEnable);
  public IUIComponent getComponent(IUIComponent comp);
  public int getComponentIndex(IUIComponent comp);
  public IUIComponent getHeader();
  public Dimension getPreferredSize();
  public UIRoot getRoot();
  public IUIComponent getUIComponent(int index);
  public int getUIComponentCount();
  public boolean handleEvent(Event evt);
  public void hide();
  public void invalidate();
  public void layout();
  public void paint(Graphics g);
  public void paintAll(Graphics g);
  public boolean postEvent(Event e);
  public Dimension preferredSize();
  protected final void preProcessHostEvent(Event e);
  protected void processComponentEvent(ComponentEvent e);
  protected void processContainerEvent(ContainerEvent e);
  protected void processEvent(AWTEvent e);
  protected void processFocusEvent(FocusEvent e);
  protected void processHostEvent(AWTEvent e);
  protected void processKeyEvent(KeyEvent e);
  protected void processMouseEvent(MouseEvent e);
  protected void processMouseMotionEvent(MouseEvent e);
  public synchronized void remove(Component comp);
  public void remove(int index);
  public void remove(IUIComponent comp);
  public void remove(int index);
  public void remove(IUIComponent comp);
  public void removeAll();
  public synchronized void removeComponentListener(
        ComponentListener l);
  public synchronized void removeContainerListener(
        ContainerListener l);
  public synchronized void removeFocusListener(FocusListener l);
  public synchronized void removeKeyListener(KeyListener l);
  public synchronized void removeMouseListener(MouseListener l);
  public synchronized void removeMouseMotionListener(
        MouseMotionListener l);
  public void removeNotify();
  public void setBackground(Color clr);
  public void setFont(Font fnt);
  public void setForeground(Color clr);
  public void setHeader(IUIComponent header);
  public void setLayout(IUILayoutManager lm);
  public void show();
  public void show(boolean on);
  public void update(Graphics g);
  public void validate();
  protected void validateTree();
}

This class links AWT with AFC. AwtUIHost extends the Panel class in AWT and is associated with a UIRoot container. (UIRoot extends the UIPanel class in AFC.) Every host is associated with a root container, and every root container is associated with a host.

AwtUIHost also provides the base support for the AwtUI and UI classes. For example, an AwtUITree object is an AWT-based control that hosts a UITree object. The AwtUITree object integrates AFC with AWT.

Panel
  |
  +--AwtUIHost

Constructors

AwtUIHost

public AwtUIHost();

Creates a host.

Remarks:

By default, the host's associated root container is created without a header component. However, you can set a header at any time by calling setHeader. To add other components to the root container, call add.

For more information about the root container, see the AwtUIHost overview. For more information about header components, see the UIPanel overview.

AwtUIHost

public AwtUIHost(IUIComponent comp);

Creates a host using the specified component.

Parameter | Description
comp | The component to be used for the root container's header.

Remarks:

The host's associated root container is created using the specified component for its header. Later, you can change the header component by calling setHeader. To add other components to the root container, call add.

For more information about the root container, see the AwtUIHost overview. For more information about header components, see the UIPanel overview.

Methods

add

public IUIComponent add(IUIComponent comp);

Adds the specified component to the associated root container.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The component to be added.

See Also: remove, setHeader

add

public IUIComponent add(IUIComponent comp, int index);

Adds the specified component to the associated root container at the specified index.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The component to be added.
index | The zero-based index at which to insert the component. To add the component at the end, pass -1. If the root container has a header component, the header is at index 0, and the first child begins at index 1. Otherwise, the first child begins at index 0. For more information about header components, see the UIPanel overview.

See Also: remove, setHeader

add

public IUIComponent add(String name, IUIComponent comp);

Adds the specified component to the associated root container, according to the specified layout location.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
name | The layout name identifying where to add the component. This value depends on the root container's current layout manager.
comp | The component to be added.

See Also: remove, setHeader

add

public IUIComponent add(IUIComponent comp, Object constraints);

Adds the specified component to the associated root container according to the specified layout constraints.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints identifying where to add the component. This value depends on the root container's current layout manager.

See Also: remove, setHeader

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds the specified component to the associated root container according to the specified layout constraints and index.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints identifying where to add the component. This value depends on the root container's current layout manager.
index | The zero-based index at which to insert the component. To add the component at the end, pass -1. If the root container has a header component, the header is at index 0, and the first child begins at index 1. Otherwise, the first child begins at index 0. For more information about header components, see the UIPanel overview.

See Also: remove, setHeader

addComponentListener

public synchronized void addComponentListener(ComponentListener l);

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

Return Value:

No return value.

Parameter | Description
l | The component listener to be added.

See Also: removeComponentListener

addContainerListener

public synchronized void addContainerListener(ContainerListener l);

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

Return Value:

No return value.

Parameter | Description
l | The container listener to be added.

See Also: removeContainerListener

addFocusListener

public synchronized void addFocusListener(FocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be added.

See Also: removeFocusListener

addKeyListener

public synchronized void addKeyListener(KeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be added.

See Also: removeKeyListener

addMouseListener

public synchronized void addMouseListener(MouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be added.

See Also: removeMouseListener

addMouseMotionListener

public synchronized void addMouseMotionListener(MouseMotionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse motion listener to be added.

See Also: removeMouseMotionListener

addNotify

public void addNotify();

Invokes addNotify for each component in the associated root container.

Return Value:

No return value.

See Also: removeNotify

disable

public void disable();

Disables the host.

Return Value:

No return value.

Remarks:

If the associated root container has a header component, this method also disables the root's header.

disableHostEvents

protected final void disableHostEvents(long eventsToDisable);

Disables the events defined by the specified event mask parameter from being delivered to this component.

Return Value:

No return value.

Parameter | Description
eventsToDisable | the event mask defining the event types.

enable

public void enable();

Enables the host.

Return Value:

No return value.

Remarks:

If the associated root container has a header component, this method also enables the root's header.

enableHostEvents

protected final void enableHostEvents(long eventsToEnable);

Enables the events defined by the specified event mask parameter to be delivered to this component.

Return Value:

No return value.

Parameter | Description
eventsToEnable | the event mask defining the event types.

Remarks:

Event types are automatically enabled when a listener for that type is added to the component. Therefore, this method only needs to be invoked by subclasses of a component requiring the specified event types delivered to processHostEvent, regardless of whether a listener is registered.

getComponent

public IUIComponent getComponent(IUIComponent comp);

Retrieves the component contained in the associated root container that is the ancestor of the specified component. The header component or any child component can be retrieved.

Return Value:

Returns the root container's immediate child or header component that is the ancestor of the specified component. If the specified component is itself an immediate child (or header) of the root container, this component is returned. If the root container is not an ancestor of the specified component, null is returned.

Parameter | Description
comp | The component to find the ancestor for.

getComponentIndex

public int getComponentIndex(IUIComponent comp);

Retrieves the index of the specified component within the associated root container.

Return Value:

Returns the zero-based index of the component (if the component belongs to the root container); otherwise, returns -1.

Parameter | Description
comp | The component to retrieve the index for. This component can be the header component or any child component.

Remarks:

If the root container has a header component, the header is at index 0, and the first child begins at index 1. Otherwise, the first child begins at index 0.

getHeader

public IUIComponent getHeader();

Retrieves the header component of the associated root container.

Return Value:

Returns the current header component (if the root container has a header); otherwise, returns null.

Remarks:

Header components are used by containers to represent the container itself. For example, the text displayed on a button is used as its header component. For more information about headers, see the UIPanel overview.

If the frame was constructed with an IUIComponent object, the root container initially uses this component for its header.

See Also: setHeader

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred dimensions (in pixels) for displaying the associated root container and its components.

Return Value:

Returns a Dimension object containing the preferred size.

See Also: preferredSize

getRoot

public UIRoot getRoot();

Retrieves the host's root container.

Return Value:

Returns the UIRoot object associated with the host.

getUIComponent

public IUIComponent getUIComponent(int index);

Retrieves the component at the specified index in the associated root container.

Return Value:

Returns the specified component.

Parameter | Description
index | The zero-based index of the component to be retrieved. If the root container has a header component, the header is at index 0 and the first child begins at index 1. Otherwise, the first child begins at index 0.

getUIComponentCount

public int getUIComponentCount();

Retrieves the number of components (including the header) contained in the associated root container.

Return Value:

Returns the total number of components.

handleEvent

public boolean handleEvent(Event evt);

Handles the specified event.

Return Value:

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

Parameter | Description
evt | The event.

Remarks:

If a listener has been added through a call to addXXXListener, this method calls processHostEvent to handle the event. Otherwise, the event is handled by one of the event methods (such as action or mouseDown).

hide

public void hide();

Hides the host and its root container.

Return Value:

No return value.

invalidate

public void invalidate();

Invalidates the host, and then updates the layout of the associated root container.

Return Value:

No return value.

layout

public void layout();

Lays out the components in the associated root container.

Return Value:

No return value.

paint

public void paint(Graphics g);

Draws the associated root container.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

paintAll

public void paintAll(Graphics g);

Draws the associated root container and its components.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

postEvent

public boolean postEvent(Event e);

Posts the specified event.

Return Value:

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

Parameter | Description
e | The event.

Remarks:

This method is called by processEvent. If the event's target is the host itself, the event is forwarded to the associated root container for handling. Otherwise, handleEvent is invoked.

preferredSize

public Dimension preferredSize();

Retrieves the preferred dimensions (in pixels) for displaying the associated root container and its components.

Return Value:

Returns a Dimension object containing the preferred size.

See Also: getPreferredSize

preProcessHostEvent

protected final void preProcessHostEvent(Event e);

Called by handleEvent to process the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has been registered through a call to addXXXListener. The preProcessHostEvent method first converts the specified Event object to an AWTEvent object, and then calls processHostEvent(AWTEvent e) to dispatch the event to the appropriate handler. A check is made if the event has been enabled through enableHostEvent or has a listener attached before it is dispatched.

processComponentEvent

protected void processComponentEvent(ComponentEvent e);

Processes component events.

Return Value:

No return value.

Parameter | Description
e | The component event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered component listener. When overriding this method, call the super method processComponentEvent to ensure the default event processing continues normally.

See Also: addComponentListener

processContainerEvent

protected void processContainerEvent(ContainerEvent e);

Processes container events.

Return Value:

No return value.

Parameter | Description
e | The container event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered key listener. When overriding this method, call the super method processContainerEvent to ensure the default event processing continues normally.

See Also: addContainerListener

processEvent

protected void processEvent(AWTEvent e);

Called by dispatchEvent to post the specified event.

Return Value:

No return value.

Parameter | Description
e | The event that has been generated.

Remarks:

This method first converts the specified AWTEvent object to an Event object, and then calls postEvent.

processFocusEvent

protected void processFocusEvent(FocusEvent e);

Processes focus events.

Return Value:

No return value.

Parameter | Description
e | The focus event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered focus listener. When overriding this method, call the super method processFocusEvent to ensure the default event processing continues normally.

See Also: addFocusListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is called by processHostEvent(Event e). Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
component event | processComponentEvent
container event | processContainerEvent
focus event | processFocusEvent
key event | processKeyEvent
mouse event | processMouseEvent
mouse motion event | processMouseMotionEvent

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processKeyEvent

protected void processKeyEvent(KeyEvent e);

Processes key events.

Return Value:

No return value.

Parameter | Description
e | The key event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered key listener. When overriding this method, call the super method processKeyEvent to ensure the default event processing continues normally.

See Also: addKeyListener

processMouseEvent

protected void processMouseEvent(MouseEvent e);

Processes mouse events.

Return Value:

No return value.

Parameter | Description
e | The mouse event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered mouse listener. When overriding this method, call the super method processMouseEvent to ensure the default event processing continues normally.

See Also: addMouseListener

processMouseMotionEvent

protected void processMouseMotionEvent(MouseEvent e);

Processes mouse motion events.

Return Value:

No return value.

Parameter | Description
e | The mouse motion event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered mouse motion listener. When overriding this method, call the super method processMouseMotionEvent to ensure the default event processing continues normally.

See Also: addMouseMotionListener

remove

public synchronized void remove(Component comp);

Removes the specified AwtUI component from the control.

Return Value:

No return value.

Parameter | Description
comp | The AwtUI component to be removed. (Pure AWT components cannot be removed.)

remove

public void remove(int index);

Removes the component at the specified index from the associated root container.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component to be removed. If the root container has a header component, the header is at index 0 and the first child begins at index 1. Otherwise, the first child begins at index 0.

See Also: removeAll, add

remove

public void remove(IUIComponent comp);

Removes the specified component from the associated root container.

Return Value:

No return value.

Parameter | Description
comp | The component to be removed.

See Also: removeAll, add

remove

public void remove(int index);

Removes the component at the specified index from the associated root container.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component to be removed. If the root container has a header component, the header is at index 0 and the first child begins at index 1. Otherwise, the first child begins at index 0.

See Also: removeAll, add

remove

public void remove(IUIComponent comp);

Removes the specified component from the associated root container.

Return Value:

No return value.

Parameter | Description
comp | The component to be removed.

See Also: removeAll, add

removeAll

public void removeAll();

Removes all components from the associated root container, including the header component.

Return Value:

No return value.

See Also: remove, add

removeComponentListener

public synchronized void removeComponentListener(ComponentListener l);

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

Return Value:

No return value.

Parameter | Description
l | The component listener to be removed.

See Also: addComponentListener

removeContainerListener

public synchronized void removeContainerListener(ContainerListener l);

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

Return Value:

No return value.

Parameter | Description
l | The container listener to be removed.

See Also: addContainerListener

removeFocusListener

public synchronized void removeFocusListener(FocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be removed.

See Also: addFocusListener

removeKeyListener

public synchronized void removeKeyListener(KeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be removed.

See Also: addKeyListener

removeMouseListener

public synchronized void removeMouseListener(MouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be removed.

See Also: addMouseListener

removeMouseMotionListener

public synchronized void removeMouseMotionListener(MouseMotionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse motion listener to be removed.

See Also: addMouseMotionListener

removeNotify

public void removeNotify();

Invokes removeNotify for each component in the associated root container.

Return Value:

No return value.

See Also: addNotify

setBackground

public void setBackground(Color clr);

Sets the host's background color.

Return Value:

No return value.

Parameter | Description
clr | The background color to be used by the host.

Remarks:

If the associated root container has a header component, this method also sets the background color of the header.

setFont

public void setFont(Font fnt);

Sets the host's font.

Return Value:

No return value.

Parameter | Description
fnt | The font to be used by the host.

Remarks:

If the associated root container has a header component, this method also sets the font of the header.

setForeground

public void setForeground(Color clr);

Sets the host's foreground color.

Return Value:

No return value.

Parameter | Description
clr | The foreground color to be used by the host.

Remarks:

If the associated root container has a header component, this method also sets the foreground color of the header.

setHeader

public void setHeader(IUIComponent header);

Sets the header component of the associated root container.

Parameter | Description
header | The component to be used as the root container's header component.

Remarks:

Header components are used by containers to represent the container itself. For example, the text displayed on a button is used as its header component. For more information about headers, see the UIPanel overview.

If the host was constructed with an IUIComponent object, the root container initially uses this component for its header. To add other child components, call add.

See Also: getHeader

setLayout

public void setLayout(IUILayoutManager lm);

Sets the layout manager of the associated root container.

Return Value:

No return value.

Parameter | Description
lm | The new layout manager to be used.

show

public void show();

Shows the host and its root container.

Return Value:

No return value.

show

public void show(boolean on);

Shows the host and optionally shows the root container.

Return Value:

No return value.

Parameter | Description
on | If true, the root container is made visible; otherwise, it is hidden.

update

public void update(Graphics g);

Updates the associated root container by redrawing the container and all its components.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

validate

public void validate();

Validates the host and the associated root container.

Return Value:

No return value.

validateTree

protected void validateTree();

Validates the host and all of its descendants, and then validates the associated root container.

Return Value:

No return value.


Class AwtUIList

public class AwtUIList extends AwtUIControl implements
            IAwtUIItemSelectable
{
  // Constructors
  public AwtUIList();
  public AwtUIList(int selMode);
  public AwtUIList(int selMode, int layoutStyle);

  // Methods
  public IUIComponent add(String s);
  public IUIComponent add(String s, int pos);
  public void addActionListener(ActionListener l);
  public void addItem(String item);
  public void addItem(String item, int pos);
  public void addItemListener(ItemListener l);
  public void addSelectedIndex(int index);
  public void addSelectedIndex(int index, boolean notify);
  public void addSelectedIndices(int indices[]);
  public void addSelectedIndices(int indices[], boolean notify);
  public void addSelectedItem(IUIComponent comp);
  public void addSelectedItem(IUIComponent comp, boolean notify);
  public void addSelectedItems(IUIComponent comps[]);
  public void addSelectedItems(IUIComponent comps[],
        boolean notify);
  public IUIComponent find(String prefix, boolean fromFocus);
  public IUIComponent find(String prefix, IUIComponent compStart);
  public IUIComponent find(String prefix);
  public IUIComponent getBase();
  public String getItem(int posn);
  public int getSelectedIndex();
  public int[] getSelectedIndices();
  public IUIComponent getSelectedItem();
  public IUIComponent[] getSelectedItems();
  public int getSelectionMode();
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  protected void processItemEvent(ItemEvent e);
  public void remove(int index);
  public void remove(IUIComponent comp);
  public synchronized void removeActionListener(ActionListener l);
  public synchronized void removeItemListener(ItemListener l);
  public void removeSelectedIndex(int index);
  public void removeSelectedIndex(int index, boolean notify);
  public void removeSelectedIndices(int indices[]);
  public void removeSelectedIndices(int indices[], boolean notify);
  public void removeSelectedItem(IUIComponent comp);
  public void removeSelectedItem(IUIComponent comp, boolean notify);
  public void removeSelectedItems(IUIComponent comps[]);
  public void removeSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setSelectedIndex(int index);
  public void setSelectedIndex(int index, boolean notify);
  public void setSelectedIndices(int indices[]);
  public void setSelectedIndices(int indices[], boolean notify);
  public void setSelectedItem(IUIComponent comp);
  public void setSelectedItem(IUIComponent comp, boolean notify);
  public void setSelectedItems(IUIComponent comps[]);
  public void setSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setSelectionMode(int selMode);
}

This class implements the functionality of a UIList object in an AWT-based control. An AwtUIList control is an AwtUIHost component whose associated root container holds a UIList object. By hosting this object, an AwtUIList control integrates AFC with AWT. Although an AwtUIList control is fully compatible with AWT, a UIList control is optimized for performance and size.

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

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIList

Constructors

AwtUIList

public AwtUIList();

Creates an empty AWT-based list control.

Remarks:

Call add or addItem to add items to the list. By default, the list control is a single-selection, single-column list.

AwtUIList

public AwtUIList(int selMode);

Creates an empty AWT-based list control with the specified selection mode.

Parameter | Description
selMode | The selection mode of the control. Possible values include IUISelector.SINGLESELECT, IUISelector.MULTISELECT, or IUISelector.EXTENDSELECT.

Remarks:

Call add or addItem to add items to the list. By default, the list control is a single-column list.

Exceptions:

IllegalArgumentException if an undefined selection mode was specified.

AwtUIList

public AwtUIList(int selMode, int layoutStyle);

Creates an empty AWT-based list control with the specified selection mode and layout style.

Parameter | Description
selMode | The selection mode of the control. Possible values include IUISelector.SINGLESELECT, IUISelector.MULTISELECT, or IUISelector.EXTENDSELECT.
layoutStyle | The layout style of the control. Possible values include UIVerticalFlowLayout.MULTICOLUMN, UIVerticalFlowLayout.FILL, or a bitwise combination of the two. (FILL extends the width of each list item's selectable area to the width of the item's column. This allows the item to be selected even when the horizontal area outside of its label is clicked.) Pass 0 for a single-column list with no fill.

Remarks:

Call add or addItem to add items to the list.

Exceptions:

IllegalArgumentException if an undefined selection mode or an undefined layout style was specified.

Methods

add

public IUIComponent add(String s);

Adds the specified text to the end of a list.

Return Value:

Returns the text component that was added, if successful; otherwise, returns null.

Parameter | Description
s | The text to be added.

Remarks:

By default, the text item is hot-tracked. To add an item that is not hot-tracked, call the inherited add method that takes an IUIComponent parameter and pass a UIText object. For more information about hot-tracking, see the UIList overview.

See Also: addItem, remove

add

public IUIComponent add(String s, int pos);

Adds the specified text to a list at the specified position.

Return Value:

Returns the text component that was added, if successful; otherwise, returns null.

Parameter | Description
s | The text to be added.
pos | The zero-based index at which to add the text. To add the text at the end of the list, pass -1.

Remarks:

By default, the text item is hot-tracked. To add an item that is not hot-tracked, call the inherited add method that takes an IUIComponent parameter and pass a UIText object. For more information about hot-tracking, see the UIList overview.

See Also: addItem, remove

addActionListener

public void addActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

addItem

public void addItem(String item);

Adds the specified text to the end of the list.

Return Value:

No return value.

Parameter | Description
item | The text to be added.

Remarks:

By default, the text item is hot-tracked. To add an item that is not hot-tracked, call the inherited add method that takes an IUIComponent parameter and pass a UIText object. For more information about hot-tracking, see the UIList overview.

See Also: add, remove

addItem

public void addItem(String item, int pos);

Adds the specified text to the list at the specified position.

Return Value:

No return value.

Parameter | Description
item | The text to be added.
pos | The zero-based index at which to add the text. To add the text at the end of the list, pass -1.

Remarks:

By default, the text item is hot-tracked. To add an item that is not hot-tracked, call the inherited add method that takes an IUIComponent and pass a UIText object. For more information about hot-tracking, see the UIList overview.

See Also: add, remove

addItemListener

public void addItemListener(ItemListener l);

Adds the specified item listener. The listener receives all item events generated for the control. (Item events are generated when the state of an item changes.)

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

addSelectedIndex

public void addSelectedIndex(int index);

Selects the component at the specified index, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.

addSelectedIndex

public void addSelectedIndex(int index, boolean notify);

Selects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedIndices

public void addSelectedIndices(int indices[]);

Selects the components at the specified indices, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.

addSelectedIndices

public void addSelectedIndices(int indices[], boolean notify);

Selects the components at the specified indices, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedItem

public void addSelectedItem(IUIComponent comp);

Selects the specified component, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.

addSelectedItem

public void addSelectedItem(IUIComponent comp, boolean notify);

Selects the specified component, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedItems

public void addSelectedItems(IUIComponent comps[]);

Selects the specified components, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be selected.

addSelectedItems

public void addSelectedItems(IUIComponent comps[], boolean notify);

Selects the specified components, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated. Currently not used.

find

public IUIComponent find(String prefix, boolean fromFocus);

Searches the control for an item whose name begins with the specified prefix. The search begins from either the current focus, or the first item in the selector.

Return Value:

Returns the first matching component, if a match is found; Otherwise, returns null.

Parameter | Description
prefix | The prefix string to search for.
fromFocus | If true, the search begins from the current focus. Otherwise, the search begins with the first item in the selector.

find

public IUIComponent find(String prefix, IUIComponent compStart);

Searches the selector control for an item whose name begins with the specified prefix. The search begins at compStart.

Return Value:

Returns The first matching component, if a match is found; otherwise, returns null.

Parameter | Description
prefix | The prefix string to search for.
compStart | The component at which the search begins. If it is null, the search will begin at the 1st item (according to navigate).

find

public IUIComponent find(String prefix);

Searches the control for an item whose name begins with the specified prefix. The search starts at the first item in the control.

Return Value:

Returns the first matching component; otherwise, returns null if a matching component is not found.

Parameter | Description
prefix | The prefix string to search for.

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIList object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIList object.

getItem

public String getItem(int posn);

Retrieves the string at the specified index.

Return Value:

Returns a string identifying the item at the specified index if the item is a UIText item, otherwise, returns null.

Parameter | Description
posn | The zero-based index of the string.

getSelectedIndex

public int getSelectedIndex();

Retrieves the zero-based index of the currently selected item.

Return Value:

Returns the index of the selected item or -1 if an item is not selected.

Remarks:

If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call getSelectedIndices.

For related code examples, see the UISelector overview.

See Also: getSelectedItem, setSelectedIndex

getSelectedIndices

public int[] getSelectedIndices();

Retrieves the zero-based indices of all currently selected items.

Return Value:

Returns an array of the indices of the selected items, or null if no item is selected.

See Also: getSelectedIndex, getSelectedItems, setSelectedIndices

getSelectedItem

public IUIComponent getSelectedItem();

Retrieves the currently selected item.

Return Value:

Returns the selected component; otherwise, returns null if no component is selected.

Remarks:

If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call getSelectedItems.

For related code examples, see the UISelector overview.

See Also: getSelectedIndex, setSelectedItem

getSelectedItems

public IUIComponent[] getSelectedItems();

Retrieves all currently selected items.

Return Value:

Returns an array of the selected components or returns null if a component is not selected.

See Also: getSelectedItem, getSelectedIndices, setSelectedItems

getSelectionMode

public int getSelectionMode();

Retrieves the selection mode of the control.

Return Value:

Returns one of the following three selection modes: IUISelector.SINGLESELECT, IUISelector.MULTISELECT, or IUISelector.EXTENDSELECT.

See Also: setSelectionMode

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
action event | processActionEvent
item event | processItemEvent
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

remove

public void remove(int index);

Removes the component at the specified index.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component to be removed.

remove

public void remove(IUIComponent comp);

Removes the specified component from the control.

Return Value:

No return value.

Parameter | Description
comp | The component to be removed.

Remarks:

For an example of calling remove, see UISelector.remove.

Overrides:

remove(IUIComponent) in AwtUIControl.

removeActionListener

public synchronized void removeActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener

removeItemListener

public synchronized void removeItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener

removeSelectedIndex

public void removeSelectedIndex(int index);

Deselects the component at the specified index, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.

removeSelectedIndex

public void removeSelectedIndex(int index, boolean notify);

Deselects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedIndices

public void removeSelectedIndices(int indices[]);

Deselects the components at the specified indices, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.

removeSelectedIndices

public void removeSelectedIndices(int indices[], boolean notify);

Deselects the components at the specified indices, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedItem

public void removeSelectedItem(IUIComponent comp);

Deselects the specified component, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.

removeSelectedItem

public void removeSelectedItem(IUIComponent comp, boolean notify);

Deselects the specified component, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[]);

Deselects the specified components, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be deselected.

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[], boolean notify);

Deselects the specified components, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

setSelectedIndex

public void setSelectedIndex(int index);

Sets the selection to the component at the specified index. By default, a list select event is not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.

Remarks:

This method clears any previous selection. If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call setSelectedIndices to select multiple items at a time.

See Also: setSelectedItem, addSelectedIndex, getSelectedIndex

setSelectedIndex

public void setSelectedIndex(int index, boolean notify);

Sets the selection to the component at the specified index and optionally generates a list select event.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.
notify | If true, a list select event will be generated; otherwise, a list select event will not be generated.

Remarks:

This method clears any previous selection. If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call setSelectedIndices to select multiple items at a time.

See Also: setSelectedItem, addSelectedIndex, getSelectedIndex

setSelectedIndices

public void setSelectedIndices(int indices[]);

Sets the selection to the components at the specified indices. List select events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the zero-based indices of the items to be selected.

Remarks:

This method clears any previous selection. If the control's selection mode is SINGLESELECT, you can also call setSelectedIndex.

See Also: setSelectedItems, getSelectedIndices

setSelectedIndices

public void setSelectedIndices(int indices[], boolean notify);

Sets the selection to the components at the specified indices and optionally generates list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the zero-based indices of the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method clears any previous selection. If the control's selection mode is SINGLESELECT, you can also call setSelectedIndex.

See Also: setSelectedItems, getSelectedIndices

setSelectedItem

public void setSelectedItem(IUIComponent comp);

Sets the selection to the specified component. A list select event is not generated.

Return Value:

No return value.

Parameter | Description
comp | The item to be selected.

Remarks:

This method clears any previous selection. If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call setSelectedItems to select multiple items at a time.

Exceptions:

IllegalArgumentException if the specified component is not an immediate child of the control.

See Also: setSelectedIndex, addSelectedItem, getSelectedItem

setSelectedItem

public void setSelectedItem(IUIComponent comp, boolean notify);

Sets the selection to the specified component, and optionally generates a list select event.

Return Value:

No return value.

Parameter | Description
comp | The item to be selected.
notify | If true, a list select event will be generated; otherwise, a list select event will not be generated.

Remarks:

This method clears any previous selection. If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call setSelectedItems to select multiple items at a time.

Exceptions:

IllegalArgumentException if the specified component is not an immediate child of the control.

See Also: setSelectedIndex, addSelectedItem, getSelectedItem

setSelectedItems

public void setSelectedItems(IUIComponent comps[]);

Sets the selection to the specified components. List select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected.

Remarks:

This method clears any previous selection. If the control's selection mode is SINGLESELECT, you can also call setSelectedItem.

Exceptions:

IllegalArgumentException if any component in the array is not an immediate child of the control.

See Also: setSelectedIndices, getSelectedItems

setSelectedItems

public void setSelectedItems(IUIComponent comps[], boolean notify);

Sets the selection to the specified components, and optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method clears any previous selection. If the control's selection mode is SINGLESELECT, you can also call setSelectedItem.

Exceptions:

IllegalArgumentException if any component in the array is not an immediate child of the control.

See Also: setSelectedIndices, getSelectedItems

setSelectionMode

public void setSelectionMode(int selMode);

Sets the selection mode of the control.

Return Value:

No return value.

Parameter | Description
selMode | The selection mode for the control. Possible values include IUISelector.SINGLESELECT, IUISelector.MULTISELECT, or IUISelector.EXTENDSELECT.

Exceptions:

IllegalArgumentException if an undefined selection mode was specified.

See Also: getSelectionMode


Class AwtUIListBeanInfo

public class AwtUIListBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIListBeanInfo


Class AwtUIMarquee

public class AwtUIMarquee extends AwtUIControl
{
  // Constructors
  public AwtUIMarquee();
  public AwtUIMarquee(IUIComponent comp);
  public AwtUIMarquee(IUIComponent comp, int rate);
  public AwtUIMarquee(IUIComponent comp, int rate, int dx, int dy);

  // Methods
  public IUIComponent getBase();
  public IUIComponent getContent();
  public void setContent(IUIComponent comp);
  public void setLabel(String str);
}

This class implements the functionality of a UIMarquee object in an AWT-based control. An AwtUIMarquee control is an AwtUIHost component whose associated root container holds a UIMarquee object. By hosting this object, an AwtUIMarquee control integrates AFC with AWT. Although an AwtUIMarquee control is fully compatible with AWT, a UIMarquee control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIMarquee

Constructors

AwtUIMarquee

public AwtUIMarquee();

Creates an AWT-based marquee control with no content.

Remarks:

To add content to the control, call setContent. By default, the content component scrolls from right to left at a rate of 75 milliseconds. The component moves by 10 pixels in the horizontal direction and 0 pixels in the vertical direction.

AwtUIMarquee

public AwtUIMarquee(IUIComponent comp);

Creates an AWT-based marquee control with the specified component.

Parameter | Description
comp | The component to be displayed within the control.

Remarks:

By default, the component scrolls from right to left at a rate of 75 milliseconds. The component moves by 10 pixels in the horizontal direction and 0 pixels in the vertical direction.

AwtUIMarquee

public AwtUIMarquee(IUIComponent comp, int rate);

Creates an AWT-based marquee control with the specified component and rate.

Parameter | Description
comp | The component to be displayed within the control.
rate | The rate at which to scroll the component (in milliseconds).

Remarks:

By default, the component scrolls from right to left at the specified rate. The component moves by 10 pixels in the horizontal direction and 0 pixels in the vertical direction.

AwtUIMarquee

public AwtUIMarquee(IUIComponent comp, int rate, int dx, int dy);

Creates an AWT-based marquee control with the specified component, rate, and scroll increments.

Parameter | Description
comp | The component to be displayed within the control.
rate | The rate at which to scroll the component (in milliseconds).
dx | The horizontal increment for scrolling the component (in pixels).
dy | The vertical increment for scrolling the component (in pixels).

Remarks:

If the dx and dy parameters are both nonnegative, the component scrolls from right to left. Otherwise, if either parameter is negative, the component scrolls from left to right.

Methods

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIMarquee object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIMarquee object.

getContent

public IUIComponent getContent();

Retrieves the control's content.

Return Value:

Returns the component currently being displayed in the control.

See Also: setContent

setContent

public void setContent(IUIComponent comp);

Sets the control's content to the specified component.

Return Value:

No return value.

Parameter | Description
comp | The component to be displayed within the control.

See Also: getContent

setLabel

public void setLabel(String str);

Sets the control's content to the specified string.

Return Value:

No return value.

Parameter | Description
str | The text string to be displayed within the control.


Class AwtUIMarqueeBeanInfo

public class AwtUIMarqueeBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIMarqueeBeanInfo


Class AwtUIMenuList

public class AwtUIMenuList extends AwtUIControl implements
            IAwtUIItemSelectable
{
  // Constructors
  public AwtUIMenuList();
  public AwtUIMenuList(int layoutStyle);

  // Methods
  public void addActionListener(ActionListener l);
  public void addItemListener(ItemListener l);
  public IUIComponent getBase();
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  protected void processItemEvent(ItemEvent e);
  public synchronized void removeActionListener(ActionListener l);
  public synchronized void removeItemListener(ItemListener l);
}

This class implements the functionality of a UIMenuList object in an AWT-based control. An AwtUIMenuList control is an AwtUIHost component whose associated root container holds a UIMenuList object. By hosting this object, an AwtUIMenuList control integrates AFC with AWT. Although an AwtUIMenuList control is fully compatible with AWT, a UIMenuList control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIMenuList

Constructors

AwtUIMenuList

public AwtUIMenuList();

Creates an empty AWT-based menu list control.

Remarks:

Call the add method (inherited through AwtUIControl) to add items to the list. By default, the control's selection mode is SINGLESELECT, and the layout style is FILL.

AwtUIMenuList

public AwtUIMenuList(int layoutStyle);

Creates an empty AWT-based menu list control with the specified layout style.

Parameter | Description
layoutStyle | The layout style of the control. Possible values include UIVerticalFlowLayout.MULTICOLUMN, UIVerticalFlowLayout.FILL, or a bitwise combination of the two. (FILL extends the width of an item to the width of the list control; this allows the item to be selected even when the area outside of its text label is clicked.) Specify 0 for a single-column list with no fill.

Remarks:

Call the add method (inherited through AwtUIControl) to add items to the list. By default, the control's selection mode is SINGLESELECT.

Exceptions:

IllegalArgumentException if an undefined layout style was specified.

Methods

addActionListener

public void addActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

addItemListener

public void addItemListener(ItemListener l);

Adds the specified item listener. The listener receives all item events generated for the control. (Item events are generated when the state of an item changes.)

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIMenuList object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIMenuList object.

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
action event | processActionEvent
item event | processItemEvent
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

removeActionListener

public synchronized void removeActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener

removeItemListener

public synchronized void removeItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener


Class AwtUIPanel

public class AwtUIPanel extends AwtUIControl
{
  // Constructors
  public AwtUIPanel();

  // Methods
  public IUIComponent getBase();
  public IUIComponent getUIComponent(int n);
  public int getUIComponentCount();
  public IUIComponent[] getUIComponents();
  public void setLayout(IUILayoutManager lm);
  public void setLayout(LayoutManager mgr);
}

This class implements the functionality of a UIPanel object in an AWT-based container. An AwtUIPanel container is an AwtUIHost component whose associated root container holds a UIPanel object. By hosting this object, an AwtUIPanel container integrates AFC with AWT. Although an AwtUIPanel container is fully compatible with AWT, a UIPanel container is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIPanel

Constructors

AwtUIPanel

public AwtUIPanel();

Creates an AwtUIPanel container.

Methods

getBase

public IUIComponent getBase();

Retrieves the UI component that the container is based on.

Return Value:

Returns the UIPanel object associated with the container.

Remarks:

When the AWT-based container is first created, it is associated with a UIPanel object.

getUIComponent

public IUIComponent getUIComponent(int n);

Retrieves the nth component in this container.

Return Value:

Returns the nth component in the container.

Parameter | Description
n | The number of the component to get

Exceptions:

ArrayIndexOutOfBoundsException if the nth value does not exist.

getUIComponentCount

public int getUIComponentCount();

Retrieves the number of components in this panel.

Return Value:

Returns the number of components in the container.

See Also: getComponent

getUIComponents

public IUIComponent[] getUIComponents();

Gets all the components in this container.

Return Value:

Returns an array containing the components in the container.

setLayout

public void setLayout(IUILayoutManager lm);

Sets the layout manager of the associated UIPanel object.

Return Value:

No return value.

Parameter | Description
lm | The new layout manager of the associated UI container.

setLayout

public void setLayout(LayoutManager mgr);

This method does nothing and should not be called. setLayout should only be called with an IUILayoutManager. Use setLayout instead.

Return Value:

No return value.

Overrides:

setLayout(LayoutManager) in AwtUIControl.

See Also: setLayout


Class AwtUIProgress

public class AwtUIProgress extends AwtUIControl
{
  // Constructors
  public AwtUIProgress();
  public AwtUIProgress(int range);
  public AwtUIProgress(int range, int pos);

  // Methods
  public IUIComponent getBase();
  public int getPos();
  public int getRange();
  public void setPos(int pos);
  public void setRange(int range);
}

This class implements the functionality of a UIProgress object in an AWT-based control. An AwtUIProgress control is an AwtUIHost component whose associated root container holds a UIProgress object. By hosting this object, an AwtUIProgress control integrates AFC with AWT. Although an AwtUIProgress control is fully compatible with AWT, a UIProgress control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIProgress

Constructors

AwtUIProgress

public AwtUIProgress();

Creates an AWT-based progress control.

Remarks:

By default, the control has a range from 0 to 100. The control's initial position is set to 0.

AwtUIProgress

public AwtUIProgress(int range);

Creates an AWT-based progress control with the specified range and an initial position of 0.

Parameter | Description
range | The maximum range value of the control. The control's range is from 0 to range.

AwtUIProgress

public AwtUIProgress(int range, int pos);

Creates an AWT-based progress control with the specified range and initial position.

Parameter | Description
range | The maximum range value of the control. The control's range is from 0 to range.
pos | The initial position of the progress control.

Methods

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIProgress object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIProgress object.

getPos

public int getPos();

Retrieves the current position of the control within its range.

Return Value:

Returns the control's position.

getRange

public int getRange();

Retrieves the range of the control.

Return Value:

Returns the maximum value in the control's range.

setPos

public void setPos(int pos);

Sets the position of the control within its range.

Return Value:

No return value.

Parameter | Description
pos | The new position of the control.

setRange

public void setRange(int range);

Sets the range of the control.

Return Value:

No return value.

Parameter | Description
range | The maximum range value of the control. The control's range is from 0 to range.


Class AwtUIProgressBeanInfo

public class AwtUIProgressBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIProgressBeanInfo


Class AwtUIPushButton

public class AwtUIPushButton extends AwtUIButton
{
  // Constructors
  public AwtUIPushButton();
  public AwtUIPushButton(String text);
  public AwtUIPushButton(String text, int style);
  public AwtUIPushButton(IUIComponent comp);
  public AwtUIPushButton(IUIComponent comp, int style);

  // Methods
  public void addActionListener(ActionListener l);
  public IUIComponent getBase();
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  public synchronized void removeActionListener(ActionListener l);
}

This class implements the functionality of a UIPushButton object in an AWT-based control. An AwtUIPushButton control is an AwtUIHost component whose associated root container holds a UIPushButton object. By hosting this object, an AwtUIPushButton control integrates AFC with AWT. Although an AwtUIPushButton control is fully compatible with AWT, a UIPushButton control is optimized for performance and size.

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.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIButton
        |
        +--AwtUIPushButton

Constructors

AwtUIPushButton

public AwtUIPushButton();

Creates an AWT-based push button control with no content.

Remarks:

By default, the button's style is RAISED.

AwtUIPushButton

public AwtUIPushButton(String text);

Creates an AWT-based push button control with the specified text.

Parameter | Description
text | The text to be displayed within the button.

Remarks:

By default, the button is hot-tracked and has a flat style. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

AwtUIPushButton

public AwtUIPushButton(String text, int style);

Creates an AWT-based push button control with the specified text and style.

Parameter | Description
text | The text to be displayed within the button.
style | The style of the button. Possible values include any bitwise combination of UIPushButton.RAISED, UIButton.TOGGLE, and UIButton.TRITOGGLE. (Combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter.

Remarks:

By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

AwtUIPushButton

public AwtUIPushButton(IUIComponent comp);

Creates an AWT-based push button control with the specified component.

Parameter | Description
comp | The component to be displayed within the button.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. By default, the button's style is RAISED. For examples of how to construct buttons, see the UIButton overview.

AwtUIPushButton

public AwtUIPushButton(IUIComponent comp, int style);

Creates an AWT-based push button control with the specified component and style.

Parameter | Description
comp | The component to be displayed within the button.
style | The style of the button. Possible values include any bitwise combination of UIPushButton.RAISED, UIButton.TOGGLE, and UIButton.TRITOGGLE. (Combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

addActionListener

public void addActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the button is based on.

Return Value:

Returns the UIPushButton object associated with the button control.

Remarks:

When the AWT-based button is first created, it is associated with a UIPushButton object.

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the methods in the following table.

Event type | Method called
action event | processActionEvent
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

removeActionListener

public synchronized void removeActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener


Class AwtUIPushButtonBeanInfo

public class AwtUIPushButtonBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIPushButtonBeanInfo


Class AwtUIRadioButton

public class AwtUIRadioButton extends AwtUIButton implements
            IAwtUIItemSelectable
{
  // Constructors
  public AwtUIRadioButton();
  public AwtUIRadioButton(String name);
  public AwtUIRadioButton(String name, int style);
  public AwtUIRadioButton(IUIComponent comp);
  public AwtUIRadioButton(IUIComponent comp, int style);

  // Methods
  public void addItemListener(ItemListener l);
  public IUIComponent getBase();
  protected void processHostEvent(AWTEvent e);
  protected void processItemEvent(ItemEvent e);
  public void removeItemListener(ItemListener l);
}

This class implements the functionality of a UIRadioButton object in an AWT-based control. An AwtUIRadioButton control is an AwtUIHost component whose associated root container holds a UIRadioButton object. By hosting this object, an AwtUIRadioButton control integrates AFC with AWT. Although an AwtUIRadioButton control is fully compatible with AWT, a UIRadioButton control is optimized for performance and size.

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.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIButton
        |
        +--AwtUIRadioButton

Constructors

AwtUIRadioButton

public AwtUIRadioButton();

Creates an AWT-based radio button control with no content.

Remarks:

By default, the button's style is set to TOGGLE.

AwtUIRadioButton

public AwtUIRadioButton(String name);

Creates an AWT-based radio button control with the specified text.

Parameter | Description
name | The text to be displayed with the radio button image.

Remarks:

By default, the button is hot-tracked and its style is set to TOGGLE. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

AwtUIRadioButton

public AwtUIRadioButton(String name, int style);

Creates an AWT-based radio button control using the specified text for content and the specified style.

Parameter | Description
name | The text to be displayed with the radio button image.
style | The style of the button. Possible values include UIButton.TOGGLE or UIButton.TRITOGGLE.

Remarks:

By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

AwtUIRadioButton

public AwtUIRadioButton(IUIComponent comp);

Creates an AWT-based radio button control with the specified component.

Parameter | Description
comp | The component to be displayed with the radio button image.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. By default, the button's style is set to TOGGLE. For examples of how to construct buttons, see the UIButton overview.

AwtUIRadioButton

public AwtUIRadioButton(IUIComponent comp, int style);

Creates an AWT-based radio button control with the specified component and style.

Parameter | Description
comp | The component to be displayed with the radio button image.
style | The style of the button. Possible values include UIButton.TOGGLE or UIButton.TRITOGGLE.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

addItemListener

public void addItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the button is based on.

Return Value:

Returns the UIRadioButton object associated with the button control.

Remarks:

When the AWT-based button is first created, it is associated with a UIRadioButton object.

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
item event | processItemEvent
action event | processActionEvent (inherited through AwtUIButton)
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

removeItemListener

public void removeItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener


Class AwtUIRadioButtonBeanInfo

public class AwtUIRadioButtonBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIRadioButtonBeanInfo


Class AwtUIRepeatButton

public class AwtUIRepeatButton extends AwtUIButton
{
  // Constructors
  public AwtUIRepeatButton();
  public AwtUIRepeatButton(IUIComponent comp);
  public AwtUIRepeatButton(String text);
  public AwtUIRepeatButton(String text, int style);
  public AwtUIRepeatButton(IUIComponent comp, int style);

  // Methods
  public void addActionListener(ActionListener l);
  public IUIComponent getBase();
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  public synchronized void removeActionListener(ActionListener l);
}

This class implements the functionality of a UIRepeatButton object in an AWT-based control. An AwtUIRepeatButton control is an AwtUIHost component whose associated root container holds a UIRepeatButton object. By hosting this object, an AwtUIRepeatButton control integrates AFC with AWT. Although an AwtUIRepeatButton control is fully compatible with AWT, a UIRepeatButton control is optimized for performance and size.

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.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIButton
        |
        +--AwtUIRepeatButton

Constructors

AwtUIRepeatButton

public AwtUIRepeatButton();

Creates an AWT-based repeating push button with no content.

Remarks:

By default, the button has a flat style.

AwtUIRepeatButton

public AwtUIRepeatButton(IUIComponent comp);

Creates an AWT-based repeating push button with the specified component.

Parameter | Description
comp | The component to be displayed within the button.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. By default, the button has a flat style. For examples of how to construct buttons, see the UIButton overview.

AwtUIRepeatButton

public AwtUIRepeatButton(String text);

Creates an AWT-based repeating push button with the specified text.

Parameter | Description
text | The text to be displayed within the button.

Remarks:

By default, the button is hot-tracked and has a flat style. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

AwtUIRepeatButton

public AwtUIRepeatButton(String text, int style);

Creates an AWT-based repeating push button with the specified text and style.

Parameter | Description
text | The text to be displayed within button.
style | The style of the button. Possible values include any bitwise combination of UIPushButton.RAISED, UIButton.TOGGLE, and UIButton.TRITOGGLE. (Combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter.

Remarks:

By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

AwtUIRepeatButton

public AwtUIRepeatButton(IUIComponent comp, int style);

Creates an AWT-based repeating push button with the specified component and style.

Parameter | Description
comp | The component to be displayed within button.
style | The style of the button. Possible values include any bitwise combination of UIPushButton.RAISED, UIButton.TOGGLE, and UIButton.TRITOGGLE. (Combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

addActionListener

public void addActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the button is based on.

Return Value:

Returns the UIRepeatButton object associated with the button control.

Remarks:

When the AWT-based button is first created, it is associated with a UIRepeatButton object.

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
action event | processActionEvent
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

removeActionListener

public synchronized void removeActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener


Class AwtUIRepeatButtonBeanInfo

public class AwtUIRepeatButtonBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIRepeatButtonBeanInfo


Class AwtUIScrollBar

public class AwtUIScrollBar extends AwtUIControl implements
            IAwtUIAdjustable
{
  // Constructors
  public AwtUIScrollBar();
  public AwtUIScrollBar(int style);
  public AwtUIScrollBar(int style, int min, int max, int page,
        int line, int pos);

  // Methods
  public void addAdjustmentListener(AdjustmentListener l);
  public IUIComponent getBase();
  public int getBlockIncrement();
  public Insets getInsets();
  public int getMaximum();
  public int getMinimum();
  public int getOrientation();
  public Point getPosition();
  public int getScrollLine();
  public int getScrollMax();
  public int getScrollMin();
  public int getScrollPage();
  public int getScrollPos();
  public int getStyle();
  public int getUnitIncrement();
  public int getValue();
  public int getVisibleAmount();
  protected void processAdjustmentEvent(AdjustmentEvent e);
  protected void processHostEvent(AWTEvent e);
  public synchronized void removeAdjustmentListener(
        AdjustmentListener l);
  public int scrollEnd();
  public int scrollHome();
  public int scrollLineDown();
  public int scrollLineUp();
  public int scrollPageDown();
  public int scrollPageUp();
  public void setBlockIncrement(int b);
  public void setMaximum(int max);
  public void setMinimum(int min);
  public void setPosition(Point pt);
  public void setPosition(int x, int y);
  public int setScrollInfo(int min, int max, int page, int line,
        int pos);
  public void setScrollLine(int line);
  public void setScrollMax(int max);
  public void setScrollMin(int min);
  public void setScrollPage(int page);
  public void setScrollPos(int pos);
  public int setScrollRange(int min, int max);
  public void setStyle(int style);
  public void setUnitIncrement(int u);
  public void setValue(int v);
  public void setVisibleAmount(int v);
}

This class implements the functionality of a UIScrollBar object in an AWT-based control. An AwtUIScrollBar control is an AwtUIHost component whose associated root container holds a UIScrollBar object. By hosting this object, an AwtUIScrollBar control integrates AFC with AWT. Although an AwtUIScrollBar control is fully compatible with AWT, a UIScrollBar control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIScrollBar

Constructors

AwtUIScrollBar

public AwtUIScrollBar();

Creates an AWT-based horizontal scroll bar. By default, the control has a range of 0 to 100.

AwtUIScrollBar

public AwtUIScrollBar(int style);

Creates an AWT-based scroll bar with the specified style. By default, the control has a range of 0 to 100.

Parameter Description
style The style of the control. You can pass any bitwise combination of the following values:
  • UIScroll.VERTICAL
  • UIScroll.NOHIDE
  • UIScroll.NOSHOW
  • UIScroll.NONPROPORTIONAL
  • UIScroll.NOKEY
  • 0 (for a horizontal scroll bar)

Exceptions:

IllegalArgumentException if an undefined style was specified.

AwtUIScrollBar

public AwtUIScrollBar(int style, int min, int max, int page, int line,
        int pos);

Creates an AWT-based scroll bar with the specified style and scroll information.

Parameter | Description
style The style of the control. You can pass any bitwise combination of the following values:
  • UIScroll.VERTICAL
  • UIScroll.NOHIDE
  • UIScroll.NOSHOW
  • UIScroll.NONPROPORTIONAL
  • UIScroll.NOKEY
  • 0 (for a horizontal scroll bar)
min | The minimum scroll position in the control's range.
max | The maximum scroll position in the control's range.
page | The number of scroll positions that are associated with a page. The size of the THUMB component is based on the ratio of page to range.
line | The number of scroll positions that are associated with a line.
pos | The current scroll position.

Remarks:

For more information about range, page, and line values, see the UIScroll overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

addAdjustmentListener

public void addAdjustmentListener(AdjustmentListener l);

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

Return Value:

No return value.

Parameter | Description
l | The adjustment listener to be added.

See Also: removeAdjustmentListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIScrollBar object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIScrollBar object.

getBlockIncrement

public int getBlockIncrement();

Retrieves the block increment of the control. The block increment is defined as the number of scroll positions associated with a page.

Return Value:

Returns the number of scroll positions in a page.

Remarks:

This method implements getBlockIncrement in the IAwtUIAdjustable interface. For more information about page values, see the UIScroll overview.

See Also: getScrollPage, setScrollPage

getInsets

public Insets getInsets();

Retrieves the control's insets (in pixels), which identify the nonclient area of the control.

Return Value:

Returns an Insets object that contains the scroll bar's insets.

getMaximum

public int getMaximum();

Retrieves the maximum value in the control's range.

Return Value:

Returns the maximum scroll position.

Remarks:

This method implements getMaximum in the IAwtUIAdjustable interface.

See Also: getScrollMax, getMinimum, setMaximum

getMinimum

public int getMinimum();

Retrieves the minimum value in the control's range.

Return Value:

Returns the minimum scroll position.

Remarks:

This method implements getMinimum in the IAwtUIAdjustable interface.

See Also: getScrollMin, getMaximum, setMinimum

getOrientation

public int getOrientation();

Retrieves the orientation style of the control.

Return Value:

Returns an integer that contains the orientation style. Possible values include ScrollBar.VERTICAL or ScrollBar.HORIZONTAL.

Remarks:

This method implements getOrientation in the IAwtUIAdjustable interface.

getPosition

public Point getPosition();

Retrieves the position of the control.

Return Value:

Returns a Point object containing the current position.

Remarks:

If the scroll bar is horizontal, the x coordinate of the returned Point is the current scroll position, and the y coordinate is zero. If the scroll bar is vertical, the x coordinate is zero, and the y coordinate is the current scroll position.

See Also: setPosition

getScrollLine

public int getScrollLine();

Retrieves the number of scroll positions associated with a line.

Return Value:

Returns the number of scroll positions in a line.

Remarks:

For more information about line values, see the UIScroll overview.

See Also: getUnitIncrement, setScrollLine

getScrollMax

public int getScrollMax();

Retrieves the maximum value in the control's range.

Return Value:

Returns the maximum scroll position.

See Also: getMaximum, getScrollMin, setScrollMax

getScrollMin

public int getScrollMin();

Retrieves the minimum value in the control's range.

Return Value:

Returns the minimum scroll position.

See Also: getMinimum, getScrollMax, setScrollMin

getScrollPage

public int getScrollPage();

Retrieves the number of scroll positions associated with a page.

Return Value:

Returns the number of scroll positions in a page.

Remarks:

For more information about page values, see the UIScroll overview.

See Also: setScrollPage

getScrollPos

public int getScrollPos();

Retrieves the position of the control.

Return Value:

Returns the current scroll position.

See Also: getValue, getPosition, setScrollPos

getStyle

public int getStyle();

Retrieves the current style of the control.

Return Value:

Returns an integer containing the current style settings. For a list of possible styles, see setStyle.

getUnitIncrement

public int getUnitIncrement();

Retrieves the unit value increment of the control. This value is defined as the number of scroll positions associated with a line.

Return Value:

Returns the number of scroll positions in a line.

Remarks:

This method implements getUnitIncrement in the IAwtUIAdjustable interface. For more information about line values, see the UIScroll overview.

See Also: getScrollLine, setUnitIncrement

getValue

public int getValue();

Retrieves the control's value, which is defined as its current position.

Return Value:

Returns the current scroll position.

Remarks:

This method implements getValue in the IAwtUIAdjustable interface.

See Also: getScrollPos, setValue

getVisibleAmount

public int getVisibleAmount();

Retrieves the length of the control's THUMB component. This value is based on the number of scroll positions associated with a page.

Return Value:

Returns the number of scroll positions in a page.

Remarks:

This method implements getVisibleAmount in the IAwtUIAdjustable interface. For more information about page values, see the UIScroll overview.

See Also: getScrollPage, setVisibleAmount

processAdjustmentEvent

protected void processAdjustmentEvent(AdjustmentEvent e);

Processes adjustment events.

Return Value:

No return value.

Parameter | Description
e | The adjustment event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered adjustment listener. When overriding this method, call the super method processAdjustmentEvent to ensure the default event processing continues normally.

See Also: addAdjustmentListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
adjustment event | processAdjustmentEvent
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

removeAdjustmentListener

public synchronized void removeAdjustmentListener(AdjustmentListener l);

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

Return Value:

No return value.

Parameter | Description
l | The adjustment listener to be removed.

See Also: addAdjustmentListener

scrollEnd

public int scrollEnd();

Moves the current scroll position to the maximum range value.

Return Value:

Returns the control's new scroll position.

See Also: scrollHome

scrollHome

public int scrollHome();

Moves the current scroll position to the minimum range value.

Return Value:

Returns the control's new scroll position.

See Also: scrollEnd

scrollLineDown

public int scrollLineDown();

Increments the current scroll position by one line.

Return Value:

Returns the control's new scroll position.

Remarks:

For more information about line values, see the UIScroll overview.

See Also: scrollLineUp

scrollLineUp

public int scrollLineUp();

Decrements the current scroll position by one line.

Return Value:

Returns the control's new scroll position.

Remarks:

For more information about line values, see the UIScroll overview.

See Also: scrollLineDown

scrollPageDown

public int scrollPageDown();

Increments the current scroll position by one line less than a full page.

Return Value:

Returns the control's new scroll position.

Remarks:

If the difference between the page and line values is negative or zero, the scroll position is incremented by one scroll position. For more information about page and line values, see the UIScroll overview.

See Also: scrollPageUp

scrollPageUp

public int scrollPageUp();

Decrements the current scroll position by one line less than a full page.

Return Value:

Returns the control's new scroll position.

Remarks:

If the difference between the page and line values is negative or zero, the scroll position is decremented by one scroll position. For more information about page and line values, see the UIScroll overview.

See Also: scrollPageDown

setBlockIncrement

public void setBlockIncrement(int b);

Sets the block increment for the control. The block increment is defined as the number of scroll positions associated with a page.

Return Value:

No return value.

Parameter | Description
b | The number of scroll positions to be associated with a page.

Remarks:

This method implements setBlockIncrement in the IAwtUIAdjustable interface. For more information about page values, see the UIScroll overview.

See Also: setScrollPage, getBlockIncrement

setMaximum

public void setMaximum(int max);

Sets the maximum range value and adjusts the control's current position accordingly.

Return Value:

No return value.

Parameter | Description
max | The maximum scroll position.

Remarks:

This method implements setMaximum in the IAwtUIAdjustable interface.

See Also: setScrollMax, setMinimum, getMaximum

setMinimum

public void setMinimum(int min);

Sets the minimum range value and adjusts the control's current position accordingly.

Return Value:

No return value.

Parameter | Description
min | The minimum scroll position.

Remarks:

This method implements setMinimum in the IAwtUIAdjustable interface.

See Also: setScrollMin, setMaximum, getMinimum

setPosition

public void setPosition(Point pt);

Sets the position of the control, based on the specified Point.

Return Value:

No return value.

Parameter | Description
pt | The requested position for the control. The x and y coordinates of pt specify the horizontal and vertical scroll positions (in pixels), respectively.

Remarks:

If the scroll bar is horizontal, the x coordinate of the returned Point is the new scroll position, and the y coordinate is zero. If the scroll bar is vertical, the x coordinate is zero, and the y coordinate is the new scroll position. Depending on the control's range, these coordinates may differ from those of the parameter pt.

See Also: getPosition

setPosition

public void setPosition(int x, int y);

Sets the position of the control, based on the specified values.

Return Value:

No return value.

Parameter | Description
x | The requested horizontal scroll position (in pixels).
y | The requested vertical scroll position (in pixels).

Remarks:

If the scroll bar is horizontal, the x coordinate of the returned Point is the new scroll position, and the y coordinate is zero. If the scroll bar is vertical, the x coordinate is zero, and the y coordinate is the scroll position. Depending on the control's range, these coordinates may differ from the x and y parameters.

See Also: getPosition

setScrollInfo

public int setScrollInfo(int min, int max, int page, int line, int pos);

Sets the specified scroll information and adjusts the control's current position accordingly.

Return Value:

Returns the control's new scroll position after setting the specified values.

Parameter | Description
min | The minimum scroll position in the control's range.
max | The maximum scroll position in the control's range.
page | The number of scroll positions associated with a page.
line | The number of scroll positions associated with a line.
pos | The current scroll position.

Remarks:

If the NONPROPORTIONAL style is not set and the page value is nonzero, the size of the THUMB component represents the ratio of page to range. Otherwise, the size of THUMB represents a scroll position. For more information about range, page, and line values, see the UIScroll overview.

setScrollLine

public void setScrollLine(int line);

Sets the number of scroll positions associated with a line and adjusts the control's current position accordingly.

Return Value:

No return value.

Parameter | Description
line | The number of scroll positions to be associated with a line.

Remarks:

For more information about line values, see the UIScroll overview.

See Also: setUnitIncrement, getScrollLine

setScrollMax

public void setScrollMax(int max);

Sets the maximum range value and adjusts the control's current position accordingly.

Return Value:

No return value.

Parameter | Description
max | The maximum scroll position.

See Also: setMaximum, setScrollMin, getScrollMax

setScrollMin

public void setScrollMin(int min);

Sets the minimum range value and adjusts the control's current position accordingly.

Return Value:

No return value.

Parameter | Description
min | The minimum scroll position.

See Also: setMinimum, setScrollMax, getScrollMin

setScrollPage

public void setScrollPage(int page);

Sets the number of scroll positions associated with a page and adjusts the control's current position accordingly.

Return Value:

No return value.

Parameter | Description
page | The number of scroll positions to be associated with a page.

Remarks:

If the NONPROPORTIONAL style is not set and the page value is nonzero, the size of the THUMB component represents the ratio of page to range. Otherwise, the size of THUMB represents a scroll position. For more information about page values, see the UIScroll overview.

See Also: setBlockIncrement, getScrollPage

setScrollPos

public void setScrollPos(int pos);

Sets the control's current position to the specified scroll position.

Return Value:

No return value.

Parameter | Description
pos | The scroll position of the control.

Remarks:

Depending on the control's range, the returned position may differ from the pos parameter.

See Also: setValue, setPosition, getScrollPos

setScrollRange

public int setScrollRange(int min, int max);

Sets the control's range and adjusts the control's current position accordingly.

Return Value:

Returns the control's new scroll position after setting the specified values.

Parameter | Description
min | The minimum scroll position.
max | The maximum scroll position.

setStyle

public void setStyle(int style);

Sets the current style for the control.

Return Value:

No return value.

Parameter Description
style The style of the control. You can pass any bitwise combination of the following values:
  • UIScroll.VERTICAL
  • UIScroll.NOHIDE
  • UIScroll.NOSHOW
  • UIScroll.NONPROPORTIONAL
  • UIScroll.NOKEY
  • 0 (for a horizontal scroll bar)

Exceptions:

IllegalArgumentException if an undefined style was specified.

setUnitIncrement

public void setUnitIncrement(int u);

Sets the unit value increment of the control. This value is defined as the number of scroll positions associated with a line.

Return Value:

No return value.

Parameter | Description
u | The number of scroll positions to be associated with a line.

Remarks:

This method implements setUnitIncrement in the IAwtUIAdjustable interface. For more information about line values, see the UIScroll overview.

See Also: setScrollLine, getUnitIncrement

setValue

public void setValue(int v);

Sets the control's value, which is defined as its current position.

Return Value:

No return value.

Parameter | Description
v | The position for the control.

Remarks:

This method implements setValue in the IAwtUIAdjustable interface.

See Also: setScrollPos, getValue

setVisibleAmount

public void setVisibleAmount(int v);

Sets the length of the control's THUMB component. This value is used as the number of scroll positions associated with a page.

Return Value:

No return value.

Parameter | Description
v | The number of scroll positions to be associated with a page.

Remarks:

This method implements setVisibleAmount in the IAwtUIAdjustable interface. For more information about page values, see the UIScroll overview.

See Also: setScrollPage, getVisibleAmount


Class AwtUIScrollBarBeanInfo

public class AwtUIScrollBarBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIScrollBarBeanInfo


Class AwtUIScrollViewer

public class AwtUIScrollViewer extends AwtUIControl
{
  // Constructors
  public AwtUIScrollViewer();
  public AwtUIScrollViewer(IUIComponent comp);
  public AwtUIScrollViewer(IUIComponent comp, int style);
  public AwtUIScrollViewer(IUIComponent comp, int hLine, int vLine);
  public AwtUIScrollViewer(IUIComponent comp, int hLine, int vLine,
        int style);
  public AwtUIScrollViewer(IUIComponent comp, int hLine, int vLine,
        int style, int scrollStyle);
  public AwtUIScrollViewer(IUIComponent comp, int hLine, int vLine,
        int style, int hstyle, int vstyle);
  public AwtUIScrollViewer(Component comp);
  public AwtUIScrollViewer(Component comp, int style);
  public AwtUIScrollViewer(Component comp, int hLine, int vLine);
  public AwtUIScrollViewer(Component comp, int hLine, int vLine,
        int style);
  public AwtUIScrollViewer(Component comp, int hLine, int vLine,
        int style, int scrollStyle);
  public AwtUIScrollViewer(Component comp, int hLine, int vLine,
        int style, int hstyle, int vstyle);

  // Methods
  public IUIComponent getBase();
  public IUIComponent getContent();
  public int getHLine();
  public Point getLine();
  public Point getPosition();
  public int getVLine();
  public void setContent(IUIComponent content);
  public void setHLine(int line);
  public void setLine(int hLine, int vLine);
  public void setPosition(Point pt);
  public void setPosition(int x, int y);
  public void setVLine(int line);
}

This class implements the functionality of a UIScrollViewer object in an AWT-based control. An AwtUIScrollViewer control is an AwtUIHost component whose associated root container holds a UIScrollViewer object. By hosting this object, an AwtUIScrollViewer control integrates AFC with AWT. Although an AwtUIScrollViewer control is fully compatible with AWT, a UIScrollViewer control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIScrollViewer

Constructors

AwtUIScrollViewer

public AwtUIScrollViewer();

Creates an AWT-based scroll viewer control with no content.

Remarks:

To add a content component to the control, call setContent. The control displays scroll bars only when they are needed to view the content component. The content component's horizontal and vertical scroll line increments are 10 pixels each.

By default, the horizontal scroll bar is placed at the bottom of the control. The vertical scroll bar is placed at the right. The horizontal and vertical header bars are placed at the top and at the left of the control, respectively.

AwtUIScrollViewer

public AwtUIScrollViewer(IUIComponent comp);

Creates an AWT-based scroll viewer control with the specified UI component.

Parameter | Description
comp | The UI component to be displayed within the control.

Remarks:

The control displays scroll bars only when they are needed to view the content component. The content component's horizontal and vertical scroll line increments are 10 pixels each. To change the content component, call setContent.

By default, the horizontal scroll bar is placed at the bottom of the control. The vertical scroll bar is placed at the right. The horizontal and vertical header bars are placed at the top and at the left of the control, respectively.

Exceptions:

IllegalArgumentException if the component is null.

AwtUIScrollViewer

public AwtUIScrollViewer(IUIComponent comp, int style);

Creates an AWT-based scroll viewer control with the specified UI component and style.

Parameter | Description
comp | The UI component to be displayed within the control.
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: UIScrollViewer.SCROLL_TOP, UIScrollViewer.SCROLL_LEFT, UIScrollViewer.HEADER_BOTTOM, and UIScrollViewer.HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control and places header bars at the top and at the left.

Remarks:

By default, the control displays scroll bars only when they are needed to view the content component. The content component's horizontal and vertical scroll line increments are 10 pixels each. To change the content component, call setContent.

Exceptions:

IllegalArgumentException if an undefined style was specified.

IllegalArgumentException if the component is null.

AwtUIScrollViewer

public AwtUIScrollViewer(IUIComponent comp, int hLine, int vLine);

Creates an AWT-based scroll viewer control with the specified UI component and the scroll line increments.

Parameter | Description
comp | The UI component to be displayed within the control.
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).

Remarks:

By default, the control displays scroll bars only when they are needed to view the content component. The horizontal scroll bar is placed at the bottom of the control. The vertical scroll bar is placed at the right. The horizontal and vertical header bars are placed at the top and at the left of the control, respectively.

To change the content component, call setContent.

Exceptions:

IllegalArgumentException if the component is null.

AwtUIScrollViewer

public AwtUIScrollViewer(IUIComponent comp, int hLine, int vLine,
        int style);

Creates an AWT-based scroll viewer control with the specified UI component, scroll line increments, and style.

Parameter | Description
comp | The UI component to be displayed within the control.
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: UIScrollViewer.SCROLL_TOP, UIScrollViewer.SCROLL_LEFT, UIScrollViewer.HEADER_BOTTOM, and UIScrollViewer.HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control and places header bars at the top and at the left.

Remarks:

By default, the control displays scroll bars only when they are needed to view the content component. To change the content component, call setContent.

Exceptions:

IllegalArgumentException if an undefined style was specified.

IllegalArgumentException if the component is null.

AwtUIScrollViewer

public AwtUIScrollViewer(IUIComponent comp, int hLine, int vLine,
        int style, int scrollStyle);

Creates an AWT-based scroll viewer control with the specified UI component, scroll line increments, and styles.

Parameter | Description
comp | The UI component to be displayed within the control.
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: UIScrollViewer.SCROLL_TOP, UIScrollViewer.SCROLL_LEFT, UIScrollViewer.HEADER_BOTTOM, and UIScrollViewer.HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control, and places header bars at the top and at the left.
scrollStyle | The style of both scroll bars. Possible values include UIScroll.NOHIDE, UIScroll.NOSHOW, or UIScroll.NONPROPORTIONAL.

Remarks:

To change the content component, call setContent.

Exceptions:

IllegalArgumentException if an undefined style was specified.

IllegalArgumentException if the component is null.

AwtUIScrollViewer

public AwtUIScrollViewer(IUIComponent comp, int hLine, int vLine,
        int style, int hstyle, int vstyle);

Creates an AWT-based scroll viewer control with the specified UI component, scroll line increments, and styles.

Parameter | Description
comp | The UI component to be displayed within the control.
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: UIScrollViewer.SCROLL_TOP, UIScrollViewer.SCROLL_LEFT, UIScrollViewer.HEADER_BOTTOM, and UIScrollViewer.HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control and places header bars at the top and at the left.
hstyle | The style of the horizontal scroll bar. Possible values include UIScroll.NOHIDE, UIScroll.NOSHOW, or UIScroll.NONPROPORTIONAL.
vstyle | The style of the vertical scroll bar. Possible values include UIScroll.NOHIDE, UIScroll.NOSHOW, or UIScroll.NONPROPORTIONAL.

Remarks:

To change the content component, call setContent.

Exceptions:

IllegalArgumentException if an undefined style was specified.

IllegalArgumentException if the component is null.

AwtUIScrollViewer

public AwtUIScrollViewer(Component comp);

Creates an AWT-based scroll viewer control with the specified AwtUI component. Pure AWT components cannot be added.

Parameter | Description
comp | The AwtUI component to be displayed within the control.

Remarks:

The control displays scroll bars only when they are needed to view the content component. The content component's horizontal and vertical scroll line increments are 10 pixels each.

By default, the horizontal scroll bar is placed at the bottom of the control. The vertical scroll bar is placed at the right. The horizontal and vertical header bars are placed at the top and at the left of the control, respectively.

AwtUIScrollViewer

public AwtUIScrollViewer(Component comp, int style);

Creates an AWT-based scroll viewer control with the specified AwtUI component and style. Pure AWT components cannot be added.

Parameter | Description
comp | The AwtUI component to be displayed within the control.
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: UIScrollViewer.SCROLL_TOP, UIScrollViewer.SCROLL_LEFT, UIScrollViewer.HEADER_BOTTOM, and UIScrollViewer.HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control, and places header bars at the top and at the left.

Remarks:

By default, the control displays scroll bars only when they are needed to view the content component. The content component's horizontal and vertical scroll line increments are 10 pixels each.

Exceptions:

IllegalArgumentException if an undefined style was specified.

AwtUIScrollViewer

public AwtUIScrollViewer(Component comp, int hLine, int vLine);

Creates an AWT-based scroll viewer control with the specified AwtUI component and scroll line increments. Pure AWT components cannot be added.

Parameter | Description
comp | The AwtUI component to be displayed within the control.
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).

Remarks:

By default, the control displays scroll bars only when they are needed to view the content component. The horizontal scroll bar is placed at the bottom of the control. The vertical scroll bar is placed at the right. The horizontal and vertical header bars are placed at the top and at the left of the control, respectively.

AwtUIScrollViewer

public AwtUIScrollViewer(Component comp, int hLine, int vLine, int style);

Creates an AWT-based scroll viewer control with the specified AwtUI component, scroll line increments, and style. Pure AWT components cannot be added.

Parameter | Description
comp | The AwtUI component to be displayed within the control
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: UIScrollViewer.SCROLL_TOP, UIScrollViewer.SCROLL_LEFT, UIScrollViewer.HEADER_BOTTOM, and UIScrollViewer.HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control and places header bars at the top and at the left.

Remarks:

By default, the control displays scroll bars only when they are needed to view the content component.

Exceptions:

IllegalArgumentException if an undefined style was specified.

AwtUIScrollViewer

public AwtUIScrollViewer(Component comp, int hLine, int vLine, int style,
        int scrollStyle);

Creates an AWT-based scroll viewer control with the specified AwtUI component, scroll line increments, and styles. Pure AWT components cannot be added.

Parameter | Description
comp | The AwtUI component to be displayed within the control.
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: UIScrollViewer.SCROLL_TOP, UIScrollViewer.SCROLL_LEFT, UIScrollViewer.HEADER_BOTTOM, and UIScrollViewer.HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control and places header bars at the top and at the left.
scrollStyle | The style of both scroll bars. Possible values include UIScroll.NOHIDE, UIScroll.NOSHOW, or UIScroll.NONPROPORTIONAL.

Exceptions:

IllegalArgumentException if an undefined style was specified.

AwtUIScrollViewer

public AwtUIScrollViewer(Component comp, int hLine, int vLine, int style,
        int hstyle, int vstyle);

Creates an AWT-based scroll viewer control with the specified AwtUI component, scroll line increments, and styles. Pure AWT components cannot be added.

Parameter | Description
comp | The AwtUI component to be displayed within the control.
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: UIScrollViewer.SCROLL_TOP, UIScrollViewer.SCROLL_LEFT, UIScrollViewer.HEADER_BOTTOM, and UIScrollViewer.HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control and places header bars at the top and at the left.
hstyle | The style of the horizontal scroll bar. Possible values include UIScroll.NOHIDE, UIScroll.NOSHOW, or UIScroll.NONPROPORTIONAL.
vstyle | The style of the vertical scroll bar. Possible values include UIScroll.NOHIDE, UIScroll.NOSHOW, or UIScroll.NONPROPORTIONAL.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIScrollViewer object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIScrollViewer object.

getContent

public IUIComponent getContent();

Retrieves the control's content component.

Return Value:

Returns The component displayed within the control.

See Also: setContent

getHLine

public int getHLine();

Retrieves the number of pixels associated with a horizontal scroll position.

Return Value:

Returns the number of pixels in the horizontal scroll bar's scroll line.

See Also: getVLine, getLine, setHLine

getLine

public Point getLine();

Retrieves the number of pixels associated with the horizontal and vertical scroll positions.

Return Value:

Returns a Point object that contains the number of pixels in a scroll line. The x coordinate specifies the horizontal scroll line; the y coordinate specifies the vertical scroll line.

See Also: getHLine, getVLine, setLine

getPosition

public Point getPosition();

Retrieves the current position of the control's content.

Return Value:

Returns a Point object that contains the content component's position. The x and y coordinates specify the horizontal and vertical positions (in pixels), respectively.

See Also: setPosition

getVLine

public int getVLine();

Retrieves the number of pixels associated with a vertical scroll position.

Return Value:

Returns the number of pixels in the vertical scroll bar's scroll line.

See Also: getHLine, getLine, setVLine

setContent

public void setContent(IUIComponent content);

Sets the control's content to the specified component.

Return Value:

No return value.

Parameter | Description
content | The component to be displayed within the control.

See Also: getContent

setHLine

public void setHLine(int line);

Sets the number of pixels associated with a horizontal scroll position.

Return Value:

No return value.

Parameter | Description
line | The number of pixels for the horizontal scroll bar's scroll line.

See Also: setVLine, setLine, getHLine

setLine

public void setLine(int hLine, int vLine);

Sets the number of pixels associated with horizontal and vertical scroll positions.

Return Value:

No return value.

Parameter | Description
hLine | The number of pixels for the horizontal scroll bar's scroll line.
vLine | The number of pixels for the vertical scroll bar's scroll line.

See Also: setHLine, setVLine, getLine

setPosition

public void setPosition(Point pt);

Moves the scroll viewer's content to the scroll position given by the specified point.

Return Value:

No return value.

Parameter | Description
pt | The requested position for the content component. The x and y coordinates of pt specify the horizontal and vertical positions (in pixels), respectively.

See Also: getPosition

setPosition

public void setPosition(int x, int y);

Moves the control's content to the position given by the specified values.

Return Value:

No return value.

Parameter | Description
x | The requested horizontal position for the content component (in pixels).
y | The requested vertical position for the content component (in pixels).

See Also: getPosition

setVLine

public void setVLine(int line);

Sets the number of pixels associated with a vertical scroll position.

Return Value:

No return value.

Parameter | Description
line | The number of pixels for the vertical scroll bar's scroll line.

See Also: setHLine, setLine, getVLine


Class AwtUISplitViewer

public class AwtUISplitViewer extends AwtUIControl
{
  // Constructors
  public AwtUISplitViewer();
  public AwtUISplitViewer(IUIComponent nw, IUIComponent se);
  public AwtUISplitViewer(IUIComponent nw, IUIComponent se,
        int style);
  public AwtUISplitViewer(IUIComponent nw, IUIComponent se,
        int style, int size);
  public AwtUISplitViewer(IUIComponent nw, IUIComponent se,
        int style, int size, boolean addScroll);
  public AwtUISplitViewer(Component nw, Component se);
  public AwtUISplitViewer(Component nw, Component se, int style);
  public AwtUISplitViewer(Component nw, Component se, int style,
        int size);

  // Methods
  public Component add(String constraint, Component component);
  public IUIComponent getBase();
  public IUIComponent getComponent(String name);
  public int getPos();
  public int getStyle();
  public void remove(IUIComponent component);
  public void setPos(int pos);
}

This class implements the functionality of a UISplitViewer object in an AWT-based control. An AwtUISplitViewer control is an AwtUIHost component whose associated root container holds a UISplitViewer object. By hosting this object, an AwtUISplitViewer control integrates AFC with AWT. Although an AwtUISplitViewer control is fully compatible with AWT, a UISplitViewer control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUISplitViewer

Constructors

AwtUISplitViewer

public AwtUISplitViewer();

Creates an AWT-based vertical split viewer control with no content.

Remarks:

To add components to the control, call the add method.

AwtUISplitViewer sv = new AwtUISplitViewer();
add(sv);  // Add sv to the container.

// Add a UI component to the left pane and an
// AwtUI component to the right pane. The layout
// constraints passed to add are defined by
// UISplitLayout, the layout manager of the
// underlying UISplitViewer object.
sv.add(new UIText("Left component"), "nw");
sv.add("se", new AwtUIText("Right component"));

By default, the size of the left component is -50, and neither pane displays scroll bars. For more information about component sizes, see the UISplitViewer overview.

AwtUISplitViewer

public AwtUISplitViewer(IUIComponent nw, IUIComponent se);

Creates an AWT-based vertical split viewer control with the specified components.

Parameter | Description
nw | The content component for the left (west) pane of the control.
se | The content component for the right (east) pane of the control.

Remarks:

By default, the size of the nw component is -50, and neither pane displays scroll bars. For more information about component sizes, see the UISplitViewer overview.

AwtUISplitViewer

public AwtUISplitViewer(IUIComponent nw, IUIComponent se, int style);

Creates an AWT-based split viewer control with the specified components and style.

Parameter | Description
nw | The content component for the top (north) or left (west) pane of the control.
se | The content component for the bottom (south) or right (east) pane of the control.
style | The style of the control. Possible values include UISplitViewer.HORIZONTAL for a horizontal split or 0 for a vertical split.

Remarks:

By default, the size of the nw component is -50, and neither pane displays scroll bars. For more information about component sizes, see the UISplitViewer overview.

AwtUISplitViewer

public AwtUISplitViewer(IUIComponent nw, IUIComponent se, int style,
        int size);

Creates an AWT-based split viewer control with the specified components, style, and size.

Parameter | Description
nw | The content component for the top (north) or left (west) pane of the control.
se | The content component for the right (east) pane of the control.
style | The style of the control. Possible values include UISplitViewer.HORIZONTAL for a horizontal split or 0 for a vertical split.
size | The size of the nw component. A negative value means the height or width is a percentage of the split viewer's total height or width. A positive value specifies the absolute height or width in pixels. For more information, see the UISplitViewer overview.

Remarks:

By default, neither pane displays scroll bars.

Exceptions:

IllegalArgumentException if the size parameter was less than -100.

AwtUISplitViewer

public AwtUISplitViewer(IUIComponent nw, IUIComponent se, int style,
        int size, boolean addScroll);

Creates an AWT-based split viewer control with the specified components, style, and size, and optional scroll bar support.

Parameter | Description
nw | The content component for the top (north) or left (west) pane of the control.
se | The content component for the right (east) pane of the control.
style | The style of the control. Possible values include HORIZONTAL for a horizontal split or 0 for a vertical split.
size | The size of the nw component. A negative value means the height or width is a percentage of the split viewer's total height or width. A positive value specifies the absolute height or width in pixels. For more information, see the UISplitViewer overview.
addScroll | If true, scroll bars will be added to each pane when they are needed; otherwise, neither pane will provide scroll bars.

Exceptions:

IllegalArgumentException if the size parameter was less than -100.

AwtUISplitViewer

public AwtUISplitViewer(Component nw, Component se);

Creates an AWT-based vertical split viewer control with the specified AwtUI components. Pure AWT components cannot be added.

Parameter | Description
nw | The AwtUI component to be displayed in the left (west) pane of the control.
se | The AwtUI component to be displayed in the right (east) pane of the control.

Remarks:

By default, the size of the nw component is -50. For more information about component sizes, see the UISplitViewer overview.

AwtUISplitViewer

public AwtUISplitViewer(Component nw, Component se, int style);

Creates an AWT-based split viewer control with the specified components and style.

Parameter | Description
nw | The content component for the top (north) or left (west) pane of the control.
se | The content component for the bottom (south) or right (east) pane of the control.
style | The style of the control. Possible values include UISplitViewer.HORIZONTAL for a horizontal split, or 0 for a vertical split.

Remarks:

By default, the size of the nw component is -50 and neither pane displays scroll bars. For more information about component sizes, see the UISplitViewer overview.

AwtUISplitViewer

public AwtUISplitViewer(Component nw, Component se, int style, int size);

Creates an AWT-based split viewer control with the specified components, style, and size.

Parameter | Description
nw | The content component for the top (north) or left (west) pane of the control.
se | The content component for the right (east) pane of the control.
style | The style of the control. Possible values include UISplitViewer.HORIZONTAL for a horizontal split, or 0 for a vertical split.
size | The size of the nw component. A negative value means the height or width is a percentage of the split viewer's total height or width. A positive value specifies the absolute height or width in pixels. For more information, see the UISplitViewer overview.

Remarks:

By default, neither pane displays scroll bars.

Exceptions:

IllegalArgumentException if the size parameter was less than -100.

Methods

add

public Component add(String constraint, Component component);

Adds the specified AwtUI component to the control. Pure AWT components cannot be added.

Return Value:

Returns the control itself.

Parameter | Description
constraint The layout constraint identifying where to add the component. You can pass one of the following values:
"nw" | Adds the component in the top (north) or left (west) pane.
"se" | Adds the component in the bottom (south) or right (east) pane.
"splitter" | Adds the component as the divider between the two panes.
component | The AwtUI component to be added.

Remarks:

Other versions of add are inherited through AwtUIControl.

Overrides:

add(String,Component) in AwtUIControl.

See Also: remove

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UISplitViewer object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UISplitViewer object.

getComponent

public IUIComponent getComponent(String name);

Retrieves the component at the specified layout position.

Return Value:

Returns the specified component.

Parameter Description
name The layout name that identifies the component to be retrieved. You can pass one of the following values:
"nw" | Retrieves the component in the top (north) or left (west) pane.
"se" | Retrieves the component in the bottom (south) or right (east) pane.
"splitter" | Retrieves the component that divides the two panes.

Remarks:

The name parameter is not case-sensitive.

Exceptions:

IllegalArgumentException if an undefined name was specified.

getPos

public int getPos();

Retrieves the current split position.

Return Value:

Returns the split position of the control.

Remarks:

For more information about split positions, see the UISplitLayout overview.

See Also: setPos

getStyle

public int getStyle();

Retrieves the style of the control.

Return Value:

Returns an integer that contains the current style setting. Possible style values include UISplitViewer.HORIZONTAL for a horizontal split or 0 for a vertical split.

remove

public void remove(IUIComponent component);

Removes the specified component from the control.

Return Value:

No return value.

Parameter | Description
component | The component to be removed.

Overrides:

remove(IUIComponent) in AwtUIControl.

See Also: add

setPos

public void setPos(int pos);

Sets the current split position.

Return Value:

No return value.

Parameter | Description
pos | The new split position.

Remarks:

For more information about split positions, see the UISplitLayout overview.

Exceptions:

IllegalArgumentException if the specified position was less than -100.

See Also: getPos


Class AwtUIStatus

public class AwtUIStatus extends AwtUIControl
{
  // Constructors
  public AwtUIStatus();
  public AwtUIStatus(String text);
  public AwtUIStatus(String text, int style);
  public AwtUIStatus(IUIComponent comp);

  // Methods
  public IUIComponent getBase();
}

This class implements the functionality of a UIStatus object in an AWT-based control. An AwtUIStatus control is an AwtUIHost component whose associated root container holds a UIStatus object. By hosting this object, an AwtUIStatus control integrates AFC with AWT. Although an AwtUIStatus control is fully compatible with AWT, a UIStatus control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIStatus

Constructors

AwtUIStatus

public AwtUIStatus();

Creates an AWT-based status bar control with no content.

AwtUIStatus

public AwtUIStatus(String text);

Creates an AWT-based status bar control with the specified text.

Parameter | Description
text | The text to be displayed within the control.

Remarks:

By default, the text is left-aligned.

AwtUIStatus

public AwtUIStatus(String text, int style);

Creates an AWT-based status bar control with the specified text and style.

Parameter | Description
text | The text to be displayed within the control.
style | The style of the control. For a list of possible values, see the alignment flags described in the UIStatic.setFlags method.

AwtUIStatus

public AwtUIStatus(IUIComponent comp);

Creates an AWT-based status bar control with the specified component.

Parameter | Description
comp | The component to be displayed within the control.

Methods

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIStatus object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIStatus object.


Class AwtUIStatusBeanInfo

public class AwtUIStatusBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUIStatusBeanInfo


Class AwtUITabList

public class AwtUITabList extends AwtUIControl implements
            IAwtUIItemSelectable
{
  // Constructors
  public AwtUITabList();

  // Methods
  public IUIComponent add(String s);
  public IUIComponent add(String s, int pos);
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int pos);
  public void addActionListener(ActionListener l);
  public void addItemListener(ItemListener l);
  public IUIComponent getBase();
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  protected void processItemEvent(ItemEvent e);
  public synchronized void removeActionListener(ActionListener l);
  public synchronized void removeItemListener(ItemListener l);
}

This class implements the functionality of a UITabList object in an AWT-based control. An AwtUITabList control is an AwtUIHost component whose associated root container holds a UITabList object. By hosting this object, an AwtUITabList control integrates AFC with AWT. Although an AwtUITabList control is fully compatible with AWT, a UITabList control is optimized for performance and size.

Note The hot-tracked color and the button text color are the same. As a result, hot-tracking does not appear to be functional.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUITabList

Constructors

AwtUITabList

public AwtUITabList();

Creates an empty AWT-based tab list control.

Remarks:

Call the add method to add tabs to the list.

Methods

add

public IUIComponent add(String s);

Adds a tab containing the specified text to the end of the control.

Return Value:

Returns the tab component that was added.

Parameter | Description
s | The text to be displayed on the tab.

Remarks:

By default, the tab is hot-tracked. To add a tab that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITabList overview.

add

public IUIComponent add(String s, int pos);

Adds a tab containing the specified text to the control. The tab is added at the specified position.

Return Value:

Returns the tab component that was added.

Parameter | Description
s | The text to be displayed on the tab.
pos | The zero-based index at which to add the tab. To add the tab at the end of the control, pass -1.

Remarks:

By default, the tab is hot-tracked. To add a tab that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITabList overview.

add

public IUIComponent add(IUIComponent comp);

Adds a tab containing the specified component to the end of the control.

Return Value:

Returns the tab component that was added.

Parameter | Description
comp | The component to be displayed on the tab. If comp is already a UITab object, this tab is added. Otherwise, a new UITab object that displays comp is added.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component.

Overrides:

add(IUIComponent) in AwtUIControl.

add

public IUIComponent add(IUIComponent comp, int pos);

Adds a tab containing the specified component to the control. The tab is added at the specified position.

Return Value:

Returns the tab component that was added.

Parameter | Description
comp | The component to be displayed on the tab. If comp is already a UITab object, this tab is added. Otherwise, a new UITab object that displays comp is added.
pos | The zero-based index at which to add the tab. To add the tab at the end of the control, pass -1.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component.

Overrides:

add(IUIComponent,int) in AwtUIControl.

addActionListener

public void addActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

addItemListener

public void addItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UITabList object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UITabList object.

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
item event | processItemEvent
action event | processActionEvent
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

removeActionListener

public synchronized void removeActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener

removeItemListener

public synchronized void removeItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener


Class AwtUITabListBeanInfo

public class AwtUITabListBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUITabListBeanInfo


Class AwtUITabViewer

public class AwtUITabViewer extends AwtUIControl
{
  // Constructors
  public AwtUITabViewer();

  // Methods
  public IUIComponent add(String name, IUIComponent comp);
  public Component add(String name, Component comp);
  public IUIComponent addTab(IUIComponent tab,
        IUIComponent content);
  public IUIComponent getBase();
  public void setSelectedIndex(int index);
}

This class implements the functionality of a UITabViewer object in an AWT-based control. An AwtUITabViewer control is an AwtUIHost component whose associated root container holds a UITabViewer object. By hosting this object, an AwtUITabViewer control integrates AFC with AWT. Although an AwtUITabViewer control is fully compatible with AWT, a UITabViewer control is optimized for performance and size.

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.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUITabViewer

Constructors

AwtUITabViewer

public AwtUITabViewer();

Creates an empty AWT-based tab viewer control.

Remarks:

Call add or addTab to insert a tab and its associated page into the control.

Methods

add

public IUIComponent add(String name, IUIComponent comp);

Adds a tab and its associated page to the control. The tab displays the specified text and the page displays the specified component.

Return Value:

Returns the page component that was added, if successful; otherwise, returns null.

Parameter | Description
name | The text to be displayed on the tab.
comp | The component to be displayed on the page that is associated with the tab.

Remarks:

If the name parameter identifies a tab that already exists in the tab viewer, this tab's page is updated with comp. Otherwise, a new tab and page are added. A tab's page is displayed only when the tab is selected.

By default, the tab is hot-tracked. To add a tab that is not hot-tracked, call the addTab method and pass a UIText object. For more information about hot-tracking, see the UITabViewer overview.

Overrides:

add(String,IUIComponent) in AwtUIControl.

add

public Component add(String name, Component comp);

Adds a tab and its associated page to the control. The tab displays the specified text, and the page displays the specified AwtUI component. Pure AWT components cannot be used.

Return Value:

Returns the control itself.

Parameter | Description
name | The text to be displayed on the tab.
comp | The AwtUI component to be displayed on the page that is associated with the tab.

Remarks:

If the name parameter identifies a tab that already exists in the tab viewer, this tab's page is updated with comp. Otherwise, a new tab and page are added. A tab's page is displayed only when the tab is selected.

By default, the tab is hot-tracked. To add a tab that is not hot-tracked, call the addTab method and pass a UIText object. For more information about hot-tracking, see the UITabViewer overview.

Overrides:

add(String,Component) in AwtUIControl.

Exceptions:

IllegalArgumentException if a pure AWT component was specified.

addTab

public IUIComponent addTab(IUIComponent tab, IUIComponent content);

Adds a tab and its associated page to the control. The tab and page display the specified components.

Return Value:

Returns the page component that was added, if successful; otherwise, returns null.

Parameter | Description
tab | The component to be displayed on the tab. If comp is a UITab object, this tab is added. Otherwise, a new UITab object that displays comp is added.
content | The component to be displayed on the page that is associated with the tab.

Remarks:

If the name parameter identifies a tab that already exists in the tab viewer, this tab's page is updated with content. Otherwise, a new tab and page are added. A tab's page is displayed only when the tab is selected.

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to add tabs, see the UITabViewer overview.

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UITabViewer object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UITabViewer object.

setSelectedIndex

public void setSelectedIndex(int index);

Selects the tab at the specified index.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the tab to be selected.

Remarks:

When the specified tab is selected, its associated page is shown.


Class AwtUIText

public class AwtUIText extends AwtUIControl
{
  // Constructors
  public AwtUIText();
  public AwtUIText(String text);
  public AwtUIText(String text, int justify);

  // Methods
  public IUIComponent getBase();
  public String getText();
  public void setText(String text);
}

This class implements the functionality of a UIText object in an AWT-based control. An AwtUIText control is an AwtUIHost component whose associated root container holds a UIText object. By hosting this object, an AwtUIText control integrates AFC with AWT. Although an AwtUIText control is fully compatible with AWT, a UIText control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIText

Constructors

AwtUIText

public AwtUIText();

Creates an AWT-based text control with no text.

AwtUIText

public AwtUIText(String text);

Creates an AWT-based text control with the specified text.

Parameter | Description
text | The text to be displayed within the control.

Remarks:

By default, the text is aligned both horizontally and vertically.

AwtUIText

public AwtUIText(String text, int justify);

Creates an AWT-based text control with the specified text and style.

Parameter | Description
text | The text to be displayed within the control.
justify | The alignment and style of the control. You can pass any bitwise combination of an alignment flag and a style flag. For a list of possible flags, see the UIStatic.setFlags method.

Remarks:

If a vertical alignment is not specified, VCENTER is used by default. Similarly, if a horizontal alignment is not specified, HCENTER is used.

Exceptions:

IllegalArgumentException if more than one vertical alignment, more than one horizontal alignment, or an undefined style was specified.

Methods

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIText object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIText object.

getText

public String getText();

Retrieves the control's text.

Return Value:

Returns the text string currently displayed within the control.

See Also: setText

setText

public void setText(String text);

Sets the control's text.

Return Value:

No return value.

Parameter | Description
text | The text to be displayed within the control.

See Also: getText


Class AwtUITextBeanInfo

public class AwtUITextBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUITextBeanInfo


Class AwtUITree

public class AwtUITree extends AwtUIControl implements
            IAwtUIItemSelectable
{
  // Constructors
  public AwtUITree();
  public AwtUITree(String s);
  public AwtUITree(Image i, String s);
  public AwtUITree(IUIComponent comp);
  public AwtUITree(IUIComponent comp, int indent);

  // Methods
  public Component add(Component comp);
  public Component add(Component comp, int pos);
  public IUIComponent add(String s);
  public IUIComponent add(String s, int pos);
  public IUIComponent add(Image i, String s);
  public IUIComponent add(Image i, String s, int pos);
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int pos);
  public void addActionListener(ActionListener l);
  public void addItemListener(ItemListener l);
  public void addSelectedIndex(int index);
  public void addSelectedIndex(int index, boolean notify);
  public void addSelectedIndices(int indices[]);
  public void addSelectedIndices(int indices[], boolean notify);
  public void addSelectedItem(IUIComponent comp);
  public void addSelectedItem(IUIComponent comp, boolean notify);
  public void addSelectedItem(IUIComponent comp, boolean on);
  public void addSelectedItems(IUIComponent comps[]);
  public void addSelectedItems(IUIComponent comps[],
        boolean notify);
  public IUIComponent find(String prefix, boolean fromFocus);
  public IUIComponent find(String prefix, IUIComponent compStart);
  public IUIComponent find(String prefix);
  public IUIComponent getBase();
  public IUIComponent getExpander();
  public int getSelectedIndex();
  public int[] getSelectedIndices();
  public IUIComponent getSelectedItem();
  public IUIComponent[] getSelectedItems();
  public int getSelectionMode();
  public boolean hasChildren();
  public boolean isExpanded();
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  protected void processItemEvent(ItemEvent e);
  public void remove(int index);
  public void remove(IUIComponent comp);
  public synchronized void removeActionListener(ActionListener l);
  public synchronized void removeItemListener(ItemListener l);
  public void removeSelectedIndex(int index);
  public void removeSelectedIndex(int index, boolean notify);
  public void removeSelectedIndices(int indices[]);
  public void removeSelectedIndices(int indices[]);
  public void removeSelectedIndices(int indices[], boolean notify);
  public void removeSelectedItem(IUIComponent comp);
  public void removeSelectedItem(IUIComponent comp, boolean notify);
  public void removeSelectedItems(IUIComponent comps[]);
  public void removeSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setExpanded(boolean expanded);
  public void setSelectedIndex(int index);
  public void setSelectedIndex(int index, boolean notify);
  public void setSelectedIndices(int indices[]);
  public void setSelectedIndices(int indices[], boolean notify);
  public void setSelectedItem(IUIComponent comp);
  public void setSelectedItem(IUIComponent comp, boolean notify);
  public void setSelectedItems(IUIComponent comps[]);
  public void setSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setSelectionMode(int selMode);
}

This class implements the functionality of a UITree object in an AWT-based control. An AwtUITree control is an AwtUIHost component whose associated root container holds a UITree object. By hosting this object, an AwtUITree control integrates AFC with AWT. Although an AwtUITree control is fully compatible with AWT, a UITree control is optimized for performance and size.

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.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUITree

Constructors

AwtUITree

public AwtUITree();

Creates an AWT-based tree control with no content.

Remarks:

Call the add method to add child items to the tree control. To add an item to the root node itself, call setHeader (inherited through AwtUIHost). For an example of calling setHeader, see the UITree overview.

AwtUITree

public AwtUITree(String s);

Creates an AWT-based tree control with the specified text.

Parameter | Description
s | The text to be displayed by the node.

Remarks:

By default, the tree node is hot-tracked. To create a node that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITree overview.

To add child items to the tree control, call the add method.

AwtUITree

public AwtUITree(Image i, String s);

Creates an AWT-based tree control with the specified image and text.

Parameter | Description
i | The image to be displayed by the node.
s | The text to be displayed by the node.

Remarks:

By default, the tree node is hot-tracked. To create a node that is not hot-tracked, pass a UIItem object instead of an Image and String. For more information about hot-tracking, see the UITree overview.

To add child items to the tree control, call the add method.

AwtUITree

public AwtUITree(IUIComponent comp);

Creates an AWT-based tree control with the specified component.

Parameter | Description
comp | The component to be displayed by the node.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. To add child items to the tree control, call the add method.

AwtUITree

public AwtUITree(IUIComponent comp, int indent);

Creates an AWT-based tree control with the specified component and indent.

Parameter | Description
comp | The component to be displayed by the node.
indent | The indent (in pixels) to be used when laying out node children.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. To add child items to the tree control, call the add method.

Methods

add

public Component add(Component comp);

Adds the specified component to the end of the control. The Component must be an instance of the AwtUIHost class.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. The newly-added child component is shown or hidden, according to the control's expanded state.

See Also: remove

add

public Component add(Component comp, int pos);

Adds the specified component to the tree control at the specified position. The Component must be an instance of the AwtUIHost class.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
pos | The zero-based index at which to add the item. If the node itself displays a content component (a header), this item is at index 0 and the first child begins at index 1. To add a child item at the end of the tree control, pass -1.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. The newly-added child component is shown or hidden, according to the control's expanded state.

See Also: remove

add

public IUIComponent add(String s);

Adds the specified text to the end of the control.

Return Value:

Returns the text component that was added.

Parameter | Description
s | The text to be added.

Remarks:

The newly-added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITree overview.

See Also: remove

add

public IUIComponent add(String s, int pos);

Adds the specified text to the control at the specified position.

Return Value:

Returns the text component that was added.

Parameter | Description
s | The text to be added.
pos | The zero-based index at which to add the text. If the root node itself displays an item (a header component), this item is at index 0, and the first child begins at index 1. To add a child item at the end of the tree control, pass -1.

Remarks:

The newly-added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITree overview.

Note If the tree node has a header, adding an item at index 0 will insert the item as the new header and shift all other components by one index position. As a result, the previous header becomes the first child item. To simply replace the header without shifting its position, call the setHeader method (inherited through AwtUIHost). For an example of calling setHeader, see the UITree overview.

See Also: remove

add

public IUIComponent add(Image i, String s);

Adds the specified image and text to the end of the control.

Return Value:

Returns the item component that was added.

Parameter | Description
i | The image to be added.
s | The text to be added.

Remarks:

The newly added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIItem object instead of an Image and String.

For more information about hot-tracking, see the UITree overview.

See Also: remove

add

public IUIComponent add(Image i, String s, int pos);

Adds the specified image and text to the control at the specified position.

Return Value:

Returns the item component that was added.

Parameter | Description
i | The image to be added.
s | The text to be added.
pos | The zero-based index at which to add the text and image. If the root node itself displays an item (a header component), this item is at index 0, and the first child begins at index 1. To add a child item at the end of the tree control, pass -1.

Remarks:

The newly added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIItem object instead of an Image and String. For more information about hot-tracking, see the UITree overview.

Note If the tree node has a header, adding an item at index 0 will insert the item as the new header and shift all other components by one index position. As a result, the previous header becomes the first child item. To simply replace the header without shifting its position, call the setHeader method (inherited through AwtUIHost). For an example of calling setHeader, see the UITree overview.

See Also: remove

add

public IUIComponent add(IUIComponent comp);

Adds the specified component to the end of the control.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. The newly added child component is shown or hidden, according to the control's expanded state.

Overrides:

add(IUIComponent) in AwtUIControl.

See Also: remove

add

public IUIComponent add(IUIComponent comp, int pos);

Adds the specified component to the tree control at the specified position.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
pos | The zero-based index at which to add the component. If the root node itself displays an item (a header component), this item is at index 0, and the first child begins at index 1. To add a child item at the end of the tree control, pass -1.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. The newly added child component is shown or hidden, according to the tree control's expanded state.

Note If the tree node has a header, adding an item at index 0 will insert the item as the new header and shift all other components by one index position. As a result, the previous header becomes the first child item. To simply replace the header without shifting its position, call the setHeader method (inherited through AwtUIHost). For an example of calling setHeader, see the UITree overview.

Overrides:

add(IUIComponent,int) in AwtUIControl.

See Also: remove

addActionListener

public void addActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

addItemListener

public void addItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

addSelectedIndex

public void addSelectedIndex(int index);

Selects the component at the specified index, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.

addSelectedIndex

public void addSelectedIndex(int index, boolean notify);

Selects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedIndices

public void addSelectedIndices(int indices[]);

Selects the components at the specified indices, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.

addSelectedIndices

public void addSelectedIndices(int indices[], boolean notify);

Selects the components at the specified indices, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedItem

public void addSelectedItem(IUIComponent comp);

Selects the specified component, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.

addSelectedItem

public void addSelectedItem(IUIComponent comp, boolean notify);

Selects the specified component, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedItem

public void addSelectedItem(IUIComponent comp, boolean on);

Sets or clears the selected state of the specified component and sets the control's selection to this component. A list select event is not generated.

Return Value:

No return value.

Parameter | Description
comp | The item to be selected or de-selected.
on | If true, the item's selected state is set; otherwise, it is cleared.

Remarks:

This method clears any previous selection.

See Also: addSelectedIndex, setSelectedItem, getSelectedItem

addSelectedItems

public void addSelectedItems(IUIComponent comps[]);

Selects the specified components, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be selected.

addSelectedItems

public void addSelectedItems(IUIComponent comps[], boolean notify);

Selects the specified components, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated. Currently not used.

find

public IUIComponent find(String prefix, boolean fromFocus);

Searches the control for an item whose name begins with the specified prefix. The search begins from either the current focus, or the first item in the selector.

Return Value:

Returns the first matching component, if a match is found; otherwise, returns null.

Parameter | Description
prefix | The prefix string to search for.
fromFocus | If true, the search begins from the current focus. Otherwise, the search begins with the first item in the selector.

find

public IUIComponent find(String prefix, IUIComponent compStart);

Searches the control for an item whose name begins with the specified prefix. The search begins at compStart.

Return Value:

Returns the first matching component, if a match is found; otherwise, returns null.

Parameter | Description
prefix | The prefix string to search for.
compStart | The component at which the search begins. If it is null, the search will begin at the 1st item (according to navigate).

find

public IUIComponent find(String prefix);

Searches the control for an item whose name begins with the specified prefix. The search starts at the first item in the control.

Return Value:

Returns the first matching component; otherwise, returns null if a component is not found.

Parameter | Description
prefix | The prefix string to search for.

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UITree object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UITree object.

getExpander

public IUIComponent getExpander();

Retrieves the tree control's Expand button, which indicates whether the node is expanded or collapsed.

Return Value:

Returns the component currently being used as the expand button.

Remarks:

By default, the control's associated UITree object uses a UIExpandButton component for the expand button.

getSelectedIndex

public int getSelectedIndex();

Retrieves the zero-based index of the currently selected item.

Return Value:

Returns the index of the selected item or -1 if an item is not selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0.

See Also: getSelectedItem, setSelectedIndex

getSelectedIndices

public int[] getSelectedIndices();

Retrieves the zero-based indices of all currently selected items.

Return Value:

Returns an array of the indices of the selected items or null if an item is not selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0.

Remarks:

Because the control's selection mode can only be SINGLESELECT, this method returns only one item in the array.

See Also: getSelectedIndex, getSelectedItems, setSelectedIndices

getSelectedItem

public IUIComponent getSelectedItem();

Retrieves the currently selected item.

Return Value:

Returns the selected component; otherwise, returns null if a component is not selected.

See Also: getSelectedIndex, setSelectedItem

getSelectedItems

public IUIComponent[] getSelectedItems();

Retrieves all currently selected items.

Return Value:

Returns an array of the selected components; otherwise, returns null if a component is not selected.

Remarks:

Because the control's selection mode can only be SINGLESELECT, this method returns one item in the array.

See Also: getSelectedIndices, setSelectedItems

getSelectionMode

public int getSelectionMode();

Retrieves the selection mode of the control.

Return Value:

Returns the control's selection mode. For a list of valid return modes, see the setSelectionMode method.

hasChildren

public boolean hasChildren();

Determines whether the tree control has child items.

Return Value:

Returns true if the node has child items; otherwise, returns false.

isExpanded

public boolean isExpanded();

Determines whether the tree control is expanded.

Return Value:

Returns true if the node is expanded; otherwise, returns false.

See Also: setExpanded

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type | Method called
item event | processItemEvent
action event | processActionEvent
component event | processComponentEvent (inherited through AwtUIHost)
container event | processContainerEvent (inherited through AwtUIHost)
focus event | processFocusEvent (inherited through AwtUIHost)
key event | processKeyEvent (inherited through AwtUIHost)
mouse event | processMouseEvent (inherited through AwtUIHost)
mouse motion event | processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

remove

public void remove(int index);

Removes the component at the specified index.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component to be removed. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0.

Remarks:

For an example of calling remove, see UISelector.remove.

remove

public void remove(IUIComponent comp);

Removes the specified component from the control.

Return Value:

No return value.

Parameter | Description
comp | The component to be removed.

Remarks:

For an example of calling remove, see UISelector.remove.

Overrides:

remove(IUIComponent) in AwtUIControl.

removeActionListener

public synchronized void removeActionListener(ActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener

removeItemListener

public synchronized void removeItemListener(ItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener

removeSelectedIndex

public void removeSelectedIndex(int index);

Deselects the component at the specified index, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.

removeSelectedIndex

public void removeSelectedIndex(int index, boolean notify);

Deselects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedIndices

public void removeSelectedIndices(int indices[]);

Deselects the components at the specified indices, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.

removeSelectedIndices

public void removeSelectedIndices(int indices[]);

Deselects the components at the specified indices, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.

removeSelectedIndices

public void removeSelectedIndices(int indices[], boolean notify);

Deselects the components at the specified indices, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedItem

public void removeSelectedItem(IUIComponent comp);

Deselects the specified component, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.

removeSelectedItem

public void removeSelectedItem(IUIComponent comp, boolean notify);

Deselects the specified component, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[]);

Deselects the specified components, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be deselected.

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[], boolean notify);

Deselects the specified components, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

setExpanded

public void setExpanded(boolean expanded);

Expands or collapses the tree control to show or hide the node's children.

Return Value:

No return value.

Parameter | Description
expanded | If true, the node will be expanded; otherwise, the node will be collapsed.

See Also: isExpanded

setSelectedIndex

public void setSelectedIndex(int index);

Sets the selection to the component at the specified index. By default, a list select event is not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0.

Remarks:

This method clears any previous selection.

See Also: setSelectedItem, addSelectedIndex, getSelectedIndex

setSelectedIndex

public void setSelectedIndex(int index, boolean notify);

Sets the selection to the component at the specified index and optionally generates a list select event.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0.
notify | If true, a list select event will be generated; otherwise, a list select event will not be generated.

Remarks:

This method clears any previous selection.

See Also: setSelectedItem, addSelectedIndex, getSelectedIndex

setSelectedIndices

public void setSelectedIndices(int indices[]);

Sets the selection to the components at the specified indices. List select events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the zero-based indices of the items to be selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0. Because the control's selection mode can only be SINGLESELECT, the array should contain only one index.

Remarks:

This method clears any previous selection.

See Also: setSelectedIndex, setSelectedItems, getSelectedIndices

setSelectedIndices

public void setSelectedIndices(int indices[], boolean notify);

Sets the selection to the components at the specified indices and optionally generates list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the zero-based indices of the items to be selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0. Because the control's selection mode can only be SINGLESELECT, the array should contain only one index.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method clears any previous selection.

See Also: setSelectedIndex, setSelectedItems, getSelectedIndices

setSelectedItem

public void setSelectedItem(IUIComponent comp);

Sets the selection to the specified component. A list select event is not generated.

Return Value:

No return value.

Parameter | Description
comp | The item to be selected.

Remarks:

This method clears any previous selection.

Exceptions:

IllegalArgumentException if the specified component is not an immediate child of the control.

See Also: setSelectedIndex, addSelectedItem, getSelectedItem

setSelectedItem

public void setSelectedItem(IUIComponent comp, boolean notify);

Sets the selection to the specified component and optionally generates a list select event.

Return Value:

No return value.

Parameter | Description
comp | The item to be selected.
notify | If true, a list select event will be generated; otherwise, a list select event will not be generated.

Remarks:

This method clears any previous selection.

Exceptions:

IllegalArgumentException if the specified component is not an immediate child of the control.

See Also: setSelectedIndex, addSelectedItem, getSelectedItem

setSelectedItems

public void setSelectedItems(IUIComponent comps[]);

Sets the selection to the specified components. List select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected. Because the control's selection mode can only be SINGLESELECT, the array should contain only one item.

Remarks:

This method clears any previous selection.

Exceptions:

IllegalArgumentException if any component in the array is not an immediate child of the control.

See Also: setSelectedItem, setSelectedIndices, getSelectedItems

setSelectedItems

public void setSelectedItems(IUIComponent comps[], boolean notify);

Sets the selection to the specified components and optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected. Because the control's selection mode can only be SINGLESELECT, the array should contain only one item.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method clears any previous selection.

Exceptions:

IllegalArgumentException if any component in the array is not an immediate child of the control.

See Also: setSelectedIndices, getSelectedItems

setSelectionMode

public void setSelectionMode(int selMode);

Sets the selection mode of the control.

Return Value:

No return value.

Parameter Description
selMode The selection mode for the control. The following selection modes are valid.
SINGLESELECT MULTISELECT EXTENDSELECT
NOSELECT

Exceptions:

IllegalArgumentException if an undefined selection mode was specified.

See Also: getSelectionMode


Class AwtUITreeBeanInfo

public class AwtUITreeBeanInfo extends SimpleBeanInfo
{
}

This class is for internal use only.

SimpleBeanInfo
  |
  +--AwtUITreeBeanInfo


Class UIApplet

public class UIApplet extends UIPanel
{
  // Constructors
  public UIApplet();

  // Methods
  public void destroy();
  public Applet getApplet();
  public AppletContext getAppletContext();
  public String getAppletInfo();
  public AudioClip getAudioClip(URL url);
  public AudioClip getAudioClip(URL url, String name);
  public URL getCodeBase();
  public URL getDocumentBase();
  public Image getImage(URL url);
  public Image getImage(URL url, String name);
  public String getParameter(String name);
  public String[][] getParameterInfo();
  public void init();
  public boolean isActive();
  public void play(URL url);
  public void play(URL url, String name);
  public final void setStub(AppletStub stub);
  public void showStatus(String msg);
  public void start();
  public void stop();
}

This class provides a container for implementing an applet.

Note To run under JDK 1.02, you must be sure to specifically set the layout manager.

The following example shows how this class is used in conjunction with the AwtUIApplet bridge class to create a basic AFC applet.

// MyApplet.java

import com.ms.ui.*;

// Bridge class.
public class MyApplet extends AwtUIApplet
{
  // Constructor.
  public MyApplet ()
  {
    super (new MyAppletImplementation ());
  }
}

// Implementation class.
class MyAppletImplementation extends UIApplet
{
  // Applet entry point
  public void init()
  {
    // Add your components here.
  }
}

If any of the applet's methods are to be scriptable, they must be implemented in this class and exposed to the host through the AwtUIApplet bridge class.

It's often advantageous to create an applet that can be run as a stand-alone application as well as an applet. One way to do this is to create a top-level frame object (based on UIFrame) to host the applet. The following example illustrates this technique and shows how to expose a scriptable method to an applet's host.

// MyApplet.java

import java.awt.*;
import com.ms.ui.*;
import com.ms.fx.*;

// Bridge class.
public class MyApplet extends AwtUIApplet
{
  // Constructor.
  public MyApplet ()
  {
    // Create instance of applet implementation.
    super (new MyAppletImplementation ());
  }

  // Stand-alone application entry point.
  public static void main(String args[])
  {
    // Create a frame to contain applet.
    MyAppletFrame f = new MyAppletFrame ("MyApplet Application");
    f.setVisible (true);
    f.setSize (320, 200);

    // Create instance of applet implementation and add to frame.
    MyAppletImplementation applet = new MyAppletImplementation ();
    f.add (applet);

    // Stand-alone application must explicitly call init().
    applet.init ();
  }

  // Add pass-through methods for scriptable applet methods here.
  public String getInfo ()
  {
    return (((MyAppletImplementation) getUIApplet ()).getInfo ());
  }
}

// Implementation class.
class MyAppletImplementation extends UIApplet
{
  // Applet entry point.
  public void init()
  {
    setBackground (FxColor.cyan);

    // Add additional components here.
  }

  public String getInfo ()
  {
    String s = "Info about MyApplet.class\r\n";
    s += "Version: 1.0\r\n";
    return s;
  }
}

class MyAppletFrame extends UIFrame
{
  // Constructor.
  public MyAppletFrame(String str)
  {
    super (str);
  }

  public boolean handleEvent (Event e)
  {
    switch (e.id)
    {
    case Event.WINDOW_DESTROY:
      // Frame window closed, exit app
      System.exit (0);
      return true;
    default:
      return super.handleEvent (e);
    }
  }
}

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIApplet

Constructors

UIApplet

public UIApplet();

Creates a new UIApplet with a UIBorderLayout manager.

Methods

destroy

public void destroy();

Called by the browser or applet viewer to inform this applet that it is being reclaimed, and that it should destroy any resources it has allocated. The stop method will always be called before destroy.

Note This method should be overwritten if the Applet needs to perform any operations before it is destroyed. For example, an applet with threads would use the init method to create the threads and the destroy method to dispose of them.

The implementation of this method provided by the Applet class does nothing.

(JDK1.0 )

Return Value:

No return value.

See Also: java.applet.Applet.init, java.applet.Applet.start, java.applet.Applet.stop

getApplet

public Applet getApplet();

Retrieves the underlying AWT Applet that is the basis for this applet.

Return Value:

Returns The underlying Applet.

getAppletContext

public AppletContext getAppletContext();

Determines this applet's context, which allows the applet to query and affect the environment in which it runs.

Return Value:

Returns the applet's context.

Remarks:

This environment of an applet represents the document that contains the applet.

(JDK1.0)

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

getAppletInfo

public String getAppletInfo();

Retrieves information about this applet. An applet should override this method to return a String containing information about the author, version, and copyright of the applet.

Return Value:

Returns a string containing information about the author, version, and copyright of the applet.

Remarks:

The implementation of this method provided by the Applet class returns null.

(JDK1.0)

getAudioClip

public AudioClip getAudioClip(URL url);

Retrieves the AudioClip object specified by the URL argument.

Note This method always returns immediately, whether the audio clip exists. When this applet attempts to play the audio clip, the data will be loaded.

(JDK1.0 )

Return Value:

Returns the audio clip at the specified URL.

Parameter | Description
url | An absolute URL, giving the location of the audio clip.

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

See Also: java.applet.AudioClip

getAudioClip

public AudioClip getAudioClip(URL url, String name);

Retrieves the AudioClip object specified by the URL and name arguments.

Note This method always returns immediately, whether the audio clip exists. When this applet attempts to play the audio clip, the data will be loaded.

(JDK1.0 )

Return Value:

Returns the audio clip at the specified URL.

Parameter | Description
url | An absolute URL, giving the base location of the audio clip.
name | The location of the audio clip, relative to the url argument.

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

See Also: java.applet.AudioClip

getCodeBase

public URL getCodeBase();

Retrieves the base's URL. This is the URL of the applet itself.

(JDK1.0 )

Return Value:

Returns the URL of this applet.

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

See Also: java.applet.Applet.getDocumentBase

getDocumentBase

public URL getDocumentBase();

Retrieves the document's URL. This is the URL of the document in which the applet is embedded.

(JDK1.0 )

Return Value:

Returns the URL of the document that contains this applet.

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

See Also: java.applet.Applet.getCodeBase

getImage

public Image getImage(URL url);

Retrieves an Image object that can be painted on the screen. The url that is passed as an argument must specify an absolute URL.

Note This method always returns immediately, whether the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The graphics primitives that draw the image will incrementally paint the image on the screen.

(JDK1.0 )

Return Value:

Returns the image at the specified URL.

Parameter | Description
url | An absolute URL, giving the location of the image.

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

See Also: java.awt.Image

getImage

public Image getImage(URL url, String name);

Retrieves an Image object that can be painted on the screen. The url argument must specify an absolute URL. The name argument is a specifier that is relative to the url argument.

Note This method always returns immediately, whether the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The graphics primitives that draw the image will incrementally paint the image on the screen.

(JDK1.0 )

Return Value:

Returns the image at the specified URL.

Parameter | Description
url | An absolute URL, giving the base location of the image.
name | The location of the image, relative to the url argument.

See Also: java.awt.Image

getParameter

public String getParameter(String name);

Retrieves the value of the named parameter in the HTML tag.

Return Value:

Returns the value of the named parameter.

Parameter | Description
name | A parameter name.

Remarks:

For example, if this applet is specified as

    <applet code="Clock" width=50 height=50>
    <param name=Color value="blue">
    </applet>

a call to getParameter(»Color») returns the value blue.

The name argument is case insensitive.

(JDK1.0)

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

getParameterInfo

public String[][] getParameterInfo();

Retrieves information about the parameters that are applicable to this applet. An applet should override this method to return an array of Strings describing these parameters.

Return Value:

Returns an array describing the parameters applicable to this applet.

Remarks:

Each element of the array should be a set of three Strings containing the name, the type, and a description. For example:

String pinfo[][] = {
     {"fps",    "1-10",    "frames per second"},
     {"repeat", "boolean", "repeat image loop"},
     {"imgs",   "url",     "images directory"}
};

The implementation of this method provided by the Applet class returns null.

(JDK1.0)

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

init

public void init();

Called by the browser or applet viewer to inform this applet that it has been loaded into the system. getCodeBase is called before the first time the start method is called.

Note This method should be overwritten when there is initialization to perform. For example, an applet with threads would use the init method to create the threads and the destroy method to dispose of them.

The implementation of this method provided by the Applet class does nothing.

(JDK1.0 )

Return Value:

No return value.

See Also: java.applet.Applet.destroy, java.applet.Applet.start, java.applet.Applet.stop

isActive

public boolean isActive();

Determines if this applet is active.

Return Value:

Returns True if the applet is active; otherwise, returns false.

Remarks:

An applet is marked active just before its start method is called. It becomes inactive immediately after its stop method is called.

(JDK1.0)

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

See Also: java.applet.Applet.start, java.applet.Applet.stop

play

public void play(URL url);

Plays the audio clip at the specified absolute URL. The audio clip is not played if it cannot be found.

(JDK1.0 )

Return Value:

No return value.

Parameter | Description
url | An absolute URL, giving the location of the audio clip.

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

play

public void play(URL url, String name);

Plays the audio clip given the URL and a specifier that is relative to it. The audio clip is not played if it cannot be found

(JDK1.0 )

Return Value:

No return value.

Parameter | Description
url | An absolute URL, giving the base location of the audio clip.
name | The location of the audio clip, relative to the url argument.

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

setStub

public final void setStub(AppletStub stub);

Sets this applet's stub. This is done automatically by the system.

Return Value:

No return value.

Parameter | Description
stub | The new stub.

showStatus

public void showStatus(String msg);

Requests that the argument string be displayed in the status window.

(JDK1.0 )

Return Value:

No return value.

Parameter | Description
msg | A string to display in the status window.

Exceptions:

IllegalArgumentException if the Applet was created without a UIApplet host.

start

public void start();

Called by the browser or applet viewer to inform this applet that it should start its execution. It is called after the init method and each time the applet is revisited in a Web page.

Note This method should be overwritten if the applet needs to execute any operations each time the Web page containing it is visited. For example, an applet with animation might want to use the start method to resume animation, and the stop method to suspend the animation.

The implementation of this method provided by the Applet class does nothing.

(JDK1.0 )

Return Value:

No return value.

See Also: java.applet.Applet.destroy, java.applet.Applet.init, java.applet.Applet.stop

stop

public void stop();

Called by the browser or applet viewer to inform this applet to stop its execution. It is called when the Web page that contains this applet has been replaced by another page, and just before the applet is to be destroyed.

Note This method should be overwritten if the Applet needs to perform any operations each time the Web page containing it is no longer visible. For example, an applet with animation might want to use the start method to resume animation, and the stop method to suspend the animation.

The implementation of this method provided by the Applet class does nothing.

(JDK1.0 )

Return Value:

No return value.

See Also: java.applet.Applet.destroy, java.applet.Applet.init


Class UIAwtHost

public class UIAwtHost extends UICanvas
{
  // Constructors
  public UIAwtHost(Component comp);

  // Methods
  public Component getComponent();
  public boolean postEvent(Event e);
}

This class is an AWT host control that enables AWT-based components to be used in AFC containers. The following example shows how to use the AWT host to include an AWT Button object in a UIPanel object.

// Create an AFC panel and an AWT button.
UIPanel p = new UIPanel ();
Button b = new Button ("AWT Button");

// Add button to panel using UIAwtHost bridge.
p.add (new UIAwtHost (b));

Events propagating to the host control are re-targeted before being propagated up the containment hierarchy, so the host becomes the target for these events. The host control supports event propagation for only one level of containment. Events associated with any components contained by the component being hosted are consumed by the host control and do not propagate further. To catch these events, you must override the postEvent method. UIAwtHost will not propagating any events whose target is an AWT component and not the component being hosted.

Note The UIAwtHost control cannot be used inside an AFC choice (UIChoice) control. If used inside a menu list (UIMenuList), the menu list cannot be launched as a pop-up menu.

UIComponent
  |
  +--UIStateComponent
    |
    +--UICanvas
      |
      +--UIAwtHost

Constructors

UIAwtHost

public UIAwtHost(Component comp);

Creates an AWT host control from the specified AWT component.

Parameter | Description
comp | The AWT component to be hosted.

Methods

getComponent

public Component getComponent();

Retrieves the AWT component hosted by the AWT host control.

Return Value:

Returns the component.

postEvent

public boolean postEvent(Event e);

Determines if the target of the event is a Component; otherwise, passes the event up to the parent, UIComponent.postEvent.

Return Value:

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

Parameter | Description
e | The event.

See Also: com.ms.ui.UIComponent.postEvent


Class UIBand

public class UIBand extends UIMenuList implements IUIBand
{
  // Fields
  public static final int BREAK;
  public static final int DRAGBREAK;

  // Constructors
  public UIBand();
  public UIBand(String name);
  public UIBand(String name, int style);

  // Methods
  public boolean getBreak();
  public boolean getDragBreak();
  public Insets getInsets();
  public Dimension getMinimumSize();
  public int getRestoredWidth();
  public int getRoleCode();
  public int getStyle();
  public boolean handleEvent(Event e);
  public void layout();
  public void setBreak(boolean on);
  public void setDragBreak(boolean on);
  public void setRestoredWidth(int width);
  public void setStyle(int style);
}

This class implements a moveable band of buttons. A UIBand object is typically contained in a UIBandBox control and uses UIFixedFlowLayout as its layout manager. UIBand contains a UIBandThumb object, which is used to reposition the band and its contents in relation to other bands in the band box.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UISelector
          |
          +--UIList
            |
            +--UIMenuList
              |
              +--UIBand

Constructors

UIBand

public UIBand();

Creates a band control with no name.

UIBand

public UIBand(String name);

Creates a band control with the specified name.

Parameter | Description
name | The text to be displayed on the band control's header.

UIBand

public UIBand(String name, int style);

Creates a band control with the specified name and style.

Parameter | Description
name | The text to be displayed on the band control's header.
style | The style of the band control. Possible values include any bitwise combination of BREAK and DRAGBREAK.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

getBreak

public boolean getBreak();

Determines whether the BREAK attribute is set in the control's style.

Return Value:

Returns true if the style includes BREAK; otherwise, returns false.

Remarks:

This method implements getBreak in the IUIBand interface.

getDragBreak

public boolean getDragBreak();

Determines whether the DRAGBREAK attribute is set in the control's style.

Return Value:

Returns true if the style includes DRAGBREAK; otherwise, returns false.

Remarks:

This method implements getDragBreak in the IUIBand interface.

getInsets

public Insets getInsets();

Retrieves the control's insets (in pixels), which identify the nonclient area of the control.

Return Value:

Returns an Insets object that contains the band's insets (which includes the band header's UIBandThumb component).

getMinimumSize

public Dimension getMinimumSize();

Determines the minimum size (in pixels) of the band control.

Return Value:

Returns the control's minimum size.

getRestoredWidth

public int getRestoredWidth();

Retrieves the width that the band control will be restored to.

Return Value:

Returns the width (in pixels) of the restored band control.

Remarks:

This method implements getRestoredWidth in the IUIBand interface.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the band control.

Return Value:

Returns the ROLE_SYSTEM_TOOLBAR code.

getStyle

public int getStyle();

Retrieves the current style of the band control.

Return Value:

Returns an integer containing the current style setting. For a list of possible values, see setStyle.

handleEvent

public boolean handleEvent(Event e);

Responds to events occurring within the control.

Return Value:

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

Parameter | Description
e | The event.

layout

public void layout();

Lays out the components contained in the band.

Return Value:

No return value.

setBreak

public void setBreak(boolean on);

Sets or clears the BREAK attribute in the control's style.

Return Value:

No return value.

Parameter | Description
on | If true, the BREAK attribute is set; otherwise, it is cleared.

Remarks:

This method implements setBreak in the IUIBand interface.

setDragBreak

public void setDragBreak(boolean on);

Sets or clears the DRAGBREAK attribute in the control's style.

This method is called by the parent when laying out its contained bands; it is not typically called by an application. Use the setBreak(boolean) method to start a band on a new row (or the same row).

Return Value:

No return value.

Parameter | Description
on | If true, the DRAGBREAK attribute is set; otherwise, it is cleared.

Remarks:

This method implements setDragBreak in the IUIBand interface.

setRestoredWidth

public void setRestoredWidth(int width);

Sets the width that the band will be restored to.

Return Value:

No return value.

Parameter | Description
width | The width (in pixels) of a restored band.

Remarks:

This method implements setRestoredWidth in the IUIBand interface.

setStyle

public void setStyle(int style);

Sets the current style of the band control.

Return Value:

No return value.

Parameter | Description
style | The style of the band control. Specify any bitwise combination of BREAK and DRAGBREAK.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Fields

BREAK
Specifies that the band will be displayed on a new row.
DRAGBREAK
Specifies that the band will be displayed on a new row because it does not fit on the current row. This state bit is used by the parent component when laying out its contained bands.
Comments:
Normally, an application uses the BREAK style, not the DRAGBREAK style, to indicate that a band should start on a new row.


Class UIBandBox

public class UIBandBox extends UIMenuList
{
  // Fields
  public static final int RBS_BANDBORDERS;
  public static final int RBS_FIXEDORDER;
  public static final int RBS_VARHEIGHT;

  // Constructors
  public UIBandBox();

  // Methods
  public void dragBand(int x, int y);
  public boolean getBreak(IUIComponent comp);
  public boolean getDragBreak(IUIComponent comp);
  public int getRoleCode();
  public boolean mouseDown(Event e, int x, int y);
  public boolean mouseDrag(Event e, int x, int y);
  public boolean mouseUp(Event e, int x, int y);
  public void paint(FxGraphics g);
}

This class implements a band box control. A UIBandBox control contains multiple band components, each of which is typically a UIBand object, or a component that implements the IUIBand interface.

Note UIBandbox uses UIBarLayout as its layout manager.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UISelector
          |
          +--UIList
            |
            +--UIMenuList
              |
              +--UIBandBox

Constructors

UIBandBox

public UIBandBox();

Creates a band box control.

Methods

dragBand

public void dragBand(int x, int y);

Resizes the currently-tracked band, based on the user's mouse movement at the specified location.

Return Value:

No return value.

Parameter | Description
x | The x coordinate of the mouse location.
y | The y coordinate of the mouse location.

getBreak

public boolean getBreak(IUIComponent comp);

Determines whether the break style is set in the specified band component.

Return Value:

Returns true if the current band has the break style set; otherwise, returns false.

Parameter | Description
comp | The component to be examined.

getDragBreak

public boolean getDragBreak(IUIComponent comp);

Determines whether the drag break style is set in the specified band component.

Return Value:

Returns true if the band has the drag break style set; otherwise, returns false.

Parameter | Description
comp | The band component to be examined.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the band box control.

Return Value:

Returns the ROLE_SYSTEM_TOOLBAR code.

mouseDown

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

Determines whether the mouse button is pressed over a band component in the band box, and if so, targets the band control for dragging.

Return Value:

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

Parameter | Description
e | The event posted to the band box control.
x | The x coordinate of the event.
y | The y coordinate of the event.

mouseDrag

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

Responds to the mouse being dragged over a band component in the band box.

Return Value:

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

Parameter | Description
e | The event posted to the band box control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method vertically rearranges the bands in the band box control to track the mouse point.

mouseUp

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

Responds to the mouse button being released by toggling the band to either its maximized or minimized size unless a drag operation has just been performed.

Return Value:

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

Parameter | Description
e | The event posted to the band box control.
x | The x coordinate of the event.
y | The y coordinate of the event.

paint

public void paint(FxGraphics g);

Draws the band box control.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Fields

RBS_BANDBORDERS
Specifies that each band in the band box have etched edges.
RBS_FIXEDORDER
Specifies that the order of the bands in the band box are fixed.
RBS_VARHEIGHT
Specifies that each row of bands can have a different height. By default, every row has the same height.


Class UIBandThumb

public class UIBandThumb extends UIThumb
{
  // Constructors
  public UIBandThumb();
  public UIBandThumb(IUIComponent comp);

  // Methods
  public Insets getInsets();
  public void paint(FxGraphics g);
}

This class implements a band thumb control. A UIBandThumb object provides a tool on a band control to allow maximizing and sliding of the control.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIThumb
          |
          +--UIBandThumb

Constructors

UIBandThumb

public UIBandThumb();

Creates a band thumb control with no content.

UIBandThumb

public UIBandThumb(IUIComponent comp);

Creates a band thumb control using the specified component for content.

Parameter | Description
comp | The component to be displayed within the control.

Methods

getInsets

public Insets getInsets();

Determines the band thumb control's insets, which indicate the size of the control's border.

Return Value:

Returns an Insets object containing the band thumb control's insets.

paint

public void paint(FxGraphics g);

Draws the band thumb control.

Return Value:

No return value.

Parameter | Description
g | The graphics context.


Class UIBarLayout

public class UIBarLayout extends UILayoutManager
{
  // Constructors
  public UIBarLayout();
  public UIBarLayout(int hgap, int vgap);

  // Methods
  public Dimension getMinimumSize(IUIContainer target);
  public Dimension getPreferredSize(IUIContainer target);
  public boolean isOverlapping();
  public void layout(IUIContainer target, Rectangle bounds);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int dir, boolean keyable);
  public void removeLayoutComponent(IUIContainer target,
        IUIComponent comp);
}

This class implements a layout manager for a bar object. UIBarLayout is the default layout manager for UIBandBox.

UILayoutManager
  |
  +--UIBarLayout

Constructors

UIBarLayout

public UIBarLayout();

Creates a bar layout manager.

Remarks:

By default, the horizontal and vertical gaps (used for spacing between components) are 5 pixels each.

UIBarLayout

public UIBarLayout(int hgap, int vgap);

Creates a bar layout manager with the specified horizontal and vertical gaps.

Parameter | Description
hgap | The number of pixels used for horizontal spacing between components.
vgap | The number of pixels used for vertical spacing between components.

Methods

getMinimumSize

public Dimension getMinimumSize(IUIContainer target);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
target | The container of the components.

Remarks:

This method is called by the container's getMinimumSize method. Typically, the container is a UIBandBox control, which manages a collection of bands or rows of objects. The width of the returned Dimension object is the largest of the widths of each band. The width of each band is the sum of the minimum widths of each item in the band, plus the horizontal gaps between items.

The returned Dimension object's height is the sum of the heights of each band and the vertical gaps between bands. The height of each band is the largest of the minimum heights of each item in the band.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer target);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
target | The container of the components.

Remarks:

This method is called by the container's getPreferredSize method. Typically, the container is a UIBandBox control, which manages a collection of bands or rows of objects. The width of the returned Dimension object is the largest of the widths of each band. The width of each band is the sum of the preferred widths of each item in the band, plus the horizontal gaps between items.

The returned Dimension object's height is the sum of the heights of each band, plus the vertical gaps between bands. The and bottom insets and the vertical gaps between bands. The height of each band is the largest of the preferred heights of each item in the band.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize

isOverlapping

public boolean isOverlapping();

Determines if this layout manager lays out its children so that they overlap either completely or partially.

Return Value:

Returns false. The UIBarLayout layout manager lays out components so they do not overlap. Returning false also means that only the sibling floater window, if one exists, needs to be clipped by the manager.

Overrides:

isOverlapping() in UILayoutManager.

layout

public void layout(IUIContainer target, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
target | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

This method is called by the container's layout method. If a component has the BREAK style, it is laid at the beginning of a new row.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp, int dir,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
cont | The container where the navigation is occurring.
comp | The tab component to navigate from.
dir The navigation direction. Specify one of the following values defined in IUIAccessible:
  • NAVDIR_LEFT
  • NAVDIR_RIGHT
  • NAVDIR_FIRST
  • NAVDIR_LAST
  • NAVDIR_NEXT
  • NAVDIR_PREV
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

This method handles keyboard navigation in the container. When a component in the container has focus and a key is pressed, navigate is called to move focus to another item in the container. The following table shows the keys that have corresponding IUIAccessible directions.

Key | IUIAccessible direction
LEFT ARROW and RIGHT ARROW | NAVDIR_LEFT and NAVDIR_RIGHT, respectively
HOME and END | NAVDIR_FIRST and NAVDIR_LAST, respectively

Overrides:

navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.

removeLayoutComponent

public void removeLayoutComponent(IUIContainer target, IUIComponent comp);

Removes the specified component from the container.

Return Value:

No return value.

Parameter | Description
target | The container of the component.
comp | The component to be removed.

Overrides:

removeLayoutComponent(IUIContainer,IUIComponent) in UILayoutManager.


Class UIBorderLayout

public class UIBorderLayout extends UILayoutManager
{
  // Fields
  public static final Integer BOTTOM;
  public static final Integer CENTER;
  public static final Integer EAST;
  public static final Integer LEFT;
  public static final Integer NORTH;
  public static final Integer RIGHT;
  public static final Integer SOUTH;
  public static final Integer TOP;
  public static final Integer WEST;

  // Constructors
  public UIBorderLayout();
  public UIBorderLayout(int hgap, int vgap);

  // Methods
  public void addLayoutComponent(IUIContainer cont,
        IUIComponent comp, Object constraints);
  public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp,
        Dimension oldSize, Dimension newSize);
  public Dimension getMinimumSize(IUIContainer parent);
  public Dimension getPreferredSize(IUIContainer parent);
  public boolean isOverlapping();
  public void layout(IUIContainer parent, Rectangle bounds);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int dir, boolean keyable);
  public void removeLayoutComponent(IUIContainer cont, IUIComponent
        comp);
}

This class implements an extended border layout manager. UIBorderLayout manages five layout components, identified as follows.

Layout Index | Description
TOP | The component at the top.
BOTTOM | The component at the bottom.
LEFT | The component at the left.
RIGHT | The component at the right.
CENTER | The component in the center.

UIBorderLayout lays out components in a manner similar to the AWT BorderLayout class.

UILayoutManager
  |
  +--UIBorderLayout

Constructors

UIBorderLayout

public UIBorderLayout();

Creates a border layout manager.

Remarks:

By default, the horizontal and vertical gaps (used for spacing between components) are 0 pixels each.

UIBorderLayout

public UIBorderLayout(int hgap, int vgap);

Creates a border layout manager using the specified horizontal and vertical gaps.

Parameter | Description
hgap | The number of pixels used for horizontal spacing between components.
vgap | The number of pixels used for vertical spacing between components.

Methods

addLayoutComponent

public void addLayoutComponent(IUIContainer cont, IUIComponent comp, Object
        constraints);

Adds the specified component to the container, according to the specified constraints.

Return Value:

No return value.

Parameter | Description
cont | The container of the component.
comp | The component to be added.
constraints | Identifies where the component will be added. You can pass a String or Integer value, as described in the Remarks section.

Remarks:

This method is called by the container's add method. The following table lists possible values for the constraints parameter.

String value | Integer value | Component
CENTER | 0 | The component in the center.
TOP | 1 | The component at the top.
BOTTOM | 2 | The component at the bottom.
LEFT | 2 | The component at the left.
RIGHT | 2 | The component at the right.

The String values are not case-sensitive. If you pass null for this parameter, the component is added in the center.

Overrides:

addLayoutComponent(IUIContainer,IUIComponent,Object) in UILayoutManager.

Exceptions:

IllegalArgumentException if an undefined constraint was specified.

See Also: removeLayoutComponent

adjustLayoutSize

public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp, Dimension oldSize,
        Dimension newSize);

Called to adjust the layout size of the specified component in the specified container.

Return Value:

Returns a Dimension object containing the new preferred size of the container.

Parameter | Description
parent | The container of the component.
oldParentSize | The previous layout size of the container.
comp | The component being sized.
oldSize | The previous layout size of the component.
newSize | The new layout size of the component.

Overrides:

adjustLayoutSize(IUIContainer,Dimension,IUIComponent,Dimension,Dimension) in UILayoutManager.

getMinimumSize

public Dimension getMinimumSize(IUIContainer parent);

Determines the minimum dimensions (in pixels) needed to lay out the components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
parent | The container of the components.

Remarks:

The width of the returned Dimension object is the sum of the minimum widths of the LEFT, RIGHT, and CENTER components, plus the horizontal gaps between the components and the container's left and right insets. The Dimension object's height is the sum of the minimum heights of the TOP and BOTTOM components, plus the largest of the minimum heights of the LEFT, RIGHT, and CENTER components, plus the vertical gaps and the container's top and bottom insets.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
parent | The container of the components.

Remarks:

The width of the returned Dimension object is the sum of the preferred widths of the LEFT, RIGHT, and CENTER components, plus the horizontal gaps between the components. The Dimension object's height is the sum of the preferred heights of the TOP and BOTTOM components, plus the largest of the preferred heights of the LEFT, RIGHT, and CENTER components, plus the vertical gaps.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize

isOverlapping

public boolean isOverlapping();

true if this layout manager lays out its children so Determines whether the components will overlap either completely or partially.

Return Value:

Returns true if the children overlap; otherwise, returns false. (The default is true.) Returning false also means that only the sibling floater window, if one exists, needs to be clipped by the manager.

Overrides:

isOverlapping() in UILayoutManager.

layout

public void layout(IUIContainer parent, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
parent | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

layout lays out the components in the following order:

Component | Layout
TOP or NORTH | Laid at the top of the bounding rectangle. The width of this component is set to the width of the bounding rectangle. The height is set to the component's preferred height.
BOTTOM or SOUTH | Laid at the bottom of the bounding rectangle. The width of this component is set to the width of the bounding rectangle. The height is set to the component's preferred height.
LEFT or WEST | Laid at the left of the bounding rectangle. The width of this component is set to its preferred width. The height is set to the height of the bounding rectangle minus the height of the TOP component, the height of the BOTTOM component, the vertical gap below the TOP component, and the vertical gap above the BOTTOM component.
RIGHT or EAST | Laid at the right of the bounding rectangle. The width of this component is set to its preferred width. The height is set to the height of the bounding rectangle minus the height of the TOP component, the height of the BOTTOM component, the vertical gap below the TOP component, and the vertical gap above the BOTTOM component.
CENTER | Laid in the center of the bounding rectangtle. The width of this component is set to the width of the bounding rectangle minus the widths of the LEFT and RIGHT components, and the horizontal gaps. The height is the height of the bounding rectangle minus the heights of the TOP and BOTTOM components, and the vertical gaps.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp, int dir,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns null, indicating that no component can be navigated to.

Parameter | Description
cont | The container where the navigation is occurring.
comp | The component to navigate from.
dir The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface. The following NAVDIR values are not supported, however.
  • NAVDIR_UP
  • NAVDIR_DOWN
  • NAVDIR_LEFT
  • NAVDIR_RIGHT
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

This method is typically used to handle keyboard navigation in the container. However, UIBorderLayout does not provide this functionality.

Overrides:

navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.

removeLayoutComponent

public void removeLayoutComponent(IUIContainer cont, IUIComponent comp);

Removes the specified component from the container.

Return Value:

No return value.

Parameter | Description
cont | The container of the component.
comp | The component to be removed.

Remarks:

This method is called by the container's remove method.

Overrides:

removeLayoutComponent(IUIContainer,IUIComponent) in UILayoutManager.

See Also: addLayoutComponent

Fields

BOTTOM
The layout index for the bottom component.
CENTER
The layout index for the center component.
EAST
Note : Use RIGHT instead.
LEFT
The layout index for the left component.
NORTH
Note : Use TOP instead.
RIGHT
The layout index for the right component.
SOUTH
Note : Use BOTTOM instead.
TOP
The layout index for the top component.
WEST
Note : Use LEFT instead.


Class UIButton

public abstract class UIButton extends UISingleContainer
{
  // Fields
  public static final int TOGGLE;
  public static final int TRITOGGLE;

  // Constructors
  public UIButton();
  public UIButton(IUIComponent comp);
  public UIButton(IUIComponent comp, int style);

  // Methods
  public void doDefaultAction();
  public String getDefaultAction();
  public int getStyle();
  public boolean keyDown(Event e, int key);
  public boolean keyUp(Event e, int key);
  public boolean mouseClicked(Event e, int x, int y);
  public void setHot(boolean on);
  public void setStyle(int style);
}

This class implements an abstract button control. The following diagram shows the classes that extend UIButton.

UIButton
|
+--UICheckButton
|  |
|  +--UIRadioButton
|
+--UIPushButton
   |
   +--UIExpandButton
   |
   +--UIRepeatButton

When constructing a button, you typically specify the button's content and style. The UIText, UIGraphic, and UIItem classes provide several options for adding text and graphical images to your button. The following example demonstrates different ways to construct a button.

// Construct a push button that displays the String
// "Push Button". By default, this text is centered.
// Make the button raised and toggled.
UIPushButton p1 =
   new UIPushButton("Push Button",
                    UIPushButton.RAISED | UIButton.TOGGLE);

// Construct a check box button that displays the text
// stored in a UIText object. Left-align the text and
// make the button tritoggled.
UICheckButton c1 =
   new UICheckButton(new UIText("Checkbox", UIStatic.LEFT),
                     UIButton.TRITOGGLE);

// Construct a repeating push button that displays the graphical
// image stored in the variable myImage. Left-align the image.
UIRepeatButton r1 =
      new UIRepeatButton(new UIGraphic(myImage, UIStatic.LEFT));

// Construct a radio button that displays both the graphical
// image stored in the variable myImage and the text
// "Radio Button." Put the image above the text.
UIRadioButton r2 =
   new UIRadioButton(new UIItem(myImage, "Radio Button",
                                0, UIItem.ABOVE));

// Add each button to the container.
add(p1);
add(c1);
add(r1);
add(r2);

UIButton inherits the setName method to change the text displayed on a button after it is created. The getName method allows you to retrieve the current text. The following example shows how to use these two methods.

// Define two UIPushButton variables.
UIPushButton p1, p2;

// Construct p1 and p2. p1 displays only text, while
// p2 displays a graphical image and text.
p1 = new UIPushButton("p1 text");
p2 = new UIPushButton(new UIItem(myImage, "p2 text"));
add(p1);
add(p2);

// Now replace the text displayed from p2 with the text from p1.
String s = p1.getName();
p2.setName(s);  // p2 now displays a graphical image and
                // the text from p1.

Note When you construct a button with a String, the button is automatically hot-tracked. To override this default, use a UIText object instead of a String, as shown in the following example.

UIPushButton p1, p2, p3;

// Construct a button with a String.
// By default, the button is hot-tracked.
p1 = new UIPushButton("Hot-tracked text");

// Construct a button with a UIText object.
// By default, the button is not hot-tracked.
p2 = new UIPushButton(new UIText("Text not hot-tracked"));

// To create a hot-tracked button using UIText,
// specify the UIStatic.HOTTRACK flag.
p3 = new UIPushButton(new UIText("Hot-tracked UIText",
                                 UIStatic.HOTTRACK));
add(p1);
add(p2);
add(p3);

For more information about hot-tracking, see the UIText overview.

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.

Typically, when a UIButton object is pressed and released, an action event is generated. (With UIRepeatButton objects, action events are continually generated while the button remains pressed.) The following example shows how to use the action method to trap these events.

public boolean action(Event e, Object o)
{
  if (e.target == c)  // c is a UICheckButton object.
  {
     // isChecked returns true if c is checked,
     // false if c is unchecked.
     boolean enabled = c.isChecked();

     // p1 and p2 are UIPushButton objects that
     // will be enabled if c is checked; otherwise,
     // they will be disabled.
     p1.setEnabled(enabled);
     p2.setEnabled(enabled);
     return true;
  }
  return false;
}

In both UIRadioButton and UICheckButton objects, the behavior of the action method is inconsistent with that of AWT components in certain cases. The inconsistency is in the way the states of the button object are retrieved.

For example, if you create a menu with a UIMenuButton, add a UIRadioButton to it as a UIMenuItem, the action method returns different values under AFC and AWT.

//Add a radio button as a menu item.
UIMenuItem uimi = new UIMenuItem(new UIRadioButton("button as menu item"));

The action method returns the following values when AFC is used.

Event.target
The name of the menu button.
Event.arg
The UIMenuItem (in this case, the name of the UIRadioButton).
Object parameter
The next state of the UIRadioButton.

In comparison, the action method returns the following under AWT.

Event.target
The name of the menu button.
Event.arg
The next state of the UIRadioButton.
Object parameter
The next state of the UIRadioButton.

You must query the button to retrieve states when using AFC, if you are currently using the action method to retrieve the states of buttons in your Java code.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIButton

Constructors

UIButton

public UIButton();

Creates a button control with no content.

UIButton

public UIButton(IUIComponent comp);

Creates a button control with the specified component.

Parameter | Description
comp | The component to be displayed within the button.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.

UIButton

public UIButton(IUIComponent comp, int style);

Creates a button control with the specified component and style.

Parameter | Description
comp | The component to be displayed within the button.
style | The style of the button. You can pass TOGGLE or TRITOGGLE, or you can set any bit in the mask 0xFF000000.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

doDefaultAction

public void doDefaultAction();

Performs the default action for the button.

Return Value:

No return value.

Remarks:

The default action for a button is "Press." This method executes a button press by generating an action event. If the button's style is TOGGLE or TRITOGGLE, the appropriate checked state (unchecked, checked, or indeterminate) is also set.

See Also: getDefaultAction

getDefaultAction

public String getDefaultAction();

Retrieves the default action for the button.

Return Value:

Returns the string "Press".

See Also: doDefaultAction

getStyle

public int getStyle();

Retrieves the button's current style settings.

Return Value:

Returns an integer containing the current style settings. For a list of possible styles, see setStyle.

keyDown

public boolean keyDown(Event e, int key);

Determines whether the SPACEBAR or the ENTER key is being pressed, and if so, sets the pressed state.

Return Value:

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

Parameter | Description
e | The event posted to the button control.
key | The key that has been pressed.

Remarks:

This method is called when the button has focus and a key is pressed. If the key being pressed is the SPACEBAR or the ENTER key, the button's pressed state is set. If the ESC key is being pressed, the button's pressed state is cleared.

For more information about states, see the UIStateContainer overview.

See Also: keyUp

keyUp

public boolean keyUp(Event e, int key);

Determines whether the SPACEBAR or the ENTER key is being released, and if so, generates an action event.

Return Value:

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

Parameter | Description
e | The event posted to the button control.
key | The key that has been released.

Remarks:

This method is called when the button has focus and a key is released. If the key being released is the SPACEBAR or the ENTER key, an action event is generated, and, if the button's style is TOGGLE or TRITOGGLE, the appropriate checked state (unchecked, checked, or indeterminate) is set. keyUp also clears the button's pressed state, which was previously set by keyDown.

For more information about states, see the UIStateContainer overview.

See Also: keyDown

mouseClicked

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

Generates an action event for the button.

Return Value:

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

Parameter | Description
e | The event posted to the button control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method is called when the button control is clicked. If the control's style is TOGGLE or TRITOGGLE, mouseClicked also sets the appropriate checked state (unchecked, checked, or indeterminate).

setHot

public void setHot(boolean on);

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

Return Value:

No return value.

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

Remarks:

For more information about states, see the UIStateContainer overview.

setStyle

public void setStyle(int style);

Sets the button's current style.

Return Value:

No return value.

Parameter | Description
style | The style of the button. You can pass TOGGLE or TRITOGGLE, or you can set any bit in the mask 0xFF000000.

Exceptions:

IllegalArgumentException if an undefined style was specified.

See Also: getStyle

Fields

TOGGLE
Specifies that the button will automatically alternate between the unchecked and checked states whenever the button is pressed.
TRITOGGLE
Specifies that the button will automatically alternate between the unchecked, checked, and indeterminate states (in that order) whenever the button is pressed.


Class UIButtonBar

public class UIButtonBar extends Vector
{
  // Fields
  public final static int ABORTRETRYIGNORE;
  public final static int BACKNEXTFINISHCANCEL;
  public static int FLAT;
  public final static int ID_ABORT;
  public final static int ID_APPLY;
  public final static int ID_BACK;
  public final static int ID_CANCEL;
  public final static int ID_FINISH;
  public final static int ID_IGNORE;
  public final static int ID_NEXT;
  public final static int ID_NO;
  public final static int ID_OK;
  public final static int ID_RETRY;
  public final static int ID_YES;
  public final static int OK;
  public final static int OKCANCEL;
  public final static int OKCANCELAPPLY;
  public static int RAISED;
  public final static int RETRYCANCEL;
  public final static int YESNO;
  public final static int YESNOCANCEL;

  // Constructors
  public UIButtonBar();
  public UIButtonBar(int buttonSet, int style);
  public UIButtonBar(String buttons, int style);
  public UIButtonBar(String buttons, String separator, int style);

  // Methods
  public void add(int id);
  public void add(String text, int id);
  public void add(String text);
  public int addMany(String buttons, String separator,
        int defaultButton);
  public IUIComponent addTo(IUIContainer cont);
  public IUIComponent getButton(String name);
  public IUIComponent getButtonID(int id);
  public int getDefaultIndex();
  public Object getDefaultObject();
  public int getIndex(IUIComponent find);
  public static String loadButtonID(int id);
  public void setDefault(Object object);
  public void setDefault(int index);
  public void setStyle(int i);
}

This class implements a container for a set of UIPushButton objects.

UIButtonBar objects are used extensively in classes, such as UIMessageBox, where a set of button choices needs to be grouped and displayed. The button labels are tokenized from the specified string buttons in the constructor. The separator character, or characters, may also be specified in the constructor (by default, the separator character is a comma).

The following example shows how to create and add a UIButtonBar to an UIMessageBox object.

// Create a UIButtonBar with two buttons labeled "Continue"
//and "Back".
// The button's style is FLAT.
UIButtonBar setupBtnbar = new UIButtonBar("Continue,Back",
                                           FLAT);

// Set the "Continue" button as the default button on the bar
// with the setDefault method. The index of the button
// corresponds to the order in which the button was added.
setupBtnbar.setDefault(0);

// Use the add method to add another button to the bar.
// The label of the button is "Exit" and the style is FLAT
// by default.
setupBtnbar.add("Exit");

// Add the completed UIButtonBar to an UIMessageBox.
UIMessageBox SetUpStep = new UIMessageBox( parentFrame,
                       "MyApplication Setup", setupMessage,
                        UIMessageBox.INFORMATION, setupBtnbar);

Vector
  |
  +--UIButtonBar

Constructors

UIButtonBar

public UIButtonBar();

Creates an empty button bar with a RAISED style. There are no button objects associated with the button bar; the default button index is initialized to -1.

UIButtonBar

public UIButtonBar(int buttonSet, int style);

Creates an button bar using default button configurations.

Parameter | Description
buttonSet | The set of buttons.
style | The button style. This may be either FLAT or RAISED.

UIButtonBar

public UIButtonBar(String buttons, int style);

Creates a button bar using a comma-separated list of button labels.

Parameter | Description
buttons | A string that contains a list of button labels.
style | The button's style. This may be either FLAT or RAISED.

UIButtonBar

public UIButtonBar(String buttons, String separator, int style);

Creates a button bar byusing a separated list of button labels. You can specify the separator or separators used to tokenize the button labels in the string.

Parameter | Description
buttons | A string that contains a list of button labels.
separator | The character or characters that are used as separators between the button labels.
style | The button's style. It may be either FLAT or RAISED.

Methods

add

public void add(int id);

Adds a new button to the list of buttons, using the current style.

Parameter Description
id The button's identifier. This may be any identifier, or one of the following predefined identifiers:
ID_OK ID_CANCEL ID_YES ID_NO
ID_RETRY ID_ABORT ID_IGNORE
ID_NEXT ID_BACK ID_BACK ID_FINISH

add

public void add(String text, int id);

Adds a new button to the list of buttons, using the current style.

The identifier does not need to be one of the predefined types. You can specify any identifier for the button (for example, add("I agree", 1234);).

Parameter | Description
text | The button's label.
id The button's identifier. This may be any identifier, or one of the following predefined identifiers:
ID_OK ID_CANCEL ID_YES ID_NO
ID_RETRY ID_ABORT ID_IGNORE
ID_NEXT ID_BACK ID_BACK ID_FINISH

add

public void add(String text);

Adds a new button to the list of buttons, using the current style.

Parameter | Description
text | The label of the button.

addMany

public int addMany(String buttons, String separator, int defaultButton);

Adds a list of buttons to the button bar, using the current style.

Return Value:

Returns the number of buttons that are added to the button bar.

Parameter | Description
buttons | A separated list of buttons.
separator | The character or characters to use to tokenize the buttons list.
defaultButton | The index of the default button.

addTo

public IUIComponent addTo(IUIContainer cont);

Adds the current group of buttons to a container.

Return Value:

Returns the default component; if no default was set, returns null.

Parameter | Description
cont | The container to add the buttons to.

Remarks:

The default button has a bold font when it is created. All other buttons have a non-bold font.

getButton

public IUIComponent getButton(String name);

Retrieves the component with the specified name.

Return Value:

Returns the button component; if the component is not found, returns null.

Parameter | Description
name | The name of the button to find in the list of buttons.

getButtonID

public IUIComponent getButtonID(int id);

Retrieves the component with the specified identifier.

Return Value:

Returns the button object, or null if the button is not found.

Parameter Description
id The button's identifier. This may be any identifier, or one of the following predefined identifiers:
ID_OK ID_CANCEL ID_YES ID_NO
ID_RETRY ID_ABORT ID_IGNORE
ID_NEXT ID_BACK ID_BACK ID_FINISH

getDefaultIndex

public int getDefaultIndex();

Retrieves the index of the currently set default button for the button bar.

Return Value:

Returns the index for the default button.

getDefaultObject

public Object getDefaultObject();

Retrieves the object currently set as the default button for the button bar.

Return Value:

Returns the object that is the current default.

getIndex

public int getIndex(IUIComponent find);

Retrieves the button index of the given component.

Return Value:

Returns the index of the button in the current the list of buttons, or -1 if the button not found.

Parameter | Description
find | The component to find in the list of buttons.

loadButtonID

public static String loadButtonID(int id);

Used in the add(int id) method. This method can be used by any application to return a string for any of the identifiers.

Note The strings are localized to the user's platform.

Parameter Description
id The button's identifier. This may be any identifier, or one of the predefined identifiers.
ID_OK ID_CANCEL ID_YES ID_NO
ID_RETRY ID_ABORT ID_IGNORE
ID_NEXT ID_BACK ID_BACK ID_FINISH

setDefault

public void setDefault(Object object);

Sets the default button on the button bar (the default button is the button that is pressed if you make no active selection).

Return Value:

No return value.

Parameter | Description
object | An object, which is the default button of the button bar.

setDefault

public void setDefault(int index);

Sets the default button on the button bar (the default button is the button that is pressed if you make no active selection).

Return Value:

No return value.

Parameter | Description
index | The index of one of the button objects that is currently associated with the button bar.

setStyle

public void setStyle(int i);

Sets the style of the button bar object.

Return Value:

No return value.

Parameter | Description
i | The style for the button bar may be either FLAT or RAISED.

Fields

ABORTRETRYIGNORE
A set of common buttons that consists of three button choices: Abort, Retry, and Ignore.
BACKNEXTFINISHCANCEL
A set of common buttons that consists of three button choices: Back, Next, Finish, and Cancel. This button set is typically used in Wizard dialog boxes.
FLAT
Specifies that the button is flat.
ID_ABORT
A string identifier associated with common Abort buttons.
ID_APPLY
A string identifier associated with common Apply buttons.
ID_BACK
A string identifier associated with common Back buttons.
ID_CANCEL
A string identifier associated with common Cancel buttons.
ID_FINISH
A string identifier associated with common Finish buttons.
ID_IGNORE
A string identifier associated with common ignore buttons.
ID_NEXT
A string identifier associated with common Next buttons.
ID_NO
A string identifier associated with common No buttons.
ID_OK
A string identifier associated with common OK buttons.
ID_RETRY
A string identifier associated with common Retry buttons.
ID_YES
A string identifier associated with common Yes buttons.
OK
A common button style, with only one button choice.
OKCANCEL
A set of common buttons that consists of two button choices: OK and Cancel.
OKCANCELAPPLY
A set of common buttons that consists of three button choices: OK, Cancel, and Apply. This button set is typically used in setup dialog boxes.
RAISED
Specifies that the button is raised.
RETRYCANCEL
A set of common buttons that consists of two button choices: Retry and Cancel.
YESNO
A set of common buttons that consists of two button choices: Yes and No.
YESNOCANCEL
A set of common buttons that consists of three button choices: Yes, No, and Cancel.


Class UICanvas

public class UICanvas extends UIStateComponent
{
  // Methods
  public int getID();
  public String getName();
  public void setID(int id);
  public void setName(String name);
}

This class implements a canvas control. UICanvas objects, such as UIDrawText controls, UILine controls, and UIStatic controls, provide a context for displaying text or images. UICanvas defines methods for retrieving and setting the object's name and identifier.

UIComponent
  |
  +--UIStateComponent
    |
    +--UICanvas

Methods

getID

public int getID();

Retrieves the control's identifier.

Return Value:

Returns the integer associated with the control.

See Also: setID, getName

getName

public String getName();

Retrieves the control's name.

Return Value:

Returns the string that displays the control's associated name.

See Also: setName, getID

setID

public void setID(int id);

Sets the control's identifier.

Return Value:

No return value.

Parameter | Description
id | The value to be associated with the control.

See Also: getID, setName

setName

public void setName(String name);

Sets the control's name.

Return Value:

No return value.

Parameter | Description
name | The name to be associated with the control.

See Also: getName, setID


Class UICardLayout

public class UICardLayout extends UILayoutManager
{
  // Constructors
  public UICardLayout();
  public UICardLayout(int h, int v);

  // Methods
  public void addLayoutComponent(IUIContainer parent,
        IUIComponent comp, Object constraints);
  public void first(IUIContainer parent);
  public Dimension getMinimumSize(IUIContainer parent);
  public Dimension getPreferredSize(IUIContainer parent);
  public boolean isOverlapping();
  public void last(IUIContainer parent);
  public void layout(IUIContainer parent, Rectangle bounds);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int dir, boolean keyable);
  public void next(IUIContainer parent);
  public void previous(IUIContainer parent);
  public void show(IUIContainer parent, String name);
}

This class is a layout manager used to place components on top of one another, showing only one of them at any given time (similar to cascading windows). Typically, card layouts are used for the content area below the tabs of a property sheet.

UILayoutManager
  |
  +--UICardLayout

Constructors

UICardLayout

public UICardLayout();

Creates a UICardLayout manager object with default horizontal and vertical gaps.

UICardLayout

public UICardLayout(int h, int v);

Creates a UICardLayout manager object with the specified horizontal and vertical gaps.

Parameter | Description
h | The number of pixels used for the horizontal gap that appears to the left and right of components laid out with the manager (by default, this is 0).
v | The number of pixels used for the vertical gap that appears above and below the components laid out with the manager (by default, this is 0).

Methods

addLayoutComponent

public void addLayoutComponent(IUIContainer parent, IUIComponent comp,
        Object constraints);

Adds the specified component to the container, according to the specified constraints.

Return Value:

No return value.

Parameter | Description
parent | The container of the component.
comp | The component to be added.
constraints | The layout constraints identifying where the component will be added.

Overrides:

addLayoutComponent(IUIContainer,IUIComponent,Object) in UILayoutManager.

first

public void first(IUIContainer parent);

Shows and lays out the first component in the container, hiding all other components.

Return Value:

No Return value.

Parameter | Description
parent | The parent of the container.

getMinimumSize

public Dimension getMinimumSize(IUIContainer parent);

Determines the minimum size (in pixels) of the control.

Return Value:

Returns the control's minimum size.

Parameter | Description
parent | The parent container.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent);

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

Return Value:

Returns a Dimension object containing the preferred size.

Parameter | Description
parent | The parent container.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

isOverlapping

public boolean isOverlapping();

Determines if this layout manager lays out its children so they overlap either completely or partially.

Return Value:

Returns true. The UICardLayout layout manager always overlaps components.

Overrides:

isOverlapping() in UILayoutManager.

last

public void last(IUIContainer parent);

Shows and lays out the last component in the container, hiding all other components.

Return Value:

No Return value.

Parameter | Description
parent | The parent of the container.

layout

public void layout(IUIContainer parent, Rectangle bounds);

Lays out the components in the associated root container.

Return Value:

No return value.

Parameter | Description
parent | The parent of the container.
bounds | The size (in pixels) to set the visible component to.

Remarks:

The visible component is the full size of the bounds parameter, reduced on the left and right by the layout manager's horizontal gap, and above and below by the manager's vertical gap.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp, int dir,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
cont | The parent container.
comp | The component to navigate from.
dir | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Overrides:

navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.

next

public void next(IUIContainer parent);

Shows and lays out the next component in the container (after the currently visible component), hiding all other components.

Return Value:

No Return value.

Parameter | Description
parent | The parent of the container.

previous

public void previous(IUIContainer parent);

Shows and lays out the previous component in the container (relative to the currently visible component), hiding all other components.

Return Value:

No Return value.

Parameter | Description
parent | The parent of the container.

show

public void show(IUIContainer parent, String name);

Shows and lays out the component with the specified name, hiding all other components.

Return Value:

No return value.

Parameter | Description
parent | The parent of the container.
name | The name of the component.


Class UICheckButton

public class UICheckButton extends UIButton
{
  // Constructors
  public UICheckButton();
  public UICheckButton(String name);
  public UICheckButton(String name, int style);
  public UICheckButton(IUIComponent comp);
  public UICheckButton(IUIComponent comp, int style);

  // Methods
  public synchronized void addItemListener(IUIItemListener l);
  public int getCheckImageSize();
  public Insets getInsets();
  public Dimension getMinimumSize();
  public Dimension getPreferredSize();
  public int getRoleCode();
  public void paint(FxGraphics g);
  public void paintCheck(FxGraphics g);
  protected void processEvent(UIEvent e);
  protected void processItemEvent(UIItemEvent e);
  public synchronized void removeItemListener(IUIItemListener l);
  public void setChecked(boolean on);
  public void setCheckImageSize(int imageSize);
  public void setHot(boolean on);
  public void setID(int id);
  public void setIndeterminate(boolean on);
  public void setName(String name);
  public void setPressed(boolean on);
  public void setSelected(boolean on);
}

This class implements a check box button control. By default, UICheckButton uses the system-defined check box image.

For more information about buttons, see the UIButton overview.

Note The behavior of the action method is not identical to the behavior of AWT components. for more information, see the overview information in UIButton.

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIButton
          |
          +--UICheckButton

Constructors

UICheckButton

public UICheckButton();

Creates a check box button control with no content.

Remarks:

By default, the button's style is set to TOGGLE.

UICheckButton

public UICheckButton(String name);

Creates a check box button control with the specified text.

Parameter | Description
name | The text to be displayed with the check box image.

Remarks:

By default, the button is hot-tracked and its style is set to TOGGLE. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

UICheckButton

public UICheckButton(String name, int style);

Creates a check box button control with the specified text and style.

Parameter | Description
name | The text to be displayed with the check box image.
style | The style of the button. Possible values include TOGGLE or TRITOGGLE.

Remarks:

By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

UICheckButton

public UICheckButton(IUIComponent comp);

Creates a check box button control with the specified component.

Parameter | Description
comp | The component to be displayed with the check box image.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. By default, the button's style is set to TOGGLE. For examples of how to construct buttons, see the UIButton overview.

UICheckButton

public UICheckButton(IUIComponent comp, int style);

Creates a check box button control with the specified component and style.

Parameter | Description
comp | The component to be displayed with the check box image.
style | The style of the button. Possible values include TOGGLE or TRITOGGLE.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. For examples of constructing buttons, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

addItemListener

public synchronized void addItemListener(IUIItemListener l);

Adds the specified item listener. The listener receives all item events generated for the control. (Item events are generated when the state of an item changes.)

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

getCheckImageSize

public int getCheckImageSize();

Retrieves the square dimensions of the check box image that is associated with the button control.

Return Value:

Returns the square dimensions (in pixels) of the check box's image.

See Also: setCheckImageSize

getInsets

public Insets getInsets();

Retrieves the button control's insets (in pixels), which identify the non-client area of the control.

Return Value:

Returns an Insets object that contains the control's insets.

Remarks:

The left inset value includes the size of the check box image plus two pixels for the space between the check box image and the content component.

getMinimumSize

public Dimension getMinimumSize();

Retrieves the minimum size of the check box button control. The minimum size specifies the smallest dimensions (in pixels) that will allow the button's content component and check box image to be displayed.

Return Value:

Returns a Dimension object containing the minimum size.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred size (in pixels) of the check box button control.

Return Value:

Returns a Dimension object containing the preferred size.

Remarks:

By default, this method returns the minimum size, as determined by getMinimumSize.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the check box button.

Return Value:

Returns the ROLE_SYSTEM_CHECKBUTTON code.

paint

public void paint(FxGraphics g);

Draws the check box button control.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method draws the button's content component, and calls paintCheck to draw the check box image.

paintCheck

public void paintCheck(FxGraphics g);

Draws the check box image, according to the button control's current state.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method is called by paint.

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.

Event type | Method called
item event | processItemEvent
action event | processActionEvent (inherited through UIButton)
container event | processContainerEvent (inherited through UIStateContainer)
focus event | processFocusEvent (inherited through UIStateContainer)
key event | processKeyEvent (inherited through UIStateContainer)
mouse event | processMouseEvent (inherited through UIStateContainer)
mouse motion event | processMouseMotionEvent (inherited through UIStateContainer)

When overriding processEvent, call the super event processEvent to ensure the default event processing continues normally.

Overrides:

processEvent(UIEvent) in UIButton.

processItemEvent

protected void processItemEvent(UIItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

removeItemListener

public synchronized void removeItemListener(IUIItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener

setChecked

public void setChecked(boolean on);

Sets or clears the checked state of the button.

Return Value:

No return value.

Parameter | Description
on | If true, the checked state is set; otherwise, it is cleared.

Remarks:

This method redraws the check box's image to display the new state. For more information about states, see the UIStateContainer overview.

See Also: getPreferredSize

setCheckImageSize

public void setCheckImageSize(int imageSize);

Sets the square dimensions of the check box image that is associated with the button control.

Return Value:

No return value.

Parameter | Description
imageSize | The square dimensions (in pixels) of the check box's image.

Remarks:

This method provides the ability to control the size of the check box's or radio button's image.

See Also: getCheckImageSize

setHot

public void setHot(boolean on);

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

Return Value:

No return value.

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

Remarks:

This method redraws the check box image to display the new state. For more information about states, see the UIStateContainer overview.

Overrides:

setHot(boolean) in UIButton.

setID

public void setID(int id);

Sets the container's identifier.

Return Value:

No return value.

Parameter | Description
id | The value to be associated with the container.

See Also: setName

setIndeterminate

public void setIndeterminate(boolean on);

Sets or clears the indeterminate state of the button.

Return Value:

No return value.

Parameter | Description
on | If true, the indeterminate state is set; otherwise, it is cleared.

Remarks:

This method redraws the check box image to display the new state. For more information about states, see the UIStateContainer overview.

setName

public void setName(String name);

Sets the container's name.

Return Value:

No return value.

Parameter | Description
name | The name to be associated with the container.

See Also: setID

setPressed

public void setPressed(boolean on);

Sets or clears the pressed state of the button.

Return Value:

No return value.

Parameter | Description
on | If true, the pressed state is set; otherwise, it is cleared.

Remarks:

This method redraws the check box image to display the new state. For more information about states, see the UIStateContainer overview.

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the button.

Return Value:

No return value.

Parameter | Description
on | If true, the selected state is set; otherwise, it is cleared.

Remarks:

For more information about states, see the UIStateContainer overview.


Class UICheckGroup

public class UICheckGroup extends UIGroup
{
  // Constructors
  public UICheckGroup();
  public UICheckGroup(String label);
  public UICheckGroup(IUIComponent header);

  // Methods
  public IUIComponent add(IUIComponent comp, int index);
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(String name, int index);
  public IUIComponent add(String name);
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public IUIComponent add(String name, Object constraints,
        int index);
  public boolean handleEvent(Event e);
  public void setHeader(IUIComponent header);
}

This class implements a group box control for a list of UICheckButton objects.

This class is very similar to the java.awt.CheckboxGroup class, except that the check boxes do not exhibit radio button behavior (see the UIRadioGroup class).

Note The default layout manager for the UICheckGroup class is the UIVerticalFlowLayout manager, so the constraints parameters of any methods that accept them are typically ignored.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIGroup
          |
          +--UICheckGroup

Constructors

UICheckGroup

public UICheckGroup();

Creates a UICheckGroup control with no label.

Remarks:

Use the UIGroup.setName method to add a label.

UICheckGroup

public UICheckGroup(String label);

Creates a check button group box control with the specified label.

Parameter | Description
label | The label for the group control.

UICheckGroup

public UICheckGroup(IUIComponent header);

Creates a check button group box control using the specified component as a header.

Parameter | Description
header | A IUIComponent label for the group control.

Methods

add

public IUIComponent add(IUIComponent comp, int index);

Adds a UICheckButton to the UICheckGroup control at the specified index.

Return Value:

Returns the UICheckButton that was added, if successful; otherwise, returns null.

Parameter | Description
comp | A UICheckButton, or a component to use for the name of the UICheckButton that is added to the UICheckGroup.
index | The zero-based index at which to insert the component.

add

public IUIComponent add(IUIComponent comp);

Adds a UICheckButton to the end of the list of objects contained by the UICheckGroup control.

Return Value:

Returns the UICheckButton that was added, if successful; otherwise, returns null.

Parameter | Description
comp | A UICheckButton, or a component to use for the name of the UICheckButton that is added to the UICheckGroup.

add

public IUIComponent add(String name, int index);

Adds a UICheckButton to the UICheckGroup control at the specified index.

Return Value:

Returns the UICheckButton that was added, if successful; otherwise, returns null.

Parameter | Description
name | The name of the UICheckButton that is added to the UICheckGroup.
index | The zero-based index at which to insert the component.

add

public IUIComponent add(String name);

Adds a UICheckButton to the end of the list of objects contained by the UICheckGroup control.

Return Value:

Returns the UICheckButton that was added, if successful; otherwise, returns null.

Parameter | Description
name | The name of the UICheckButton that is added to the UICheckGroup.

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds a UICheckButton to the UICheckGroup control, according to the specified constraints and index.

Return Value:

Returns the UICheckButton that was added, if successful; otherwise, returns null.

Parameter | Description
comp | A UICheckButton, or a component to use for the name of the UICheckButton that is added to the UICheckGroup.
constraints | The layout constraints, which depend on the current layout manager. For more information about possible values, see the layout manager's addLayoutComponent method.
index | The zero-based index at which to insert the component.

add

public IUIComponent add(String name, Object constraints, int index);

Adds a UICheckButton to the UICheckGroup control, according to the specified constraints and index.

Return Value:

Returns the UICheckButton that was added, if successful; otherwise, returns null.

Parameter | Description
name | The name of the UICheckButton that is added to the UICheckGroup.
constraints | The layout constraints, which depend on the current layout manager. For more information about possible values, see the layout manager's addLayoutComponent method.
index | The zero-based index at which to insert the component.

handleEvent

public boolean handleEvent(Event e);

Responds to events occurring within the control. This method posts either a LIST_SELECT or a LIST_DESELECT event if the target of the event is a check box within the group control.

Return Value:

Returns true if the event is handled by the check group control, or false if the event is passed to the parent component.

Parameter | Description
e | The event that occurred within the check group.

setHeader

public void setHeader(IUIComponent header);

Sets the header component for the panel.

Return Value:

No return value.

Parameter | Description
header | The component to be used as the group control's header.

See Also: com.ms.ui.UIPanel.getHeader


Class UIChoice

public class UIChoice extends UIPanel implements IUISelector
{
  // Fields
  public static final int THICK;

  // Constructors
  public UIChoice();

  // Methods
  public boolean action(Event e, Object obj);
  public IUIComponent add(IUIComponent comp);
  public void addActionListener(IUIActionListener l);
  public synchronized void addItemListener(IUIItemListener l);
  public void addNotify();
  public void addSelectedIndex(int index);
  public void addSelectedIndex(int index, boolean notify);
  public void addSelectedIndices(int indices[]);
  public void addSelectedIndices(int indices[], boolean notify);
  public void addSelectedItem(IUIComponent comp);
  public void addSelectedItem(IUIComponent comp, boolean notify);
  public void addSelectedItems(IUIComponent comps[]);
  public void addSelectedItems(IUIComponent comps[],
        boolean notify);
  public IUIComponent addString(String s);
  public IUIComponent getAnchorItem();
  public IUIComponent getExtensionItem();
  public UIMenuList getMenu();
  public Dimension getPreferredSize();
  public int getRoleCode();
  public int[] getSelectedIndices();
  public IUIComponent getSelectedItem();
  public IUIComponent[] getSelectedItems();
  public int getSelectionMode();
  public int getStyle();
  public String getValueText();
  public boolean handleEvent(Event e);
  public boolean keyDown(Event e, int key);
  public void layout();
  public boolean mouseDown(Event e, int x, int y);
  public boolean postEvent(Event e);
  protected void processEvent(UIEvent e);
  protected void processItemEvent(UIItemEvent e);
  public void remove(IUIComponent comp);
  public void removeActionListener(IUIActionListener l);
  public synchronized void removeItemListener(IUIItemListener l);
  public void removeSelectedIndex(int index);
  public void removeSelectedIndex(int index, boolean notify);
  public void removeSelectedIndices(int indices[]);
  public void removeSelectedIndices(int indices[], boolean notify);
  public void removeSelectedItem(IUIComponent comp);
  public void removeSelectedItem(IUIComponent comp, boolean notify);
  public void removeSelectedItems(IUIComponent comps[]);
  public void removeSelectedItems(IUIComponent comps[],
        boolean notify);
  public void requestFocus();
  public void setAnchorItem(IUIComponent comp);
  public void setExtensionItem(IUIComponent comp);
  public void setSelectedIndex(int index);
  public void setSelectedIndex(int index, boolean notify);
  public void setSelectedIndices(int indices[]);
  public void setSelectedIndices(int indices[], boolean notify);
  public void setSelectedItem(IUIComponent comp);
  public void setSelectedItem(IUIComponent comp, boolean notify);
  public void setSelectedItems(IUIComponent comps[]);
  public void setSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setSelectionMode(int mode);
  public void setStyle(int style);
  public void setValueText(String s);
}

This class implements a choice control (combo box). A UIChoice object manages the components listed in the following table. In general, any IUIComponent can be added to the menu list. If the IUIComponent is not an IUIContainer, for example, it is a UIItem or UIText, an exact copy of this item appears in the choice display when the item is selected. If an IUIContainer component is used, for example, UIPanel, the name of that container is used in display component, instead of a copy of the actual container. Use getSelectedItem to retrieve the container.

This class supports event listeners.

Component | Description
UIMenuList component | Displays the pop-up list of items that can be selected by the choice control.
UIMenuButton component | Launches or cancels the associated pop-up list.
IUIComponent component | Displays the choice control's currently selected item.

When a UIChoice object is first created, its associated UIMenuList object is empty. To add items to the list, call the add or addString method, as shown in the following example.

// Construct a UIChoice object.
UIChoice c = new UIChoice();

// Create an array of components. When items are added to
// the choice control, these array values will hold the
// components returned from addString.
IUIComponent comps[] = new IUIComponent[4];

// Create an array of strings and add each
// element to the choice control.
String colors[] = {"Red", "Blue", "Green", "Black"};
for (int i=0; i<4; i++)
   comps[i] = c.addString(colors[i]);

// Add the control to the container.
uiec.addSelectedItems(comps);

Note Although UIChoice operates only in SINGLESELECT mode, it implements the IUISelector interface, which has "pluralized" methods, such as getSelectedItems and setSelectedIndices. An IllegalArgumentException is thrown more if an attempt is made to select more than one item. The methods getSelectedIndices/Items simply returns arrays of length 1.

To remove items from a UIChoice menu, use one of the following methods. Call UIChoice.remove(IUIComponent comp) where the comp is the component to be moved from the menu. Or, obtain the UIChoice menu using UIChoice.getMenu, and call any remove method on the menu itself. If UIChoice.remove(int index) is used, components will be removed from the UIChoice control itself, like the menu launcher button.

Also see getSelectedIndex, getSelectedItem

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIChoice

Constructors

UIChoice

public UIChoice();

Creates an empty choice control.

Remarks:

Call add or addString to add items to the control's pop-up list.

Methods

action

public boolean action(Event e, Object obj);

Updates the choice control to display the currently selected item.

Return Value:

Returns false.

Parameter | Description
e | The event posted to the control.
obj | The object that posted the event.

Remarks:

An action event is generated when an item in the control's pop-up list is selected, and the pop-up list is closed.

add

public IUIComponent add(IUIComponent comp);

Adds the specified component to the end of the choice control's associated pop-up list.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added to the choice control.

See Also: addString

addActionListener

public void addActionListener(IUIActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

addItemListener

public synchronized void addItemListener(IUIItemListener l);

Adds the specified item listener. The listener receives all item events generated for the control. (Item events are generated when the state of an item changes.)

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

addNotify

public void addNotify();

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

Return Value:

No return value.

Remarks:

This method adds the UIMenuButton component to the choice control. By default, the button displays the system-defined down arrow.

addSelectedIndex

public void addSelectedIndex(int index);

Selects the component at the specified index, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.

addSelectedIndex

public void addSelectedIndex(int index, boolean notify);

Selects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedIndices

public void addSelectedIndices(int indices[]);

Selects the components at the specified indices, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.

addSelectedIndices

public void addSelectedIndices(int indices[], boolean notify);

Selects the components at the specified indices, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedItem

public void addSelectedItem(IUIComponent comp);

Selects the specified component, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.

addSelectedItem

public void addSelectedItem(IUIComponent comp, boolean notify);

Selects the specified component, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedItems

public void addSelectedItems(IUIComponent comps[]);

Selects the specified components, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be selected.

addSelectedItems

public void addSelectedItems(IUIComponent comps[], boolean notify);

Selects the specified components, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addString

public IUIComponent addString(String s);

Adds the specified text to the end of the choice control's associated pop-up list.

Return Value:

Returns the text component that was added.

Parameter | Description
s | The text to be added to the choice control.

See Also: add

getAnchorItem

public IUIComponent getAnchorItem();

Retrieves the component that is the current anchor in extend select mode.

Return Value:

Returns the component that is the anchor.

getExtensionItem

public IUIComponent getExtensionItem();

Retrieves the last item (the extension item) that was (CTRL)+SHIFT+clicked in EXTENDSELECT mode.

Return Value:

Returns the extension item.

getMenu

public UIMenuList getMenu();

Retrieves the choice control's associated pop-up list.

Return Value:

Returns the associated UIMenuList object.

getPreferredSize

public Dimension getPreferredSize();

Determines the preferred size (in pixels) of the choice control. The UIChoice preferred size is just large enough to accommodate the largest of the items in its menu. If you want to have the UIChoice sized differently, use a layout manager that ignores getPreferredSize.

Return Value:

Returns a Dimension object containing the preferred size.

Remarks:

The choice control's preferred size is based on the associated button's preferred size, the control's insets, and the largest preferred size of all the associated menu's children.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the choice control.

Return Value:

Returns the ROLE_SYSTEM_COMBOBOX code.

getSelectedIndices

public int[] getSelectedIndices();

Retrieves the zero-based indices of all currently selected items.

Return Value:

Returns an array of the indices of the selected items, if an item is selected; otherwise, returns null.

getSelectedItem

public IUIComponent getSelectedItem();

Retrieves the currently selected item of the choice control.

Return Value:

Returns the selected component, if a component is selected; otherwise, returns null.

Remarks:

If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call getSelectedItems.

getSelectedItems

public IUIComponent[] getSelectedItems();

Retrieves all currently selected items.

Return Value:

Returns an array of the selected components, if a component is selected; otherwise, returns null.

getSelectionMode

public int getSelectionMode();

Retrieves the selection mode of the control.

Return Value:

Returns one of the following three selection modes: SINGLESELECT, MULTISELECT, or EXTENDSELECT.

getStyle

public int getStyle();

Retrieves the current style of the control.

Return Value:

Returns an integer containing the current style setting. For a list of possible values, see setStyle.

getValueText

public String getValueText();

Retrieves the name of the currently selected item.

Return Value:

Returns the name of the currently selected item.

handleEvent

public boolean handleEvent(Event e);

Updates the display box each time a list select event happens.

Return Value:

Returns false.

Parameter | Description
e | The LIST_SELECT event.

keyDown

public boolean keyDown(Event e, int key);

Determines whether the SPACEBAR or the ENTER key is being pressed, and if so, sets the pressed state.

Return Value:

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

Parameter | Description
e | The event posted to the button control.
key | The key that has been pressed.

Remarks:

This method is called when the button has focus and a key is pressed. If the key being pressed is the SPACEBAR or the ENTER key, the button's pressed state is set. If the ESC key is being pressed, the button's pressed state is cleared.

For more information about states, see the UIStateContainer overview.

See Also: keyUp

layout

public void layout();

Lays out the choice control.

Return Value:

No return value.

mouseDown

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

Responds to the mouse button being pressed over the control.

Return Value:

Returns true if the event was handled, false otherwise.

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method calls UIComponent.mouseDown.

postEvent

public boolean postEvent(Event e);

Posts the specified event to the control.

Return Value:

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

Parameter | Description
e | The event to post.

Remarks:

If the event's target is the button component, this method changes the target to the choice control itself before posting the event.

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.

Event type | Method called
item event | processItemEvent
container event | processContainerEvent (inherited through UIStateContainer)
focus event | processFocusEvent (inherited through UIStateContainer)
key event | processKeyEvent (inherited through UIStateContainer)
mouse event | processMouseEvent (inherited through UIStateContainer)
mouse motion event | processMouseMotionEvent (inherited through UIStateContainer)

When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(UIItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

remove

public void remove(IUIComponent comp);

Removes the specified component from the choice control's associated pop-up list.

Return Value:

No return value.

Parameter | Description
comp | The component to be removed.

removeActionListener

public void removeActionListener(IUIActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

removeItemListener

public synchronized void removeItemListener(IUIItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener

removeSelectedIndex

public void removeSelectedIndex(int index);

Deselects the component at the specified index, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.

removeSelectedIndex

public void removeSelectedIndex(int index, boolean notify);

Deselects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedIndices

public void removeSelectedIndices(int indices[]);

Deselects the components at the specified indices, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.

removeSelectedIndices

public void removeSelectedIndices(int indices[], boolean notify);

Deselects the components at the specified indices, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedItem

public void removeSelectedItem(IUIComponent comp);

Deselects the specified component, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.

removeSelectedItem

public void removeSelectedItem(IUIComponent comp, boolean notify);

Deselects the specified component, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[]);

Deselects the specified components, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be deselected.

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[], boolean notify);

Deselects the specified components, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

requestFocus

public void requestFocus();

Responds to the control that is receiving input focus.

Return Value:

No return value.

Remarks:

requestFocus calls UIContainer.requestFocus.

setAnchorItem

public void setAnchorItem(IUIComponent comp);

Sets the item used as an anchor in EXTENDSELECT mode. The anchor item cannot be set to null.

Note Resetting the anchor automatically sets the current extension item to null. If it is intended to set both to specific items, call setAnchorItem, followed by setExtensionItem.

Setting the anchor in an IUISelector other than the outermost one, has no effect.

Return Value:

No return value.

Parameter | Description
comp | The component that will be the new anchor.

Exceptions:

IllegalArgumentException if the component is not a child of the selector, or if the component is null.

setExtensionItem

public void setExtensionItem(IUIComponent comp);

Sets the item to which a selection extends from an anchor.

Note Calling setAnchorItem automatically resets this item to null.

Return Value:

No return value.

Parameter | Description
comp | The component that will be the new extension item.

Exceptions:

IllegalArgumentException if the component is not a child of the selector.

setSelectedIndex

public void setSelectedIndex(int index);

Sets the selection to the component at the specified index. By default, a list select event is not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.

Remarks:

This method clears any previous selection.

setSelectedIndex

public void setSelectedIndex(int index, boolean notify);

Sets the selection to the component at the specified index, and optionally generates a list select event.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.
notify | If true, a list select event will be generated; otherwise, a list select event will not be generated.

Remarks:

This method clears any previous selection.

setSelectedIndices

public void setSelectedIndices(int indices[]);

Sets the selection to the components at the specified indices. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.

Remarks:

This method clears any previous selection.

setSelectedIndices

public void setSelectedIndices(int indices[], boolean notify);

Sets the selection to the components at the specified indices, and optionally generates list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method clears any previous selection.

setSelectedItem

public void setSelectedItem(IUIComponent comp);

Sets the selection to the specified component. By default, a list select event is not generated. To be notified when a new selection is made, override this method and call the super method setSelectedItem(comp).

Return Value:

No return value.

Parameter | Description
comp | The item to be selected.

Remarks:

This method clears any previous selection.

setSelectedItem

public void setSelectedItem(IUIComponent comp, boolean notify);

Sets the selection to the specified component, and optionally generates a list select event. To be notified when a new selection is made, override this method and call the super method setSelectedItem(comp, notify).

Return Value:

No return value.

Parameter | Description
comp | The item to be selected.
notify | If true, a list select event will be generated; otherwise, a list select event will not be generated.

Remarks:

This method clears any previous selection.

setSelectedItems

public void setSelectedItems(IUIComponent comps[]);

Sets the selection to the specified components. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected.

Remarks:

This method clears any previous selection.

setSelectedItems

public void setSelectedItems(IUIComponent comps[], boolean notify);

Sets the selection to the specified components, and optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method clears any previous selection.

setSelectionMode

public void setSelectionMode(int mode);

Sets the selection mode of the control.

Return Value:

No return value.

Parameter | Description
mode | The selection mode for the control. Only the SINGLESELECT mode is supported for UIChoice.

Exceptions:

IllegalArgumentException If a mode other than SINGLESELECT is used.

setStyle

public void setStyle(int style);

Sets the current style for the component.

Return Value:

No return value.

Parameter | Description
style | The style of the component. You can pass THICK to specify a thick border around the component and its elements. To return the style to the default, call setStyle(0).

Exceptions:

IllegalArgumentException if an undefined style was specified.

setValueText

public void setValueText(String s);

Searches the UIChoice control for an item whose name matches that of the string. If that item is found, it becomes the selected item.

Return Value:

No return value.

Parameter | Description
s | The string that contains the name of the control.

Fields

THICK
Specifies that the button has a thick edge.


Class UIColorDialog

public class UIColorDialog extends UIDialog
{
  // Constructors
  public UIColorDialog(UIFrame parent);

  // Methods
  public Color getColor();
  public FxColor getFxColor();
  public boolean handleEvent(Event event);
  public void setColor(Color color);
  public void setFxColor(FxColor fxColor);
}

This class displays a dialog window from which the user can select a color.

A UIColorDialog object is a modal dialog window, engaged by calling the show method. The application will not let the user proceed until a color is chosen.

Also see com.ms.ui.UIDialog.show

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow
            |
            +--UIDialog
              |
              +--UIColorDialog

Constructors

UIColorDialog

public UIColorDialog(UIFrame parent);

Creates a color dialog for picking a color.

Parameter | Description
parent | The owner of the dialog.

Methods

getColor

public Color getColor();

Gets the selected color of this color dialog.

Return Value:

Returns the currently selected color of this color dialog; returns null if no color is selected.

See Also: getFxColor, setColor

getFxColor

public FxColor getFxColor();

Gets the selected extended color of this color dialog.

Return Value:

Returns the currently selected color of this color dialog; returns null if no color is selected.

See Also: getColor, setFxColor

handleEvent

public boolean handleEvent(Event event);

Responds to events occurring within the control.

Return Value:

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

Parameter | Description
event | The event.

Overrides:

handleEvent(Event) in UIDialog.

setColor

public void setColor(Color color);

Sets the selected color for this dialog.

Comments:
This color becomes the default color when the color dialog window is first shown. If no color is specified, the default initial color will be white.

Return Value:

No return value.

Parameter | Description
color | The color being set.

See Also: setFxColor, getColor

setFxColor

public void setFxColor(FxColor fxColor);

Sets the selected color for this color dialog to be the extended color.

Comments:
This color becomes the default color when the color dialog window is first shown. If no color is specified, the default initial color will be white.

Return Value:

No return value.

Parameter | Description
color | The color being set.

See Also: setColor, getFxColor


Class UIColumnHeader

public class UIColumnHeader extends UIScrollThumb
{
  // Constructors
  public UIColumnHeader();
  public UIColumnHeader(String text);
  public UIColumnHeader(IUIComponent comp);

  // Methods
  public int getRoleCode();
  public boolean isMoving();
  public boolean isSizing();
  public boolean isSizingLeft();
  public boolean isSizingRight();
  public boolean mouseDown(Event e, int x, int y);
}

This class manages column headers. UIColumnHeader objects are used with UIColumnViewer objects and UIScrollViewer objects to display sizeable headings for columns of data.

You can construct a UIColumnHeader with textual or graphical content using a String or a component (such as a UIText or UIGraphic object). The following example demonstrates different ways to construct a UIColumnHeader object.

// Construct a UIColumnHeader object that displays
// the "Expenses" text string. By default, the
// text is left-aligned and hot-tracked.
UIColumnHeader ch1 = new UIColumnHeader("Expenses");

// Construct a UIColumnHeader object that displays
// the "Revenue" string, centered in the control.
UIColumnHeader ch2 =
   new UIColumnHeader(new UIText("Revenue", UIStatic.CENTERED));

// Construct a UIColumnHeader object that uses an
// appropriate, right-aligned .gif file image (for example,
// a "$" sign for "Profit").
URL docBase  = getDocumentBase();
Image myDollarSign = getImage(docBase, "Profit.gif");
UIColumnHeader ch3 =
   new UIColumnHeader(new UIGraphic(myDollarSign, UIStatic.RIGHT));

When you use a UIGraphic object or an image in a UIColumnHeader, the header is sized to fit the image.

// Create an array of UIColumnHeader objects
// to pass to a UIColumnViewer object.
UIColumnHeader financialReportHeadings [] = {ch1, ch2, ch3};

// Create the UIColumnViewer object that uses
// the headings.
UIColumnViewer cv1 =
   new UIColumnViewer(financialReportHeadings, listOfData);

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIThumb
          |
          +--UIScrollThumb
            |
            +--UIColumnHeader

Constructors

UIColumnHeader

public UIColumnHeader();

Creates a column header object with no content.

UIColumnHeader

public UIColumnHeader(String text);

Creates a column header object using the given string for content.

Parameter | Description
text | The string to use as the column header.

UIColumnHeader

public UIColumnHeader(IUIComponent comp);

Creates a column header object using the given component for content.

Parameter | Description
comp | The component to use.

Methods

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the column header control.

Return Value:

Returns the ROLE_SYSTEM_COLUMNHEADER code.

isMoving

public boolean isMoving();

Checks if the column header is moving.

Return Value:

Returns true if the column header is moving; otherwise, returns false.

Remarks:

Column header objects need not remain in the same order they were added to the viewer, and can be moved (along with the column of contents they head) within the viewer object with a drag-and-drop mouse action.

isSizing

public boolean isSizing();

Checks if the column header is sizing left or right.

Return Value:

Returns true if the column header is sizing; otherwise, returns false.

isSizingLeft

public boolean isSizingLeft();

Checks if the left side of the column header is sizing.

Return Value:

Returns true if the left side is sizing; otherwise, returns false.

isSizingRight

public boolean isSizingRight();

Checks if the right side of the column header is sizing.

Return Value:

Returns true if the right side is sizing; otherwise, returns false.

mouseDown

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

Checks if the mouse button is down. This method specifically checks to see if an edge of the column header is being dragged (a resizing operation) or if the entire header is being moved.

Return Value:

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

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.


Class UIColumnViewer

public class UIColumnViewer extends UIScrollViewer
{
  // Constructors
  public UIColumnViewer();
  public UIColumnViewer(Object columns[], IUIComponent list);

  // Methods
  public boolean action(Event e, Object o);
  public IUIComponent add(Object columns[]);
  public IUIComponent add(Object columns[], int index);
  public IUIComponent add(Object columns[], Object constraints);
  public IUIComponent add(Object columns[], Object constraints, int
        index);
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public synchronized void addActionListener(IUIActionListener l);
  public synchronized void addItemListener(IUIItemListener l);
  public int getOrderIndex(int index);
  public int getWidth(int i);
  public int[] getWidths();
  public void moveColumn(int from, int to);
  protected void processActionEvent(UIActionEvent e);
  protected void processEvent(UIEvent e);
  protected void processItemEvent(UIItemEvent e);
  public synchronized void removeActionListener(
        IUIActionListener l);
  public synchronized void removeItemListener(IUIItemListener l);
  public void setColumns(Object columns[]);
  public void setWidth(int index, int width);
  public void setWidths(int width);
  public void setWidths(int widths[]);
}

This class implements a scrollable column viewer control. UIColumnViewer extends UIScrollViewer to display columns of data, either with or without headers for the columns. IUIComponent objects can be added to the UIColumnViewer and the UIColumnViewer will perform setting the layout of all UIRow elements contained within the IUIComponent being added.

When creating a UIColumnViewer object, you specify the column headers and the content component. Typically, the content component is a UIList object, but can also be other containers, such as UITree objects.

The following example shows how to construct and work with UIColumnViewer objects.

// Set the layout manager for the current container.
setLayout(new BorderLayout());
setFont(new Font("Helvetica", 0, 14));

// Create column headings. This is typically an array of
// Objects, Strings, or UIColumnHeader objects. In this
// example, the array passed to the column viewer is an
// array of UIColumnHeader objects, each with a different
// attribute.
UIColumnHeader headings[] = { (new UIColumnHeader("Expenses")),
               new UIText("Inventory", UIStatic.CENTERED),
               new UIGraphic(myImage, UIStatic.RIGHT),
               new UIText("Profit", UIStatic.BOTTOMRIGHT) };

// Create a list object for the column viewer's content.
// This UIList object is populated with a generic fillList() method.
list = new UIList();
fillList(list, rows[]);

// Create a column viewer control with the previously
// specified headings and list objects.
cl = new UIColumnViewer(headings, list);

// Add the column viewer to the container with a
// centered alignment.
add("Center", cl);

With the add methods, you can add Object arrays and UI components to the column viewer directly. The UIColumnViewer handles the layout of the objects, but you can specify constraints, as well as an insertion point where the row of objects is added to the viewer contained list. All the add methods return the actual object added to the list, regardless of the columns parameter type. Typically, this is a UIRow object.

// You can still add objects to the column viewer
// once it has been created.

 objectArray[0] = (new UIGraphic(dirImage, UIStatic.LEFT));
 objectArray[1] = names[file.type];
 objectArray[2] = file.lastModified();
 objectArray[3] = "" + file.size + " bytes";
cl.add(objectArray, -1);

UIRow forgotOne = new UIRow(theLastRow);
// ...
cl.add(forgotOne, UIScrollViewer.CONTENT, -1);

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIScrollViewer
          |
          +--UIColumnViewer

Constructors

UIColumnViewer

public UIColumnViewer();

Creates a column viewer control with no column headers or content.

UIColumnViewer

public UIColumnViewer(Object columns[], IUIComponent list);

Creates a column viewer control using an array of objects for headers and a component list for content.

Parameter | Description
columns | The array of column objects.
list | The component list.

Methods

action

public boolean action(Event e, Object o);

Handles column viewer actions. Specifically, this method handles the resizing operations for content columns when a column header is moved or resized.

Return Value:

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

Parameter | Description
e | The event posted to the control.
o | The object that posted the event.

add

public IUIComponent add(Object columns[]);

Adds an Object array to the end of a UIColumnViewer object's contained list.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

Parameter | Description
columns | An array of objects to add to the column viewer.

add

public IUIComponent add(Object columns[], int index);

Adds an Object array to the UIColumnViewer object's contained list, at a specified index.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

Parameter | Description
columns | An array of objects to add to the column viewer.
index | The position of the row object when added to the list. Set this value to -1 if the row is added to the end of the list.

add

public IUIComponent add(Object columns[], Object constraints);

Adds an Object array to the end of a UIColumnViewer object's contained list.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

Parameter | Description
columns | An array of objects to add to the column viewer.
constraints | The layout constraints of the content container for the column viewer.

add

public IUIComponent add(Object columns[], Object constraints, int index);

Adds an Object array to the UIColumnViewer object's contained list, at a specified insertion index.

Return Value:

Returns the UIRow object added to the list that contains the given objects as the columns in the row.

Parameter | Description
columns | An array of objects to add to the column viewer.
constraints | The layout constraints of the content container for the column viewer.
index | The position of the row object when added to the list.

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds an IUIComponent to the UIColumnViewer object's contained list, at a specified insertion index.

Return Value:

Returns the actual component added. Typically, this is a UIRow object.

Parameter | Description
comp | A component to add to the column viewer. Typically, this is some type of list object.
constraints The layout constraints of the content container for the column viewer. This can be one of the following constraints.
CONTENT | SCROLL_VERT | SCROLL_HORIZ | SCROLL_CORNER
HEADER_VERT | HEADER_HORIZ | HEADER_CORNER
index | The position of the row object when it is added to the list.

Overrides:

add(IUIComponent,Object,int) in UIScrollViewer.

addActionListener

public synchronized void addActionListener(IUIActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

addItemListener

public synchronized void addItemListener(IUIItemListener l);

Adds the specified item listener. The listener receives all item events generated for the control. (Item events are generated when the state of an item changes.)

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

getOrderIndex

public int getOrderIndex(int index);

Retrieves the order of the column at the specified index.

Return Value:

Returns the zero-based order of the column.

Parameter | Description
index | The zero-based index of the column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

getWidth

public int getWidth(int i);

Retrieves the current width of the column at the specified index.

Return Value:

Returns the width (in pixels) of the specified column.

Parameter | Description
i | The zero-based index of the column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: setWidth

getWidths

public int[] getWidths();

Retrieves the current widths for all the columns.

Return Value:

Returns an array of the widths (in pixels) for each of the columns.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: setWidths

moveColumn

public void moveColumn(int from, int to);

Moves a column from one location to another.

Return Value:

No return value.

Parameter | Description
from | The zero-based index that identifies the column to move.
to | The zero-based index that identifies where the column is moving to.

processActionEvent

protected void processActionEvent(UIActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.

Event type | Method called
action event | processActionEvent
item event | processItemEvent
container event | processContainerEvent (inherited through UIStateContainer)
focus event | processFocusEvent (inherited through UIStateContainer)
key event | processKeyEvent (inherited through UIStateContainer)
mouse event | processMouseEvent (inherited through UIStateContainer)
mouse motion event | processMouseMotionEvent (inherited through UIStateContainer)

When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(UIItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

removeActionListener

public synchronized void removeActionListener(IUIActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener

removeItemListener

public synchronized void removeItemListener(IUIItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener

setColumns

public void setColumns(Object columns[]);

Adds an array of columns to the component.

Return Value:

No return value.

Parameter | Description
columns | The array of columns to set.

setWidth

public void setWidth(int index, int width);

Sets the width of the column at the specified index.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the column.
width | The new width (in pixels) for the column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: getWidth

setWidths

public void setWidths(int width);

Sets the widths of all columns to the specified width.

Return Value:

No return value.

Parameter | Description
width | The new width (in pixels) for each column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: getWidths

setWidths

public void setWidths(int widths[]);

Sets all the column widths to the specified widths.

Return Value:

No return value.

Parameter | Description
widths | The array of new widths (in pixels) for each column.

Exceptions:

IllegalArgumentException if an invalid index is specified.

See Also: getWidths


Class UIComponent

abstract public class UIComponent implements IUIComponent,
            IUIAccessible, ImageObserver, Cloneable
{
  // Methods
  public boolean action(Event evt, Object what);
  public synchronized void addFocusListener(IUIFocusListener l);
  public synchronized void addKeyListener(IUIKeyListener l);
  public synchronized void addMouseListener(IUIMouseListener l);
  public synchronized void addMouseMotionListener(
        IUIMouseMotionListener l);
  public void addNotify();
  public void adjustLayoutSize(Dimension oldSize,
        Dimension newSize);
  public Object clone();
  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 doDefaultAction();
  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 String getDefaultAction();
  public String getDescription();
  public int getFlags();
  public Font getFont();
  public FontMetrics getFontMetrics(Font f);
  public Color getForeground();
  public FxGraphics getGraphics();
  public String getHelp();
  public int getID();
  public int getIndex();
  public String getKeyboardShortcut();
  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 int getRoleCode();
  public IUIRootContainer getRoot();
  public Dimension getSize();
  public int getStateCode();
  public Toolkit getToolkit();
  public final Object getTreeLock();
  public String getValueText();
  public boolean gotFocus(Event e, Object o);
  public boolean handleEvent(Event e);
  public boolean imageUpdate(Image image, int flags, int x, int y,
        int width, int height);
  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 e, Object o);
  public boolean mouseClicked(Event e, int x, int y);
  public boolean mouseDown(Event e, int x, int y);
  public boolean mouseDrag(Event e, int x, int y);
  public boolean mouseEnter(Event e, int x, int y);
  public boolean mouseExit(Event e, int x, int y);
  public boolean mouseMove(Event evt, int x, int y);
  public boolean mouseUp(Event e, int x, int y);
  public IUIComponent navigate(IUIComponent comp, int direction,
        boolean keyable);
  public void notifyEvent(UINotifyEvent e);
  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 synchronized void removeFocusListener(IUIFocusListener l);
  public synchronized void removeKeyListener(IUIKeyListener l);
  public synchronized void removeMouseListener(IUIMouseListener l);
  public synchronized 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 rect);
  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 on);
  public void setValueText(String value);
  public void setVisible(boolean show);
  public String toString();
  public void update(FxGraphics g);
  public void validate();
}

This class implements a stateless component. UIComponent is the base class for all components and containers in AFC. UIContainer extends UIComponent to implement a stateless container.

UIComponent allows you to create lightweight controls without the overhead of managing an object's states. Although most components and containers in AFC are not stateless, UIComponent and UIContainer provide the option of creating controls that have no states.

Note AFC extends UIStateComponent and UIStateContainer from UIComponent and UIContainer, respectively, to implement objects having states.

UIComponent implements the IUIComponent, IUIAccessible, and ImageObserver interfaces.

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.

Return Value:

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

Parameter | Description
evt | The event posted to the control.
what | The object that posted the event.

Remarks:

This method implements action in the IUIComponent interface, and by default, does nothing. UIComponent components should override this method.

addFocusListener

public synchronized void addFocusListener(IUIFocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be added.

Remarks:

This method implements addFocusListener in the IUIComponent interface.

See Also: removeFocusListener

addKeyListener

public synchronized void addKeyListener(IUIKeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be added.

Remarks:

This method implements addKeyListener in the IUIComponent interface.

See Also: removeKeyListener

addMouseListener

public synchronized void addMouseListener(IUIMouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be added.

Remarks:

This method implements addMouseListener in the IUIComponent interface.

See Also: removeMouseListener

addMouseMotionListener

public synchronized 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.

Parameter | Description
l | The mouse motion listener to be added.

Remarks:

This method implements addMouseMotionListener in the IUIComponent interface.

See Also: removeMouseMotionListener

addNotify

public void addNotify();

Called to perform initialization when the graphics context is first available. Sends an EVENT_OBJECT_CREATE event notification to the parent or child.

Return Value:

No return value.

Remarks:

This method implements addNotify in the IUIComponent interface, and by default, does nothing. Components should override this method.

See Also: removeNotify

adjustLayoutSize

public void adjustLayoutSize(Dimension oldSize, Dimension newSize);

Invalidates the control and adjusts its layout size.

Return Value:

No return value.

Parameter | Description
oldSize | The previous layout size of the control.
newSize | The new layout size of the control.

Remarks:

This method implements adjustLayoutSize in the IUIComponent interface. adjustLayoutSize is automatically invoked when the component's size has changed.

clone

public Object clone();

Clones a copy of the component.

Return Value:

Returns the new cloned copy of the component

Exceptions:

CloneNotSupportedException This exception should not occur.

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.

Parameter | Description
x | The x coordinate of the point, in the control's coordinate space.
y | The y coordinate of the point, in the control's coordinate space.

Remarks:

This method implements contains in the IUIComponent interface, and calls getSize to determine whether the point lies within the control.

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.

Parameter | Description
point | The point, in the control's coordinate space.

Remarks:

This method implements contains in the IUIComponent interface, and calls getSize to determine whether the point lies within the control.

createImage

public Image createImage(ImageProducer ip);

Creates an image from the specified image producer.

Return Value:

Returns the created image.

Parameter | Description
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 (in pixels).

Return Value:

Returns the created image.

Parameter | Description
width | The width of the image.
height | The height of the image.

deliverEvent

public void deliverEvent(Event e);

Delivers an event to the control.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method implements deliverEvent in the IUIComponent interface by calling postEvent.

doDefaultAction

public void doDefaultAction();

Performs the default action for the control. For example, the default action for a button is to be pressed.

Return Value:

No return value.

Remarks:

This method implements doDefaultAction in the IUIAccessible interface, and by default, does nothing. Components should override this method.

See Also: getDefaultAction

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.

Parameter | Description
rect | The rectangle identifying the area to be made visible.

Remarks:

This method implements ensureVisible in the IUIComponent interface.

getBackground

public Color getBackground();

Retrieves the background color of the control.

Return Value:

Returns a Color object containing the background color.

Remarks:

This method implements getBackground in the IUIComponent interface, and only checks the background color of the control's parent. By default, the control has no parent (see getParent); therefore, null is returned. Components should override this method.

See Also: setBackground

getBounds

public Rectangle getBounds();

Retrieves the bounding rectangle of the control, relative to its parent.

Return Value:

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

Remarks:

This method implements getBounds in the IUIComponent interface. If the control has no parent, the returned rectangle has a width and height of 0 pixels.

See Also: setBounds, getParent

getBounds

public Rectangle getBounds(IUIComponent comp);

Retrieves the bounding rectangle of the control, relative to the specified component.

Return Value:

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

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

Remarks:

This method implements getBounds in the IUIComponent interface.

See Also: setBounds

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.

Parameter | Description
x | The x coordinate of the point, in the control's coordinate space.
y | The y coordinate of the point, in the control's coordinate space.

Remarks:

This method implements getComponent in the IUIComponent interface, and calls getSize to determine whether the point lies within the control.

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.

Parameter | Description
point | The point, in the control's coordinate space.

Remarks:

This method implements getComponent in the IUIComponent interface, and calls getSize to determine whether the point lies within the control.

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.

Return Value:

Returns a Cursor object containing the cursor.

Remarks:

This method implements getCursor in the IUIComponent interface, and only checks the cursor of the control's parent. By default, the control has no parent (see getParent); therefore, null is returned. Components should override this method.

See Also: setCursor

getDefaultAction

public String getDefaultAction();

Retrieves the default action for the control.

Return Value:

Returns an empty string, indicating the control has no default action.

Remarks:

This method implements getDefaultAction in the IUIAccessible interface. Components should override this method.

See Also: doDefaultAction

getDescription

public String getDescription();

Retrieves a description of the control.

Return Value:

Returns an empty string, indicating the control has no description.

Remarks:

This method implements getDescription in the IUIAccessible interface. Components should override this method.

getFlags

public int getFlags();

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

Return Value:

Returns 0, indicating no user-defined bits are set.

Remarks:

This method implements getFlags in the IUIComponent interface. Components that have states should override this method.

See Also: setFlags

getFont

public Font getFont();

Retrieves the font of the control.

Return Value:

Returns a Font object containing the font.

Remarks:

This method implements getFont in the IUIComponent interface, and only checks the font of the control's parent. By default, the control has no parent (see getParent); therefore, null is returned. Components should override this method.

See Also: setFont

getFontMetrics

public FontMetrics getFontMetrics(Font f);

Retrieves the font metrics for the specified font.

Return Value:

Returns the font metrics.

Parameter | Description
f | The font.

Remarks:

This method implements getFontMetrics in the IUIComponent interface.

getForeground

public Color getForeground();

Retrieves the foreground color of the control.

Return Value:

Returns a Color object containing the foreground color.

Remarks:

This method implements getForeground in the IUIComponent interface, and only checks the foreground color of the control's parent. By default, the control has no parent (see getParent); therefore, null is returned. Components should override this method.

See Also: setForeground

getGraphics

public FxGraphics getGraphics();

Retrieves the graphics context of the control.

Return Value:

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

Remarks:

This method implements getGraphics in the IUIComponent interface.

Note In order to get a valid FxGraphics object back from the getGraphics call, the isNotified state must be checked first.

getHelp

public String getHelp();

Retrieves the Help text for the control.

Return Value:

Returns an empty string, indicating the control has no Help text.

Remarks:

This method implements getHelp in the IUIAccessible interface. Components should override this method.

getID

public int getID();

Retrieves the control's identifier.

Return Value:

Returns -1, indicating the control has no identifier.

Remarks:

This method implements getID in the IUIComponent interface. Components should override this method.

See Also: setID, getName

getIndex

public int getIndex();

Retrieves the index of the control within its parent container.

Return Value:

Returns the control's index (if it has a parent container); otherwise, returns -1.

Remarks:

This method implements getIndex in the IUIComponent interface.

See Also: setIndex, getParent

getKeyboardShortcut

public String getKeyboardShortcut();

Retrieves the keyboard shortcut for the control.

Return Value:

Returns an empty string, indicating the control has no keyboard shortcut.

Remarks:

This method implements getKeyboardShortcut in the IUIAccessible interface. Components should override this method.

getLocation

public Point getLocation();

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

Return Value:

Returns a Point object containing the upper-left corner of the control, in its parent's coordinate space.

Remarks:

This method implements getLocation in the IUIComponent interface.

See Also: setLocation

getLocation

public Point getLocation(IUIComponent comp);

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

Return Value:

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

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

Remarks:

This method implements getLocation in the IUIComponent interface.

See Also: setLocation

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 with the width and height set to the maximum integer value.

Remarks:

This method implements getMaximumSize in the IUIComponent interface. Components should override this method.

See Also: getMinimumSize, getPreferredSize, getSize

getMinimumSize

public Dimension getMinimumSize();

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

Return Value:

Returns a Dimension object with a width and height of 0 pixels.

Remarks:

This method implements getMinimumSize in the IUIComponent interface. Components should override this method.

See Also: getPreferredSize, getMaximumSize, getSize

getName

public String getName();

Retrieves the control's name.

Return Value:

Returns the name of the control, or null, indicating the control has no name.

Remarks:

This method implements getName in the IUIComponent interface. Components should override this method.

See Also: setName, getID

getParent

public IUIContainer getParent();

Retrieves the control's parent.

Return Value:

Returns the parent of the container, or null, indicating the control has no parent container.

Remarks:

This method implements getParent in the IUIComponent interface. Components should override this method.

See Also: setParent

getPeer

public ComponentPeer getPeer();

Retrieves the peer of the control's root container.

Return Value:

Returns the root container's peer.

Remarks:

This method implements getPeer in the IUIComponent interface.

getPreferredSize

public Dimension getPreferredSize();

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

Return Value:

Returns a Dimension object with a width and height of 0 pixels.

Remarks:

This method implements getPreferredSize in the IUIComponent interface. Components should override this method.

See Also: getMinimumSize, getMaximumSize, getSize

getPreferredSize

public Dimension getPreferredSize(Dimension size);

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

Return Value:

Returns a Dimension object with a width and height of 0 pixels.

Parameter | Description
size | The Dimension to coerce the preferred size to.

Remarks:

This method implements getPreferredSize in the IUIComponent interface. Components should override this method.

This method is used to force the preferred size of a component to a specified Dimension or on a particular axis.

See Also: getMinimumSize, getMaximumSize, getSize

getRoleCode

public int getRoleCode();

Retrieves the role of the control.

Return Value:

Returns 0, indicating no ROLE_SYSTEM code describes the control.

Remarks:

This method implements getRoleCode in the IUIAccessible interface. Components should override this method if one of the ROLE_SYSTEM codes describes the control.

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.

Remarks:

This method implements getRoot in the IUIComponent interface.

getSize

public Dimension getSize();

Retrieves the size (in pixels) of the control.

Return Value:

Returns a Dimension object containing the control's size.

Remarks:

This method implements getSize in the IUIComponent interface, and uses the control's parent container to determine the size. If the control has no parent, getSize returns a width and height of zero.

See Also: setSize, getParent

getStateCode

public int getStateCode();

Retrieves the state of the control.

Return Value:

Returns the combination of STATE_SYSTEM codes that best describe the state of the control.

Remarks:

This method implements getStateCode in the IUIAccessible interface. The returned code contains the STATE_SYSTEM_SIZEABLE and STATE_SYSTEM_MOVEABLE flags. Depending on which states are set for the control, the returned code may also contain one of the following other codes.

State | Code
checked | STATE_SYSTEM_CHECKED
focused | STATE_SYSTEM_FOCUSED
hot-tracked | STATE_SYSTEM_HOTTRACKED
indeterminate | STATE_SYSTEM_MIXED
pressed | STATE_SYSTEM_PRESSED
selected | STATE_SYSTEM_SELECTED
can receive keyboard input | STATE_SYSTEM_FOCUSABLE
can be selected | STATE_SYSTEM_SELECTABLE
not visible | STATE_SYSTEM_INVISIBLE

Components can override getStateCode by combining any class-specific codes with the codes obtained from each superclass. The following example shows how UISelector overrides this method.

public int getStateCode()
{
   int state = super.getStateCode();

   if (selMode == MULTISELECT)
      state |= STATE_SYSTEM_MULTISELECTABLE;
   else if (selMode == EXTENDSELECT)
      state |= STATE_SYSTEM_EXTSELECTABLE;

   return(state);
}

See Also: isChecked, isFocused, isHot, isIndeterminate, isKeyable, isPressed, isSelectable, isSelected, isVisible

getToolkit

public Toolkit getToolkit();

Retrieves the toolkit associated with the control.

Return Value:

Returns the associated toolkit.

Remarks:

This method implements getToolkit in the IUIComponent interface.

getTreeLock

public final Object getTreeLock();

Retrieves the locking object for AWT component tree and layout operations.

getValueText

public String getValueText();

Retrieves the value of the control.

Return Value:

Returns an empty string, indicating the control has no value text.

Remarks:

This method implements getValueText in the IUIAccessible interface. Components should override this method.

See Also: setValueText

gotFocus

public boolean gotFocus(Event e, Object o);

Responds to the control receiving input focus.

Return Value:

Returns false.

Parameter | Description
e | The event posted to the control.
o | The object that posted the event (typically null).

Remarks:

This method implements gotFocus in the IUIComponent interface. gotFocus calls setFocused to set the focus state.

handleEvent

public boolean handleEvent(Event e);

Responds to events occurring within the control.

Return Value:

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

Parameter | Description
e | The event.

Remarks:

This method implements handleEvent in the IUIComponent interface. handleEvent checks the type of event and calls the corresponding event method, as follows.

Event type | Method called
ACTION_EVENT | action
GOT_FOCUS | gotFocus
LOST_FOCUS | lostFocus
KEY_ACTION or KEY_PRESS | keyDown
KEY_ACTION_RELEASE or KEY_RELEASE | keyUp
MOUSE_CLICKED | mouseClicked
MOUSE_DOWN | mouseDown
MOUSE_UP | mouseUp
MOUSE_DRAG | mouseDrag
MOUSE_ENTER | mouseEnter
MOUSE_EXIT | mouseExit
MOUSE_MOVE | mouseMove

See Also: postEvent

imageUpdate

public boolean imageUpdate(Image image, int flags, int x, int y, int width,
        int height);

Called to incrementally draw the control's image as the image bits become available.

Return Value:

Returns false, indicating the image is fully loaded.

Parameter | Description
image | The control's image.
flags | The flags that specify the status of the image being loaded. You can pass any bitwise combination of the fields defined in the ImageObserver interface.
x | The x coordinate of the image.
y | The y coordinate of the image.
width | The width of the image (in pixels).
height | The height of the image (in pixels).

Remarks:

This method implements imageUpdate in the ImageObserver interface. Components that display images should override this method.

invalidate

public void invalidate();

Note This method is replaced by setValid.

invalidateAll

public boolean invalidateAll();

Invalidates the control and all of its child components.

Return Value:

Returns true, indicating that the control was invalidated.

Remarks:

This method implements invalidateAll in the IUIComponent interface.

isChecked

public boolean isChecked();

Determines whether the control's checked state is set.

Return Value:

Returns false, indicating the checked state is not set.

Remarks:

This method implements isChecked in the IUIComponent interface. Components that have states should override this method.

See Also: setChecked

isEnabled

public boolean isEnabled();

Determines whether the control's enabled state is set.

Return Value:

Returns false, indicating the enabled state is not set.

Remarks:

This method implements isEnabled in the IUIComponent interface. Components that have states should override this method.

See Also: setEnabled

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 the recurse parameter is true) or if the control alone is enabled (if recurse is false); otherwise, returns false.

Parameter | Description
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.

Remarks:

This method implements isEnabled in the IUIComponent interface.

See Also: setEnabled

isFocused

public boolean isFocused();

Determines whether the control's focus state is set.

Return Value:

Returns false, since the control is stateless.

Remarks:

This method implements isFocused in the IUIComponent interface. Components with states should override this method.

See Also: setFocused

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 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 vertical resizing.

See Also: isWidthRelative

isHot

public boolean isHot();

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

Return Value:

Returns false, indicating the hot-tracked state is not set.

Remarks:

This method implements isHot in the IUIComponent interface. Components that have states should override this method.

See Also: setHot

isIndeterminate

public boolean isIndeterminate();

Determines whether the control's indeterminate state is set.

Return Value:

Returns false, indicating the indeterminate state is not set.

Remarks:

This method implements isIndeterminate in the IUIComponent interface. Components that have states should override this method.

See Also: setIndeterminate

isInvalidating

public boolean isInvalidating();

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

Determines whether the control can receive keyboard input.

Return Value:

Returns true if the control can receive keyboard input; otherwise, returns false.

Remarks:

This method implements isKeyable in the IUIComponent interface. A control can receive keyboard input if it is enabled and visible.

See Also: isEnabled, isVisible

isKeyable

public boolean isKeyable(boolean recurse);

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

Return Value:

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

Parameter | Description
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.

Remarks:

This method implements isKeyable in the IUIComponent interface. A control can receive keyboard input if it is enabled and visible.

See Also: isEnabled, isVisible

isNotified

public boolean isNotified();

Determines whether the control's notified state is set.

Return Value:

Returns false, indicating the notified state is not set.

Remarks:

This method implements isNotified in the IUIComponent interface. Components that have states should override this method.

See Also: addNotify, removeNotify

isPressed

public boolean isPressed();

Determines whether the control's pressed state is set.

Return Value:

Returns false, indicating the pressed state is not set.

Remarks:

This method implements isPressed in the IUIComponent interface. Components that have states should override this method.

See Also: setPressed

isRedrawing

public boolean isRedrawing();

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

Return Value:

Returns false, indicating the redrawing state is not set.

Remarks:

This method implements isRedrawing in the IUIComponent interface, and by default, simply returns false. Components should override this method.

See Also: setRedrawing

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.

Remarks:

This method implements isSelectable in the IUIComponent interface, and simply calls isKeyable.

See Also: setSelected, isSelected

isSelected

public boolean isSelected();

Determines whether the control's selected state is set.

Return Value:

Returns false, indicating the selected state is not set.

Remarks:

This method implements isSelected in the IUIComponent interface. Components that have states should override this method.

See Also: setSelected

isShowing

public boolean isShowing();

Note This method is replaced by isVisible.

isValid

public boolean isValid();

Determines whether the control is valid.

Return Value:

Returns false, indicating the control is invalid.

Remarks:

This method implements isValid in the IUIComponent interface, and by default, simply returns false. Components should override this method.

isVisible

public boolean isVisible();

Determines whether the control's visible state is set.

Return Value:

Returns false, indicating the control is hidden.

Remarks:

This method implements isVisible in the IUIComponent interface. Components that have states should override this method.

See Also: setVisible

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 the recurse parameter is true) or if the control alone is visible (if recurse is false); otherwise, returns false.

Parameter | Description
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.

Remarks:

This method implements isVisible in the IUIComponent interface.

See Also: setVisible

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 control has the input focus.

Return Value:

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

Parameter | Description
evt | The event posted to the control.
key | The key that was pressed.

Remarks:

This method implements keyDown in the IUIComponent interface, and by default, does nothing. UIComponent components should override this method.

keyUp

public boolean keyUp(Event evt, int key);

Responds to a key being released when the control has the input focus.

Return Value:

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

Parameter | Description
evt | The event posted to the control.
key | The key that was released.

Remarks:

This method implements keyUp in the IUIComponent interface, and by default, does nothing. UIComponent components should override this method.

layout

public void layout();

Lays out the control.

Return Value:

No return value.

Remarks:

This method implements layout in the IUIComponent interface, and by default, does nothing. Components should override this method.

layout is invoked when the control is validated.

See Also: relayout

lostFocus

public boolean lostFocus(Event e, Object o);

Responds to the control losing input focus.

Return Value:

Returns false.

Parameter | Description
e | The event posted to the control.
o | The object that posted the event (typically null).

Remarks:

This method implements lostFocus in the IUIComponent interface. lostFocus calls setFocused to clear the focus state. lostFocus also clears the pressed state, if set.

mouseClicked

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

Responds to the control being clicked with the mouse.

Return Value:

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

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method implements mouseClicked in the IUIComponent interface, and by default, does nothing. UIComponent components should override this method.

mouseDown

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

Responds to the mouse button being pressed over the control.

Return Value:

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

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method implements mouseDown in the IUIComponent interface. mouseDown calls setPressed to set the pressed state. UIComponent components should override this method.

See Also: mouseUp

mouseDrag

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

Responds to the mouse being dragged (while the mouse button is pressed) inside or outside the control.

Return Value:

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

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method implements mouseDrag in the IUIComponent interface. mouseDrag calls setPressed to set or clear the pressed state. If the mouse is dragged inside the control, the pressed state is set. If the mouse is dragged outside the control, the pressed state is cleared. UIComponent components should override this method.

mouseEnter

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

Responds to the mouse entering the control.

Return Value:

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

Parameter | Description
evt | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method implements mouseEnter in the IUIComponent interface. If the control can receive keyboard input, mouseEnter calls setHot to set the hot-tracked state. If the control has a tool tip, mouseEnter manages a timer to display the tool tip. UIComponent components should override this method.

See Also: mouseExit, mouseMove

mouseExit

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

Responds to the mouse leaving the control.

Return Value:

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

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method implements mouseExit in the IUIComponent interface. If the control can receive keyboard input, mouseExit calls setHot to clear the hot-tracked state. If the control has a tool tip, mouseExit manages a timer to display the tool tip. UIComponent components should override this method.

See Also: mouseEnter, mouseMove

mouseMove

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

Responds to the mouse being moved within the control (with the mouse button unpressed).

Return Value:

Returns false.

Parameter | Description
evt | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method implements mouseMove in the IUIComponent interface. If the control has a tool tip, mouseMove manages a timer to display the tool tip.

mouseUp

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

Responds to the mouse button being released over the control.

Return Value:

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

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method implements mouseUp in the IUIComponent interface. mouseUp calls setPressed to clear the pressed state. UIComponent components should override this method.

See Also: mouseDown

navigate

public IUIComponent navigate(IUIComponent comp, int direction,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns null, indicating no component can be navigated to.

Parameter | Description
comp | The component to navigate from.
direction | The navigation direction. Specify one of the NAVDIR values in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

This method implements navigate in the IUIAccessible interface. UIContainer overrides this method to handle keyboard navigation among components in a container.

notifyEvent

public void notifyEvent(UINotifyEvent e);

Passes event notification to any children that have requested notification.

Return Value:

No return value.

Parameter | Description
e | The event.

paint

public void paint(FxGraphics g);

Draws the control in the specified graphics context.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method implements paint in the IUIComponent interface, and by default, does nothing. Components should override this method.

See Also: paintAll, repaint, setRedrawing

paintAll

public void paintAll(FxGraphics g);

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

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method implements paintAll in the IUIComponent interface. If the control is valid and its redrawing state is set, paintAll simply calls update.

See Also: paint, isRedrawing, isValid

postEvent

public boolean postEvent(Event e);

Posts an event to the control.

Return Value:

Returns true if the event was handled (either by the control or by one of its ancestors); otherwise, returns false.

Parameter | Description
e | The event.

Remarks:

This method implements postEvent in the IUIComponent interface. postEvent calls handleEvent to respond to the event. If handleEvent returns false, the event is posted to the control's parent for handling (see getParent).

If the control and all of its ancestors are disabled, the event is not handled and postEvent returns false.

See Also: deliverEvent

prepareImage

public boolean prepareImage(Image image, ImageObserver observer);

Prepares an image for this component.

Return Value:

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

Parameter | Description
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. The dimensions are specified in pixels.

Return Value:

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

Parameter | Description
image | The image to prepare for component.
width | The width of the image.
height | The height of the image.
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.

Parameter | Description
g | The graphics context.

Remarks:

This method implements print in the IUIComponent interface, and simply calls paint.

See Also: printAll

printAll

public void printAll(FxGraphics g);

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

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method implements printAll in the IUIComponent interface, and simply calls paintAll.

See Also: print

relayout

public void relayout();

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

Return Value:

No return value.

Remarks:

This method implements relayout in the IUIComponent interface. relayout calls layout if the control is valid.

See Also: isValid

removeFocusListener

public synchronized void removeFocusListener(IUIFocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be removed.

Remarks:

This method implements removeFocusListener in the IUIComponent interface.

See Also: addFocusListener

removeKeyListener

public synchronized void removeKeyListener(IUIKeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be removed.

Remarks:

This method implements removeKeyListener in the IUIComponent interface.

See Also: addKeyListener

removeMouseListener

public synchronized void removeMouseListener(IUIMouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be removed.

Remarks:

This method implements removeMouseListener in the IUIComponent interface.

See Also: addMouseListener

removeMouseMotionListener

public synchronized 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.

Parameter | Description
l | The mouse motion listener to be removed.

Remarks:

This method implements removeMouseMotionListener in the IUIComponent interface.

See Also: addMouseMotionListener

removeNotify

public void removeNotify();

Called when the graphics context is first unavailable. Sends an EVENT_OBJECT_DESTROY event notification to the parent or child.

Return Value:

No return value.

Remarks:

This method implements removeNotify in the IUIComponent interface, and by default, does nothing. Components should override this method.

See Also: addNotify

repaint

public void repaint();

Schedules the control to be redrawn as soon as possible.

Return Value:

No return value.

Remarks:

This method implements repaint in the IUIComponent interface. If the control is valid and its redrawing state is set, repaint calls update to redraw the control (if the control's graphics context is available).

Note This method is synchronous.

See Also: getGraphics, isRedrawing, isValid

repaint

public void repaint(long time);

Schedules the control to be redrawn after the specified amount of time.

Return Value:

No return value.

Parameter | Description
time | The number of milliseconds after which the control is redrawn.

Remarks:

This method implements repaint in the IUIComponent interface. This implementation ignores the time parameter and simply calls repaint(). Components should override this method.

Note This method is synchronous.

repaint

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

Schedules the specified rectangle within the control to be redrawn as soon as possible.

Return Value:

No return value.

Parameter | Description
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).

Remarks:

This method implements repaint in the IUIComponent interface. This implementation ignores all parameters and simply calls repaint(). Components should override this method.

Note This method is synchronous.

repaint

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

Schedules the specified rectangle within the control to be redrawn after the specified amount of time.

Return Value:

No return value.

Parameter | Description
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).

Remarks:

This method implements repaint in the IUIComponent interface. This implementation ignores all parameters and simply calls repaint(). Components should override this method.

Note This method is synchronous.

requestFocus

public void requestFocus();

Requests that the control receive the input focus.

Return Value:

No return value.

Remarks:

This method implements requestFocus in the IUIComponent interface.

setBackground

public void setBackground(Color color);

Sets the control's background color.

Return Value:

No return value.

Parameter | Description
color | The background color for the control.

Remarks:

This method implements setBackground in the IUIComponent interface. Components should override this method.

See Also: getBackground

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. Sends an EVENT_OBJECT_LOCATIONCHANGE event notification to the parent or child.

Return Value:

No return value.

Parameter | Description
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).

Remarks:

This method implements setBounds in the IUIComponent interface. If the control has no parent container, this method returns false.

See Also: getBounds, getParent, com.ms.ui.UIWinEvent

setBounds

public void setBounds(Rectangle rect);

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

Return Value:

No return value.

Parameter | Description
rect | The rectangle identifying the coordinates for the control's upper-left corner and the control's new width and height.

Remarks:

This method implements setBounds in the IUIComponent interface.

See Also: getBounds

setChecked

public void setChecked(boolean on);

Sets or clears the checked state of the control.

Return Value:

No return value.

Parameter | Description
on | If true, the checked state is set; otherwise, it is cleared.

Remarks:

This method implements setChecked in the IUIComponent interface. Components that have states should override this method.

See Also: isChecked

setCursor

public void setCursor(Cursor cursor);

Sets the control's cursor.

Return Value:

No return value.

Parameter | Description
cursor | The cursor for the control.

Remarks:

This method implements setCursor in the IUIComponent interface. Components should override this method.

See Also: getCursor

setEnabled

public void setEnabled(boolean on);

Sets or clears the enabled state of the control.

Return Value:

No return value.

Parameter | Description
on | If true, the enabled state is set; otherwise, it is cleared.

Remarks:

This method implements setEnabled in the IUIComponent interface. Components that have states should override this method.

See Also: isEnabled

setFlags

public void setFlags(int flags);

Sets the user-defined bits for the control.

Return Value:

No return value.

Parameter | Description
flags | The user-defined settings for the control. You can set any bit in the mask 0xFFFF0000.

Remarks:

This method implements setFlags in the IUIComponent interface. Components that have states should override this method.

See Also: getFlags

setFocused

public void setFocused(boolean on);

Sets or clears the focus state of the control. Sends an EVENT_OBJECT_FOCUS event notification to the parent or child.

Return Value:

No return value.

Parameter | Description
on | If true, the focus state is set; otherwise, it is cleared.

Remarks:

This method implements setFocused in the IUIComponent interface. Components that have states should override this method.

setFocused is automatically invoked when the control receives or loses focus.

See Also: isFocused, com.ms.ui.UIWinEvent

setFont

public void setFont(Font font);

Sets the control's font.

Return Value:

No return value.

Parameter | Description
font | The font for the control.

Remarks:

This method implements setFont in the IUIComponent interface. Components should override this method.

See Also: getFont

setForeground

public void setForeground(Color color);

Sets the control's foreground color.

Return Value:

No return value.

Parameter | Description
color | The foreground color for the control.

Remarks:

This method implements setForeground in the IUIComponent interface. Components should override this method.

See Also: getForeground

setHot

public void setHot(boolean on);

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

Return Value:

No return value.

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

Remarks:

This method implements setHot in the IUIComponent interface. Components that have states should override this method.

setHot is automatically invoked when the mouse enters and exits the control.

See Also: isHot

setID

public void setID(int id);

Set the control's identifier.

Return Value:

No return value.

Parameter | Description
id | The value to be associated with the control.

Remarks:

This method implements setID in the IUIComponent interface. Components should override this method.

See Also: getID, setName

setIndeterminate

public void setIndeterminate(boolean on);

Sets or clears the indeterminate state of the control.

Return Value:

No return value.

Parameter | Description
on | If true, the indeterminate state is set; otherwise, it is cleared.

Remarks:

This method implements setIndeterminate in the IUIComponent interface. Components that have states should override this method.

See Also: isIndeterminate

setIndex

public void setIndex(int index);

Sets the index of the control within its parent container.

Return Value:

No return value.

Parameter | Description
index | The index for the control.

Remarks:

This method implements setIndex in the IUIComponent interface, and by default, does nothing. Components should override this method.

See Also: getIndex

setInvalidating

public void setInvalidating(boolean on);

Sets the invalidating state of this object.

Return Value:

No return value.

Parameter | Description
on | The invalidating state setting.

setLocation

public void setLocation(int x, int y);

Sets the location of the control, relative to its parent. Sends an EVENT_OBJECT_LOCATIONCHANGE event notification to the parent or child.

Return Value:

No return value.

Parameter | Description
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.

Remarks:

This method implements setLocation in the IUIComponent interface.

See Also: getLocation, com.ms.ui.UIWinEvent

setLocation

public void setLocation(Point point);

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

Return Value:

No return value.

Parameter | Description
point | The upper-left corner of the control, relative to the parent.

Remarks:

This method implements setLocation in the IUIComponent interface.

See Also: getLocation

setName

public void setName(String name);

Set the control's name. Sends an EVENT_OBJECT_NAMECHANGE event notification to the parent or child.

Return Value:

No return value.

Parameter | Description
name | The name to be associated with the control.

Remarks:

This method implements setName in the IUIComponent interface. Components should override this method.

See Also: getName, setID, com.ms.ui.UIWinEvent

setParent

public void setParent(IUIContainer parent);

Sets the control's parent. Sends an EVENT_OBJECT_PARENTCHANGE event notification to the parent or child.

Return Value:

No return value.

Parameter | Description
parent | The new parent container of the control.

Remarks:

This method implements setParent in the IUIComponent interface. Components should override this method.

See Also: getParent, com.ms.ui.UIWinEvent

setPressed

public void setPressed(boolean on);

Sets or clears the pressed state of the control.

Return Value:

No return value.

Parameter | Description
on | If true, the pressed state is set; otherwise, it is cleared.

Remarks:

This method implements setPressed in the IUIComponent interface. Components that have states should override this method.

setPressed is automatically invoked when the mouse button is pressed, released, or dragged over the control.

See Also: isPressed

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.

Parameter | Description
on | If true, the redrawing state is set; otherwise, it is cleared.

Remarks:

This method implements setRedrawing in the IUIComponent interface, and by default, simply returns false. Components should override this method.

See Also: isRedrawing

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the control. Sends an EVENT_OBJECT_SELECTION event notification to the parent or child.

Return Value:

No return value.

Parameter | Description
on | If true, the selected state is set; otherwise, it is cleared.

Remarks:

This method implements setSelected in the IUIComponent interface. Components that have states should override this method.

See Also: isSelected, com.ms.ui.UIWinEvent

setSize

public void setSize(int width, int height);

Sets the size of the control, according to the specified dimensions. Sends an EVENT_OBJECT_LOCATIONCHANGE event notification to the parent or child.

Return Value:

No return value.

Parameter | Description
width | The new width for the control (in pixels).
height | The new height for the control (in pixels).

Remarks:

This method implements setSize in the IUIComponent interface.

See Also: getSize, com.ms.ui.UIWinEvent

setSize

public void setSize(Dimension size);

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

Return Value:

No return value.

Parameter | Description
size | The new width and height for the control (in pixels).

Remarks:

This method implements setSize in the IUIComponent interface.

See Also: getSize

setValid

public void setValid(boolean on);

Sets or clears the valid state of the control.

Return Value:

No return value.

Parameter | Description
on | If true, the control is validated; otherwise, the control is invalidated.

Remarks:

This method implements setValid in the IUIComponent interface. By default, the on parameter is ignored. Components should override this method.

See Also: isValid

setValueText

public void setValueText(String value);

Sets the value of the control. Sends an EVENT_OBJECT_VALUECHANGE event notification to the parent or child.

Return Value:

No return value.

Parameter | Description
value | The string that describes the visual information contained in the control. This value expands on the information provided by getRoleCode, getStateCode, and getName.

Remarks:

This method implements setValueText in the IUIAccessible interface, and by default, does nothing. Components should override this method.

See Also: getValueText, com.ms.ui.UIWinEvent

setVisible

public void setVisible(boolean show);

Sets or clears the visible state of the control. Sends an EVENT_OBJECT_SELECTION or EVENT_OBJECT_HIDE event notification to the parent or child.

Return Value:

No return value.

Parameter | Description
show | If true, the visible state is set; otherwise, it is cleared.

Remarks:

This method implements setVisible in the IUIComponent interface. Components that have states should override this method.

See Also: isVisible, com.ms.ui.UIWinEvent

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.

Remarks:

This method implements toString in the IUIComponent interface.

See Also: getName

update

public void update(FxGraphics g);

Updates the drawing of the control, using the specified graphics context.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method implements update in the IUIComponent interface. update fills the control with its background color, and then calls paint to redraw the control using the control's foreground color.

See Also: getBackground, getForeground, setRedrawing

validate

public void validate();

Note This method is replaced by setValid.


Class UIContainer

abstract public class UIContainer extends UIComponent
             implements IUIContainer
{
  // Constructors
  public UIContainer();
  public UIContainer(int edge);

  // Methods
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int index);
  public IUIComponent add(IUIComponent comp, Object constraints);
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public IUIComponent add(String name, IUIComponent comp);
  public void addContainerListener(IUIContainerListener l);
  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(IUIComponent comp,
        Dimension oldSize, Dimension newSize);
  public boolean continueInvalidate(IUIComponent comp);
  public boolean ensureVisible(int index);
  public IUIComponent getChild(int index);
  public Rectangle getChildBounds(IUIComponent child);
  public Rectangle getChildBounds(int index);
  public int getChildCount();
  public int getChildIndex(IUIComponent comp);
  public Point getChildLocation(IUIComponent child);
  public Point getChildLocation(int index);
  public Dimension getChildSize(IUIComponent child);
  public Dimension getChildSize(int index);
  public Rectangle getClientRect();
  public IUIComponent getComponent(int x, int y);
  public IUIComponent getComponent(Point point);
  public IUIComponent getComponent(int index);
  public IUIComponent getComponent(IUIComponent comp);
  public int getComponentCount();
  public IUIComponent getComponentFromID(int id);
  public int getComponentIndex(IUIComponent comp);
  public IUIComponent[] getComponents();
  public int getEdge();
  public IUIComponent getFloater();
  public IUIComponent getFocusComponent();
  public IUIComponent getHeader();
  public int getID();
  public Insets getInsets();
  public IUILayoutManager getLayout();
  public Dimension getMinimumSize();
  public String getName();
  public Dimension getPreferredSize(Dimension size);
  public Dimension getPreferredSize();
  public boolean gotFocus(Event e, Object o);
  public boolean invalidateAll();
  public boolean isHeightRelative();
  public boolean isOverlapping();
  public boolean isWidthRelative();
  public boolean keyDown(Event e, int key);
  public void layout();
  public boolean lostFocus(Event e, Object o);
  public boolean mouseEnter(Event e, int x, int y);
  public boolean mouseExit(Event e, int x, int y);
  public boolean move(IUIComponent comp, IUIComponent before);
  public boolean move(int from, int to);
  public IUIComponent navigate(IUIComponent comp, int direction,
        boolean keyable);
  public void notifyEvent(UINotifyEvent e);
  public void paint(FxGraphics g);
  public void paintAll(FxGraphics g);
  public void paintComponents(FxGraphics g);
  public IUIComponent passFocus(int dir);
  public void printAll(FxGraphics g);
  public void remove(int index);
  public void remove(IUIComponent comp);
  public void removeAll();
  public void removeAllChildren();
  public void removeContainerListener(IUIContainerListener l);
  public void removeFocusListener(IUIFocusListener l);
  public void removeKeyListener(IUIKeyListener l);
  public void removeMouseListener(IUIMouseListener l);
  public void removeMouseMotionListener(IUIMouseMotionListener l);
  public void removeNotify();
  public IUIComponent replace(IUIComponent comp, IUIComponent old);
  public IUIComponent replace(IUIComponent comp, int index);
  public IUIComponent replace(IUIComponent comp,
        Object constraints, IUIComponent old);
  public IUIComponent replace(IUIComponent comp,
        Object constraints, int index);
  public IUIComponent replace(IUIComponent comp,
        Object constraints);
  public void setChildBounds(IUIComponent child, int x, int y,
        int width, int height);
  public void setChildBounds(IUIComponent child, Rectangle rect);
  public void setChildBounds(int index, int x, int y, int width,
        int height);
  public void setChildBounds(int index, Rectangle rect);
  public void setChildLocation(IUIComponent child, int x, int y);
  public void setChildLocation(IUIComponent child, Point point);
  public void setChildLocation(int index, int x, int y);
  public void setChildLocation(int index, Point point);
  public void setChildSize(IUIComponent child, int width,
        int height);
  public void setChildSize(IUIComponent child, Dimension size);
  public void setChildSize(int index, int width, int height);
  public void setChildSize(int index, Dimension size);
  public void setComponent(int index, IUIComponent comp);
  public void setEdge(int edge);
  public void setHeader(IUIComponent header);
  public void setID(int id);
  public void setLayout(IUILayoutManager lm);
  public void setLocation(int x, int y);
  public void setName(String name);
  public void setSize(int width, int height);
  public void update(FxGraphics g);
}

This class implements a stateless container. UIContainer is the base class for all containers in AFC, and allows you to create lightweight controls without the overhead of managing an object's states. Although most containers in AFC are not stateless, UIContainer provides the option of creating a container that has no states.

Note AFC extends UIStateContainer from UIContainer to implement a container having states.

A container in AFC is a UIComponent object that holds a collection of other UIComponent objects. Some containers hold multiple child components and an optional header component. Others contain only a header component. Header components are used to represent the container itself; for example, the text displayed on a button is used as its header component.

UIContainer provides methods that operate either on the entire collection of components, or on the collection of child components that excludes the header. For example, getComponentCount returns the total number of child and header components in the container, while getChildCount strictly returns the number of child components, excluding the header component.

UIContainer implements the IUIContainer interface.

UIComponent
  |
  +--UIContainer

Constructors

UIContainer

public UIContainer();

Creates a stateless container with no edge.

UIContainer

public UIContainer(int edge);

Creates a stateless container with the specified edge.

Parameter Description
edge The style of the container's edge. Edge styles can be one of the following values:
  • IFxGraphicsConstants.BDR_RAISED
  • IFxGraphicsConstants.BDR_SUNKEN
  • IFxGraphicsConstants.BDR_OUTER
  • IFxGraphicsConstants.BDR_INNER
  • IFxGraphicsConstants.BDR_RAISEDOUTER
  • IFxGraphicsConstants.BDR_RAISEDINNER
  • IFxGraphicsConstants.BDR_SUNKENOUTER
  • IFxGraphicsConstants.BDR_SUNKENINNER
  • IFxGraphicsConstants.BDR_FLAT
  • IFxGraphicsConstants.EDGE_RAISED
  • IFxGraphicsConstants.EDGE_SUNKEN
  • IFxGraphicsConstants.EDGE_ETCHED
  • IFxGraphicsConstants.EDGE_BUMP
  • 0 (No edge style)

Remarks:

By default, the edge parameter is ignored.

Methods

add

public IUIComponent add(IUIComponent comp);

Adds the specified component to the end of the container.

Return Value:

Returns the component that was added if successful; otherwise, returns null. (The default return value is null.)

Parameter | Description
comp | The component to be added.

Remarks:

This method implements add in the IUIContainer interface. Containers that override this method should return the component that was added, if successful, or null otherwise.

See Also: remove

add

public IUIComponent add(IUIComponent comp, int index);

Adds the specified component to the container at the specified index.

Return Value:

Returns the component that was added if successful; otherwise, returns null. (The default return value is null.)

Parameter | Description
comp | The component to be added.
index | The zero-based index at which to insert the component. If the container has a header component, the header is at index 0, and the first child begins at index 1; otherwise, the first child begins at index 0. To add the component at the end of the container, pass -1 as the index. (For more information about header components, see the UIContainer overview.)

Remarks:

This method implements add in the IUIContainer interface. Containers that override this method should return the component that was added, if successful, or null otherwise.

See Also: remove

add

public IUIComponent add(IUIComponent comp, Object constraints);

Adds the specified component to the container, according to the specified constraints.

Return Value:

Returns the component that was added if successful; otherwise, returns null. (The default return value is null.)

Parameter | Description
comp | The component to be added.
constraints | The layout constraints, which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.

Remarks:

This method implements add in the IUIContainer interface. Containers that override this method should return the component that was added, if successful, or null otherwise.

See Also: remove

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds the specified component to the container, according to the specified constraints and index.

Return Value:

Returns the component that was added if successful; otherwise, returns null. (The default return value is null.)

Parameter | Description
comp | The component to be added.
constraints | The layout constraints, which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.
index | The zero-based index at which to insert the component. If the container has a header component, the header is at index 0, and the first child begins at index 1; otherwise, the first child begins at index 0. To add the component at the end of the container, pass -1 as the index. (For more information about header components, see the UIContainer overview.)

Remarks:

This method implements add in the IUIContainer interface. Containers that override this method should return the component that was added, if successful, or null otherwise.

See Also: remove

add

public IUIComponent add(String name, IUIComponent comp);

Note This method is replaced by add(IUIComponent comp, Object constraints).

addContainerListener

public void addContainerListener(IUIContainerListener l);

Adds the specified container listener. The listener receives all container events generated for the container.

Return Value:

No return value.

Parameter | Description
l | The container listener to be added.

Remarks:

This method implements addContainerListener in the IUIContainer interface.

See Also: removeContainerListener

addFocusListener

public void addFocusListener(IUIFocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be added.

Remarks:

This method implements addFocusListener in the IUIContainer interface.

See Also: removeFocusListener

addKeyListener

public void addKeyListener(IUIKeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be added.

Remarks:

This method implements addKeyListener in the IUIContainer interface.

See Also: removeKeyListener

addMouseListener

public void addMouseListener(IUIMouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be added.

Remarks:

This method implements addMouseListener in the IUIContainer interface.

See Also: removeMouseListener

addMouseMotionListener

public void addMouseMotionListener(IUIMouseMotionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse motion listener to be added.

Remarks:

This method implements addMouseMotionListener in the IUIContainer interface.

See Also: removeMouseMotionListener

addNotify

public void addNotify();

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

Return Value:

No return value.

Remarks:

This method invokes addNotify for each component in the container.

Overrides:

addNotify() in UIComponent.

See Also: removeNotify

adjustLayoutSize

public void adjustLayoutSize(IUIComponent comp, Dimension oldSize,
        Dimension newSize);

Adjusts the layout size of the specified component.

Return Value:

No return value.

Parameter | Description
comp | The component being sized.
oldSize | The previous layout size of the component (in pixels).
newSize | The new layout size of the component (in pixels).

Remarks:

This method implements adjustLayoutSize in the IUIContainer interface. adjustLayoutSize is automatically invoked when the specified component's size has changed.

continueInvalidate

public boolean continueInvalidate(IUIComponent comp);

Determines whether the container should be invalidated when the specified child component is invalidated.

Return Value:

Returns true if the container should be invalidated; otherwise, returns false.

Parameter | Description
comp | The component being invalidated.

Remarks:

This method implements continueInvalidate in the IUIContainer interface.

ensureVisible

public boolean ensureVisible(int index);

Brings the component at the specified index into view.

Return Value:

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

Parameter | Description
index | The zero-based index of the component to be made visible in the container. If the container has a header component, the header is at index 0, and the first child begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements ensureVisible in the IUIContainer interface.

getChild

public IUIComponent getChild(int index);

Retrieves the child component at the specified index. This method cannot retrieve the header component.

Return Value:

Returns null, indicating the specified component cannot be found.

Parameter | Description
index | The zero-based index of the component to be retrieved. Regardless of whether the container has a header component, pass 0 to indicate the first child component.

Remarks:

This method implements getChild in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: getComponent, getChildCount

getChildBounds

public Rectangle getChildBounds(IUIComponent child);

Retrieves the bounding rectangle of the specified component.

Return Value:

Returns the result of calling getChildBounds with the index parameter.

Parameter | Description
child | The component. Specify either the container's header component or any child component.

Remarks:

This method implements getChildBounds in the IUIContainer interface.

See Also: setChildBounds

getChildBounds

public Rectangle getChildBounds(int index);

Retrieves the bounding rectangle of the component at the specified index.

Return Value:

Returns null, indicating the bounding rectangle cannot be retrieved.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, then the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements getChildBounds in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: setChildBounds

getChildCount

public int getChildCount();

Retrieves the number of child components in the container, excluding the header component.

Return Value:

Returns the number of components or 0, indicating that the container has no child components.

Remarks:

This method implements getChildCount in the IUIContainer interface. Containers should override this method.

See Also: getComponentCount, getChild

getChildIndex

public int getChildIndex(IUIComponent comp);

Retrieves the index of the specified child component.

Return Value:

Returns the zero-based index of the component (if the component belongs to the container); otherwise, returns null.

Parameter | Description
comp | The component to retrieve the index for. This component must be a child component and not the header component.

Remarks:

This method implements getChildIndex in the IUIContainer interface. Regardless of whether the container has a header component, index 0 indicates the first child component.

See Also: getComponentIndex

getChildLocation

public Point getChildLocation(IUIComponent child);

Retrieves the location of the specified component.

Return Value:

Returns the result of calling getChildLocation with the index parameter.

Parameter | Description
child | The component. Specify either the container's header component or any child component.

Remarks:

This method implements getChildLocation in the IUIContainer interface.

See Also: setChildLocation

getChildLocation

public Point getChildLocation(int index);

Retrieves the location of the component at the specified index.

Return Value:

Returns null, indicating the location cannot be retrieved.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements getChildLocation in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: setChildLocation

getChildSize

public Dimension getChildSize(IUIComponent child);

Retrieves the size of the specified component.

Return Value:

Returns the result of calling getChildSize with the index parameter.

Parameter | Description
child | The component. Specify either the container's header component or any child component.

Remarks:

This method implements getChildSize in the IUIContainer interface.

See Also: setChildSize

getChildSize

public Dimension getChildSize(int index);

Retrieves the size of the component at the specified index.

Return Value:

Returns null, indicating the size cannot be retrieved.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements getChildSize in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: setChildSize

getClientRect

public Rectangle getClientRect();

Retrieves the client rectangle of the container. The client rectangle is the area that remains after the container's bounding rectangle is reduced by the size of its insets.

Return Value:

Returns the bounding rectangle of the container's client area, in the container's coordinate space.

Remarks:

This method implements getClientRect in the IUIContainer interface. The height of the client rectangle is the height of the container minus its top and bottom insets. Similarly, the width of the client rectangle is the width of the container minus its left and right insets. (The width and height are given in pixels.)

getComponent

public IUIComponent getComponent(int x, int y);

Retrieves the component that contains the point identified by the specified coordinates. The header component or any child component can be retrieved.

Return Value:

Returns the component containing the point (if the point lies within the container); otherwise, returns null.

Parameter | Description
x | The x coordinate of the point, in the container's coordinate space.
y | The y coordinate of the point, in the container's coordinate space.

Remarks:

If the point lies within the container's boundaries, this method enumerates the container's child components to find the first component containing the point. If no child contains the point, the container itself is returned.

Overrides:

getComponent(int,int) in UIComponent.

getComponent

public IUIComponent getComponent(Point point);

Retrieves the component that contains the specified point. The header component or any child component can be retrieved.

Return Value:

Returns the component containing the point (if the point lies within the container); otherwise, returns null.

Parameter | Description
point | The point, whose coordinates are given in the container's coordinate space.

Remarks:

If the point lies within the container's boundaries, this method enumerates the container's child components to find the first component containing the point. If no child contains the point, the container itself is returned.

Overrides:

getComponent(Point) in UIComponent.

getComponent

public IUIComponent getComponent(int index);

Retrieves the component that lies at the specified index. The header component or any child component can be retrieved.

Return Value:

Returns null, indicating no component was found at the specified index.

Parameter | Description
index | The zero-based index of the component to be retrieved. If the container has a header component, the header is at index 0, and the first child begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements getComponent in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

getComponent

public IUIComponent getComponent(IUIComponent comp);

Retrieves the component in the container that is the ancestor of the specified component. The header component or any child component can be retrieved.

Return Value:

Returns the container's immediate child or header component that is the ancestor of the specified component. If the specified component is itself an immediate child (or header) of the container, this component is returned. If the container is not an ancestor of the specified component, null is returned.

Parameter | Description
comp | The component to find the ancestor for.

Remarks:

This method implements getComponent in the IUIContainer interface.

getComponentCount

public int getComponentCount();

Retrieves the number of components in the container, including the header component.

Return Value:

Returns the number of components or 0, indicating that the container has no components.

Remarks:

This method implements getComponentCount in the IUIContainer interface. Containers should override this method.

See Also: getChildCount, getComponent

getComponentFromID

public IUIComponent getComponentFromID(int id);

Retrieves the component with the specified identifier.

Return Value:

Returns the component; returns null if no component with the specified identifier was found.

Parameter | Description
id | The ID of the component to be retrieved.

See Also: setID

getComponentIndex

public int getComponentIndex(IUIComponent comp);

Retrieves the index of the specified component.

Return Value:

Returns the zero-based index of the component (if the component belongs to the container); otherwise, returns null.

Parameter | Description
comp | The component to retrieve the index for. This component can be the header component or any child component.

Remarks:

This method implements getComponentIndex in the IUIContainer interface. If the container has a header component, the header is at index 0, and the first child begins at index 1; otherwise, the first child begins at index 0.

See Also: getChildIndex

getComponents

public IUIComponent[] getComponents();

Retrieves all components in the container.

Return Value:

Returns an array of the container's components. If the container has a header, the first item in the array is the header component; otherwise, the first item is the first child component.

Remarks:

This method implements getComponents in the IUIContainer interface.

getEdge

public int getEdge();

Retrieves the style of the container's edge.

Return Value:

Returns 0, indicating the container has no edge style.

Remarks:

This method implements getEdge in the IUIContainer interface. Containers should override this method.

See Also: setEdge

getFloater

public IUIComponent getFloater();

Retrieves the floating component in this container, if there is one. The floating component is the component that is superceding the standard z-order of the container's children by being first in the z-order. This is most commonly used when a component is being dragged across the screen, such as a column header or a scroll thumb.

Return Value:

Returns the current floating component; returns null if there is none.

getFocusComponent

public IUIComponent getFocusComponent();

Retrieves the component of the container that currently has input focus.

Return Value:

Returns the component that either itself has focus or is the ancestor of the component that has focus. If no descendant of the container currently has focus, null is returned.

Remarks:

This method implements getFocusComponent in the IUIContainer interface. The returned component is either a direct child of the container or the header component. For example, the container has a child component that is itself a container and a component within this child container has focus. Then, getFocusComponent returns the child container.

getHeader

public IUIComponent getHeader();

Retrieves the container's header component.

Return Value:

Returns null, indicating the container has no header.

Remarks:

This method implements getHeader in the IUIContainer interface, and by default, simply returns null. Containers should override this method. For more information about header components, see the UIContainer overview.

See Also: setHeader

getID

public int getID();

Retrieves the container's identifier.

Return Value:

Returns the integer associated with the container; returns null if the container has no identifier.

Overrides:

getID() in UIComponent.

See Also: setID, getName

getInsets

public Insets getInsets();

Retrieves the container's insets (in pixels), which identify the nonclient area of the container.

Return Value:

Returns an Insets object containing the container's insets.

Remarks:

This method implements getInsets in the IUIContainer interface. The container's insets are based on the style of its edges.

See Also: getEdge

getLayout

public IUILayoutManager getLayout();

Retrieves the layout manager of the container.

Return Value:

Returns null, indicating the container has no layout manager.

Remarks:

This method implements getLayout in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: setLayout

getMinimumSize

public Dimension getMinimumSize();

Retrieves the minimum size of the container. The minimum size specifies the smallest dimensions (in pixels) that will allow the container and its components to be displayed.

Return Value:

Returns a Dimension object containing the minimum size.

Remarks:

If the container has a layout manager, the layout manager's getMinimumSize method is called to determine the container's minimum size.

Overrides:

getMinimumSize() in UIComponent.

See Also: getPreferredSize

getName

public String getName();

Retrieves the container's name.

Return Value:

Returns the String that displays the container's associated name; returns null if the container has no name.

Overrides:

getName() in UIComponent.

See Also: setName, getID

getPreferredSize

public Dimension getPreferredSize(Dimension size);

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

Return Value:

Returns a Dimension object with a width and height of 0 pixels.

Parameter | Description
size | The Dimension to coerce the preferred size to.

Remarks:

This method implements getPreferredSize in the IUIComponent interface. Components should override this method if their size is dependent upon a possible size constraint.

Overrides:

getPreferredSize(Dimension) in UIComponent.

See Also: getMinimumSize, getMaximumSize, getSize

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred dimensions (in pixels) for displaying the container and its components.

Return Value:

Returns a Dimension object containing the preferred size.

Remarks:

If the container has a layout manager, the layout manager's getPreferredSize method is called to determine the container's preferred size.

Overrides:

getPreferredSize() in UIComponent.

See Also: getMinimumSize

gotFocus

public boolean gotFocus(Event e, Object o);

Responds to the control receiving input focus.

Return Value:

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

Parameter | Description
e | The event posted to the control.
o | The object that posted the event (typically null).

Remarks:

This method calls UIComponent.gotFocus.

Overrides:

gotFocus(Event,Object) in UIComponent.

invalidateAll

public boolean invalidateAll();

Invalidates the container and all its components.

Return Value:

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

Overrides:

invalidateAll() in UIComponent.

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

Overrides:

isHeightRelative() in UIComponent.

See Also: isWidthRelative

isOverlapping

public boolean isOverlapping();

Determines if this layout manager lays out its children so they overlap either completely or partially.

Return Value:

Returns true if the children overlap; otherwise, returns false. (The default is true.) Returning false also means that only the sibling floater window, if one exists, needs to be clipped by the manager.

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 vertical resizing.

Overrides:

isWidthRelative() in UIComponent.

See Also: isHeightRelative

keyDown

public boolean keyDown(Event e, int key);

Handles keyboard navigation in the container.

Return Value:

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

Parameter | Description
e | The event posted to the container.
key | The key that was pressed.

Remarks:

This method is called when the container (or a component in the container) has focus and a key is pressed. keyDown navigates to another component in the container based on the following key values:

Key | Component navigated to
HOME | The first component in the container
END | The last component in the container
UP ARROW | The component above
DOWN ARROW | The component below
LEFT ARROW | The component to the left
RIGHT ARROW | The component to the right

The component navigated to receives the focus.

Overrides:

keyDown(Event,int) in UIComponent.

See Also: navigate

layout

public void layout();

Lays out the container and its components.

Return Value:

No return value.

Remarks:

If the container has a layout manager, the layout manager's layout method is called to lay out the container.

Overrides:

layout() in UIComponent.

lostFocus

public boolean lostFocus(Event e, Object o);

Responds to the control losing input focus.

Return Value:

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

Parameter | Description
e | The event posted to the control.
o | The object that posted the event (typically null).

Remarks:

This method calls UIComponent.lostFocus.

Overrides:

lostFocus(Event,Object) in UIComponent.

mouseEnter

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

Responds to the mouse entering the control.

Return Value:

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

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method calls UIComponent.mouseEnter.

Overrides:

mouseEnter(Event,int,int) in UIComponent.

See Also: mouseExit

mouseExit

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

Responds to the mouse leaving the control.

Return Value:

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

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method calls UIComponent.mouseExit.

Overrides:

mouseExit(Event,int,int) in UIComponent.

See Also: mouseEnter, mouseMove

move

public boolean move(IUIComponent comp, IUIComponent before);

Moves a component in the container before the specified component.

Return Value:

Returns false, indicating the component was not moved.

Parameter | Description
comp | The component to move.
before | The component to move comp before. If null, comp is placed at the end of the container.

Remarks:

This method implements move in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

move

public boolean move(int from, int to);

Moves a component in the container, according to the specified indices.

Return Value:

Returns false, indicating the component was not moved.

Parameter | Description
from | The zero-based index of the component to move.
to | The zero-based index of the position to move the component in front of. If -1, the component is placed at the end of the container.

Remarks:

This method implements move in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

If the container has a header component, the header is at index 0 and the first child begins at index 1; otherwise, the first child begins at index 0.

navigate

public IUIComponent navigate(IUIComponent comp, int direction,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
comp | The component to navigate from.
direction | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

This method implements navigate in the IUIContainer interface. If the container has a layout manager, then the layout manager's navigate method is called. Otherwise this method returns null.

Overrides:

navigate(IUIComponent,int,boolean) in UIComponent.

notifyEvent

public void notifyEvent(UINotifyEvent e);

Passes event notification to any children who have requested notification.

Return Value:

No return value.

Parameter | Description
e | The event.

Overrides:

notifyEvent(UINotifyEvent) in UIComponent.

paint

public void paint(FxGraphics g);

Draws the container.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

If the container has a layout manager, the layout manager's paintContainer method is also invoked.

Overrides:

paint(FxGraphics) in UIComponent.

See Also: paintAll

paintAll

public void paintAll(FxGraphics g);

Draws the container and its components.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

If the container has the redrawing state set, this method draws the container and its components by calling update and paintComponents. For more information about states, see the UIStateContainer overview.

Overrides:

paintAll(FxGraphics) in UIComponent.

See Also: paint

paintComponents

public void paintComponents(FxGraphics g);

Draws all the components in the container.

Parameter | Description
g | The graphics context.

Remarks:

This method implements paintComponents in the IUIContainer interface, and is invoked by paintAll.

passFocus

public IUIComponent passFocus(int dir);

Retrieves the component that should receive input focus when navigating to the container in the specified direction.

Return Value:

Returns the component, or the container itself, that should receive input focus.

Parameter | Description
dir | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.

Remarks:

This method implements passFocus in the IUIContainer interface.

See Also: navigate

printAll

public void printAll(FxGraphics g);

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

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method calls update and printComponents.

Overrides:

printAll(FxGraphics) in UIComponent.

See Also: print

remove

public void remove(int index);

Removes the component at the specified index from the container.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component to be removed. If the container has a header component, the header is at index 0 and the first child begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements remove in the IUIContainer interface.

See Also: removeAll, removeAllChildren, add

remove

public void remove(IUIComponent comp);

Removes the specified component from the container.

Return Value:

No return value.

Parameter | Description
comp | The header or child component to be removed.

Remarks:

This method implements remove in the IUIContainer interface.

Exceptions:

IllegalArgumentException if the specified component does not belong to the container.

See Also: removeAll, removeAllChildren, add

removeAll

public void removeAll();

Removes all components from the container, including the header component.

Return Value:

No return value.

Remarks:

This method implements removeAll in the IUIContainer interface.

See Also: remove, removeAllChildren, add

removeAllChildren

public void removeAllChildren();

Removes all child components from the container. The header component is not removed.

Return Value:

No return value.

Remarks:

This method implements removeAllChildren in the IUIContainer interface.

See Also: remove, removeAll, add

removeContainerListener

public void removeContainerListener(IUIContainerListener l);

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

Return Value:

No return value.

Parameter | Description
l | The container listener to be removed.

Remarks:

This method implements removeContainerListener in the IUIContainer interface.

See Also: addContainerListener

removeFocusListener

public void removeFocusListener(IUIFocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be removed.

Remarks:

This method implements removeFocusListener in the IUIContainer interface.

See Also: addFocusListener

removeKeyListener

public void removeKeyListener(IUIKeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be removed.

Remarks:

This method implements removeKeyListener in the IUIContainer interface.

See Also: addKeyListener

removeMouseListener

public void removeMouseListener(IUIMouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be removed.

Remarks:

This method implements removeMouseListener in the IUIContainer interface.

See Also: addMouseListener

removeMouseMotionListener

public void removeMouseMotionListener(IUIMouseMotionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse motion listener to be removed.

Remarks:

This method implements removeMouseMotionListener in the IUIContainer interface.

See Also: addMouseMotionListener

removeNotify

public void removeNotify();

Called when the graphics context first becomes unavailable.

Return Value:

No return value.

Remarks:

This method invokes removeNotify for each component in the container.

Overrides:

removeNotify() in UIComponent.

See Also: addNotify

replace

public IUIComponent replace(IUIComponent comp, IUIComponent old);

Adds the specified component to the container, replacing the specified component.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
old | The component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, int index);

Adds the specified component to the container, replacing the specified component.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
index | The index of the component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, Object constraints,
        IUIComponent old);

Adds the specified component to the container with the specified constraints, replacing the specified component.

Return Value:

Returns the component added.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints, which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.
old | The component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, Object constraints,
        int index);

Adds the specified component to the container with the specified constraints, replacing the specified component.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints, which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.
index | The index of the component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, Object constraints);

Adds the specified component to the container, replacing the component with the specified constraints.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints of the component to be replaced (as well as the component to be added), which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.

See Also: add, remove

setChildBounds

public void setChildBounds(IUIComponent child, int x, int y, int width, int
        height);

Sets the bounds of the specified component, according to the specified coordinates and dimensions.

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.
width | The width for the component (in pixels).
height | The height for the component (in pixels).

Remarks:

This method implements setChildBounds in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildBounds

setChildBounds

public void setChildBounds(IUIComponent child, Rectangle rect);

Sets the bounds of the specified component, according to the specified Rectangle object.

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
rect | The bounding rectangle for the component.

Remarks:

This method implements setChildBounds in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildBounds

setChildBounds

public void setChildBounds(int index, int x, int y, int width, int height);

Sets the bounds of the component at the specified index, according to the specified coordinates and dimensions.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, then the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.
width | The width for the component.
height | The height for the component.

Remarks:

This method implements setChildBounds in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildBounds

setChildBounds

public void setChildBounds(int index, Rectangle rect);

Sets the bounds of the component at the specified index, according to the specified Rectangle object.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, then the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
rect | The bounding rectangle for the component.

Remarks:

This method implements setChildBounds in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildBounds

setChildLocation

public void setChildLocation(IUIComponent child, int x, int y);

Sets the location of the specified component, according to the specified coordinates.

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.

Remarks:

This method implements setChildLocation in the IUIContainer interface.

See Also: getChildLocation

setChildLocation

public void setChildLocation(IUIComponent child, Point point);

Sets the location of the specified component, according to the specified Point object.

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
point | The upper-left corner of the component.

Remarks:

This method implements setChildLocation in the IUIContainer interface.

See Also: getChildLocation

setChildLocation

public void setChildLocation(int index, int x, int y);

Sets the location of the component at the specified index, according to the specified coordinates.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.

Remarks:

This method implements setChildLocation in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildLocation

setChildLocation

public void setChildLocation(int index, Point point);

Sets the location of the component at the specified index, according to the specified Point object.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
point | The upper-left corner of the component.

Remarks:

This method implements setChildLocation in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildLocation

setChildSize

public void setChildSize(IUIComponent child, int width, int height);

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

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
width | The width for the component (in pixels).
height | The height for the component (in pixels).

Remarks:

This method implements setChildSize in the IUIContainer interface.

See Also: getChildSize

setChildSize

public void setChildSize(IUIComponent child, Dimension size);

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

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
size | The dimensions for the component (in pixels).

Remarks:

This method implements setChildSize in the IUIContainer interface.

See Also: getChildSize

setChildSize

public void setChildSize(int index, int width, int height);

Sets the size of the component at the specified index, according to the specified dimensions.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, then the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
width | The width for the component (in pixels).
height | The height for the component (in pixels).

Remarks:

This method implements setChildSize in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildSize

setChildSize

public void setChildSize(int index, Dimension size);

Sets the location of the component at the specified index, according to the specified Dimension object.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, then the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
size | The dimensions for the component.

Remarks:

This method implements setChildSize in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildSize

setComponent

public void setComponent(int index, IUIComponent comp);

Adds the component to the container.

Return Value:

No return value.

Parameter | Description
index | The index in the container where the component will be inserted.
comp | The component to be inserted.

setEdge

public void setEdge(int edge);

Sets the style of the container's edge.

Return Value:

No return value.

Parameter Description
edge The style of the container's edge. Edge styles can be one of the following values:
  • IFxGraphicsConstants.BDR_RAISED
  • IFxGraphicsConstants.BDR_SUNKEN
  • IFxGraphicsConstants.BDR_OUTER
  • IFxGraphicsConstants.BDR_INNER
  • IFxGraphicsConstants.BDR_RAISEDOUTER
  • IFxGraphicsConstants.BDR_RAISEDINNER
  • IFxGraphicsConstants.BDR_SUNKENOUTER
  • IFxGraphicsConstants.BDR_SUNKENINNER
  • IFxGraphicsConstants.BDR_FLAT
  • IFxGraphicsConstants.EDGE_RAISED
  • IFxGraphicsConstants.EDGE_SUNKEN
  • IFxGraphicsConstants.EDGE_ETCHED
  • IFxGraphicsConstants.EDGE_BUMP
  • 0 (No edge style)

Remarks:

This method implements setEdge in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getEdge

setHeader

public void setHeader(IUIComponent header);

Sets the header component for the container.

Return Value:

No return value.

Parameter | Description
header | The component to be used as the container's header component. For more information about headers, see the UIContainer overview.

Remarks:

This method implements setHeader in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: getHeader

setID

public void setID(int id);

Sets the container's identifier.

Return Value:

No return value.

Parameter | Description
id | The value to be associated with the container.

Remarks:

To set the identifier, the container must have a header component.

Overrides:

setID(int) in UIComponent.

See Also: getID, setName, getHeader, setHeader

setLayout

public void setLayout(IUILayoutManager lm);

Sets the layout manager of the container.

Return Value:

No return value.

Parameter | Description
lm | The new layout manager to be used.

Remarks:

This method implements setLayout in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getLayout

setLocation

public void setLocation(int x, int y);

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

Return Value:

No return value.

Parameter | Description
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.

Remarks:

This method implements setLocation in the IUIComponent interface.

Overrides:

setLocation(int,int) in UIComponent.

See Also: getLocation

setName

public void setName(String name);

Sets the container's name.

Return Value:

No return value.

Parameter | Description
name | The name to be associated with the container.

Remarks:

To set the name, the container must have a header component.

Overrides:

setName(String) in UIComponent.

See Also: getName, setID, getHeader, setHeader

setSize

public void setSize(int width, int height);

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

Return Value:

No return value.

Parameter | Description
width | The new width for the control (in pixels).
height | The new height for the control (in pixels).

Remarks:

This method implements setSize in the IUIComponent interface.

Overrides:

setSize(int,int) in UIComponent.

See Also: getSize

update

public void update(FxGraphics g);

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

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Overrides:

update(FxGraphics) in UIComponent.

See Also: paintAll


Class UIContextMenu

public class UIContextMenu extends UIMenuLauncher
{
  // Constructors
  public UIContextMenu(UIMenuList uiMenuList);
  public UIContextMenu(IUIComponent comp, UIMenuList uiMenuList);

  // Methods
  public boolean action(Event e, Object o);
  public void ended(Event event);
  public Rectangle getPlacement(Dimension Dim);
  public IUIRootContainer getRoot();
  public UIMenuItem getUserItem(int x, int y);
  public UIMenuItem getUserItem(int x, int y, IUIComponent parent);
  public boolean launchAt(int x, int y, IUIComponent parent);
}

This class implements a context menu or shortcut menu that manages a vector of buttons, one of which is a default. A context menu is typically launched when an object is clicked with the right mouse button. The menu can be posted anywhere on the screen.

The context menu extends a UIMenuLauncher with the ability to be launched at a particular location on the screen.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIMenuLauncher
          |
          +--UIContextMenu

Constructors

UIContextMenu

public UIContextMenu(UIMenuList uiMenuList);

Creates a context menu control with the specified menu. The control itself has no content.

Parameter | Description
uiMenuList | The UIMenuList object containing the content of the associated pop-up menu.

UIContextMenu

public UIContextMenu(IUIComponent comp, UIMenuList uiMenuList);

Creates a context menu control using the specified component for content and the specified menu.

Note To receive event notification, extend UIContextMenu and catch the events there.

Parameter | Description
comp | The component to be displayed within the control.
uiMenuList | The UIMenuList object containing the content of the associated pop-up menu.

Methods

action

public boolean action(Event e, Object o);

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.

Parameter | Description
e | The event posted to the control.
o | The object that posted the event.

ended

public void ended(Event event);

Called by the control's associated pop-up menu once the menu is closed.

Return Value:

No return value.

Parameter | Description
event | The event that will be fired after end is complete; null if no event will be fired.

Overrides:

ended(Event) in UIMenuLauncher.

getPlacement

public Rectangle getPlacement(Dimension Dim);

Called by the control's pop-up menu when the menu is to be displayed.

Return Value:

Returns the bounding rectangle (in screen coordinates) of the pop-up menu.

Parameter | Description
Dim | The preferred size of the pop-up menu.

Overrides:

getPlacement(Dimension) in UIMenuLauncher.

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.

getUserItem

public UIMenuItem getUserItem(int x, int y);

Retrieves the item selected in the control's associated pop-up menu.

Note This is a blocking call.

Return Value:

Returns the menu item that was selected; returns null if none was selected.

Parameter | Description
x | The x coordinate of the menu item's upper-left corner.
y | The y coordinate of the menu item's upper-left corner.

getUserItem

public UIMenuItem getUserItem(int x, int y, IUIComponent parent);

Retrieves the item selected in the control's associated pop-up menu.

Note This is a blocking call.

Return Value:

Returns the menu item that was selected; returns null if none was selected.

Parameter | Description
x | The x coordinate of the menu item's upper-left corner.
y | The y coordinate of the menu item's upper-left corner.
parent | The parent of the item.

launchAt

public boolean launchAt(int x, int y, IUIComponent parent);

Launches the control's associated pop-up menu at the specified location.

Return Value:

Returns true if the pop-up menu was launched; otherwise, returns false.

Parameter | Description
x | The x coordinate for the menu's upper-left corner.
y | The y coordinate for the menu's upper-left corner.
parent | The parent.


Class UIDialog

public class UIDialog extends UIWindow
{
  // Constructors
  public UIDialog(UIFrame parent);
  public UIDialog(UIFrame parent, boolean modal);
  public UIDialog(UIFrame parent, String title);
  public UIDialog(UIFrame parent, String title, boolean modal);

  // Methods
  public void adjustLayoutSize(IUIComponent comp,
        Dimension oldSize, Dimension newSize);
  public void dispose();
  public Point getPosition();
  public String getTitle();
  public boolean handleEvent(Event evt);
  public boolean isAutoPack();
  public boolean isModal();
  public boolean keyDown(Event e, int key);
  public boolean keyUp(Event e, int key);
  public void position(boolean resizable);
  public void setAutoPack(boolean b);
  public void setModal(boolean b);
  public void setName(String name);
  public void setPosition(Point p);
  public void setResizable(boolean resizable);
  public void setTitle(String title);
  public void show();
}

This class implements a dialog window. UIDialog extends the UIWindow class and uses UIHost and UIRootContainer to link with the Application Foundation Classes (AFC). Each UIDialog object has an associated java.awt host (a UIHost object) that delegates method calls to an AFC root container (a UIRootContainer object). When the dialog window is created, the host is added to the window, which in turn displays the root container. The root container allows the dialog window to display IUIComponent objects.

Note All event and paint notifications sent from AWT to the dialog window are also received by the host, which is a child component of the window. The host then routes these notifications to the root container.

A dialog window is initially hidden when it is first created. You must call the dialog window's show method to make the window visible.

Caution The dispose method must be called after any instance of UIDialog, especially after calling show.

UIWindow events are supported.

Note Classes that extend UIDialog and implement the TimerListener interface must call the super method TimerTriggered(event).

Also see com.ms.ui.UIWindow, com.ms.ui.event.IUIMouseListener, com.ms.util.TimerListener, setAutoPack

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow
            |
            +--UIDialog

Constructors

UIDialog

public UIDialog(UIFrame parent);

Creates a modeless dialog window using the specified parent frame. The dialog window has no title.

Parameter | Description
parent | The parent frame of the dialog window.

Remarks:

By default, the dialog window uses BorderLayout for its layout manager. The host is then added to the center of the dialog window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.

Note The dialog window is initially hidden. You must call the dialog window's show method to make the window visible.

For more information about the root container, see the UIDialog overview.

See Also: com.ms.ui.IUIContainer.setLayout

UIDialog

public UIDialog(UIFrame parent, boolean modal);

Creates a modeless or modal dialog window using the specified parent frame. The dialog window has no title.

Parameter | Description
parent | The parent frame of the dialog window.
modal | If true, the dialog window is modal (meaning no other window can receive input while this window is visible); otherwise, the dialog window is modeless.

Remarks:

By default, the dialog window uses BorderLayout for its layout manager. The host is then added to the center of the dialog window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.

Note The dialog window is initially hidden. You must call the dialog window's show method to make the window visible.

For more information about the root container, see the UIDialog overview.

See Also: com.ms.ui.IUIContainer.setLayout

UIDialog

public UIDialog(UIFrame parent, String title);

Creates a modeless dialog window using the specified parent frame and title.

Parameter | Description
parent | The parent frame of the dialog window.
title | The title of the dialog window.

Remarks:

By default, the dialog window uses BorderLayout for its layout manager. The host is then added to the center of the dialog window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.

Note The dialog window is initially hidden. You must call the dialog window's show method to make the window visible.

For more information about the root container, see the UIDialog class overview.

See Also: com.ms.ui.IUIContainer.setLayout

UIDialog

public UIDialog(UIFrame parent, String title, boolean modal);

Creates a modeless or modal dialog window using the specified parent frame and title.

Parameter | Description
parent | The parent frame of the dialog window.
title | The title of the dialog window.
modal | If true, the dialog window is modal (meaning no other window can receive input while this window is visible); otherwise, the dialog window is modeless.

Remarks:

By default, the dialog window uses BorderLayout for its layout manager. The host is then added to the center of the dialog window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.

Note The dialog window is initially hidden. You must call the dialog window's show method to make the window visible.

For more information about the root container, see the UIDialog class overview.

See Also: com.ms.ui.IUIContainer.setLayout

Methods

adjustLayoutSize

public void adjustLayoutSize(IUIComponent comp, Dimension oldSize,
        Dimension newSize);

Adjusts the layout size of the component. This method calls adjustLayoutSize.

Return Value:

No return value.

Parameter | Description
comp | The component to be adjusted.
oldSize | The old size of the component.
newSize | The new size of the component.

Remarks:

If isAutoPack is set to true, pack is called.

dispose

public void dispose();

Called when the UIDialog component is no longer needed and can be disposed of.

Return Value:

No return value.

getPosition

public Point getPosition();

Retrieves the position of the dialog window.

Return Value:

Returns a Point object containing the upper-left corner of the dialog window.

See Also: setPosition

getTitle

public String getTitle();

Retrieves the title of the UIDialog box.

Return Value:

Returns a String that contains the title of the dialog box.

See Also: setTitle

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.

Parameter | Description
evt | The event.

isAutoPack

public boolean isAutoPack();

Determines if the components in a window will be packed. Returns true or false, depending on whether the components in the container will be packed.

Return Value:

Returns true if the components in the window will be packed; otherwise, returns false.

See Also: setAutoPack, com.ms.ui.UIWindow.pack

isModal

public boolean isModal();

Gets the modality of the dialog box.

Return Value:

Returns true if the dialog is modal; otherwise, returns false.

See Also: setModal

keyDown

public boolean keyDown(Event e, int key);

Called, usually by the handleEvent method, when a key is pressed.

Return Value:

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

Parameter | Description
e | The event that caused the call to the keyDown.
key | The ASCII value of the key that was pressed.

Remarks:

If the ESC key has been pressed, it is handled locally in keyUp where the window will be closed. If it is any other key, it is handled in the superclass keyDown method. See the similar UIMessageBox method which checks for enter or space keys,

See Also: keyUp, com.ms.ui.UIMessageBox.keyUp

keyUp

public boolean keyUp(Event e, int key);

Called, usually by the handleEvent method, when a key is pressed.

Return Value:

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

Parameter | Description
e | The event that caused the call to keyUp.
key | The ASCII value of the key released.

Remarks:

If the ESC key has been pressed and the component is not a modal message box, the component will be made invisible. Otherwise the event will be handled by the superclass keyUp method. See the similar UIMessageBox.keyUp method which checks for enter or space keys,

position

public void position(boolean resizable);

Positions the dialog window on the screen.

Return Value:

No return value.

Parameter | Description
resizable | If true, the dialog window can be resized; otherwise its size is fixed.

Remarks:

If a point was set through setPosition, this method positions the dialog window based on the coordinates of this point. Otherwise, the window is centered on the screen.

setAutoPack

public void setAutoPack(boolean b);

Sets the automatic packing feature.

Return Value:

No return value.

Parameter | Description
b | boolean. Toggles an internal flag that determines whether the components in a container will be packed or not. Set this variable to true, if components are to be packed; false otherwise.

See Also: getPosition, isAutoPack, com.ms.ui.UIWindow.pack

setModal

public void setModal(boolean b);

Sets the modality of the dialog box.

Return Value:

No return value.

Parameter | Description
b | Set this to true if the dialog box is modal.

See Also: isModal

setName

public void setName(String name);

Sets the dialog box's name and title. Calls UIPanel.setName and setTitle.

Return Value:

No return value.

Parameter | Description
name | The name to be associated with the container.

See Also: getName

setPosition

public void setPosition(Point p);

Sets the position of the dialog window, based on the specified point.

Return Value:

No return value.

Parameter | Description
p | The coordinates for the upper-left corner of the dialog window.

Remarks:

This method only marks the new position for the dialog window. The position method actually repositions the window based on the specified point.

See Also: getPosition

setResizable

public void setResizable(boolean resizable);

Sets the resizable flag.

Return Value:

No return value.

Parameter | Description
resizable | Set to true if the dialog can be resized; otherwise, set to false.

setTitle

public void setTitle(String title);

Sets the title of the dialog box.

Return Value:

No return value.

Parameter | Description
title | The new title set for the dialog box.

See Also: getTitle

show

public void show();

Shows the applet and its root container.

Return Value:

No return value.

Overrides:

show() in UIWindow.


Class UIDialogMapping

public class UIDialogMapping
{
  // Constructors
  public UIDialogMapping();
  public UIDialogMapping(Component Parent);
  public UIDialogMapping(Font font);

  // Methods
  public Dimension mapDimension(Dimension dim);
  public Rectangle mapRectangle(Rectangle rect);
}

This class maps pixels to dialog logical units (DLUs). DLUs are resolution-independent coordinates that are useful for laying out controls in a dialog box. The mapping from pixels to DLUs is based on the font of the dialog box. An x coordinate DLU is 1/4 (.25) of the average character width of the font used in the dialog box. A y coordinate DLU is 1/8 (.125) of the character height.

Note The average character width is not the average of all characters. Rather, it is the average of all alpha characters, both uppercase and lowercase. That is, the average character width is the total width of the string "a...zA...Z" divided by 52.

Constructors

UIDialogMapping

public UIDialogMapping();

Creates a UIDialogMapping object with a default font.

Remarks:

The default font has a style of Font.PLAIN and a point size of 8. The mapDimension and mapRectangle methods use this font to convert pixels to dialog logical units (DLUs). For more information about the relationship between pixels and DLUs, see the UIDialogMapping overview.

UIDialogMapping

public UIDialogMapping(Component Parent);

Creates a UIDialogMapping object using the font of the specified component.

Parameter | Description
Parent | The component that defines the font to be used.

Remarks:

The mapDimension and mapRectangle methods use the font of the specified component to convert pixels to dialog logical units (DLUs). For more information about the relationship between pixels and DLUs, see the UIDialogMapping overview.

UIDialogMapping

public UIDialogMapping(Font font);

Creates a UIDialogMapping object using the specified font.

Parameter | Description
font | The font to be used.

Remarks:

The mapDimension and mapRectangle methods use the specified font to convert pixels to dialog logical units (DLUs). For more information about the relationship between pixels and DLUs, see the UIDialogMapping overview.

Methods

mapDimension

public Dimension mapDimension(Dimension dim);

Maps a Dimension object given in pixels to a Dimension object given in dialog logical units (DLUs).

Return Value:

Returns the Dimension object given in DLUs.

Parameter | Description
dim | The Dimension object given in pixels.

Remarks:

This method converts pixels to DLUs based on the font associated with the UIDialogMapping object. For more information about the relationship between pixels and DLUs, see the UIDialogMapping overview.

mapRectangle

public Rectangle mapRectangle(Rectangle rect);

Maps a Rectangle object given in pixels to a Rectangle object given in dialog logical units (DLUs).

Return Value:

Returns the Rectangle object given in DLUs.

Parameter | Description
rect | The Rectangle object given in pixels.

Remarks:

This method converts pixels to DLUs based on the font associated with the UIDialogMapping object. For more information about the relationship between pixels and DLUs, see the UIDialogMapping overview.


Class UIDragDrop

public abstract class UIDragDrop
{
  // Methods
  public static void beginDrag(TransferSession session);
  public static void beginDrag(MetaObject data, int available);
  public static void beginDrag(MetaObject data, int available, int preferred);
  public static void beginDrag(DragSource source, MetaObject data,
        int available);
  public static void beginDrag(DragSource source, MetaObject data,
        int available, int preferred);
  public static void beginDrag(DragSource source, TransferSession session);
}

This class implements the beginDrag drag-and-drop API for AFC objects. It is similar to the AWT-based implementation in the WDragSession class. The dragdrop APIs work for both AWT and Microsoft AFC, but are implemented slightly different. For a small comparative example of drag-and-drop functionality implemented using both AWT and AFC, see the WDragSession overview.

Use the beginDrag methods to start a drag-and-drop operation. All beginDrag methods act on two parameters, a DragSource object and a TransferSession. Several of the beginDrag methods accept various TransferSession parameters to simplify drag session creation.

Object
  |
  +--UIDragDrop

Methods

beginDrag

public static void beginDrag(TransferSession session);

Starts a drag session by obtaining a TransferSession object and acting on it. The drag session has an undefined DragSource object. Drag-and-drop TransferSession implementations must support Transfer.MOVE.

Return Value:

No return value.

Parameter | Description
session | The TransferSession object that is used during the current drag operation.

beginDrag

public static void beginDrag(MetaObject data, int available);

Starts a drag session by obtaining a TransferSession object and acting on it. The drag session has an undefined DragSource object. Drag-and-drop TransferSession implementations must support Transfer.MOVE.

Return Value:

No return value.

Parameter | Description
data | A MetaObject used to create a TransferSession object. It is used in the current drag session.
available | The transfer effects that are available for the created TransferSession. These include NONE, COPY, MOVE, and LINK.

beginDrag

public static void beginDrag(MetaObject data, int available, int preferred);

Starts a drag session by obtaining a TransferSession object and acting on it. The drag session has an undefined DragSource object. Drag-and-drop TransferSession implementations must support Transfer.MOVE.

Return Value:

No return value.

Parameter | Description
data | A MetaObject used to create a TransferSession object. It is used in the current drag session.
available | The transfer effects that are available for the created TransferSession. These include NONE, COPY, MOVE, and LINK.
preferred | The preferred transfer effects for the current TransferSession.

beginDrag

public static void beginDrag(DragSource source, MetaObject data,
        int available);

Starts a drag session by obtaining a TransferSession object and acting on it. Drag-and-drop TransferSession implementations must support Transfer.MOVE.

Return Value:

No return value.

Parameter | Description
source | A DragSource object that provides custom cursor behavior for the drag session.
data | A MetaObject used to create a TransferSession object. It is used in the current drag session.
available | The transfer effects that are available for the created TransferSession. These include NONE, COPY, MOVE, and LINK.

beginDrag

public static void beginDrag(DragSource source, MetaObject data,
        int available, int preferred);

Starts a drag session by obtaining a TransferSession object and acting on it. Drag-and-drop TransferSession implementations must support Transfer.MOVE.

Return Value:

No return value.

Parameter | Description
source | A DragSource object that provides custom cursor behavior for the drag session.
data | A MetaObject used to create a TransferSession object. It is used in the current drag session.
available | The transfer effects that are available for the created TransferSession. These include NONE, COPY, MOVE, and LINK.
preferred | The preferred transfer effects for the current TransferSession.

beginDrag

public static void beginDrag(DragSource source, TransferSession session);

Starts a drag session by obtaining a TransferSession object and acting on it. Drag-and-drop TransferSession implementations must support Transfer.MOVE.

Return Value:

No return value.

Parameter | Description
source | A DragSource object that provides custom cursor behavior for the drag session.
session | The TransferSession object that is used during the current drag operation.


Class UIDrawText

public class UIDrawText extends UICanvas implements
            IFxTextConstants, IFxGraphicsConstants
{
  // Constructors
  public UIDrawText();
  public UIDrawText(String newBuff);
  public UIDrawText(char newBuff[]);

  // Methods
  public void addNotify();
  public void ensureNotDirty(FxGraphics g);
  public boolean ensureVisible(int idx);
  public boolean ensureVisible(Point p);
  public boolean ensureVisible(Rectangle r);
  protected int eoln(int idx);
  public int getCharFromScreen(int scrnX, int scrnY);
  public int getCharFromScreen(Point scrnPos);
  public Point getCharLocation(int iPos);
  public int getCurrIndex();
  public int getHorizAlign();
  public int getIndexHeight(int index);
  public int getLength();
  public Dimension getMinimumSize();
  public IFxShape getOutline();
  public char getPasswordChar();
  public Dimension getPreferredSize();
  public Dimension getPreferredSize(Dimension size);
  public int getRoleCode();
  public String getSelectedText();
  public int getSelectionEnd();
  public int getSelectionStart();
  public String getValueText();
  public int getVertAlign();
  protected int getWordEdge(int iPos, boolean pleaseMoveLeft,
        boolean givePrevious);
  public int getWordWrap();
  public boolean gotFocus(Event evt, Object what);
  public void hideCaret();
  public boolean isAlwaysShowSelection();
  public boolean isAutoResizable();
  public boolean isBordered();
  public boolean isSingleLine();
  public boolean keyDown(Event evt, int key);
  public boolean lostFocus(Event evt, Object what);
  public boolean mouseDown(Event evt, int x, int y);
  public boolean mouseDrag(Event evt, int x, int y);
  public void paint(FxGraphics g);
  protected synchronized void paint(FxGraphics g, int startPos, int
        endPos, boolean wantOpaque);
  protected void processKeyEvent(KeyEvent ke);
  public void selectAll();
  public void setAlwaysShowSelection(boolean on);
  public void setAutoResizable(boolean auto);
  public void setBackground(Color c);
  public void setBordered(boolean b);
  public void setBounds(int x, int y, int width, int height);
  public void setCurrIndex(int idx, boolean showCaretNow);
  public void setCurrIndex(int idx);
  public void setFont(Font f);
  public void setForeground(Color c);
  public void setHorizAlign(int h);
  public void setInputMethod( InputMethodListener ime );
  public void setLocation(int x, int y);
  public void setOutline(IFxShape outline);
  public void setPasswordChar(char c);
  public void setRefresh(boolean r);
  public void setSelection(int selStart, int selEnd);
  public void setSingleLine(boolean sl);
  public void setSize(int width, int height);
  public void setTabs(int tabs[]);
  public void setTextCallback(IFxTextCallback tcb);
  public void setValueText(char newBuff[], int offset, int len);
  public void setValueText(String value);
  public void setVertAlign(int v);
  public void setWordWrap(int ww);
  public void showCaret();
  public synchronized void showCaret(int iPos);
  public void update(FxGraphics g);
}

This class manages the display of read-only text. Although the text cannot be changed through user interaction, it can be changed programatically. The UIEdit class allows a user to directly edit the control.

The UIDrawText component can also be associated with an InputMethodListener object. Use the setInputMethod method to set the input method editor (IME), and the showCaret methods to display an IME composition window, once when the listener is set.

UIComponent
  |
  +--UIStateComponent
    |
    +--UICanvas
      |
      +--UIDrawText

Constructors

UIDrawText

public UIDrawText();

Creates an empty read-only text control.

UIDrawText

public UIDrawText(String newBuff);

Creates a read-only text control with the specified string.

Parameter | Description
newBuff | The text for the control.

UIDrawText

public UIDrawText(char newBuff[]);

Creates a read-only text control with the specified character buffer.

Parameter | Description
newBuff | Contains the text for the control.

Methods

addNotify

public void addNotify();

Called when the graphics context is first available to set a font.

Return Value:

No return value.

ensureNotDirty

public void ensureNotDirty(FxGraphics g);

Updates all text blocks.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

ensureVisible

public boolean ensureVisible(int idx);

Ensures that a character index is visible and scrolls the control, if necessary.

Note UIDrawText objects to not have class-level scrolling capabilities. This methods only succeeds if the UIDrawText object is contained in an IUIContainer that has scrolling capabilities (for example, UIScrollViewer).

Return Value:

Returns true if the method was successful; otherwise, returns false.

Parameter | Description
idx | The index of the character that will be made visible.

ensureVisible

public boolean ensureVisible(Point p);

Ensures that a position in the control is visible and scrolls the control, if necessary.

Note UIDrawText objects do not have class-level scrolling capabilities. This methods only succeeds if the UIDrawText object is contained in an IUIContainer that has scrolling capabilities (for example, UIScrollViewer).

Return Value:

Returns true if the method was successful; otherwise, returns false.

Parameter | Description
p | The client coordinates that will be made visible.

ensureVisible

public boolean ensureVisible(Rectangle r);

Ensures that a specified rectangle is visible and resizes the control, if necessary.

Note UIDrawText objects do not have class-level scrolling capabilities. This method only succeeds if the UIDrawText object is contained in an IUIContainer that has scrolling capabilities (for example, UIScrollViewer).

Return Value:

Returns true if the method was successful; otherwise, returns false.

Parameter | Description
r | The rectangle to be made visible.

eoln

protected int eoln(int idx);

Retrieves the end-of-line character index for the current line.

Return Value:

Returns the index of the end-of-line character. This index indicates where the caret would be positioned if it were at the end of the line.

Parameter | Description
idx | The index of a character on the line.

getCharFromScreen

public int getCharFromScreen(int scrnX, int scrnY);

Retrieves the character at the specified coordinates.

Return Value:

Returns the index of the character at the specified position. If there is no character at that position, the character returned will be the last one on the nearest line. Before you use the returned index, you must check if the index is a valid index for the string (as it is possible to index past the end of the string using the mouse, which may then return an invalid index).

Parameter | Description
scrnX | The x coordinate, in pixels.
scrnY | The y coordinate, in pixels.

getCharFromScreen

public int getCharFromScreen(Point scrnPos);

Retrieves the character at the specified point.

Return Value:

Returns the index of the character at the specified position. If there is no character at that position, the character returned will be the last one on the nearest line. Before you use the returned index, you must check if the index is a valid index for the string (as it is possible to index past the end of the string using the mouse, which may then return an invalid index).

Parameter | Description
scrnPos | The coordinates of the point, in pixels.

getCharLocation

public Point getCharLocation(int iPos);

Retrieves the position that the character would be drawn at if drawn alone. Typically, this is used for placing the caret.

Return Value:

Returns a Point object that contains the client coordinates of the character.

Parameter | Description
iPos | The index of the character to query.

getCurrIndex

public int getCurrIndex();

Retrieves the current caret position.

Return Value:

Returns the character index where the caret is located.

getHorizAlign

public int getHorizAlign();

Retrieves the horizontal alignment of the text.

Return Value:

Returns the horizontal alignment.

Remarks:

One of the following values defined by the IFxTextConstants interface will be returned.

  • htaLeft
  • htaCenter
  • htaRight
  • htaJustified
  • htaStretch
  • htaScriptDefault

See Also: setHorizAlign, setVertAlign, getVertAlign

getIndexHeight

public int getIndexHeight(int index);

Retrieves the height of the font used to paint the character at a given index. This method is used internally by the keyDown method.

Return Value:

Returns the height of a font (in pixels).

Parameter | Description
index | An index of a character in an FxFormattedText buffer. If the index is invalid, 1 is returned.

getLength

public int getLength();

Retrieves the length of the text in the control.

Return Value:

Returns the number of characters in the control.

getMinimumSize

public Dimension getMinimumSize();

Retrieves the minimum size (in pixels) of the control.

Return Value:

Returns a Dimension object containing the minimum size.

See Also: getPreferredSize

getOutline

public IFxShape getOutline();

Retrieves the outline along which text is drawn.

Return Value:

Returns an IFxShape object that specifies the outline.

Remarks:

For example, if the outline is an ellipse, the text that the AwtUIDrawText object is created with is drawn along the outline of this ellipse.

See Also: setOutline

getPasswordChar

public char getPasswordChar();

Retrieves the character that the control displays for password characters.

Return Value:

Returns the character that the control displays for password characters.

See Also: setPasswordChar

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred size (in pixels) of the control.

Return Value:

Returns a Dimension object containing the preferred size.

See Also: getMinimumSize

getPreferredSize

public Dimension getPreferredSize(Dimension size);

Retrieves the preferred layout size of the control (in pixels), given a constraint. The Dimension parameter that is passed is typically the size of the container hosting the control.

For example, if the UIDrawText object has word wrapping set, the returned Dimension will have a width no greater than size.width, and a height that is large enough to hold all the text. If the UIDrawText object has no word wrapping set, the size constraint is ignored and the method is equivalent to calling getPreferredSize().

Return Value:

Returns a Dimension that describes the preferred layout size.

Parameter | Description
size | The Dimension to constrain the preferred size to.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the text control.

Return Value:

Returns the ROLE_SYSTEM_STATICTEXT code.

getSelectedText

public String getSelectedText();

Retrieves the selected text in the control.

Return Value:

Returns a String object that contains the selected text of the control.

getSelectionEnd

public int getSelectionEnd();

Retrieves the ending point of the selection.

Return Value:

Returns the character index of the ending point of the selection.

getSelectionStart

public int getSelectionStart();

Retrieves the starting point of the selection.

Return Value:

Returns the character index of the starting point of the selection.

getValueText

public String getValueText();

Retrieves the text in the control.

Return Value:

Returns a String object that contains the text of the control.

See Also: setValueText

getVertAlign

public int getVertAlign();

Retrieves the vertical alignment for the text.

Return Value:

Returns the vertical alignment.

See Also: setVertAlign

getWordEdge

protected int getWordEdge(int iPos, boolean pleaseMoveLeft,
        boolean givePrevious);

Searches for and retrieves the character index of the first or last character in a word.

Return Value:

Returns the index of the first or the last character of the word, depending upon givePrevious.

Parameter | Description
iPos | Specifies the position where the search should start.
pleaseMoveLeft | Specifies the direction of the search. If true, the search will be to the left of iPos. If false, the search will be to the right of iPos.
givePrevious | Specifies if the index of the beginning or end of the word will be returned. If true, the index of the first character will be returned. If false, the index of the last character will be returned.

getWordWrap

public int getWordWrap();

Retrieves the word wrapping style.

Return Value:

Returns the word wrapping style. For a list of possible values, see setWordWrap.

gotFocus

public boolean gotFocus(Event evt, Object what);

Called when the component receives the input focus. The caret associated with the UIDrawText object is activated when the control receives focus.

Return Value:

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

Parameter | Description
evt | The event posted to the control.
what | The object that previously had the focus.

See Also: lostFocus

hideCaret

public void hideCaret();

Hides the caret.

Return Value:

No return value.

Remarks:

The hideCaret and showCaret methods are used internally, and only when the UIDrawText or UIEdit control has focus. These methods are not directly used by the application.

isAlwaysShowSelection

public boolean isAlwaysShowSelection();

Determines whether the Always Show Selection mode is set. This is equivalent to the ES_NOHIDESEL Win32 edit style flag.

Return Value:

Returns true if the text drawing mode is set to Always Show Selection; otherwise, returns false.

See Also: setAlwaysShowSelection

isAutoResizable

public boolean isAutoResizable();

Determines whether the bounding box of the control's text will automatically adjust to the size of the control when the control is resized or reshaped.

Return Value:

Returns true if the auto-resize attribute is set; otherwise, returns false.

See Also: setAutoResizable

isBordered

public boolean isBordered();

Determines whether the control has a border.

Return Value:

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

See Also: setBordered

isSingleLine

public boolean isSingleLine();

Retrieves the control's single-line attribute.

Return Value:

Returns true if the control's text can be displayed on a single line; otherwise, returns false.

keyDown

public boolean keyDown(Event evt, int key);

Processes a key down event.

Return Value:

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

Parameter | Description
evt | The event posted to the control.
key | The key that was pressed.

lostFocus

public boolean lostFocus(Event evt, Object what);

Called when the component loses the input focus. The caret associated with the UIDrawText object is hidden when the control loses focus.

Return Value:

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

Parameter | Description
evt | The event posted to the control.
what | The object that is gaining the focus.

mouseDown

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

Processes a mouse down event.

Return Value:

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

Parameter | Description
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);

Processes a mouse drag event.

Return Value:

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

Parameter | Description
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.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

paint

protected synchronized void paint(FxGraphics g, int startPos, int endPos,
        boolean wantOpaque);

Draws a portion of the control's text.

Return Value:

No return value.

Parameter | Description
g | The graphics context.
startPos | Specifies the starting character index.
endPos | Specifies the ending character index.
wantOpaque | True for opaque text.

processKeyEvent

protected void processKeyEvent(KeyEvent ke);

Processes the specified key event.

Return Value:

No return value.

Parameter | Description
ke | The key event.

selectAll

public void selectAll();

Selects all the text in the control.

Return Value:

No return value.

setAlwaysShowSelection

public void setAlwaysShowSelection(boolean on);

Sets the text drawing Always Show Selection mode to on Off. When this mode is set to On, it is equivalent to the ES_NOHIDESEL Win32 edit style flag.

Return Value:

No return value.

Parameter | Description
on | If true, the always show selection mode is set to on.

See Also: isAlwaysShowSelection

setAutoResizable

public void setAutoResizable(boolean auto);

Sets the control's auto-resize attribute.

Return Value:

No return value.

Parameter | Description
auto | If true, the bounding box of the control's text will automatically adjust to the size of the control when the control is resized or reshaped.

See Also: isAutoResizable

setBackground

public void setBackground(Color c);

Sets the background color of the control.

Return Value:

No return value.

Parameter | Description
c | A Color object that specifies the background color.

setBordered

public void setBordered(boolean b);

Sets or clears the control's border.

Return Value:

No return value.

Parameter | Description
b | If true, the control has a border; otherwise, it does not.

setBounds

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

Sets the bounding rectangle of the UIDrawText object, according to the specified coordinates and dimensions. This method ensures that various blocks are set to the correct dimension, unless isAutoResizable returns false.

Return Value:

No return value.

Parameter | Description
x | The x coordinate of the upper-left corner of the block (in pixels).
y | The y coordinate of the upper-left corner of the block (in pixels).
width | The width of the bounding rectangle (in pixels).
height | The height of the bounding rectangle (in pixels).

setCurrIndex

public void setCurrIndex(int idx, boolean showCaretNow);

Note This method is replaced by setCurrIndex(int idx).

setCurrIndex

public void setCurrIndex(int idx);

Sets the position of the caret. The caret's current display state remains unchanged.

Return Value:

No return value.

Parameter | Description
idx | The character index where the caret will be placed.

setFont

public void setFont(Font f);

Sets the font for all the text.

Return Value:

No return value.

Parameter | Description
f | A Font object that specifies the font.

setForeground

public void setForeground(Color c);

Sets the text color of the control.

Return Value:

No return value.

Parameter | Description
c | A Color object that specifies the text color.

setHorizAlign

public void setHorizAlign(int h);

Sets the horizontal alignment of the control's text.

Return Value:

No return value.

Parameter | Description
h The horizontal alignment. You can pass one of the following values, defined by the IFxTextConstants interface.
  • htaLeft
  • htaCenter
  • htaRight
  • htaJustified
  • htaStretch
  • htaScriptDefault
h | The horizontal alignment.

Remarks:

Some of the vertical and horizontal alignment values are script and locale dependant. Although all values are valid, the ensureNotDirty method may use default values (htaLeft and vtaTop) if the horizontal or vertical alignments are not appropriate for the current locale or script direction.

setInputMethod

public void setInputMethod( InputMethodListener ime );

Sets the InputMethodListener for the UIDrawText component. If an InputMethodListener is set, an FxCaret object will display the IME composition window near the caret.

Return Value:

No return value.

Parameter | Description
ime | The InputMethodListener to be set.

setLocation

public void setLocation(int x, int y);

Sets the location of the control.

Return Value:

No return value.

Parameter | Description
x | The x coordinate for the upper-left corner of the control.
y | The y coordinate for the upper-left corner of the control.

setOutline

public void setOutline(IFxShape outline);

Sets an outline that the text buffer is drawn along.

Return Value:

No return value.

Parameter | Description
outline | An IFxShape object that specifies the outline.

See Also: getOutline

setPasswordChar

public void setPasswordChar(char c);

Sets the character that is displayed in the control when a password is entered. When you use this method and enter a password, word wrap settings are ignored and the text becomes a single line.

Return Value:

No return value.

Parameter | Description
c | Specifies the character that will be displayed in place of password characters. If this value is zero, the password character is cleared.

See Also: getPasswordChar

setRefresh

public void setRefresh(boolean r);

Sets the refresh flag.

Return Value:

No return value.

Parameter | Description
r | If true, the control will be automatically updated whenever a parameter is changed; otherwise, the control will not be updated when a parameter changes.

setSelection

public void setSelection(int selStart, int selEnd);

Sets the current selection from the specified start index to the end index (non-inclusive).

Return Value:

No return value.

Parameter | Description
selStart | The starting index of the selection.
selEnd | The ending index of the selection.

setSingleLine

public void setSingleLine(boolean sl);

Changes the control's single line attribute.

Return Value:

No return value.

Parameter | Description
sl | Set to false if the control's text is displayed on multiple lines; otherwise, the text is displayed on a single line.

setSize

public void setSize(int width, int height);

Sets the size of the control.

Return Value:

No return value.

Parameter | Description
width | The new width of the control (in pixels).
height | The new height of the control (in pixels).

setTabs

public void setTabs(int tabs[]);

Sets the tab stops (in pixels) for the UIDrawText control. The tabs are set the same for each FxFormattedText block.

Return Value:

No return value.

Parameter | Description
tabs | An array of tab positions. If the length of the tabs array is 1, the tab stops will all be multiples of tabs[0].

See Also: com.ms.fx.FxFormattedText.setTabs

setTextCallback

public void setTextCallback(IFxTextCallback tcb);

Sets the IFxTextCallback interface associated with the current UIDrawText object as the IFxTextCallback for each FxFormattedText object that uses the UIDrawText object to draw formatted text buffers.

Return Value:

No return value.

Parameter | Description
tcb | The IFxTextCallback interface associated with the UIDrawText object.

setValueText

public void setValueText(char newBuff[], int offset, int len);

Sets the text in the control.

Return Value:

No return value.

Parameter | Description
newBuff | The array of characters that contains the text.
offset | The offset of the newBuff text buffer where the text starts.
len | The length of the text.

See Also: getValueText

setValueText

public void setValueText(String value);

Sets the text in the control.

Return Value:

No return value.

Parameter | Description
s | A String object that specifies the new text.

See Also: getValueText

setVertAlign

public void setVertAlign(int v);

Sets the vertical alignment of the control's text.

Return Value:

No return value.

Parameter Description
v The vertical alignment. You can pass one of the following values, defined by the IFxTextConstants interface.
  • vtaTop
  • vtaCenter
  • vtaBottom
  • vtaBaseline
  • vtaStretch

Remarks:

Some of the vertical and horizontal alignment values are script and locale dependant. Although all values are valid, the ensureNotDirty method may use default values (htaLeft and vtaTop) if the horizontal or vertical alignments are not appropriate for the current locale or script direction.

setWordWrap

public void setWordWrap(int ww);

Sets the word wrapping style.

Return Value:

No return value.

Parameter Description
ww The style of word wrapping. You can use one of the following values, defined by the IFxTextConstants interface.
  • wwNone
  • wwWrap
  • wwKeepWordIntact
  • wwVirtualRectEnd
  • wwVirtualRectSide
  • wwCleanEdges
  • wwMask

showCaret

public void showCaret();

Shows the caret at the current position. If an InputMethodListener object is associated with the UIDrawText object, an IME composition window is displayed near the caret.

Return Value:

No return value.

Remarks:

The hideCaret and showCaret methods are used internally, and only when the UIDrawText or UIEdit control has focus. These methods are not directly used by the application.

showCaret

public synchronized void showCaret(int iPos);

Positions and displays the caret at the specified position. If an InputMethodListener object is associated with the UIDrawText object, an IME composition window is displayed near the caret.

Return Value:

No return value.

Parameter | Description
iPos | The character index where the caret will be positioned.

Remarks:

The hideCaret and showCaret methods are used internally, and only when the UIDrawText or UIEdit control has focus. These methods are not directly used by the application.

update

public void update(FxGraphics g);

Updates the drawing of the control, using the specified graphics context.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method implements update in the IUIComponent interface. update fills the control with its background color, and then calls paint to redraw the control using the control's foreground color.

See Also: getBackground, getForeground


Class UIEdit

public class UIEdit extends UIDrawText
{
  // Fields
  public static final int EXCLUDE;
  public static final int INCLUDE;
  protected final static int READONLY;

  // Constructors
  public UIEdit();
  public UIEdit(String newBuff);
  public UIEdit(char newBuff[]);

  // Methods
  public synchronized void addActionListener(IUIActionListener l);
  public synchronized void addTextListener(IUITextListener l);
  public int append(char key);
  public int append(char key, boolean notify);
  public int append(char key[], boolean notify);
  public int append(char key[]);
  public int append(String s, boolean notify);
  public int append(String s);
  public void clear(boolean notify);
  public void clear();
  public void clearUndo();
  public Color getBackground();
  public String getMaskChars();
  public int getMaskMode();
  public int getMaxBufferSize();
  public int getRoleCode();
  public int insert(String s, int iPos);
  public int insert(String s, int iPos, boolean notify);
  public int insert(char key, int iPos, boolean notify);
  public int insert(char key, int iPos);
  public int insert(char key[], int iPos, boolean notify);
  public int insert(char key[], int iPos);
  public boolean isReadOnly();
  public boolean isRedoable();
  public boolean isUndoable();
  public boolean keyDown(Event evt, int key);
  protected void processActionEvent(UIActionEvent e);
  protected void processEvent(UIEvent e);
  protected void processTextEvent(UITextEvent e);
  public boolean redo(boolean notify);
  public boolean redo();
  public void remove(int iPos, int numberToRemove, boolean notify);
  public void remove(int iPos, int numberToRemove);
  public synchronized void removeActionListener(
        IUIActionListener l);
  public synchronized void removeTextListener(IUITextListener l);
  public void setBackground(Color c);
  public void setMaskChars(String mask);
  public void setMaskMode(int maskMode);
  public void setMaxBufferSize(int newMax);
  public void setReadOnly(boolean ro);
  public void setValueText(String value, boolean notify);
  public void setValueText(char newBuff[], int offset, int len,
        boolean notify);
  public boolean undo(boolean notify);
  public boolean undo();
}

This class implements an edit control. UIEdit extends UIDrawText to allow the user to edit the control's text. Typically, a UIEdit control is placed inside a layout manager that provides a fixed size container. UIScrollViewer, UISplitViewer, and UIColumnViewer are all examples of fixed size layout managers. By using a fixed size layout manager, the size of the edit window will be fixed also.

To get a 3D edge effect for the UIEdit control, you must place it in a UIViewer or UIScrollViewer. You cannot use the setEdge method because UIEdit extends from UICanvas.

Note insert, append, remove, clear, setValueText, undo, or redo must be called with the boolean parameter notify set to true to generate event notification for text value changes.

Also see com.ms.ui.UIDrawText.setValueText

UIComponent
  |
  +--UIStateComponent
    |
    +--UICanvas
      |
      +--UIDrawText
        |
        +--UIEdit

Constructors

UIEdit

public UIEdit();

Creates an empty edit control.

UIEdit

public UIEdit(String newBuff);

Creates an edit control with the specified string.

Parameter | Description
newBuff | The text of the control.

UIEdit

public UIEdit(char newBuff[]);

Creates an edit control with the specified character buffer.

Parameter | Description
newBuff | The text of the control.

Methods

addActionListener

public synchronized void addActionListener(IUIActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

addTextListener

public synchronized void addTextListener(IUITextListener l);

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

Return Value:

No return value.

Parameter | Description
l | The text listener to be added.

See Also: removeTextListener

append

public int append(char key);

Appends a character to the end of the text in the control.

Return Value:

Returns the number of characters added.

Parameter | Description
key | The character to be appended.

append

public int append(char key, boolean notify);

Appends a character to the end of the control.

Return Value:

Returns the number of characters added.

Parameter | Description
key | The character to be appended.
notify | Set notify to true if an event listener is notified when the append operation is performed successfully.

append

public int append(char key[], boolean notify);

Appends an array of characters to the end of the control.

Return Value:

Returns the number of characters added.

Parameter | Description
key | The array of characters to be appended.
notify | Set to true if an event listener is notified when the append operation is performed successfully.

append

public int append(char key[]);

Appends an array of characters to the end of the control.

Return Value:

Returns the number of characters added.

Parameter | Description
key | The array of characters to be appended.

append

public int append(String s, boolean notify);

Appends a string to the end of the control.

Return Value:

Returns the number of characters added.

Parameter | Description
s | The string to be appended.
notify | Set to true if an event listener is notified when the append operation is performed successfully.

append

public int append(String s);

Appends a string to the end of the control.

Return Value:

Returns the number of characters added.

Parameter | Description
s | The string to be appended.

clear

public void clear(boolean notify);

Deletes all the text from the edit control.

Return Value:

No return value.

Parameter | Description
notify | Set to true if an event listener is notified when the clear operation is performed successfully.

clear

public void clear();

Deletes all the text from the edit control.

Return Value:

No return value.

clearUndo

public void clearUndo();

Clears and resets all the redo and undo information associated with the current UIEdit control.

Return Value:

No return value.

getBackground

public Color getBackground();

Retrieves the background color of the UIEdit control.

Return Value:

Returns the background Color of the control.

Remarks:

If the control's background color has been set (using the setBackground method), this color is returned. Otherwise, if the control's text field is read-only or the control is disabled, the text is shaded and the background color is the same as the text. If the control's text field is editable, the background color is the same as the system window color.

If the current background color is set, the background color will not change if the control is set to read-only. If the background color is set and the state is read-only, call setBackground(null) to clear the previous state.

See Also: setBackground

getMaskChars

public String getMaskChars();

Retrieves the set of characters used as a mask for input to the control.

Return Value:

Returns the set of characters used as a mask for input to the control.

getMaskMode

public int getMaskMode();

Retrieves the mode for interpreting the character mask.

Return Value:

Returns the mode for interpreting the character mask.

getMaxBufferSize

public int getMaxBufferSize();

Retrieves the maximum number of characters that the control can hold. By default, the maximum buffer size is set to Integer.MAX_VALUE.

Return Value:

Returns the maximum number of characters that the control can hold.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the edit control.

Return Value:

Returns the ROLE_SYSTEM_TEXT code.

Overrides:

getRoleCode() in UIDrawText.

insert

public int insert(String s, int iPos);

Inserts a string into the control at the specified position.

Return Value:

Returns the number of characters inserted.

Parameter | Description
s | The string to be inserted.
iPos | The character index where the string will be inserted.

insert

public int insert(String s, int iPos, boolean notify);

Inserts a string into the control at the specified position.

Return Value:

Returns the number of characters inserted.

Parameter | Description
s | The string to be inserted.
iPos | The character index where the string will be inserted.
notify | Set to true if an event listener is notified when the insert operation is performed successfully.

insert

public int insert(char key, int iPos, boolean notify);

Inserts a character into the control at the specified position.

Return Value:

Returns the number of characters inserted.

Parameter | Description
key | The character to be inserted.
iPos | The character index where the character will be inserted.
notify | Set to true if an event listener is notified when the insert operation is performed successfully.

insert

public int insert(char key, int iPos);

Inserts a character into the control at the specified position.

Return Value:

Returns the number of characters inserted.

Parameter | Description
key | The character to be inserted.
iPos | The character index where the character will be inserted.

insert

public int insert(char key[], int iPos, boolean notify);

Inserts an array of characters into the control at the specified position.

Return Value:

Returns the number of characters inserted.

Parameter | Description
key[] | The array of characters to be inserted.
iPos | The character index where the characters will be inserted.
notify | Set to true if an event listener is notified when the insert operation is performed successfully.

insert

public int insert(char key[], int iPos);

Inserts an array of characters into the control at the specified position.

Return Value:

Returns the number of characters inserted.

Parameter | Description
key[] | The array of characters to be inserted.
iPos | The character index where the characters will be inserted.

isReadOnly

public boolean isReadOnly();

Determines whether the control is read-only.

Return Value:

Returns true if the READONLY style is set; otherwise, returns false.

isRedoable

public boolean isRedoable();

Determines if the previous undo operation is recoverable.

Return Value:

Returns true if the undo can be recovered.

isUndoable

public boolean isUndoable();

Determines if the previous operation can be undone.

Return Value:

Returns true if the operation can be undone; otherwise, returns false.

keyDown

public boolean keyDown(Event evt, int key);

Processes a key down event.

Return Value:

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

Parameter | Description
evt | The event posted to the control.
key | The key that was pressed.

Overrides:

keyDown(Event,int) in UIDrawText.

processActionEvent

protected void processActionEvent(UIActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.

Event type | Method called
action event | processActionEvent
text event | processTextEvent
focus event | processFocusEvent (inherited through UIStateComponent)
key event | processKeyEvent (inherited through UIStateComponent)
mouse event | processMouseEvent (inherited through UIStateComponent)
mouse motion event | processMouseMotionEvent (inherited through UIStateComponent)

When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.

processTextEvent

protected void processTextEvent(UITextEvent e);

Processes text events.

Return Value:

No return value.

Parameter | Description
e | The text event.

Remarks:

This method is called by processEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processTextEvent to ensure the default event processing continues normally.

See Also: addTextListener

redo

public boolean redo(boolean notify);

Recovers the last undo operation, if it is recoverable.

Return Value:

Returns true if the undo is recovered.

Parameter | Description
notify | Set to true if an event listener is notified when the redo operation is performed successfully.

redo

public boolean redo();

Recovers the last undo operation, if it is recoverable, without notifying an event listener.

Return Value:

Returns true if the undo is recovered.

remove

public void remove(int iPos, int numberToRemove, boolean notify);

Deletes one or more characters from the edit control.

Return Value:

No return value.

Parameter | Description
iPos | Specifies the character index where the characters will be deleted.
numberToRemove | Specifies the number of characters that will be deleted.
notify | Set to true if an event listener is notified when the remove operation is performed successfully.

remove

public void remove(int iPos, int numberToRemove);

Deletes one or more characters from the edit control.

Return Value:

No return value.

Parameter | Description
iPos | Specifies the character index where the characters will be deleted.
numberToRemove | Specifies the number of characters that will be deleted.

removeActionListener

public synchronized void removeActionListener(IUIActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener

removeTextListener

public synchronized void removeTextListener(IUITextListener l);

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

Return Value:

No return value.

Parameter | Description
l | The text listener to be removed.

See Also: addTextListener

setBackground

public void setBackground(Color c);

Sets the background color of the control.

Return Value:

No return value.

Parameter Description
c A Color object that specifies the background color.

If the current background color is set, the background color will not change when the control is set to read-only. If the background color is set, and the state is read-only, call setBackground(null) to clear the previous state.

Overrides:

setBackground(Color) in UIDrawText.

See Also: getBackground

setMaskChars

public void setMaskChars(String mask);

Sets the set of characters to use as a mask for input to the control.

Return Value:

No return value.

Parameter | Description
mask | The set of mask characters.

Remarks:

The interpretation of these characters is determined by calling the setMaskMode method.

See Also: setMaskMode

setMaskMode

public void setMaskMode(int maskMode);

Sets the mode for interpreting the character mask.

Return Value:

No return value.

Parameter | Description
maskMode | This may be INCLUDE or EXCLUDE.

Remarks:

The character mask is set by calling setMaskChars.

See Also: getMaskMode, setMaskChars

setMaxBufferSize

public void setMaxBufferSize(int newMax);

Sets the maximum number of characters that the control can hold. By default, the maximum buffer size is set to Integer.MAX_VALUE.

Return Value:

No return value.

Parameter | Description
newMax | Specifies the new maximum number of characters that the control can hold.

setReadOnly

public void setReadOnly(boolean ro);

Changes the read-only attribute of the control.

Return Value:

No return value.

Parameter | Description
ro | If true, the READONLY style is set; otherwise, it is cleared.

setValueText

public void setValueText(String value, boolean notify);

Sets the text in the control.

Return Value:

No return value.

Parameter | Description
value | A String object that specifies the new text.
notify | Set to true if an event listener is notified when the setValueText operation is performed successfully.

setValueText

public void setValueText(char newBuff[], int offset, int len,
        boolean notify);

Sets the text in the control.

Return Value:

No return value.

Parameter | Description
newBuff[] | A character array that contains the new text.
offset | The offset of the newBuff text buffer where the text begins.
len | The length of the character array to use.
notify | Set to true if an event listener is notified when the setValueText operation is performed successfully.

undo

public boolean undo(boolean notify);

Clears the previous operation, if it can be undone.

Return Value:

Returns true if the previous operation was undone.

Parameter | Description
notify | Set to true if an event listener is notified when the undo operation is performed successfully.

undo

public boolean undo();

Clears the previous operation, if it can be undone, without notifying an event listener.

Return Value:

Returns true if the previous operation was undone.

Fields

EXCLUDE
Specifies that mask characters are excluded.
INCLUDE
Specifies that mask characters are an include list, so only those characters are allowed.
READONLY
Specifies that the control is read-only.


Class UIEditChoice

public class UIEditChoice extends UIChoice implements
            IUITextListener
{
  // Constructors
  public UIEditChoice();

  // Methods
  public boolean action(Event e, Object obj);
  public String getValueText();
  public boolean gotFocus(Event e, Object o);
  public boolean keyDown(Event e, int key);
  public void layout();
  public boolean lostFocus(Event e, Object o);
  public void requestFocus();
  public void setValueText(String s);
  public void textValueChanged(UITextEvent te);
}

This class implements an editable choice control (combo box). A UIEditChoice object manages the following component in addition to those managed by a typical UIChoice control.

Component | Description
UIEdit | Displays the text of the choice control's currently selected item when the choice control has focus. The user can edit this text.

When a UIEditChoice object is first created, its associated UIMenuList object is empty. To add items to the list, call the add or addString method, inherited from the UIChoice class.

// Construct a UIEditChoice object.
UIEditChoice uiec = new UIEditChoice();

// Create an array of components. When items are added to
// the choice control, these array values will hold the
// components returned from addString.
IUIComponent comps[] = new IUIComponent[4];

// Create an array of strings and add each
// element to the choice control.
String colors[] = {"Mango", "Indigo", "Forest", "Heather"};
for (int i=0; i<4; i++)
   comps[i] = uiec.addString(colors[i]);

// Initialize the control to display the first item.
uiec.setSelectedComp(comps[0]);

// Add the control to the container.
add(c);

The UIEditChoice class extends UIChoice and implements IUITextListener. By default, the text is centered and a UITextListener is added.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIChoice
          |
          +--UIEditChoice

Constructors

UIEditChoice

public UIEditChoice();

Creates an empty, single line, editable choice control. The control automatically adds a text event listener to the edit control.

Remarks:

Call the add or addString method to add items to the control's pop-up list.

Methods

action

public boolean action(Event e, Object obj);

Updates the editable choice control to display the currently selected item.

Return Value:

Returns false.

Parameter | Description
e | The event that was posted.
obj | The object that posted the event.

Remarks:

An action event is generated when an item in the control's pop-up list is selected, and the pop-up is closed.

Overrides:

action(Event,Object) in UIChoice.

getValueText

public String getValueText();

Retrieves the current text in the UIEditChoice control.

Return Value:

Returns a string containing the current text, or an empty string if there is no text.

Overrides:

getValueText() in UIChoice.

gotFocus

public boolean gotFocus(Event e, Object o);

Called when the component receives the input focus. The edit box becomes visible, and the display component is hidden.

Return Value:

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

Parameter | Description
e | The event that was posted.
o | The object that previously had the focus.

keyDown

public boolean keyDown(Event e, int key);

Determines whether the SPACEBAR or the ENTER key is being pressed, and if so, sets the pressed state.

Return Value:

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

Parameter | Description
e | The event posted to the button control.
key | The key that has been pressed.

Remarks:

This method is called when the button has focus and a key is pressed. If the key being pressed is the SPACEBAR or the ENTER key, the button's pressed state is set. If the ESC key is being pressed, the button's pressed state is cleared.

Overrides:

keyDown(Event,int) in UIChoice.

layout

public void layout();

Lays out the UIEditChoice control.

Return Value:

No return value.

Overrides:

layout() in UIChoice.

lostFocus

public boolean lostFocus(Event e, Object o);

Called when the component loses the input focus. If the text in the edit box corresponds to an item in the editable choice control's pop-up menu, this item is now displayed.

Return Value:

Returns false.

Parameter | Description
e | The event that was posted.
o | The object that posted the event.

requestFocus

public void requestFocus();

Responds to the control receiving input focus.

Return Value:

No return value.

Remarks:

requestFocus calls UIContainer.requestFocus.

setValueText

public void setValueText(String s);

Sets the text in the current UIEditChoice control to the value of the specified string.

Return Value:

No return value.

Parameter | Description
s | The string to set the text to.

Overrides:

setValueText(String) in UIChoice.

textValueChanged

public void textValueChanged(UITextEvent te);

Used internally by the editable choice control to determine if the text of the UIEdit control has changed.

Return Value:

No return value.

Parameter | Description
te | The text event that was posted.


Class UIExpandButton

public class UIExpandButton extends UIPushButton
{
  // Constructors
  public UIExpandButton(IUITree tree);

  // Methods
  public boolean action(Event e, Object o);
  public Dimension getMinimumSize();
  public Dimension getPreferredSize();
  public IUITree getTree();
  public boolean isKeyable();
  public boolean mouseEnter(Event e, int x, int y);
  public void paint(FxGraphics g);
  public void update(FxGraphics g);
}

This class implements the expand button of a tree control. A UIExpandButton object indicates whether the tree node is expanded or collapsed. UITree uses UIExpandButton to create its tree expander, and every UIExpandButton object is associated with a tree control. By default, UIExpandButton uses the system-defined expand box image.

For more information about buttons, see the UIButton overview.

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIButton
          |
          +--UIPushButton
            |
            +--UIExpandButton

Constructors

UIExpandButton

public UIExpandButton(IUITree tree);

Creates an expand button associated with the specified tree node.

Parameter | Description
tree | The tree node associated with the expand button.

Remarks:

By default, the button's style is set to TOGGLE.

Methods

action

public boolean action(Event e, Object o);

Toggles the expanded state of the associated tree node.

Return Value:

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

Parameter | Description
e | The event posted to the button.
o | The object that posted the event.

Remarks:

If the tree node is collapsed when the expand button is clicked, this method expands the node. Conversely, if the node is expanded when the button is clicked, this method collapses the node.

getMinimumSize

public Dimension getMinimumSize();

Retrieves the minimum size (in pixels) of the button control.

Return Value:

Returns a Dimension object containing the minimum size.

Remarks:

The button's minimum size is based on the height of the associated tree's bounding rectangle, as determined by the getAttachRect method.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred size of the button control. The preferred size specifies the dimensions (in pixels) you want for the button.

Return Value:

Returns a Dimension object containing the preferred size.

Remarks:

By default, this method returns the minimum size, as determined by getMinimumSize.

getTree

public IUITree getTree();

Retrieves the tree node associated with the expand button.

Return Value:

Returns the associated tree.

isKeyable

public boolean isKeyable();

Determines whether the expand button can receive keyboard input.

Return Value:

Returns false, indicating the button cannot receive keyboard input.

mouseEnter

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

Sets the expand button's hot-tracked state.

Return Value:

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

Parameter | Description
e | The event posted to the button.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

By setting the hot-tracked state, this method causes the expand box image to change colors when the mouse enters the button area. The image's original color is restored when the mouse exits the button area.

Note Button controls typically inherit the mouseEnter method, which automatically sets the hot-tracked state for buttons that can receive keyboard input. However, UIExpandButton objects cannot receive keyboard input; therefore, UIExpandButton must override mouseEnter to explicitly set the hot-tracked state.

For more information about hot-tracking, see the UIButton overview.

See Also: isKeyable

paint

public void paint(FxGraphics g);

Draws the button's expand box image, according to the associated tree node's expanded state.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

By default, this method uses the system-defined expand box image. If the associated tree node is expanded, the button displays a plus sign. If the node is collapsed, the button displays a minus sign.

Overrides:

paint(FxGraphics) in UIPushButton.

update

public void update(FxGraphics g);

Updates the expand button.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method simply calls paint to redraw the expand box image.


Class UIFindReplaceDialog

public class UIFindReplaceDialog extends UIDialog
{
  // Fields
  public static final int FIND;
  public static final int ID_BACKWARDS;
  public static final int ID_CANCEL;
  public static final int ID_CASESENSITIVE;
  public static final int ID_FINDNEXT;
  public static final int ID_FINDTEXT;
  public static final int ID_FORWARDS;
  public static final int ID_REPLACE;
  public static final int ID_REPLACEALL;
  public static final int ID_REPLACETEXT;
  public static final int ID_WHOLEWORD;
  public static final int REPLACE;

  // Constructors
  public UIFindReplaceDialog(UIFrame frame, String title,
        boolean modal);

  // Methods
  public boolean action(Event evt, Object what);
  protected void createFindDialog();
  protected void createReplaceDialog();
  public int display(int style);
  public boolean doFindNext();
  public boolean doReplace();
  public boolean doReplaceAll();
  protected IUIComponent findEditControl(int id);
  public String getFindText();
  public boolean getForwardSearch();
  public boolean getFromTop();
  public boolean getMatchCase();
  public String getReplaceText();
  public boolean handleEvent(Event evt);
  public boolean isCaseSensitive();
  public boolean isForward();
  public boolean isWholeWord();
  public void setCaseSensitive(boolean b);
  public void setFindText(String text);
  public void setForward(boolean b);
  public void setForwardSearch(boolean b);
  public void setFromTop(boolean b);
  public void setMatchCase(boolean b);
  public void setReplaceText(String text);
  public void setWholeWord(boolean b);
}

This class implements a find-and-replace dialog window. The controls for the dialog box are loaded from resource files, depending on the specified dialog box style.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow
            |
            +--UIDialog
              |
              +--UIFindReplaceDialog

Constructors

UIFindReplaceDialog

public UIFindReplaceDialog(UIFrame frame, String title, boolean modal);

Creates an empty UIFindReplace dialog box.

Parameter | Description
frame | The parent frame of the dialog box.
title | The title of the Find or Replace dialog box. To use default titles, pass null for this parameter.
modal | Set this value to true if the displayed UIFindReplaceDialog dialog box is modal.

Methods

action

public boolean action(Event evt, Object what);

Performs operations depending on which button is pushed inside the message box.

Return Value:

Returns true if the action was successfully executed; otherwise, returns false.

Parameter | Description
evt | The event, such as key release or mouse up, generated within the message box.
what | The button that was pushed.

Remarks:

The action method specifically handles the OK, Cancel, Replace, and Replace All buttons in an UIFindReplaceDialog dialog box, depending on the style of the box. (The FIND style contains no Replace or Replace All buttons.) OK and Cancel are handled by closing the dialog box. Pushing the Replace button generates a call to the doReplace method, and pushing the Replace All button calls the doReplaceAll method.

Note When cancelling the dialog box, the method calls UIDialog.dispose.

createFindDialog

protected void createFindDialog();

Creates a Find dialog box. This method is called by the display method. Override this method to change the look of the dialog. By default it will use the resources to load the controls.

Return Value:

No return value.

Exceptions:

ResourceFormattingException if the dialog was not populated correctly.

See Also: createReplaceDialog

createReplaceDialog

protected void createReplaceDialog();

Creates a Replace dialog box. This method is called by display. Override this method to change the look of the dialog. By default it will use the resources to load the controls.

Return Value:

No return value.

Exceptions:

ResourceFormattingException if the dialog was not populated correctly.

See Also: createFindDialog

display

public int display(int style);

Displays the UIFindReplaceDialog dialog box in the given style.

Return Value:

Returns an integer identifying the button that was clicked in the dialog box. Possible return values include ID_FINDNEXT, ID_REPLACE, ID_REPLACEALL, ID_CANCEL, or 0 (if a button was not clicked).

Parameter | Description
style | The style of the dialog box. To display a Find dialog box, pass FIND. To display a Replace dialog box, pass REPLACE.

doFindNext

public boolean doFindNext();

Override this method to retrieve the next match to the search string, given the current search parameters (case sensitive, for example). This method is called in the action method when the "Find" button of an UIFindReplaceDialog dialog box is pressed.

Note This method should only be overridden if the dialog is not modal.

Return Value:

Returns true if a match is successfully found. Returns true by default.

doReplace

public boolean doReplace();

Override this method to replace the selected text in the document or selection with that contained in the current replace buffer. This method is called by the action method when the "Replace" button of a REPLACE style dialog box is pushed.

Note This is a blocking call.

Return Value:

Returns true if the replace operation is completed successfully. Returns true by default.

doReplaceAll

public boolean doReplaceAll();

Override this method to search a selection and replace all matches with the text in the replace buffer. This method is called by the action method, when the "Replace All" button of a REPLACE style dialog box is pushed.

Note This is a blocking call.

Return Value:

Returns true if the replace operation is completed successfully. Returns true by default.

findEditControl

protected IUIComponent findEditControl(int id);

Used in the setReplaceText, setFindText, getReplaceText, getFindText methods to access edit controls contained in scroll viewer controls.

Return Value:

Returns the edit control if found; otherwise, returns null.

Parameter | Description
id | This may be either ID_REPLACETEXT or ID_FINDTEXT.

getFindText

public String getFindText();

Retrieves the current search string.

Return Value:

Returns a String object that contains the search string.

See Also: setFindText

getForwardSearch

public boolean getForwardSearch();

Determines the search direction through a file or selection.

Return Value:

Returns true if the search direction is forward; returns false if the search direction is backward.

See Also: setForwardSearch

getFromTop

public boolean getFromTop();

Determines whether a search starts from the beginning of a file or from the current location of the text caret.

Return Value:

Returns true if the search starts from the beginning of the file; returns false if the search starts from the current location of the caret.

See Also: setFromTop

getMatchCase

public boolean getMatchCase();

Determines whether the comparison between the search string and any resulting string should be match the case of the search string.

Return Value:

Returns true if the comparison should match case; otherwise, returns false.

See Also: setMatchCase

getReplaceText

public String getReplaceText();

Retrieves the current replace string.

Return Value:

Returns a String object that contains the replace string.

See Also: setReplaceText

handleEvent

public boolean handleEvent(Event evt);

Called to handle events that occur inside the dialog box. In the UIFindReplaceDialog class, this method checks specifically for the WINDOW_DESTROY event identifier, and closes the message box appropriately.

Return Value:

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

Parameter | Description
evt | The event.

Overrides:

handleEvent(Event) in UIDialog.

isCaseSensitive

public boolean isCaseSensitive();

Determines whether the comparison between the search string and result should be case sensitive.

Return Value:

Returns true if searches are case sensitive.

See Also: setCaseSensitive

isForward

public boolean isForward();

Determines whether a search is in the forward direction. This method is associated with a radio button that the end user uses to specify search direction.

Return Value:

Returns true if a search is in the forward direction; otherwise, returns false.

See Also: setForward

isWholeWord

public boolean isWholeWord();

Determines whether a search finds all instances of the search string or finds only tokenized instances (complete words).

Return Value:

Returns true if the search only matches tokenized instances of the search string; otherwise, returns false.

See Also: setWholeWord

setCaseSensitive

public void setCaseSensitive(boolean b);

Sets whether the string comparison should be case sensitive.

Return Value:

No return value.

Parameter | Description
b | Set to true to make a search case sensitive.

See Also: isCaseSensitive

setFindText

public void setFindText(String text);

Sets the current search string to the specified text.

Return Value:

No return value.

Parameter | Description
text | A buffer that contains the current search string.

See Also: getFindText

setForward

public void setForward(boolean b);

Sets a search in the forward direction when the appropriate radio button is selected.

Return Value:

No return value.

Parameter | Description
b | Set to true to specify forward searches.

See Also: isForward

setForwardSearch

public void setForwardSearch(boolean b);

Sets the direction of the search through a file or selection.

Return Value:

No return value.

Parameter | Description
b | Set to true if the search operation proceeds forward through the document or selection. If b is set to false, the search operation proceeds backward.

See Also: getForwardSearch

setFromTop

public void setFromTop(boolean b);

Sets whether the search starts from the beginning of the file or from the current location of the caret.

Return Value:

No return value.

Parameter | Description
b | Set to true if the search starts from the beginning of the file. Set b to false if the search starts from the current location of the cursor.

See Also: getFromTop

setMatchCase

public void setMatchCase(boolean b);

Sets whether the string comparison should be match case.

Return Value:

No return value.

Parameter | Description
b | Set to true if the comparison should match case.

See Also: getMatchCase

setReplaceText

public void setReplaceText(String text);

Sets the current replace string to the specified text.

Return Value:

No return value.

Parameter | Description
text | A buffer that contains the current replace string.

See Also: getReplaceText

setWholeWord

public void setWholeWord(boolean b);

Sets whether a search should include all instances of a search string (including fragments of a complete token) or if the search includes only tokenized instances of the search string.

Return Value:

No return value.

Parameter | Description
b | Set this value to true if the search should match only tokenized instances with the search string.

See Also: isWholeWord

Fields

FIND
A dialog box style that is used for only searching operations. Typically, this dialog box contains only one edit field and enables the user to set the properties of a particular search, such as check boxes for matching whole words and matching case in the search string.
ID_BACKWARDS
The identifier of one of the two search direction buttons in the dialog box.
ID_CANCEL
The identifier of the Cancel button in the dialog box.
ID_CASESENSITIVE
The identifier of the case sensitive search option checkbox in the dialog box.
ID_FINDNEXT
The identifier of the Find Next button in the dialog box.
ID_FINDTEXT
The identifier for the search string.
ID_FORWARDS
The identifier of one of the two search direction buttons in the dialog box.
ID_REPLACE
The identifier of the Replace button in the dialog box.
ID_REPLACEALL
The identifier of the Replace All button in the dialog box.
ID_REPLACETEXT
The identifier for the replace string.
ID_WHOLEWORD
The identifier of the whole word search option checkbox in the dialog box.
REPLACE
A dialog box style that is used for both searching and replacing operations. Typically, this style of dialog box contains two edit fields, Replace and Replace All buttons, as well as the other features commonly associated with the FIND style.


Class UIFixedFlowLayout

public class UIFixedFlowLayout extends UILayoutManager
{
  // Fields
  public static final int CENTER;
  public static final int LEFT;
  public static final int RIGHT;

  // Constructors
  public UIFixedFlowLayout();
  public UIFixedFlowLayout(int hgap, int vgap);
  public UIFixedFlowLayout(int hgap, int vgap, int alignment);

  // Methods
  protected Dimension computeUnitDimension(IUIContainer target,
        boolean min);
  public int getAlignment();
  public Dimension getMinimumSize(IUIContainer target);
  public Dimension getPreferredSize(IUIContainer target);
  public boolean isOverlapping();
  public boolean isWidthRelative();
  public void layout(IUIContainer target, Rectangle bounds);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int dir, boolean keyable);
  public void setAlignment(int alignment);
}

This class implements a fixed-width flow layout manager. UIFixedFlowLayout lays out components by row, using a fixed width for each component. The fixed width is the largest of the preferred widths of each component.

UIFixedFlowLayout is the default layout manager for UIBand.

UILayoutManager
  |
  +--UIFixedFlowLayout

Constructors

UIFixedFlowLayout

public UIFixedFlowLayout();

Creates a fixed-width flow layout manager.

Remarks:

By default, the horizontal and vertical gaps (used for spacing around the container's components) are 5 pixels each. The components are left-aligned within the container.

UIFixedFlowLayout

public UIFixedFlowLayout(int hgap, int vgap);

Creates a fixed-width flow layout manager with the specified horizontal and vertical gaps.

Parameter | Description
hgap | The number of pixels used for horizontal spacing between the components.
vgap | The number of pixels used for vertical spacing above and below the components.

Remarks:

By default, the components are left-aligned within the container.

UIFixedFlowLayout

public UIFixedFlowLayout(int hgap, int vgap, int alignment);

Creates a fixed-width flow layout manager with the specified alignment, and horizontal and vertical gaps.

Parameter | Description
hgap | The number of pixels used for horizontal spacing between the components.
vgap | The number of pixels used for vertical spacing above and below the components.
alignment | The horizontal alignment for the components in the container. Possible values include LEFT, CENTER, or RIGHT.

Methods

computeUnitDimension

protected Dimension computeUnitDimension(IUIContainer target, boolean min);

Returns the maximum size of the biggest component's width and height (in pixels).

Return Value:

Returns a dimension object that contains the biggest component's width and height.

Parameter | Description
target | The container that holds the components.
min | The minimum size.

getAlignment

public int getAlignment();

Retrieves the current layout alignment.

Return Value:

Returns an integer indicating the horizontal alignment of the container's components. For a list of possible values, see setAlignment.

getMinimumSize

public Dimension getMinimumSize(IUIContainer target);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
target | The container of the components.

Remarks:

getMinimumSize determines the minimum size as if the components were laid in a single row. The width of the returned Dimension object is the sum of the the fixed widths of the remaining components, and the horizontal gaps between components. The fixed width is defined to be the largest of the minimum widths of the components. The Dimension object's height is the sum of the largest minimum height of all components, and the vertical gaps.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize, layout

getPreferredSize

public Dimension getPreferredSize(IUIContainer target);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
target | The container of the components.

Remarks:

getPreferredSize determines the preferred size as if the components were laid in a single row. The width of the returned Dimension object is the sum of the the fixed widths of the remaining components and the horizontal gaps between components. The fixed width is defined to be the largest of the preferred widths of the components. The Dimension object's height is the sum of the largest preferred height of all components, and the vertical gaps.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize, layout

isOverlapping

public boolean isOverlapping();

Determines if the container allows its children to overlap partially or completely.

Return Value:

Returns false, by default.

Overrides:

isOverlapping() in UILayoutManager.

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 the alignment is not LEFT; 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.

Overrides:

isWidthRelative() in UILayoutManager.

layout

public void layout(IUIContainer target, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
target | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

The child components are laid out using the horizontal gap for spacing between each component. The width of these components is fixed to be the largest of their preferred widths. The height is the largest of the preferred heights. If necessary, the layout flows to multiple rows. (The vertical gap is used for spacing between rows.)

Each row of components is horizontally aligned within the container's available space, according to the current layout alignment (LEFT, CENTER, or RIGHT). The available space is determined from the container's size minus its horizontal and vertical gaps.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp, int dir,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
cont | The container where the navigation is occurring.
comp | The tab component to navigate from.
dir The navigation direction. Specify one of the following values defined in IUIAccessible:
  • NAVDIR_LEFT
  • NAVDIR_RIGHT
  • NAVDIR_FIRST
  • NAVDIR_LAST
  • NAVDIR_NEXT
  • NAVDIR_PREV
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

This method handles keyboard navigation in the container. When a component in the container has focus and a key is pressed, navigate is called to move focus to another item in the container.

The following table shows the keys that have corresponding IUIAccessible directions.

Key | IUIAccessible direction
LEFT ARROW and RIGHT ARROW | NAVDIR_LEFT and NAVDIR_RIGHT, respectively
HOME and END | NAVDIR_FIRST and NAVDIR_LAST, respectively.

Overrides:

navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.

setAlignment

public void setAlignment(int alignment);

Sets the layout alignment.

Return Value:

No return value.

Parameter | Description
alignment | The horizontal alignment for the container's components. Possible values include LEFT, CENTER, or RIGHT.

See Also: getAlignment

Fields

CENTER
Specifies that the layout manager will horizontally center the components in the container.
LEFT
Specifies that the layout manager will left-align the components in the container.
RIGHT
Specifies that the layout manager will right-align the components in the container.


Class UIFlowLayout

public class UIFlowLayout extends UILayoutManager
{
  // Fields
  public static final int CENTER;
  public static final int LEFT;
  public static final int RIGHT;

  // Constructors
  public UIFlowLayout();
  public UIFlowLayout(int align);
  public UIFlowLayout(int align, int hgap, int vgap);

  // Methods
  public int getAlignment();
  public Dimension getMinimumSize(IUIContainer target);
  public Dimension getPreferredSize(IUIContainer target);
  public boolean isHeightRelative();
  public boolean isOverlapping();
  public boolean isWidthRelative();
  public boolean isWrap();
  public void layout(IUIContainer target, Rectangle bounds);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int dir, boolean keyable);
  public void setAlignment(int alignment);
  public void setWrap(boolean b);
}

This class implements an extended flow layout manager. UIFlowLayout lays out components from left to right by row, similar to the AWT FlowLayout class. By default, the components are centered horizontally within the container. UIFlowLayout is the default layout manager for UIPanel.

UILayoutManager
  |
  +--UIFlowLayout

Constructors

UIFlowLayout

public UIFlowLayout();

Creates a flow layout manager.

Remarks:

By default, the horizontal and vertical gaps (used for spacing around the container's components) are defined to be 5 pixels each. The components are centered horizontally within the container.

UIFlowLayout

public UIFlowLayout(int align);

Creates a flow layout manager with the specified horizontal alignment.

Parameter | Description
align | The horizontal alignment for the components in the container. Possible values include LEFT, CENTER, or RIGHT.

Remarks:

By default, the horizontal and vertical gaps (used for spacing between components) are 5 pixels each.

UIFlowLayout

public UIFlowLayout(int align, int hgap, int vgap);

Creates a flow layout manager with the specified horizontal alignment.

Parameter | Description
align | The horizontal alignment for the components in the container. Possible values include LEFT, CENTER, or RIGHT.
hgap | The number of pixels used for horizontal spacing between the components.
vgap | The number of pixels used for vertical spacing above and below the components.

Methods

getAlignment

public int getAlignment();

Retrieves the current layout alignment.

Return Value:

Returns an integer indicating the horizontal alignment of the container's components. For a list of possible values, see setAlignment.

getMinimumSize

public Dimension getMinimumSize(IUIContainer target);

Determines the minimum dimensions (in pixels) needed to lay out the components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
target | The container of the components.

Remarks:

getMinimumSize determines the minimum size as if the components were laid in a single row. The width of the returned Dimension object is the sum of the minimum widths of each component, and the horizontal gaps between components. The Dimension object's height is the largest minimum height of the components, plus the vertical gaps.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize, layout

getPreferredSize

public Dimension getPreferredSize(IUIContainer target);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
target | The container of the components.

Remarks:

getPreferredSize determines the preferred size as if the components were laid in a single row. The width of the returned Dimension object is the sum of the preferred widths of each component, the horizontal gaps between components. The Dimension object's height is the largest preferred height of the components, plus the vertical gaps.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize, layout

isHeightRelative

public boolean isHeightRelative();

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

Return Value:

Returns true when not in wrap mode; 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.

Overrides:

isHeightRelative() in UILayoutManager.

See Also: isWidthRelative, setWrap, isWrap

isOverlapping

public boolean isOverlapping();

Determines if this layout manager lays out its children so that they overlap either completely or partially.

Return Value:

Returns true if the children overlap; otherwise, returns false. (The default is false.) Returning false also means that only the sibling floater window, if one exists, needs to be clipped by the manager.

Overrides:

isOverlapping() in UILayoutManager.

isWidthRelative

public boolean isWidthRelative();

Determines if this layout manager uses the width of the container to lay out its children. Returning false also means that the container's layout method doesn't need to be called on a vertical resizing.

Return Value:

Returns true when not LEFT aligned; otherwise, returns false.

Overrides:

isWidthRelative() in UILayoutManager.

See Also: isHeightRelative

isWrap

public boolean isWrap();

Retrieves the layout wrap state. The wrap state can be either true or false. When set to true, the layout will use more than one line.

Return Value:

Returns the wrap state, either true or false, depending on how it was set.

See Also: setWrap

layout

public void layout(IUIContainer target, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
target | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

The components are laid from left to right, using the horizontal gap for spacing between each component. The width of each component is its preferred width, and if necessary, the layout flows to multiple rows. (The vertical gap is used for spacing between rows.) The height of a component is the largest preferred height of all components in the row.

Each row of components is horizontally aligned within the bounding rectangle, according to the current layout alignment (LEFT, CENTER, or RIGHT).

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp, int dir,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
cont | The container where the navigation is occurring.
comp | The component to navigate from.
dir | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

This method handles keyboard navigation in the container. When a component in the container has focus and a key is pressed, navigate is called to move focus to another item in the container. The following table shows the keys that have corresponding IUIAccessible directions.

Key | IUIAccessible direction
UP ARROW and LEFT ARROW | NAVDIR_LEFT
DOWN ARROW and RIGHT ARROW | NAVDIR_RIGHT
HOME and END | NAVDIR_FIRST and NAVDIR_LAST, respectively.

Overrides:

navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.

setAlignment

public void setAlignment(int alignment);

Sets the layout alignment.

Return Value:

No return value.

Parameter | Description
alignment | The horizontal alignment for the container's components. Possible values include LEFT, CENTER, or RIGHT.

See Also: getAlignment

setWrap

public void setWrap(boolean b);

Sets the layout to allow wrapping of components.

Return Value:

No return value.

Parameter | Description
b | Can be either true or false, depending on whether the state is being set to wrappable or non-wrappable.

See Also: isWrap

Fields

CENTER
Specifies that the layout manager will horizontally center the components in the container.
LEFT
Specifies that the layout manager will left-align the components in the container.
RIGHT
Specifies that the layout manager will right-align the components in the container.


Class UIFontDialog

public class UIFontDialog extends UIDialog
{
  // Constructors
  public UIFontDialog(UIFrame parent);
  public UIFontDialog(UIFrame parent, String[] fontStringList);

  // Methods
  public FxFont getFxFont();
  public boolean handleEvent(Event event);
  public void setFxFont(FxFont font);
}

This class displays a dialog window from which the user can select a font. It is a modal dialog window, engaged by calling the show method. The application blocks until the user has chosen a font.

Also see com.ms.ui.UIDialog.show

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow
            |
            +--UIDialog
              |
              +--UIFontDialog

Constructors

UIFontDialog

public UIFontDialog(UIFrame parent);

Creates a font dialog box for selecting a font.

Parameter | Description
parent | The owner of the dialog box.

UIFontDialog

public UIFontDialog(UIFrame parent, String[] fontStringList);

Creates a font dialog box for choosing a font.

Parameter | Description
parent | The owner of the dialog box.
fontStringList | A string array of fonts to be displayed.

Methods

getFxFont

public FxFont getFxFont();

Gets the selected font of this font dialog box.

Return Value:

Returns the currently selected FxFont of this font dialog; returns null if no font is selected.

See Also: setFxFont

handleEvent

public boolean handleEvent(Event event);

Responds to events occurring within the control.

Return Value:

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

Parameter | Description
event | The event.

Overrides:

handleEvent(Event) in UIDialog.

setFxFont

public void setFxFont(FxFont font);

Sets the initial default font for this font dialog to be the FxFont.

Comments:
If no font is specified, the default initial font will be 12-point Dialog.

Return Value:

No return value.

Parameter | Description
font | The FxFont being set.

See Also: getFxFont


Class UIFrame

public class UIFrame extends UIWindow
{
  // Constructors
  public UIFrame();
  public UIFrame(String name);

  // Methods
  protected boolean forwardEvent(Event e);
  public Frame getFrame();
  public Insets getInsets();
  public UIBandBox getMenuBar();
  public int getStateCode();
  public String getTitle();
  public void layout();
  public void setMenuBar(UIBandBox bar);
  public void setName(String name);
  public void setResizable(boolean resizable);
  public void setTitle(String title);
}

This class implements a frame. A frame is a top-level window with a title and a border. UIFrame extends the UIWindow class.

Note All event and paint notifications sent to the frame are also received by the host (because the host is a child of the frame). The host then routes these notifications to the root container.

A frame is initially hidden when it is first created. You must call the frame's show method to make the frame visible.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow
            |
            +--UIFrame

Constructors

UIFrame

public UIFrame();

Creates a frame with no title.

Remarks:

By default, the frame uses BorderLayout for its layout manager. The host is then added to the center of the frame, and the root container is displayed. Initially, the root container is empty; to add components, call UIRoot.add. By default, the root container uses UIBorderLayout for its layout manager.

Note The frame is initially hidden. You must call the frame's UIWindow.show method to make the frame visible.

For more information about the root container, see the UIFrame overview.

Applications extending UIFrame must call the super method handleEvent() inside the local handleEvent to use tool tips.

See Also: com.ms.ui.UIPanel.setLayout

UIFrame

public UIFrame(String name);

Creates a frame using the specified title.

Parameter | Description
name | The title of the frame.

Remarks:

By default, the frame uses BorderLayout for its layout manager. The host is then added to the center of the frame, and the root container is displayed. Initially, the root container is empty; to add components, call UIRoot.add. By default, the root container uses UIBorderLayout for its layout manager.

Note The frame is initially hidden. You must call the frame's UIWindow.show method to make the frame visible.

For more information about the root container, see the UIFrame overview.

See Also: com.ms.ui.UIPanel.setLayout

Methods

forwardEvent

protected boolean forwardEvent(Event e);

Intercepts an event and forwards the event to the parent container.

Return Value:

Returns the event that was intercepted.

getFrame

public Frame getFrame();

Retrieves the underlying AWT frame. Used when the frame is needed by another object, such as a media tracker.

The following code example shows how to set, or change, the icon for a class that extends UIFrame. See FxSystemIcon for additional icons.

//Sets the icon to a stop sign icon.
getFrame().setIconImage(FxSystemIcon.stopIcon.getImage());

Return Value:

Returns the com.ms.awt.Frame object.

getInsets

public Insets getInsets();

Retrieves the insets (margins) of the component.

Return Value:

Returns an inset object containing the margin sizes, in pixels.

getMenuBar

public UIBandBox getMenuBar();

Retrieves the menu bar.

Return Value:

Returns the menu bar if it is an instance of a UIBandBox class; otherwise, returns null.

getStateCode

public int getStateCode();

Retrieves the state of the object.

Return Value:

Returns the combination of the STATE_SYSTEM_MOVABLE and STATE_SYSTEM_SIZEABLE codes, as well as any additional states inherited from the super object.

getTitle

public String getTitle();

Retrieves a string containing the title of the dialog box.

Return Value:

Returns the title of the dialog box.

See Also: setTitle

layout

public void layout();

Sets the layout of the container using the current menu bar and insets.

Return Value:

No return value.

See Also: setMenuBar, getMenuBar, getInsets

setMenuBar

public void setMenuBar(UIBandBox bar);

Sets the current menu bar.

Return Value:

No return value.

Parameter | Description
bar | The UIBandBox menu bar to be set as the current menu bar.

setName

public void setName(String name);

Sets the dialog box's name and title.

Return Value:

No return value.

Parameter | Description
name | The name (and title) for the container.

See Also: setTitle

setResizable

public void setResizable(boolean resizable);

Sets the resizable flag.

Return Value:

No return value.

Parameter | Description
resizable | Set to true if the container is resizable; otherwise, set to false.

setTitle

public void setTitle(String title);

Sets the dialog box's title.

Return Value:

No return value. No return value.

Parameter | Description
title | The new title being given to the dialog box.

See Also: getTitle, setName


Class UIGraphic

public class UIGraphic extends UIStatic
{
  // Constructors
  public UIGraphic();
  public UIGraphic(Image image);
  public UIGraphic(Image image, int style);

  // Methods
  public Image getImage();
  public Dimension getPreferredSize();
  public int getRoleCode();
  public boolean imageUpdate(Image image, int flags, int x, int y,
        int width, int height);
  public void paint(FxGraphics g, Rectangle rect);
  public void setImage(Image image);
}

This class implements a static graphic control. Typically, a UIGraphic object is used to display a graphical image on another control, such as a button. When you create a UIGraphic object, you specify the image to be displayed and an optional alignment or style. The following example shows how to use UIGraphic to create other objects.

// Construct a push button that uses UIGraphic
// to display the image stored in the variable myImage1.
// Left-align the image.
UIPushButton p =
   new UIPushButton(new UIGraphic(myImage1, UIStatic.LEFT));
add(p);  // Add p to the container.

// Construct a scroll viewer control that displays myImage2.
UIScrollViewer sv = new UIScrollViewer(new UIGraphic(myImage2));
add(sv);

In addition to using UIGraphic, you can use UIText and UIItem to create other static objects.

UIComponent
  |
  +--UIStateComponent
    |
    +--UICanvas
      |
      +--UIStatic
        |
        +--UIGraphic

Constructors

UIGraphic

public UIGraphic();

Creates a static graphic control with no image.

Remarks:

By default, any image added to the control will be aligned both horizontally and vertically.

UIGraphic

public UIGraphic(Image image);

Creates a static graphic control with the specified image.

Parameter | Description
image | The image to be displayed within the control.

Remarks:

By default, the image is aligned both horizontally and vertically.

UIGraphic

public UIGraphic(Image image, int style);

Creates a static graphic control with the specified image and style.

Parameter | Description
image | The image to be displayed within the control.
style | The alignment and style of the control. You can pass any bitwise combination of an alignment flag and a style flag. For a list of possible flags, see the UIStatic.setFlags method.

Remarks:

If a vertical alignment is not specified, VCENTER is used by default. Similarly, if a horizontal alignment is not specified, HCENTER is used.

Exceptions:

IllegalArgumentException if more than one vertical alignment, more than one horizontal alignment, or an undefined style was specified.

Methods

getImage

public Image getImage();

Retrieves the control's image.

Return Value:

Returns the Image object displayed within the control.

See Also: setImage

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred size (in pixels) of the static graphic control.

Return Value:

Returns a Dimension object containing the preferred size.

Remarks:

The preferred size is based on the width and height of the control's image.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the static graphic control.

Return Value:

Returns the ROLE_SYSTEM_GRAPHIC code.

imageUpdate

public boolean imageUpdate(Image image, int flags, int x, int y, int width,
        int height);

Incrementally draws the control's image as the bits become available.

Return Value:

Returns true if more information is needed to draw the full image; otherwise, returns false.

Parameter | Description
image | The control's image.
flags | The flags that specify the status of the image that is being loaded. You can pass any bitwise combination of the fields that are defined in the ImageObserver interface.
x | The x coordinate of the image.
y | The y coordinate of the image.
width | The width of the image (in pixels).
height | The height of the image (in pixels).

paint

public void paint(FxGraphics g, Rectangle rect);

Called by paint(Graphics g), which is inherited through UIStatic, to draw the control's image.

Return Value:

No return value.

Parameter | Description
g | The graphics context.
rect | The rectangle to draw the control's image in.

Overrides:

paint(FxGraphics,Rectangle) in UIStatic.

setImage

public void setImage(Image image);

Sets the control's image.

Return Value:

No return value.

Parameter | Description
image | The image to be displayed within the control.

See Also: getImage


Class UIGridBagConstraints

public class UIGridBagConstraints implements Cloneable
{
  // Fields
  public int anchor;
  public static final int BOTH;
  public static final int CENTER;
  public static final int EAST;
  public int fill;
  public int gridheight;
  public int gridwidth;
  public int gridx;
  public int gridy;
  public static final int HORIZONTAL;
  public Insets insets;
  public int ipadx, ipady;
  public static final int NONE;
  public static final int NORTH;
  public static final int NORTHEAST;
  public static final int NORTHWEST;
  public static final int RELATIVE;
  public static final int REMAINDER;
  public static final int SOUTH;
  public static final int SOUTHEAST;
  public static final int SOUTHWEST;
  public static final int VERTICAL;
  public double weightx;
  public double weighty;
  public static final int WEST;

  // Constructors
  public UIGridBagConstraints ();
  public UIGridBagConstraints( GridBagConstraints c);

  // Methods
  public Object clone ();
  static public Point getOffsetFromAnchor(Dimension container,
        Dimension dim, int anchor);
}

This class is used to specify constraint values for components laid out using the UIGridBagLayout class.

Constructors

UIGridBagConstraints

public UIGridBagConstraints ();

Sets the UIGridBagConstraints values to the default values as shown in the following table.

gridz | 0
gridy | 0
gridwidth | 1
gridheight | 1
weightx | 0
weighty | 0
ipadx | 0
ipady | 0

UIGridBagConstraints

public UIGridBagConstraints( GridBagConstraints c);

Constructs a UIGridBagConstraints object using the information in a UIGridBagConstraints.

Comments:
This constructor sets the following variables to UIGridBagConstraints values.

gridx | c.gridx
gridy | c.gridy
gridwidth | c.gridwidth
gridheight | c.gridheight
weightx | c.gridweight
weighty | c.weighty
ipadx | c.ipadx
ipady | c.ipady

Parameter | Description
c | The UIGridBagConstraints object.

See Also: UIGridBagConstraints

Methods

clone

public Object clone ();

Clones a copy of the UIGridBagConstraints.

Return Value:

Returns a copy of the UIGridBagConstraints object.

Exceptions:

InternalError, but this exception should not occur. This object can be cloned.

getOffsetFromAnchor

static public Point getOffsetFromAnchor(Dimension container, Dimension dim,
        int anchor);

Calculates an object's x and y offsets from the anchor, given the containing rectangle and the size of the component to place. This method returns the coordinates for the top left of the component, relative to the anchor. For example, the following would return (70,80).

getOffsetFromAnchor(new Dimension(100,100), new Dimension (30,20)
SOUTHEAST);

Return Value:

Returns a point object containing the x and y offsets from the anchor.

Parameter | Description
container | The container.
dim | The dimensions of the object.
anchor The object's location within the container. Allowable values for anchor are as follows:
  • CENTER
  • NORTH
  • NORTHEAST
  • EAST
  • SOUTHEAST
  • SOUTH
  • SOUTHWEST
  • WEST
  • NORTHWEST

Fields

anchor
Specifies the location in the component where the component is placed.
Comments:
Possible values for the anchor parameter are as follows:
  • CENTER
  • NORTH
  • NORTHEAST
  • EAST
  • SOUTHEAST
  • SOUTH
  • SOUTHWEST
  • WEST
  • NORTHWEST
BOTH
A value used to describe the direction the object can grow in to fill the container. The object can grow in the following directions: NONE, HORIZONTAL, or VERTICAL.
CENTER
Anchors the component in the CENTER of the component.
EAST
Anchors the component in the EAST edge of the component.
fill
Specifies the direction the component can grow.
gridheight
The height (in pixels) of the component in cells. Used with REMAINDER and gridwidth.
gridwidth
The width (in pixels) of the component in cells. Used with REMAINDER and gridheight.
gridx
The component's vertical, or row, location on the grid. Used with gridy and relative.
gridy
The component's horizontal, or column, location on the grid. Used with gridx and relative.
HORIZONTAL
A value used to describe the direction the object can grow in to fill the container. The width is set to the width of the column.
insets
This object defines the margins.
ipadx
Not Supported.
ipady
Not Supported.
NONE
A value used to describe the direction the object can grow in to fill the container. This value specifies no fill; instead, getPreferredSize is used.
NORTH
Anchors the component in the NORTH end of the component.
NORTHEAST
Anchors the component in the NORTHEAST corner of the component.
NORTHWEST
Anchors the component in the NORTHWEST corner of the component.
RELATIVE
Specifies the location of gridx or gridy relative to the adjacent gridx or gridy component.
REMAINDER
Specifies that this is the last component to be added. This component will receive the remaining cells. Used in conjunction with gridwidth or gridheight.
SOUTH
Anchors the component in the SOUTH edge of the component.
SOUTHEAST
Anchors the component in the SOUTHEAST corner of the component.
SOUTHWEST
Anchors the component in the SOUTHWEST corner of the component.
VERTICAL
A value used to describe the direction the object can grow in to fill the container. The height is set to the height of the row.
weightx
Used to distribute extra horizontal space in a container.
Comments:
Each component in a container can ask for a percentage of the extra space by setting weightx to a decimal equivalent of a percentage. The weights are normalized, that is, they are divided among the components that request to be weighted. For example, if 70 pixels were available and only one component set its weightx to .5, that component would receive all 70 pixels. If two components set their weightx to .5, each would receive 35 pixels (half of 70).
weighty
Used to distribute extra vertical space in a container.
Comments:
Each component in a container can ask for a percentage of the extra space by setting weighty to a decimal equivalent of the percentage needed. The weights are normalized, that is, they are divided among the components that request to be weighted. For example, if 70 pixels were available and only one component set its weighty to .5, that component would receive all 70 pixels. If two components set their weighty to .5, each would receive 35 pixels (half of 70).
WEST
Anchors the component in the WEST edge of the component.


Class UIGridBagLayout

public class UIGridBagLayout extends UILayoutManager
{
  // Constructors
  public UIGridBagLayout();

  // Methods
  public void addLayoutComponent(IUIContainer cont,
        IUIComponent comp, Object constraints);
  public int getAlignment();
  public UIGridBagConstraints getConstraints(IUIComponent comp);
  public Dimension getMinimumSize(IUIContainer parent);
  public Dimension getPreferredSize(IUIContainer c,
        Rectangle parentRect, boolean pref);
  public Dimension getPreferredSize(IUIContainer parent);
  public Dimension getPreferredSize(IUIContainer parent,
        Rectangle rect);
  public void layout(IUIContainer c, Rectangle bounds,
        int alignment);
  public void layout(IUIContainer parent, Rectangle bounds);
  protected UIGridBagConstraints lookupConstraints(
        IUIComponent comp);
  public void setAlignment(int align);
  public void setConstraints(IUIComponent comp,
        UIGridBagConstraints cons);
  public void setConstraints(IUIComponent comp,
        GridBagConstraints cons);
}

This class implements a frame manager with a row by column format or grid for placing components. This class allows components of different sizes to be placed in a single container. The default alignment is centered.

Note A row will be as tall and as wide as the largest component. The class UIGridLayout is a much simpler version of the UIGridBagLayout. It does not allow variable row or column sizing. The following NAVDIR values are not supported in UIGridBagLayout.

  • NAVDIR_UP
  • NAVDIR_DOWN
  • NAVDIR_LEFT
  • NAVDIR_RIGHT

Also see com.ms.ui.UIGridLayout

UILayoutManager
  |
  +--UIGridBagLayout

Constructors

UIGridBagLayout

public UIGridBagLayout();

Creates a new instance of a UIGridBagLayout. Use addLayoutComponent to add components to the UIGridBagLayout container.

See Also: addLayoutComponent, com.ms.ui.UIGridBagConstraints

Methods

addLayoutComponent

public void addLayoutComponent(IUIContainer cont, IUIComponent comp, Object
        constraints);

Adds the specified component to the layout, using the specified constraint object.

Return Value:

No return value.

Parameter | Description
cont | The container of the component.
comp | The component to be added.
constraints | Where or how the component is added to the layout.

Overrides:

addLayoutComponent(IUIContainer,IUIComponent,Object) in UILayoutManager.

Exceptions:

IllegalArgumentException if the constraints passed in are not proper UIGridBagConstraints.

See Also: com.ms.ui.UIGridBagConstraints

getAlignment

public int getAlignment();

Retrieves the current layout alignment.

Return Value:

Returns an integer indicating the alignment of the container's components. For a list of possible values, see setAlignment.

See Also: setAlignment

getConstraints

public UIGridBagConstraints getConstraints(IUIComponent comp);

Retrieves a copy of the constraints for the specified component.

Return Value:

Returns the constraints for the specified component.

Parameter | Description
comp | The component to be queried.

getMinimumSize

public Dimension getMinimumSize(IUIContainer parent);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
parent | The container of the components.

Remarks:

This method is called by the container's getMinimumSize method.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer c, Rectangle parentRect,
        boolean pref);

Determines the preferred dimensions (in pixels) for laying out the components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
c | The container of the components.
parentRect | The bounding parent rectangle.
pref | If set to true, getPreferredSize will be used; if set to false, getMinimumSize is used.

Remarks:

This method is called by the container's getPreferredSize method.

See Also: getMinimumSize, com.ms.ui.UIGridBagConstraints

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
parent | The container of the components.

Remarks:

This method is called by the container's getPreferredSize method.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent, Rectangle rect);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
parent | The container of the components.
rect | The bounding rectangle.

Remarks:

This method is called by the container's getPreferredSize method.

See Also: getMinimumSize

layout

public void layout(IUIContainer c, Rectangle bounds, int alignment);

Lays out the components in the specified container. The grid of cells can be positioned within the container using alignment (see UIGridBagConstraints.anchor for values).

Return Value:

No return value.

Parameter | Description
c | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.
alignment | Specifies how to anchor the grid of cells within the container.

Remarks:

This method is called by the container's layout method.

See Also: com.ms.ui.UIGridBagConstraings.anchor

layout

public void layout(IUIContainer parent, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
parent | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

This method is called by the container's layout method.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

lookupConstraints

protected UIGridBagConstraints lookupConstraints(IUIComponent comp);

Retrieves the constraints for the specified component. The return value is not a copy, but is the actual constraints class used by the layout mechanism.

Return Value:

Returns the constraints for the specified component.

Parameter | Description
comp | The component to be queried.

setAlignment

public void setAlignment(int align);

Sets the layout alignment.

Return Value:

No return value.

Parameter | Description
align | The alignment for the container's components. See UIGridBagConstraints for possible anchor values.

See Also: getAlignment, com.ms.ui.UIGridBagConstraints

setConstraints

public void setConstraints(IUIComponent comp, UIGridBagConstraints cons);

Sets the constraints for the specified component.

Return Value:

No return value.

Parameter | Description
comp | The component to be modified.
cons | The constraints to be applied.

See Also: com.ms.ui.UIGridBagConstraints

setConstraints

public void setConstraints(IUIComponent comp, GridBagConstraints cons);

Sets the constraints for the specified component.

Return Value:

No return value.

Parameter | Description
comp | The component to be modified.
cons | The constraints to be applied.

See Also: com.ms.ui.UIGridBagConstraints


Class UIGridLayout

public class UIGridLayout extends UILayoutManager
{
  // Constructors
  public UIGridLayout(int rows, int cols);
  public UIGridLayout(int rows, int cols, int hgap, int vgap);

  // Methods
  public boolean continueInvalidate(IUIContainer parent,
        IUIComponent check);
  public Dimension getMinimumSize(IUIContainer parent);
  public Dimension getPreferredSize(IUIContainer parent);
  public boolean isOverlapping();
  public void layout(IUIContainer parent, Rectangle bounds);
  public IUIComponent navigate(IUIContainer parent,
        IUIComponent comp, int dir, boolean keyable);
}

This class implements an extended grid layout manager. UIGridLayout lays out components in a two-dimensional grid, similar to the AWT GridLayout class. The container is divided into rows and columns, where each component has the same width and height.

UILayoutManager
  |
  +--UIGridLayout

Constructors

UIGridLayout

public UIGridLayout(int rows, int cols);

Creates a grid layout manager using the specified number of rows and columns.

Parameter | Description
rows | The number of rows in the grid. If zero, the grid consists of one column, and the number of rows is determined from the number of components.
cols | The number of columns in the grid. If zero, the grid consists of one row, and the number of columns is determined from the number of components.

Remarks:

By default, the horizontal and vertical gaps (used for spacing between components) are 0 pixels each.

UIGridLayout

public UIGridLayout(int rows, int cols, int hgap, int vgap);

Creates a grid layout manager using the specified number of rows and columns, and the specified horizontal and vertical gaps.

Parameter | Description
rows | The number of rows in the grid. If zero, the grid consists of one column, and the number of rows is determined from the number of components.
cols | The number of columns in the grid. If zero, the grid consists of one row, and the number of columns is determined from the number of components.
hgap | The number of pixels used for horizontal spacing between components.
vgap | The number of pixels used for vertical spacing between components.

Methods

continueInvalidate

public boolean continueInvalidate(IUIContainer parent, IUIComponent check);

Determines whether the container should be invalidated when the specified child component is invalidated.

Return Value:

Returns false, indicating the container should not be invalidated.

Parameter | Description
parent | The container of the component.
check | The component being invalidated.

Overrides:

continueInvalidate(IUIContainer,IUIComponent) in UILayoutManager.

getMinimumSize

public Dimension getMinimumSize(IUIContainer parent);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
parent | The container of the components.

Remarks:

This method is called by the container's getMinimumSize method. The width of the returned Dimension object is the largest of the widths of each row. The width of each row is the sum of the minimum widths of the components in the row, plus the horizontal gaps around components.

Similarly, the returned Dimension object's height is the largest of the heights of each column. The height of each column is the sum of the minimum heights of the components in the column, plus the vertical gaps around components.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
parent | The container of the components.

Remarks:

This method is called by the container's getPreferredSize method. The width of the returned Dimension object is the largest of the widths of each row. The width of each row is the sum of the preferred widths of the components in the row, plus the horizontal gaps around components.

Similarly, the returned Dimension object's height is the largest of the heights of each column. The height of each column is the sum of the preferred heights of the components in the column, plus the vertical gaps around components.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize

isOverlapping

public boolean isOverlapping();

Determines if the layout manager lays out its children so that they overlap either completely or partially; otherwise, false. Returning false also means that only the sibling floater window, if one exists, needs to be clipped by the manager.

Return Value:

Returns true if the children overlap; otherwise, returns false. (The default is true.)

Overrides:

isOverlapping() in UILayoutManager.

layout

public void layout(IUIContainer parent, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
parent | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

This method is called by the container's layout method. layout divides the space in the bounding rectangle equally into rows and columns. This grid is then filled by row. Each component has the same width and height, and is separated by the horizontal and vertical gaps.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

navigate

public IUIComponent navigate(IUIContainer parent, IUIComponent comp,
        int dir, boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
parent | The container where the navigation is occurring.
comp | The component to navigate from.
dir | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

This method handles keyboard navigation in the container. When a component in the container has focus and a key is pressed, navigate is called to move focus to another item in the container.

The following table shows the keys that have corresponding IUIAccessible directions.

Key | IUIAccessible direction
UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW | NAVDIR_UP, NAVDIR_DOWN, NAVDIR_LEFT, and NAVDIR_RIGHT, respectively.
HOME and END | NAVDIR_FIRST and NAVDIR_LAST, respectively.

Overrides:

navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.


Class UIGroup

public class UIGroup extends UIPanel
{
  // Constructors
  public UIGroup();
  public UIGroup(String label);
  public UIGroup(IUIComponent header);

  // Methods
  public void adjustLayoutSize(IUIComponent comp,
        Dimension oldSize, Dimension newSize);
  public Insets getInsets();
  public boolean isWidthRelative();
  public void layout();
  public void paint(FxGraphics fxg);
  public void setName(String name);
}

This class implements a group box control. A group box is a control that consists of a rectangular frame and a label, and is used to organize other controls.

The following examples show the different ways to create UIGroup objects.

// Use the default constructor to create an empty
// group box, and the setName method to set its label.
UIGroup uigroup1 = new UIGroup();
uigroup1.setName("Direction");

// You can create the same group box with a different constructor.
UIGroup uigroup2 = new UIGroup("Direction");

// You can also use an IUIComponent for the
// group box's header.
UIText header = new UIText("Direction", UIStatic.LEFT);
UIGroup uigroup3 = new UIGroup(header);

The UIGroup class uses a default UIVerticalFlowLayout to lay out components in the group box control. If you add certain components to the group box, such as a UIList object, no scroll bars are added to view the list (because the control is not contained in a UIScrollViewer), and the list may not be completely viewable.

However, simply adding a UIScrollViewer object does not help, because the layout is still a vertical flow layout. You must set the layout manager of the group box to something other than the default (to UIBorderLayout, for example).

The following example shows how to correctly add lists and other vertically scrollable components to a group box.

 // Create a list object to add to the UIGroup object
 list = new UIList();
 for(int loop = 0;loop < 150;loop++)
 {
      list.add("List " + loop);
 }

 // Add the list.
 uigroup4.setLayout(new UIBorderLayout());
 uigroup4.add("Center",new UIScrollViewer(list));

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIGroup

Constructors

UIGroup

public UIGroup();

Creates a UIGroup control with no label.

Remarks:

Use the setName method to add a label.

UIGroup

public UIGroup(String label);

Creates a group box control with the specified label.

Parameter | Description
label | The label for the group control.

UIGroup

public UIGroup(IUIComponent header);

Creates a group box control using the specified component as a label.

Parameter | Description
header | A IUIComponent label for the group control.

Methods

adjustLayoutSize

public void adjustLayoutSize(IUIComponent comp, Dimension oldSize,
        Dimension newSize);

Adjusts the layout size of the group box.

Return Value:

No return value.

Parameter | Description
comp | The component contained by the UIGroup object whose preferred size has changed.
oldSize | The previous layout size of the group box (in pixels).
newSize | The new layout size of the group box (in pixels).

Remarks:

This method is automatically invoked when the container's size has changed.

getInsets

public Insets getInsets();

Retrieves the insets for the group box relative to its parent component, in pixels. This method is not called directly by the application. It is used in the layout method to lay out the group control relative to its parent component.

Return Value:

Returns a set of Insets for the group control.

isWidthRelative

public boolean isWidthRelative();

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

Return Value:

Returns true, signifying that this layout manager uses the container's width to lay out the children.

layout

public void layout();

This method is used to lay out the group box control.

Return Value:

No return value.

paint

public void paint(FxGraphics fxg);

Paints the group control.

Return Value:

No return value.

Parameter | Description
fxg | The graphics context.

setName

public void setName(String name);

Sets the group box's displayed name.

Return Value:

No return value.

Parameter | Description
name | The string that contains the name of the group control.

Overrides:

setName(String) in UIPanel.


Class UIHeaderRow

public class UIHeaderRow extends UIRow
{
  // Constructors
  public UIHeaderRow();
  public UIHeaderRow(Object columns[]);

  // Methods
  public IUIComponent getFloater();
  public boolean isKeyable();
  public void layout();
  public boolean mouseDown(Event e, int x, int y);
  public boolean mouseDrag(Event e, int x, int y);
  public boolean mouseUp(Event e, int x, int y);
  public IUIComponent navigate(IUIComponent comp, int dir,
        boolean keyable);
  public void paint(FxGraphics g);
  public void paintComponent(FxGraphics g, IUIComponent comp);
  public void setSelected(boolean flag);
}

This class implements a header row.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRow
          |
          +--UIHeaderRow

Constructors

UIHeaderRow

public UIHeaderRow();

Creates a header row.

UIHeaderRow

public UIHeaderRow(Object columns[]);

Creates a header row using an array of columns.

Parameter | Description
columns | The array of columns.

Methods

getFloater

public IUIComponent getFloater();

Returns the floating component in this container, if there is one. The floating component is the component that is superceding the standard z-order of the container's children by being first in the z-order. This is most commonly used when a component is being dragged, such as a column header or a scroll thumb.

Return Value:

Returns the current floating component, or null if there is none.

isKeyable

public boolean isKeyable();

Determines whether the header row can receive keyboard input.

Return Value:

Returns false, indicating the header row cannot receive keyboard input.

layout

public void layout();

Lays out the row header.

Return Value:

No return value.

mouseDown

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

Responds to the mouse button being pressed over the header row.

Return Value:

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

Parameter | Description
e | 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 e, int x, int y);

Responds to the mouse button being dragged over the header row.

Return Value:

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

Parameter | Description
e | 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 e, int x, int y);

Responds to the mouse button being released over the header row.

Return Value:

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

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

navigate

public IUIComponent navigate(IUIComponent comp, int dir, boolean keyable);

Navigates to another component from the specified component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
comp | The component to navigate from.
dir | The navigation direction. Specify one of the NAVDIR values in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

paint

public void paint(FxGraphics g);

Draws the header row.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

paintComponent

public void paintComponent(FxGraphics g, IUIComponent comp);

Draws the specified component.

Return Value:

No return value.

Parameter | Description
g | The graphics context.
comp | The component to paint.

setSelected

public void setSelected(boolean flag);

Sets or clears the selected state of the header row.

Return Value:

No return value.

Parameter | Description
flag | If true, the header row is selected; otherwise, it is deselected.

Remarks:

By default, this method ignores the flag parameter and simply returns true.

Overrides:

setSelected(boolean) in UIRow.


Class UIItem

public class UIItem extends UIStatic
{
  // Fields
  static public final int ABOVE;
  static public final int FIRSTLINE;
  static public final int ONLEFT;

  // Constructors
  public UIItem();
  public UIItem(Image image, String text);
  public UIItem(Image image, String text, int style);
  public UIItem(Image image, String text, int style, int imagePos);

  // Methods
  public int getGap();
  public Image getImage();
  public int getImagePos();
  public Dimension getPreferredSize();
  public int getRoleCode();
  public boolean imageUpdate(Image image, int flags, int x, int y,
        int width, int height);
  public void paint(FxGraphics g, Rectangle rect);
  public void setFocused(boolean on);
  public void setGap(int gap);
  public void setHot(boolean on);
  public void setImage(Image image);
  public void setImagePos(int imagePos);
  public void setName(String text);
  public void setSelected(boolean on);
}

This class implements a static item control that displays both a graphical image and text. Typically, a UIItem object is used to display information on another control, such as a button. When you create a UIItem object, you specify the image and text, as well as an optional alignment, style, and image position. The image position identifies where the image will be positioned relative to the text. By default, UIItem uses a gap of 2 pixels between the image and text.

The following example shows how to use UIItem to create another object.

// Construct a push button that uses UIItem to
// display the image stored in the variable myImage,
// and the text "Push Button." Left-align the content
// and let the image lie above the text.
UIPushButton p =
   new UIPushButton(new UIItem(myImage, "Push Button",
                               UIStatic.LEFT, UIItem.ABOVE));
add(p);  // Add p to the container.

In addition to using UIItem, you can use UIText and UIGraphic to create other static objects.

UIItem overrides the paint method to draw the associated text string according to the control's current states. For example, if the control is hot-tracked, the text changes colors when the mouse enters the control; the color is restored when the mouse exits. If the control is currently selected, the text is white on a dark background. Whenever the state of the control changes, paint is called to redraw the control.

Note UIItem and UIText handle the display of text in a similar manner. For more information about hot-tracked controls, see the UIText overview.

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

UIComponent
  |
  +--UIStateComponent
    |
    +--UICanvas
      |
      +--UIStatic
        |
        +--UIItem

Constructors

UIItem

public UIItem();

Creates a static item control with no image or text.

UIItem

public UIItem(Image image, String text);

Creates a static item control with the specified image and text.

Parameter | Description
image | The image to be displayed within the control.
text | The text to be displayed within the control.

Remarks:

By default, the image and text are aligned both horizontally and vertically. The image is positioned to the left of the text, with a gap of 2 pixels between the image and text.

UIItem

public UIItem(Image image, String text, int style);

Creates a static item control with the specified image, text, and style.

Parameter | Description
image | The image to be displayed within the control.
text | The text to be displayed within the control.
style | The alignment and style of the control. You can pass any bitwise combination of an alignment flag and a style flag. For a list of possible flags, see the UIStatic.setFlags method.

Remarks:

By default, the image is positioned to the left of the text, with a gap of 2 pixels between the image and text. If a vertical alignment is not specified, VCENTER is used (by default). Similarly, if a horizontal alignment is not specified, HCENTER is used.

Exceptions:

IllegalArgumentException if more than one vertical alignment, more than one horizontal alignment, or an undefined style was specified.

UIItem

public UIItem(Image image, String text, int style, int imagePos);

Creates a static item control using the specified image and text, with the specified alignment, style, and image position.

Parameter | Description
image | The image to be displayed within the control.
text | The text to be displayed within the control.
style | The alignment and style of the control. You can pass any bitwise combination of an alignment flag and a style flag. For a list of possible flags, see the UIStatic.setFlags method.
imagePos | The position of the image relative to the text. Possible values include ONLEFT, ABOVE, or FIRSTLINE.

Remarks:

By default, a gap of 2 pixels is used between the image and text. If a vertical alignment is not specified, VCENTER is used (by default). Similarly, if a horizontal alignment is not specified, HCENTER is used.

Exceptions:

IllegalArgumentException if more than one vertical alignment, more than one horizontal alignment, or an undefined style or image position was specified.

Methods

getGap

public int getGap();

Retrieves the size of the gap (in pixels) between the control's image and text.

Return Value:

Returns the number of pixels in the gap.

Remarks:

If the image is positioned above the text, the gap is the vertical space between the image and text. Otherwise, the gap is the horizontal space between the image and text.

See Also: setGap

getImage

public Image getImage();

Retrieves the control's image.

Return Value:

Returns the Image object displayed within the control.

See Also: setImage

getImagePos

public int getImagePos();

Retrieves the position of the control's image relative to the text.

Return Value:

Returns the current image position. Possible values include ONLEFT, ABOVE, or FIRSTLINE.

See Also: setImagePos

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred size (in pixels) of the static item control.

Return Value:

Returns a Dimension object containing the preferred size.

Remarks:

If the image lies above the text, the height of the returned Dimension object is the sum of the image's height, the text's height, and the current gap. The Dimension object's width is the larger of the image's width and the text's width.

Conversely, if the image does not lie above the text, the Dimension object's width is the sum of the image's width, the text's width, and the current gap. The height is the larger of the image's and text's height (whichever is greater).

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the control.

Return Value:

Returns the ROLE_SYSTEM_GRAPHIC code.

imageUpdate

public boolean imageUpdate(Image image, int flags, int x, int y, int width,
        int height);

Called to incrementally draw the control's image as the image bits become available.

Return Value:

Returns true if more information is needed to draw the full image; otherwise, returns false.

Parameter | Description
image | The control's image.
flags | The flags that specify the status of the image being loaded. You can pass any bitwise combination of the fields defined in the ImageObserver interface.
x | The x coordinate of the image.
y | The y coordinate of the image.
width | The width of the image.
height | The height of the image.

paint

public void paint(FxGraphics g, Rectangle rect);

Draws the control's image and text. This method is called by paint(FxGraphics g), inherited through UIStatic.

Return Value:

No return value.

Parameter | Description
g | The graphics context.
rect | The rectangle to draw the control's image and text in.

Remarks:

This method checks the current image position and gap, and draws the image and text accordingly.

Overrides:

paint(FxGraphics,Rectangle) in UIStatic.

setFocused

public void setFocused(boolean on);

Sets or clears the focus state of the static item control.

Return Value:

No return value.

Parameter | Description
on | If true, the focus state is set; otherwise, it is cleared.

Remarks:

This method redraws the control to update the text according to the new state. For more information, see the UIItem overview.

setGap

public void setGap(int gap);

Sets the size of the gap (in pixels) between the control's image and text.

Return Value:

No return value.

Parameter | Description
gap | The number of pixels for the gap.

Remarks:

If the image is positioned above the text, the gap is the vertical space between the image and text. Otherwise, the gap is the horizontal space between the image and text.

See Also: getGap

setHot

public void setHot(boolean on);

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

Return Value:

No return value.

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

Remarks:

This method redraws the control to update the text according to the new state. The control must have the HOTTRACK style for the hot-tracked state to be set or cleared. For more information about hot-tracking, see the UIItem overview.

Overrides:

setHot(boolean) in UIStatic.

setImage

public void setImage(Image image);

Sets the control's image.

Return Value:

No return value.

Parameter | Description
image | The image to be displayed within the control.

See Also: getImage

setImagePos

public void setImagePos(int imagePos);

Sets the position of the control's image relative to the text.

Return Value:

No return value.

Parameter | Description
imagePos | The position of the image. Possible values include ONLEFT, ABOVE, or FIRSTLINE.

Exceptions:

IllegalArgumentException if an undefined position was specified.

See Also: getImagePos

setName

public void setName(String text);

Sets the control's text.

Return Value:

No return value.

Parameter | Description
text | The text to be displayed within the control.

Remarks:

The getName method (inherited through UICanvas) enables you to retrieve the control's current text.

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the static item control.

Return Value:

No return value.

Parameter | Description
on | If true, the selected state is set; otherwise, it is cleared.

Remarks:

This method redraws the control to update the text according to the new state. For more information about states, see the UIItem overview.

Fields

ABOVE
Specifies that the image will be positioned above the text.
FIRSTLINE
Specifies that the image will be positioned, centered vertically, on the first line of text.
ONLEFT
Specifies that the image will be positioned to the left of the text.


Class UILayoutManager

public abstract class UILayoutManager implements
            IUILayoutManager
{
  // Methods
  public void addLayoutComponent(IUIContainer cont,
        IUIComponent comp, Object constraints);
  public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp,
        Dimension oldSize, Dimension newSize);
  public boolean continueInvalidate(IUIContainer cont, IUIComponent
        comp);
  public IUIComponent getComponent(IUIContainer cont, int index);
  public IUIComponent getComponent(IUIContainer cont,
        Object constraints);
  public int getComponentIndex(IUIContainer cont,
        IUIComponent comp);
  public int getHgap();
  public Dimension getMinimumSize(IUIContainer parent);
  public Dimension getPreferredSize(IUIContainer parent);
  public Dimension getPreferredSize(IUIContainer parent,
        Dimension size);
  public int getVgap();
  public boolean isHeightRelative();
  public boolean isOverlapping();
  public boolean isWidthRelative();
  public void layout(IUIContainer parent, Rectangle bounds);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int dir, boolean keyable);
  public void paintContainer(IUIContainer parent, FxGraphics g);
  public void removeLayoutComponent(IUIContainer cont, IUIComponent
        comp);
  public void setHgap(int g);
  public void setVgap(int g);
}

This class implements an abstract layout manager with default keyboard handling. UILayoutManager implements the IUILayoutManager interface.

The following diagram shows the classes that extend UILayoutManager.

UILayoutManager
|
+--UIBarLayout
|
+--UIBorderLayout
|
+--UIFixedFlowLayout
|
+--UIFlowLayout
|
+--UIGridLayout
|
+--UIRowLayout
|
+--UISplitLayout
|
+--UITabLayout
|
+--UITabListLayout
|
+--UIThreePanelLayout
|
+--UITreeLayout
|
+--UIVerticalFlowLayout

Methods

addLayoutComponent

public void addLayoutComponent(IUIContainer cont, IUIComponent comp, Object
        constraints);

Adds the specified component to the container, according to the specified constraints.

Return Value:

No return value.

Parameter | Description
cont | The container of the component.
comp | The component to be added.
constraints | Identifies where the component will be added. For more information about layout constraints, see UISplitLayout.addLayoutComponent or UIBorderLayout.addLayoutComponent.

Remarks:

This method implements addLayoutComponent in the IUILayoutManager interface, and by default, does nothing. UISplitLayout and UIBorderLayout override this method.

See Also: getComponent, removeLayoutComponent

adjustLayoutSize

public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp, Dimension oldSize,
        Dimension newSize);

Called to adjust the layout size of the specified component in the specified container.

Return Value:

Returns a Dimension object containing the new preferred size of the container.

Parameter | Description
parent | The container of the component.
oldParentSize | The previous layout size of the container.
comp | The component being sized.
oldSize | The previous layout size of the component.
newSize | The new layout size of the component.

Remarks:

This method implements adjustLayoutSize in the IUILayoutManager interface.

continueInvalidate

public boolean continueInvalidate(IUIContainer cont, IUIComponent comp);

Currently not implemented.

getComponent

public IUIComponent getComponent(IUIContainer cont, int index);

Retrieves the component at the specified index.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
cont | The container of the component.
index | The zero-based index of the component to retrieve.

Remarks:

This method implements getComponent in the IUILayoutManager interface.

getComponent

public IUIComponent getComponent(IUIContainer cont, Object constraints);

Retrieves a component from the container, according to the specified constraints.

Return Value:

Returns null, indicating the specified component was not retrieved.

Parameter | Description
cont | The container of the component.
constraints | Identifies the component to be retrieved. For more information about layout constraints, see UISplitLayout.getComponent.

Remarks:

This method implements getComponent in the IUILayoutManager interface, and by default, simply returns null. UISplitLayout overrides this method.

See Also: addLayoutComponent, removeLayoutComponent

getComponentIndex

public int getComponentIndex(IUIContainer cont, IUIComponent comp);

Retrieves the layout index of the specified component from the specified container.

Return Value:

Returns the layout index of the component; returns -1 if the component is not in the container.

Parameter | Description
cont | The container of the component.
comp | The component whose layout index is being requested.

getHgap

public int getHgap();

Retrieves the horizontal spacing, in pixels, between components when laid out by the layout manager.

Return Value:

Returns the horizontal gap between components.

See Also: setHgap

getMinimumSize

public Dimension getMinimumSize(IUIContainer parent);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
parent | The container of the components.

Remarks:

This method implements getMinimumSize in the IUILayoutManager interface, and by default, returns a height and width of 0.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
parent | The container of the components.

Remarks:

This method implements getPreferredSize in the IUILayoutManager interface, and by default, returns a height and width of 0.

See Also: getMinimumSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent, Dimension size);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container, given the specified size.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
parent | The container of the components.
size | The size of the container

Remarks:

This method implements getPreferredSize in the IUILayoutManager interface, and by default, returns a height and width of 0 pixels.

See Also: getMinimumSize

getVgap

public int getVgap();

Retrieves the vertical spacing, in pixels, between components when laid out by the layout manager.

Return Value:

Returns the vertical gap between components.

See Also: setVgap

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 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: isWidthRelative

isOverlapping

public boolean isOverlapping();

Determines if this layout manager lays out its children so they overlap either completely or partially.

Return Value:

Returns true if the children overlap; otherwise, returns false. (The default is true.) Returning false also means that only the sibling floater window, if one exists, needs to be clipped by the manager.

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 vertical resizing.

See Also: isHeightRelative

layout

public void layout(IUIContainer parent, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
parent | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

This method implements layout in the IUILayoutManager interface, and by default, does nothing.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp, int dir,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
cont | The container where the navigation is occurring.
comp | The component to navigate from.
dir | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

This method implements navigate in the IUILayoutManager interface, and handles keyboard navigation in the container. When a component in the container has focus and a key is pressed, navigate is called to move focus to another item in the container. The following table shows the keys that have corresponding IUIAccessible directions.

Key | IUIAccessible direction
UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW | NAVDIR_UP, NAVDIR_DOWN, NAVDIR_LEFT, and NAVDIR_RIGHT, respectively.
HOME and END | NAVDIR_FIRST and NAVDIR_LAST, respectively.

Exceptions:

IllegalArgumentException if an undefined navigation direction was specified.

paintContainer

public void paintContainer(IUIContainer parent, FxGraphics g);

Draws the container.

Return Value:

No return value.

Parameter | Description
parent | The container.
g | The graphics context of the container.

Remarks:

This method implements paintContainer in the IUILayoutManager interface, and by default, does nothing. UITreeLayout overrides this method.

removeLayoutComponent

public void removeLayoutComponent(IUIContainer cont, IUIComponent comp);

Removes the specified component from the container.

Return Value:

No return value.

Parameter | Description
cont | The container of the component.
comp | The component to be removed.

Remarks:

This method implements removeLayoutComponent in the IUILayoutManager interface, and by default, does nothing. UIBarLayout, UIBorderLayout, and UISplitLayout override this method.

See Also: addLayoutComponent, getComponent

setHgap

public void setHgap(int g);

Sets the horizontal spacing between the components that are laid out by the layout manager.

Note Not all layout managers use both Hgap and Vgap settings. For example, in UITreeLayout, Hgap is ignored when components are laid out.

Return Value:

No return value.

Parameter | Description
g | The horizontal gap between components (in pixels).

See Also: getHgap

setVgap

public void setVgap(int g);

Sets the horizontal spacing between the components that are laid out by the layout manager.

Note Not all layout managers use both Hgap and Vgap settings. For example, in UITreeLayout, Hgap is ignored when components are laid out.

Return Value:

No return value.

Parameter | Description
g | The vertical gap between components (in pixels).

See Also: getVgap


Class UILine

public class UILine extends UICanvas
{
  // Constructors
  public UILine();

  // Methods
  public Dimension getMinimumSize();
  public Dimension getPreferredSize();
  public int getRoleCode();
  public void paint(FxGraphics g);
}

This class implements painting a single separator line.

UIComponent
  |
  +--UIStateComponent
    |
    +--UICanvas
      |
      +--UILine

Constructors

UILine

public UILine();

Creates a separator line control.

Methods

getMinimumSize

public Dimension getMinimumSize();

Retrieves the minimum size (in pixels) of the line control.

Return Value:

Returns a Dimension object containing the minimum size.

Remarks:

By default, this method returns the preferred size as determined by getPreferredSize.

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred size (in pixels) of the line control.

Return Value:

Returns a Dimension object containing the preferred size.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the line control.

Return Value:

Returns the ROLE_SYSTEM_TOOLBAR code.

paint

public void paint(FxGraphics g);

Draws the line control.

Return Value:

No return value.

Parameter | Description
g | The graphics context.


Class UIList

public class UIList extends UISelector
{
  // Constructors
  public UIList();
  public UIList(int selMode);
  public UIList(int selMode, int layoutStyle);

  // Methods
  public IUIComponent add(String s);
  public IUIComponent add(String s, int pos);
}

This class implements a list control. A UIList object can have a SINGLESELECT, MULTISELECT, or a EXTENDSELECT selection mode. By default, UIList uses UIVerticalFlowLayout for its layout manager, which provides support for multicolumn list controls. The following example shows several ways to construct a UIList object.

// Construct a single-selection, multicolumn list control.
UIList lst1 =
   new UIList(UIList.SINGLESELECT, UIVerticalFlowLayout.MULTICOLUMN);

// Construct a list control that allows multiple items
// to be selected by clicking each individual item.
UIList lst2 = new UIList(UIList.MULTISELECT);

// Now add lst1 and lst2 to the container.
add(lst1);
add(lst2);

A UIList object is empty when it is first created. The add method allows extra text items to be inserted into the list control, as shown in the following example.

// Create an array of Strings.
String colors[] = {"Red", "Blue", "Green", "Black"};

// Add each item in the array to lst1.
for (int i=0; i<4; i++)
  lst1.add(colors[i]);

Note When add is called with a String, the list item is automatically hot-tracked. To override this default, call add with a UIText object, as shown in the following example.

UIList lst3 = new UIList();
UIList lst4 = new UIList();

// Add each item in the colors array to lst3,
// using UIText. By default, these items will
// not be hot-tracked.
for (int i=0; i<4; i++)
  lst3.add(new UIText(colors[i]));

// Add each item in the colors array to lst4,
// using UIText. To create hot-tracked items,
// specify the UIStatic.HOTTRACK style.
for (int i=0; i<4; i++)
  lst4.add(new UIText(colors[i], UIStatic.HOTTRACK));

add(lst3);
add(lst4);

For more information about hot-tracking, see the UIText overview.

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.

By default, a list select event is generated when an item in the list control is clicked. (An action event is generated when an item is double-clicked.) The following example shows how to use the handleEvent method to trap this event.

public boolean handleEvent(Event e)
{
   if ((e.id == Event.LIST_SELECT) && (e.target == lst1))
   {
      // Determine whether the first item in lst1
      // was selected. The getSelectedIndex
      // is for SINGLESELECT controls. If the
      // selection mode is MULTISELECT or EXTENDSELECT,
      // call getSelectedIndices.
      if (lst1.getSelectedIndex() == 0)
         cb.setChecked(true); // cb is a UICheckButton object.
      else
         cb.setChecked(false);

      return true;
   }
   return false;
}

UIList objects alone have no scrolling capabilities. Typically, a UIList control is placed inside a UIScrollViewer.

UIScrollViewer automatically inserts scroll bars when necessary. Also, placing the component inside a fixed size layout manager, such as UIScrollViewer, ensures that the size of the window will also be a fixed size also.

The following example adds a list control to a UIScrollViewer object.

UIList myList = new UIList();
myList.add("first item"); // Add an item to myList.
...  // Continue adding items to myList.

// Now create a UIScrollViewer object to display myList.
UIScrollViewer sv = new UIScrollViewer(myList);

// Add sv to the container.
add(sv);

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UISelector
          |
          +--UIList

Constructors

UIList

public UIList();

Creates an empty list control.

Remarks:

Call the add method to add items to the list. By default, the list control is a single-selection, single-column list.

UIList

public UIList(int selMode);

Creates an empty list control with the specified selection mode.

Parameter | Description
selMode | The selection mode of the control. Possible values include SINGLESELECT, MULTISELECT, or EXTENDSELECT.

Remarks:

Call the add method to add items to the list. By default, the list control is a single-column list.

Exceptions:

IllegalArgumentException if an undefined selection mode was specified.

UIList

public UIList(int selMode, int layoutStyle);

Creates an empty list control with the specified selection mode and layout style.

Parameter | Description
selMode | The selection mode of the control. Possible values include SINGLESELECT, MULTISELECT, or EXTENDSELECT.
layoutStyle | The layout style of the control. Possible values include UIVerticalFlowLayout.MULTICOLUMN, UIVerticalFlowLayout.FILL, or a bitwise combination of the two. (FILL extends the width of each list item's selectable area to the width of the item's column. This allows the item to be selected even when the horizontal area outside of its label is clicked.) Specify 0 for a single-column list with no fill.

Remarks:

Call the add method to add items to the list.

Exceptions:

IllegalArgumentException if an undefined selection mode or an undefined layout style was specified.

Methods

add

public IUIComponent add(String s);

Adds the specified text to the end of the list.

Return Value:

Returns the text component that was added, if successful; otherwise, returns null.

Parameter | Description
s | The text to be added.

Remarks:

By default, the text item is hot-tracked. To add an item that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIList overview.

To remove an item from the list control, call the remove method (inherited through UISelector).

add

public IUIComponent add(String s, int pos);

Adds the specified text to the list at the specified position.

Return Value:

Returns the text component that was added, if successful; otherwise, returns null.

Parameter | Description
s | The text to be added.
pos | The zero-based index at which to add the text. To add the text at the end of the list, pass -1.

Remarks:

By default, the text item is hot-tracked. To add an item that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIList overview.

To remove an item from the list control, call the remove method (inherited through UISelector).

Exceptions:

ArrayIndexOutOfBoundsException if an incorrect position is specified.


Class UIMarquee

public class UIMarquee extends UIViewer implements
            TimerListener
{
  // Constructors
  public UIMarquee();
  public UIMarquee(IUIComponent comp);
  public UIMarquee(IUIComponent comp, int rate);
  public UIMarquee(IUIComponent comp, int rate, int dx, int dy);

  // Methods
  public void addNotify();
  public boolean ensureVisible(Rectangle rect);
  public int getRoleCode();
  public int getStateCode();
  public void setContent(IUIComponent comp);
  public void timeTriggered(TimerEvent te);
}

This class implements a marquee control. By extending UIViewer, UIMarquee displays and moves 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.
// By default, this text will scroll from right to left.
UIMarquee m = new UIMarquee(new UIText("Hello World"), 100);

// Now add the marquee to the container.
add(m);

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIViewer
          |
          +--UIMarquee

Constructors

UIMarquee

public UIMarquee();

Creates a marquee control with no content.

Remarks:

To add content to the control, call setContent. By default, the content component scrolls from right to left at a rate of 75 milliseconds. The component moves by 10 pixels in the horizontal direction and 0 pixels in the vertical direction.

UIMarquee

public UIMarquee(IUIComponent comp);

Creates a marquee control with the specified component.

Parameter | Description
comp | The component to be displayed within the marquee control.

Remarks:

By default, the component scrolls from right to left at a rate of 75 milliseconds. The component moves by 10 pixels in the horizontal direction and 0 pixels in the vertical direction.

UIMarquee

public UIMarquee(IUIComponent comp, int rate);

Creates a marquee control with 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 (in milliseconds).

Remarks:

By default, the component scrolls from right to left at the specified rate. The component moves by 10 pixels in the horizontal direction and 0 pixels in the vertical direction.

UIMarquee

public UIMarquee(IUIComponent comp, int rate, int dx, int dy);

Creates a marquee control with the specified component, rate, and scroll increments.

Parameter | Description
comp | The component to be displayed within the marquee control.
rate | The rate at which to scroll the component (in milliseconds).
dx | The horizontal increment for scrolling the component (in pixels).
dy | The vertical increment for scrolling the component (in pixels).

Remarks:

If the dx and dy parameters are both nonnegative, the component scrolls from right to left. Otherwise, if either parameter is negative, the component scrolls from left to right.

Methods

addNotify

public void addNotify();

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

Return Value:

No return value.

Overrides:

addNotify in UIViewer.

ensureVisible

public boolean ensureVisible(Rectangle rect);

Brings the area identified by the specified rectangle into view.

Note This method is currently not implemented.

Return Value:

Returns Returns false.

Parameter | Description
rect | The rectangle identifying the area to be made visible.

Overrides:

ensureVisible(Rectangle) in UIViewer.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the marquee control.

Return Value:

Returns the ROLE_SYSTEM_ANIMATION code.

Overrides:

getRoleCode() in UIViewer.

getStateCode

public int getStateCode();

Retrieves the state of the marquee control.

Return Value:

Returns the combination of STATE_SYSTEM codes that best describe the state of the control.

Remarks:

The returned code contains the STATE_SYSTEM_MARQUEED flag. If either the horizontal scroll increment or vertical scroll increment is nonzero, the code also contains the STATE_SYSTEM_ANIMATED flag.

setContent

public void setContent(IUIComponent comp);

Sets the marquee control's content to the specified component.

Return Value:

No return value.

Parameter | Description
comp | The component to be displayed within the control.

Overrides:

setContent(IUIComponent) in UIViewer.

timeTriggered

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.

You can specify the scroll rate and scroll increments in the constructor. By default, the component scrolls from right to left at a rate of 75 milliseconds. The component moves by 10 pixels in the horizontal direction and 0 pixels in the vertical direction.

Note If you extend your own class from UIMarquee and implement the TimerListener interface, be sure to call the super method TimerListener(event).

Overrides:

timeTriggered(TimerEvent) in UIViewer.

See Also: com.ms.util.TimerListener


Class UIMenuButton

public class UIMenuButton extends UIMenuLauncher
{
  // Constructors
  public UIMenuButton(String string, UIMenuList menu);
  public UIMenuButton(String string, int style, UIMenuList menu);
  public UIMenuButton(IUIComponent comp, UIMenuList menu);
  public UIMenuButton(IUIComponent comp, int style,
        UIMenuList menu);

  // Methods
  public boolean action(Event e, Object o);
  public void ended(Event event);
  public Rectangle getPlacement(Dimension size);
  public int getRoleCode();
  public boolean keyDown(Event e, int key);
  public boolean launch();
  public boolean mouseDown(Event e, int x, int y);
  public void requestFocus();
}

This class implements a menu button control. UIMenuButton uses UIPushButton to create the content of the menu button control. Each UIMenuButton object is then associated with a pop-up menu, which uses UIMenuList for the content of the menu. Typically, you'll add a collection of UIMenuButton objects to a UIBand control to create a menu bar, as shown in the following example.

UIBand menuBar;
UIMenuButton fileButton, editButton, helpButton;

// Create the menu bar and add it to the container.
menuBar = new UIBand();
add(menuBar);

// Create the menus.
UIMenuList fileMenu = new UIMenuList();
UIMenuList editMenu = new UIMenuList();
UIMenuList helpMenu = new UIMenuList();
...  // Add items to each menu.

// Create each menu button.
fileButton = new UIMenuButton("File", fileMenu);
editButton = new UIMenuButton("Edit", editMenu);
helpButton = new UIMenuButton("Help", helpMenu);

// Add each menu button to the menu bar.
menuBar.add(fileButton);
menuBar.add(editButton);
menuBar.add(helpButton);

For more information about using UIMenuButton objects, see the UIMenuLauncher overview.

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIMenuLauncher
          |
          +--UIMenuButton

Constructors

UIMenuButton

public UIMenuButton(String string, UIMenuList menu);

Creates a menu button control with the specified text and menu.

Parameter | Description
string | The text to be displayed by the control.
menu | The UIMenuList object containing the content of the associated pop-up menu.

Remarks:

By default, the button is hot-tracked and its style is RAISED. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

UIMenuButton

public UIMenuButton(String string, int style, UIMenuList menu);

Creates a menu button control with the specified text, style, and menu.

Parameter | Description
string | The text to be displayed by the control.
style | The style of the button. Possible values include UIPushButton.RAISED or 0 for a flat style. Be aware that specifying UIButton.TOGGLE or UIButton.TRITOGGLE has no effect. You must manually set and clear the button's checked state.
menu | The UIMenuList object containing the content of the associated pop-up menu.

Remarks:

By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

UIMenuButton

public UIMenuButton(IUIComponent comp, UIMenuList menu);

Creates a menu button control with the specified component and menu.

Parameter | Description
comp | The component to be displayed by the control.
menu | The UIMenuList object containing the content of the associated pop-up menu.

Remarks:

By default, the button's style is RAISED. Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.

UIMenuButton

public UIMenuButton(IUIComponent comp, int style, UIMenuList menu);

Creates a menu button control with the specified component, style, and menu.

Parameter | Description
comp | The component to be displayed by the control.
style | The style of the button. Possible values include UIPushButton.RAISED or 0 for a flat style. Be aware that specifying UIButton.TOGGLE or UIButton.TRITOGGLE has no effect. You must manually set and clear the button's checked state.
menu | The UIMenuList object containing the content of the associated pop-up menu.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

action

public boolean action(Event e, Object o);

Launches or cancels the menu button's associated pop-up menu.

Return Value:

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

Parameter | Description
e | The event posted to the button.
o | The object that posted the event.

Remarks:

By default, an action event is generated when an item in the pop-up menu is selected. This method responds by cancelling the menu. For information about trapping action events, see the UIMenuLauncher overview.

ended

public void ended(Event event);

Called by the button control's associated pop-up menu when the menu is closed.

Return Value:

No return value.

Parameter | Description
event | The event that will be fired after ended is complete; null if no event will be fired.

Remarks:

This method is invoked by cancel (inherited through UIMenuLauncher). ended clears the launched state of the pop-up menu and clears the checked state of the control's UIPushButton content component.

Overrides:

ended(Event) in UIMenuLauncher.

getPlacement

public Rectangle getPlacement(Dimension size);

Called by the button's associated pop-up menu when the menu is to be displayed.

Return Value:

Returns the bounding rectangle (in screen coordinates) of the pop-up menu.

Parameter | Description
size | Specifies the preferred size (in pixels) of the pop-up menu.

Remarks:

This method calls fitToScreen (inherited through UIMenuLauncher) to determine where the pop-up menu will be displayed. By default, the pop-up menu is positioned below the button when it is launched.

Overrides:

getPlacement(Dimension) in UIMenuLauncher.

See Also: launch

getRoleCode

public int getRoleCode();

Retrieves the role of the object.

Return Value:

Returns the ROLE_SYSTEM_BUTTONMENU role code for the menu button object.

keyDown

public boolean keyDown(Event e, int key);

Determines whether the DOWN ARROW key is being pressed, and if so, launches the associated menu.

Return Value:

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

Parameter | Description
e | The event posted to the button.
key | The key that has been pressed.

See Also: launch

launch

public boolean launch();

Launches the button control's associated pop-up menu.

Return Value:

Returns true if the pop-up menu was launched; otherwise, returns false.

Remarks:

This method sets the launched state of the pop-up menu and sets the checked state of the control's UIPushButton content component. The getPlacement method is invoked to display the menu. Any previously launched menu is cancelled.

Overrides:

launch() in UIMenuLauncher.

mouseDown

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

Launches or cancels the button control's associated pop-up menu.

Return Value:

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

Parameter | Description
e | The event posted to the button.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

If the pop-up menu is already in the launched state when the control is clicked, the menu is cancelled; otherwise, it is launched.

requestFocus

public void requestFocus();

Requests that the button control's UIPushButton content component receives focus.

Return Value:

No return value.


Class UIMenuItem

public class UIMenuItem extends UIMenuLauncher
{
  // Constructors
  public UIMenuItem(String text);
  public UIMenuItem(String text, UIMenuList menu);
  public UIMenuItem(IUIComponent comp);
  public UIMenuItem(IUIComponent comp, UIMenuList menu);

  // Methods
  public boolean action(Event e, Object o);
  public Insets getInsets();
  public int getRoleCode();
  public boolean keyDown(Event e, int key);
  public void paint(FxGraphics g);
}

This class implements a menu item control. A UIMenuItem object can be used to launch a pop-up menu. Typically, you'll create a UIMenuButton control with an associated pop-up menu. This menu uses a UIMenuList object for content, which displays a list of items. From those items that are UIMenuItem objects, other pop-up menus can be launched.

For more information about using UIMenuItem objects, see the UIMenuLauncher overview.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIMenuLauncher
          |
          +--UIMenuItem

Constructors

UIMenuItem

public UIMenuItem(String text);

Creates a menu item with the specified text. The menu item has no associated pop-up menu.

Parameter | Description
text | The text to be displayed by the item.

UIMenuItem

public UIMenuItem(String text, UIMenuList menu);

Creates a menu item using the specified text and menu.

Parameter | Description
text | The text to be displayed by the item.
menu | The UIMenuList object containing the content of the associated pop-up menu.

UIMenuItem

public UIMenuItem(IUIComponent comp);

Creates a menu item with the specified component. The menu item has no associated pop-up menu.

Parameter | Description
comp | The component to be displayed by the item.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component.

UIMenuItem

public UIMenuItem(IUIComponent comp, UIMenuList menu);

Creates a menu item with the specified component and menu.

Parameter | Description
comp | The component to be displayed by the item.
menu | The UIMenuList object containing the content of the associated pop-up menu.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component.

Methods

action

public boolean action(Event e, Object o);

Responds to an action that has occurred within the control.

Return Value:

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

Parameter | Description
e | The event posted to the control.
o | The object that posted the event.

getInsets

public Insets getInsets();

Retrieves the menu item control's insets (in pixels), which identify the nonclient area of the control.

Return Value:

Returns an Insets object containing the menu item's insets.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the menu item control.

Return Value:

Returns the ROLE_SYSTEM_MENUITEM code.

keyDown

public boolean keyDown(Event e, int key);

Determines whether the RIGHT ARROW key or the LEFT ARROW key is being pressed, and if so, launches or cancels the associated pop-up menu.

Return Value:

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

Parameter | Description
e | The event posted to the menu item control.
key | The key that has been pressed.

Remarks:

This method is called when the menu item has focus and a key is pressed. keyDown invokes launch if the RIGHT ARROW key is being pressed, or cancel if the LEFT ARROW key is being pressed. (These two methods are inherited from UIMenuLauncher.)

paint

public void paint(FxGraphics g);

Draws the menu item.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

If the menu item has an associated pop-up menu, the system-defined right arrow is added to the menu item to indicate a menu can be launched.


Class UIMenuLauncher

public abstract class UIMenuLauncher extends UISingleContainer
             implements IUIMenuLauncher
{
  // Constructors
  public UIMenuLauncher(UIMenuList menu);
  public UIMenuLauncher(IUIComponent comp);
  public UIMenuLauncher(IUIComponent comp, UIMenuList menu);

  // Methods
  public void cancel();
  public void ended(Event event);
  public Rectangle fitToScreen(Rectangle exclude, Dimension size,
        boolean right);
  public IUIContainer getDisplayer();
  public UIMenuList getMenu();
  public Rectangle getPlacement(Dimension size);
  public boolean isLaunched();
  public boolean launch();
  public boolean postEvent(Event e);
  public void raiseEvent(Event e);
  public void setFocused(boolean on);
  public void setHot(boolean on);
  public void setMenu(UIMenuList menu);
  public void setSelected(boolean on);
}

This class implements an abstract menu launcher control. By implementing the IUIMenuLauncher interface, UIMenuLauncher provides methods for launching and cancelling a pop-up menu. Typically, a UIMenuLauncher object is associated with a specific UIMenuList control, which is used for the content of the pop-up menu. This is a one-to-one relationship — you can't assign a UIMenuList to more than one menu launcher at a time.

Classes that extend UIMenuLauncher include UIMenuButton, and UIMenuItem, and UIContextMenu. The following example shows how to create a UIMenuButton object with an associated pop-up menu. It contains a UIMenuItem object, which launches a second pop-up menu.

UIBand myMenuBar;
UIMenuButton myButton;
UIMenuList myMenu;
UIMenuItem myItem;
UIComponent c1, c2, c3;

// Construct the pop-up menu for the menu button.
UIMenuList myMenu = new UIMenuList();

// Add two text items to myMenu.
c1 = myMenu.add("Item 1");
c2 = myMenu.add("Item 2");

// Add a UIMenuItem object to myMenu.
{
  // Construct the pop-up menu for the UIMenuItem
  // object and add a text item to the menu.
  UIMenuList mySubMenu = new UIMenuList();
  c3 = mySubMenu.add("Sub Item 1");

  // Construct the UIMenuItem object, using mySubMenu.
  UIMenuItem myItem = new UIMenuItem("Item 3", mySubMenu);

  // Add myItem to myMenu.
  myMenu.add(myItem);
}

// Now construct the menu button, using myMenu.
UIMenuButton myButton = new UIMenuButton("Menu 1", myMenu);

// Construct the menu bar and add the menu button.
myMenuBar = new UIBand();
myMenuBar.add(myButton);
add(myMenuBar);  // Add the menu bar to the container.

When an item in the pop-up menu is selected, an action event is generated. The following example shows how to use the action method to trap this event.

public boolean action(Event e, Object arg)
{
   if (e.target == myButton)
   {
      if (arg == c1)
      {
         // Do something.
         return true;
      }
      else if (arg == c2)
      {
         // Do something.
         return true;
      }
      else if (arg == c3)
      {
         // Do something.
         return true;
      }
   }
   return false;
}

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIMenuLauncher

Constructors

UIMenuLauncher

public UIMenuLauncher(UIMenuList menu);

Creates a menu launcher control with the specified menu. The control itself has no content.

Parameter | Description
menu | The UIMenuList object containing the content of the associated pop-up menu.

UIMenuLauncher

public UIMenuLauncher(IUIComponent comp);

Creates a menu launcher control with the specified component. The control has no associated menu.

Parameter | Description
comp | The component to be displayed within the control.

UIMenuLauncher

public UIMenuLauncher(IUIComponent comp, UIMenuList menu);

Creates a menu launcher control with the specified component and menu.

Parameter | Description
comp | The component to be displayed within the control.
menu | The UIMenuList object containing the content of the associated pop-up menu.

Methods

cancel

public void cancel();

Cancels the control's associated pop-up menu.

Return Value:

No return value.

Remarks:

This method implements cancel in the IUIMenuLauncher interface. If the pop-up menu is currently launched, this method terminates the launch and closes the pop-up menu.

See Also: launch

ended

public void ended(Event event);

Called by the control's associated pop-up menu once the menu is closed (either by selecting an item or cancelling menu mode).

Return Value:

No return value.

Parameter | Description
event | The event that will be fired by the caller after end is complete; null if no event will be fired.

Remarks:

This method implements selected in the IUIMenuLauncher interface by resetting its state.

fitToScreen

public Rectangle fitToScreen(Rectangle exclude, Dimension size,
        boolean right);

Determines where the pop-up menu will be displayed on the screen.

Return Value:

Returns the bounding rectangle (in screen coordinates) of the pop-up menu.

Parameter | Description
exclude | The rectangle identifying where the pop-up menu will be displayed when it is launched. The menu will not obscure this rectangle.
size | The preferred size (in pixels) of the pop-up menu.
right | If true, the pop-up menu will be displayed to the right of the exclude rectangle; otherwise, the pop-up menu will be displayed below this rectangle.

Remarks:

This method is called by getPlacement.

getDisplayer

public IUIContainer getDisplayer();

Retrieves the displayer for the pop-up menu associated with the menu launcher control. By default, this is null.

Note Any displayer must have a UIMenuLauncher menu as a child.

Return Value:

Returns the displayer object for the pop-up menu.

getMenu

public UIMenuList getMenu();

Retrieves the pop-up menu associated with the menu launcher control.

Return Value:

Returns the UIMenuList object containing the menu's content.

Remarks:

This method implements getMenu in the IUIMenuLauncher interface.

See Also: setMenu

getPlacement

public Rectangle getPlacement(Dimension size);

Called by the control's pop-up menu when the menu is to be displayed.

Return Value:

Returns the bounding rectangle (in screen coordinates) of the pop-up menu.

Parameter | Description
size | The preferred size (in pixels) of the pop-up menu.

Remarks:

This method implements getPlacement in the IUIMenuLauncher interface, and calls fitToScreen to determine where the pop-up menu will be displayed. By default, the menu is positioned to the right of the menu launcher control.

See Also: launch

isLaunched

public boolean isLaunched();

Determines the launched state of the control's associated pop-up menu.

Return Value:

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

Remarks:

This method implements isLaunched in the IUIMenuLauncher interface. The launch method sets the pop-up menu's launched state The ended method clears it.

launch

public boolean launch();

Launches the control's associated pop-up menu.

Return Value:

Returns true if the pop-up menu was launched; otherwise, returns false.

Remarks:

This method implements launch in the IUIMenuLauncher interface. launch sets the pop-up menu's launched state and invokes getPlacement to display the menu. Any previously launched menu is cancelled.

See Also: cancel, isLaunched

postEvent

public boolean postEvent(Event e);

Posts the specified event.

Return Value:

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

Parameter | Description
e | The event.

raiseEvent

public void raiseEvent(Event e);

Called by the object's pop-up menu when an event occurs.

Return Value:

No return value.

Parameter | Description
e | The event that occurred.

setFocused

public void setFocused(boolean on);

Sets or clears the focus state of the menu launcher control.

Return Value:

No return value.

Parameter | Description
on | If true, the focus state is set; otherwise, it is cleared.

Remarks:

This method also sets or clears the focus state of the control's content component.

Overrides:

setFocused(boolean) in UISingleContainer.

setHot

public void setHot(boolean on);

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

Return Value:

No return value.

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

Remarks:

This method also sets or clears the hot-tracked state of the control's content component.

setMenu

public void setMenu(UIMenuList menu);

Sets the pop-up menu to be associated with the menu launcher control.

Return Value:

No return value.

Parameter | Description
menu | The UIMenuList object containing the menu's content.

Remarks:

This method implements setMenu in the IUIMenuLauncher interface.

See Also: getMenu

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the menu launcher control.

Return Value:

No return value.

Parameter | Description
on | If true, the selected state is set; otherwise, it is cleared.

Remarks:

This method also sets or clears the selected state of the control's content component.


Class UIMenuList

public class UIMenuList extends UIList
{
  // Constructors
  public UIMenuList();
  public UIMenuList(int layoutStyle);

  // Methods
  public boolean action(Event e, Object o);
  public IUIMenuLauncher getMenuLauncher();
  public boolean gotFocus(Event e, Object o);
  public boolean keyDown(Event e, int key);
  public boolean lostFocus(Event e, Object o);
  public boolean mouseClicked(Event e, int x, int y);
  public boolean mouseEnter(Event e, int x, int y);
  public void requestFocus();
  public void setMenuLauncher(IUIMenuLauncher ml);
}

This class implements a menu list control. Typically, a UIMenuList object is used for the content of a pop-up menu, and is associated with a UIMenuButton control, a UIMenuItem control, or a UIContextMenu control.

A UIMenuList object is empty when it is first created. Using the add method, you can then insert items into the menu list.

Note To insert a separator bar, pass a UILine object to add. The following example shows how to add string items and a separator bar to a menu list.

UIBand menuBar;
UIMenuButton fileButton;

// Create a menu list control.
UIMenuList fileMenu = new UIMenuList();

// Create an array of strings and add each item to the menu.
String fileOptions[] = {"New", "Open", "Close", "Save"};
for (int i=0; i<4; i++)
   fileMenu.add(fileOptions[i]);

// Add a separator bar using a UILine object.
// Add a final string after the separator.
fileMenu.add(new UILine());
fileMenu.add("Print");

// Now create the menu button that uses fileMenu
// for its associated pop-up menu.
fileButton = new UIMenuButton("File", fileMenu);

// Create the menu bar and add the menu button.
menuBar = new UIBand();
add(menuBar);  // Add the menu bar to the container.
menuBar.add(fileButton);

When the mouse enters a menu item component, its selected state is set and a list select event is generated. When an item is clicked, an action event is generated.

For more information about using UIMenuList objects, see the UIMenuLauncher overview.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UISelector
          |
          +--UIList
            |
            +--UIMenuList

Constructors

UIMenuList

public UIMenuList();

Creates an empty menu list control.

Remarks:

Call the add method (inherited through UIList) to add items to the list. By default, the control's selection mode is SINGLESELECT, and the layout style is FILL.

UIMenuList

public UIMenuList(int layoutStyle);

Creates an empty menu list control with the specified layout style.

Parameter | Description
layoutStyle | The layout style of the control. Possible values include UIVerticalFlowLayout.MULTICOLUMN, UIVerticalFlowLayout.FILL, or a bitwise combination of the two. (FILL extends the width of an item to the width of the list control. This allows the item to be selected even when the area outside its text label is clicked.) Specify 0 for a single-column list with no fill.

Remarks:

Call the add method (inherited through UIList) to add items to the list. By default, the control's selection mode is SINGLESELECT.

Exceptions:

IllegalArgumentException if an undefined layout style was specified.

Methods

action

public boolean action(Event e, Object o);

Updates the choice control to display the currently selected item.

Return Value:

Returns false.

Parameter | Description
e | The event posted to the control.
o | The object that posted the event.

Remarks:

An action event is generated when an item in the control's pop-up list is selected, and the pop-up is closed.

getMenuLauncher

public IUIMenuLauncher getMenuLauncher();

Retrieves the current menu launcher.

Return Value:

Returns the current menu launcher.

See Also: setMenuLauncher

gotFocus

public boolean gotFocus(Event e, Object o);

Responds to the control receiving input focus.

Return Value:

Returns false.

Parameter | Description
e | The event posted to the control.
o | The object that posted the event (typically, null).

Remarks:

gotFocus calls UIContainer.gotFocus.

keyDown

public boolean keyDown(Event e, int key);

Determines whether the DOWN ARROW key is being pressed, and if so, launches the associated menu.

Return Value:

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

Parameter | Description
e | The event posted to the button.
key | The key that has been pressed.

See Also: launch

lostFocus

public boolean lostFocus(Event e, Object o);

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

Return Value:

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

Parameter | Description
e | The event posted to the control.
o | The object that posted the event (typically, null).

mouseClicked

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

Generates an action event if the mouse button is released over an item that is not a menu launcher object.

Return Value:

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

Parameter | Description
e | The event posted to the menu list control.
x | The x coordinate of the event.
y | The y coordinate of the event.

mouseEnter

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

Sets the selected state of the item at the mouse's current location. A list select event is generated.

Return Value:

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

Parameter | Description
e | The event posted to the menu list control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

If the menu item has an associated pop-up menu, its menu is launched.

requestFocus

public void requestFocus();

Requests that the first component associated with the menu list receive focus.

Return Value:

No return value.

setMenuLauncher

public void setMenuLauncher(IUIMenuLauncher ml);

Sets the current UIMenuLauncher to the value passed in. This is a one-to-one relationship—you cannot assign a UIMenuList to more than one menu launcher at a time.

Return Value:

No return value.

Parameter | Description
ml | The new UIMenuLauncher.

See Also: getMenuLauncher


Class UIMessageBox

public class UIMessageBox extends UIDialog implements
            TimerListener
{
  // Fields
  public final static int CENTER;
  public final static int EXCLAMATION;
  public final static int INFORMATION;
  public final static int LEFT;
  public final static int QUESTION;
  public final static int RIGHT;
  public final static int STOP;

  // Constructors
  public UIMessageBox(UIFrame frame);
  public UIMessageBox(UIFrame frame, String Title, String Text, int
        image, int buttonSet);
  public UIMessageBox(UIFrame frame, String Title, String Text,
        Image image, UIButtonBar buttons);
  public UIMessageBox(UIFrame frame, String Title, String Text,
        Image Image, UIButtonBar Buttons, int Alignment,
        int Default );

  // Methods
  public boolean action(Event e, Object o);
  public void addNotify();
  public Object doModal();
  public int doModalIndex();
  public int getButtonAlignment();
  public UIButtonBar getButtons();
  public int getDefaultButton();
  public UIFrame getFrame();
  public Image getImage();
  public Insets getInsets();
  public Dimension getPreferredSize();
  public String getText();
  public int getTimeout();
  public Insets insets();
  public boolean keyDown(Event e, int key);
  public boolean keyUp(Event e, int key);
  public Dimension preferredSize();
  public void setButtonAlignment(int Align);
  public void setButtons(UIButtonBar buttons);
  public UIButtonBar setButtons(String buttons, int style);
  public void setDefaultButton(int i);
  public void setImage(int image);
  public void setImage(Image i);
  public void setText(String text);
  public void setTimeout(int time);
  public void timeTriggered(TimerEvent e);
}

This class implements a message box window. UIMessageBox enables you to generate message boxes that conform to Windows guidelines or create custom message boxes using several types of button alignments, custom buttons, and imported images. A set of predefined buttons and standard system images are supplied to make basic message box construction simple and efficient. Message boxes may only be modal.

The following example shows how to construct multiple types of message boxes:

// Construct a generic message box with the title
//"Image File Read Error", a message that informs the user
// that the file could not be opened, and an appropriate
// system-defined image.
String message = "The image file was not found,
                    or cannot be opened.";
UIMessageBox fileNotFound = new UIMessageBox(parentFrame,
                      "File Not Found", message, UIMessageBox.STOP,
                       UIButtonBar.RETRYCANCEL);

// Construct a message box with custom image, two buttons, and
// LEFT button alignment.
String message2 = "VirusScan found no viruses or Trojan Horses on
                   this disk. Would you like to scan another?";

UIButtonBar VirScanButns = new UIButtonBar("Scan Another Disk,Exit",
                                           ",",
                                           UIPushButton.RAISED);

UIMessageBox ScanMe = new UIMessageBox (parentFrame,
                                        "VirusScan Ver 1.00",
                                         message2, VirScanImg,
                                         VirScanButns,
                                         UIMessageBox.RIGHT, -1);

// You can also construct an initially empty message box and
// populate it using the setText, setImage, setButtons,
// and setButtonAlignment methods.
UIMessageBox myEmptyBox = new UIMessageBox(parentFrame);

// Call the Dialog class setTitle method.
myEmptyBox.setTitle("DiskCopy");

// Set the message that is displayed by the message box.
myEmptyBox.setText("Copy complete.");

// Use a pre-defined image for the message box.
myEmptyBox.setImage(UIMessageBox.INFORMATION);

// Because this is an information box, we need only
// supply an OK button for the end user.
myEmptyBox.setButtons(new UIButtonBar("OK",
                                  UIPushButton.RAISED));

// Set the button so that it is aligned in the center of
// the message box.
myEmptyBox.setButtonAlignment(UIMessageBox.CENTER);

UIMessageBox objects may be automatically dismissed when associated with a timer. Use the setTimeout method to set the length of time the message box should be displayed and call the doModal method as you normally would. The following example shows you how to set a timed modal message box.

// The myEmptyBox message box created in the previous example
// can be used as a timed, informative message box that requires
// no end user interaction. The message box is still constructed
// in the same way, but it will be displayed for 3 seconds, and then
// automatically  destroyed when the timeTriggered
// method is called.
myEmptyBox.setTimeout(3000);

myEmptyBox.doModal();

The com.ms.fx package provides classes that manage the system images and fonts typically used in message and dialog boxes, as well as four standard system images in .gif file format. See the FxSystemIcon and FxSystemFont classes for more information.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow
            |
            +--UIDialog
              |
              +--UIMessageBox

Constructors

UIMessageBox

public UIMessageBox(UIFrame frame);

Creates a message box with no title, text, image, or buttons. By default, the message box is center aligned.

Parameter | Description
frame | The parent container to attach the message box to.

UIMessageBox

public UIMessageBox(UIFrame frame, String Title, String Text, int image,
        int buttonSet);

Creates a message box with specified title, text, pre-defined image, and buttons. By default, the message box is center aligned.

Parameter | Description
frame | The parent container to attach the message box to.
Title | The title of the message box.
Text | The message that is displayed in the message box.
image An index to one of 4 default images or zero. The images may be one of the following:
STOP
QUESTION
EXCLAMATION
INFORMATION
buttonSet | One of the predefined sets of buttons in UIButtonBar.

UIMessageBox

public UIMessageBox(UIFrame frame, String Title, String Text, Image image,
        UIButtonBar buttons);

Creates a message box with specified title, text, image, and buttons. By default, the message box is center aligned. This constructor enables you to use custom images for your message boxes and sets of UIPushButton objects wrapped by a UIButtonBar object.

Parameter | Description
frame | The parent container to attach the message box to.
Title | The title of the message box.
Text | The message that is displayed in the message box.
image | The imported image displayed to the left of the text in the message box.
buttons | A UIButtonBar object that contains the buttons for the message box.

UIMessageBox

public UIMessageBox(UIFrame frame, String Title, String Text, Image Image,
        UIButtonBar Buttons, int Alignment, int Default );

Creates a message box with the specified title, text, imported image, buttons, and alignment. You can also specify a default button with this constructor.

Parameter | Description
frame | The parent container to attach the message box to.
Title | The title of the message box.
Text | The message that is displayed in the message box.
Image | The imported image displayed to the left of the text in the message box.
Buttons | A UIButtonBar object that contains the buttons for the message box.
Alignment | The alignment of the buttons in the message box. By default this is CENTER, but it may also be LEFT or RIGHT.
Default | A specified default button or -1 for no default.

Methods

action

public boolean action(Event e, Object o);

Performs operations depending on which button inside the message box was pushed.

Note When cancelling the dialog, the method calls UIDialog.dispose.

Return Value:

Returns true if the action was successfully executed; otherwise, returns false.

Parameter | Description
e | The event, such as a KEY_RELEASE or MOUSE_UP, generated within the message box.
o | The button that was pushed.

addNotify

public void addNotify();

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

Return Value:

No return value.

Remarks:

This method initializes the font of the message box. The font's style is set to PLAIN, and the size is set to 8 points. addNotify also adds the button bar, image, and text components to the message box.

doModal

public Object doModal();

Displays the message box as a modal message box and retrieves the button that is pressed. The message box can also be automatically destroyed by using an associated timer.

Return Value:

Returns the pressed button. Use the getID method to retrieve the button's identifier and compare that to the UIButtonBar used to construct the message box.

Remarks:

A modal message box requires the user to interact with the message box before continuing in any other of the application's windows.

See Also: setTimeout, getTimeout, timeTriggered

doModalIndex

public int doModalIndex();

Displays the message box as a modal message box and retrieves the index of the button that is pressed.

Return Value:

Returns the index of the pressed button; returns -1 if the message box is cancelled.

Remarks:

A modal message box requires the user to interact with the message box before continuing in any other of the application's windows.

getButtonAlignment

public int getButtonAlignment();

Retrieves the current alignment of the buttons in the message box.

Return Value:

Returns either a CENTER, LEFT, or RIGHT alignment flag.

Remarks:

This method is used when the default UIMessageBox constructor has been called and no buttons have been added to the message box.

See Also: setButtonAlignment

getButtons

public UIButtonBar getButtons();

Retrieves the UIButtonBar object that contains the buttons for the message box.

Return Value:

Returns the UIButtonBar object that contains the buttons for the message box.

See Also: setButtons

getDefaultButton

public int getDefaultButton();

Retrieves the index of the UIButtonBar object that is used for default buttons in message boxes.

Return Value:

Returns the index of the UIButtonBar object that is set as the default button.

getFrame

public UIFrame getFrame();

Retrieves the parent container associated with the message box.

Return Value:

Returns a UIFrame object that is the parent for the message box.

getImage

public Image getImage();

Retrieves the image displayed in the message box.

Return Value:

Returns the Image displayed in the message box. Returns null if no image is associated with the message box.

getInsets

public Insets getInsets();

Retrieves the insets of the message box.

Return Value:

Returns an object containing the insets for the message box.

See Also: insets

getPreferredSize

public Dimension getPreferredSize();

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

Return Value:

Returns a Dimension object with a width and height of 0 pixels.

getText

public String getText();

Retrieves the text that the message box displays.

Return Value:

Returns a String buffer that contains the message displayed in the message box.

See Also: setText

getTimeout

public int getTimeout();

Retrieves the length of time that the message box is displayed, when associated with a timer.

Return Value:

Returns the length of time that the message box is displayed.

See Also: setTimeout, timeTriggered

insets

public Insets insets();

Determines the insets of the message box.

Return Value:

Returns the Insets object containing the insets.

keyDown

public boolean keyDown(Event e, int key);

Responds to a key being pressed when the message box has focus.

Return Value:

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

Parameter | Description
e | The event posted to the message box.
key | The key that has been pressed.

Remarks:

This method checks for the ENTER or SPACEBAR keys, which indicate a button has been depressed (a choice may be made). The method similarly responds to the ESCAPE key. Otherwise, the superclass handles the keyDown method.

Overrides:

keyDown(Event,int) in UIDialog.

keyUp

public boolean keyUp(Event e, int key);

Responds to a key being released when the message box has focus.

Return Value:

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

Parameter | Description
e | The event posted to the message box.
key | The key that has been released.

Remarks:

This method checks for the ENTER and SPACEBAR keys, which indicate a button has been pressed and released, and closes the window. The ESCAPE key closes the window if the message box is not a modal message box and a choice does not need to be made. Otherwise, the superclass handles the keyUp method.

Overrides:

keyUp(Event,int) in UIDialog.

preferredSize

public Dimension preferredSize();

Calculates the minimum size of a message box. The minimum size is limited to one-sixth the screen width.

Return Value:

Returns a Dimension object containing the preferred size, in pixels.

setButtonAlignment

public void setButtonAlignment(int Align);

Sets the button alignment in the message box.

Return Value:

No return value.

Parameter | Description
Align | The button alignment. Possible values include CENTER, LEFT, or RIGHT.

Remarks:

This method is used when the default UIMessageBox constructor has been called and no buttons have been added to the message box.

See Also: getButtonAlignment

setButtons

public void setButtons(UIButtonBar buttons);

Sets the buttons that are displayed at the bottom of the message box.

Return Value:

No return value.

Parameter | Description
buttons | The buttons that are displayed.

Remarks:

This method is used when the default UIMessageBox constructor has been called and no buttons have been added to the message box.

setButtons

public UIButtonBar setButtons(String buttons, int style);

Sets the button that is displayed at the bottom of the message box using a string for the button name.

Return Value:

Returns a UIButtonBar with a button of the given name.

Parameter | Description
buttons | The name of the button.
style | The button's style. This may be either FLAT or RAISED.

Remarks:

This method is used when the default UIMessageBox constructor has been called and no buttons have been added to the message box.

setDefaultButton

public void setDefaultButton(int i);

Sets the given UIButtonBar index as the default buttons created with a message box.

Return Value:

No return value.

Parameter | Description
i | The index of the button associated with the UIButtonBar. Set this parameter to -1 if you don't want to set a default button for the UIButtonBar.

setImage

public void setImage(int image);

Sets the image that is displayed to the left of the message box as one of four predefined types.

Return Value:

No return value.

Parameter Description
image The image to use in the message box. This may be one of the following images:
STOP
QUESTION
EXCLAMATION
INFORMATION

setImage

public void setImage(Image i);

Sets the image that is displayed to the left of the message box.

Return Value:

No return value.

Parameter | Description
i | The imported image to use in the message box.

Remarks:

This method is used when the default UIMessageBox constructor has been called and no buttons have been added to the message box.

setText

public void setText(String text);

Sets the message that the message box displays.

Return Value:

No return value.

Parameter | Description
text | The text in the message box.

Remarks:

This method is used when the default UIMessageBox constructor has been called and no buttons have been added to the message box.

See Also: getText

setTimeout

public void setTimeout(int time);

Sets a timer used to display the message box for a certain amount of time.

Return Value:

No return value.

Parameter | Description
time | The amount of time that the message box is displayed (in milliseconds).

See Also: getTimeout, timeTriggered

timeTriggered

public void timeTriggered(TimerEvent e);

Posts a window destroy event to the message box object.

Return Value:

No return value.

Parameter | Description
e | A TimerEvent object that is timing the message box.

Remarks:

This method implements timeTriggered in the TimerListener interface.

Note if you extend your own class from UIMessageBox and implement the TimerListener interface, be sure to call the super method TimerListener(event).

See Also: setTimeout, getTimeout, com.ms.util.TimerListener

Fields

CENTER
The buttons are centered in the message box.
EXCLAMATION
The image used in message boxes when a warning message is displayed.
INFORMATION
The image used in message boxes when an information message is displayed.
LEFT
The buttons are aligned on the left side of the message box.
QUESTION
The image used to query a user. This image is no longer commonly used on the Microsoft® Win32® platform.
RIGHT
The buttons are aligned on the right side of the message box.
STOP
The image used in message boxes when a critical message is displayed.


Class UIPanel

public class UIPanel extends UIStateContainer
{
  // Constructors
  public UIPanel();
  public UIPanel(int edge);

  // Methods
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public IUIComponent getChild(int index);
  public Rectangle getChildBounds(IUIComponent child);
  public Rectangle getChildBounds(int index);
  public int getChildCount();
  public Point getChildLocation(IUIComponent child);
  public Point getChildLocation(int index);
  public Dimension getChildSize(IUIComponent child);
  public Dimension getChildSize(int index);
  public IUIComponent getComponent(int index);
  public int getComponentCount();
  public IUIComponent getHeader();
  public int getID();
  public IUILayoutManager getLayout();
  public String getName();
  public int getRoleCode();
  public boolean move(IUIComponent comp, IUIComponent before);
  public boolean move(int from, int to);
  public void paintAll(FxGraphics g);
  public void remove(int index);
  public void setChildBounds(IUIComponent child, int x, int y,
        int width, int height);
  public void setChildBounds(int index, int x, int y, int width,
        int height);
  public void setChildBounds(int index, Rectangle rect);
  public void setChildLocation(IUIComponent child, int x, int y);
  public void setChildLocation(int index, int x, int y);
  public void setChildLocation(int index, Point point);
  public void setChildSize(IUIComponent child, int width,
        int height);
  public void setChildSize(int index, int width, int height);
  public void setChildSize(int index, Dimension size);
  public void setHeader(IUIComponent header);
  public void setID(int id);
  public void setLayout(IUILayoutManager lm);
  public void setName(String name);
  public void setRedrawing(boolean on);
}

This class implements a container for multiple components. A UIPanel object can contain both child items and a header component, where the header represents the container itself. For example, a tree control's header component is the item displayed by the tree node itself; items displayed below the node are child items. Many UIPanel containers, however, do not have a header component (such as a list control). Other types of containers, specifically UISingleContainer objects, contain only a header component and no child components. For example, the text displayed on a button is its header; however, the button has no children.

UIPanel provides the getHeader and setHeader methods to retrieve and set the current header component. You can insert child components with add.

Note The preferred width of a sub-class of UIPanel does not include the preferred width of the sub-classes's header text. This is similar to a top level window's preferred width not including the preferred width of the window's caption text. Hence, when the largest component in a UIPanel shrinks, the UIPanel also shrinks.

The following diagram shows the classes that extend UIPanel.

UIPanel
|
+--UIChoice
|
+--UIGroup
|
+--UIRoot
|
+--UIRow
|
+--UIScroll
|
+--UIScrollViewer
|
+--UISelector
|
+--UISplitViewer
|
+--UITabViewer
|
+--UIViewer

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel

Constructors

UIPanel

public UIPanel();

Creates a UIPanel container with no edge.

Remarks:

By default, the container uses UIFlowLayout for its layout manager.

UIPanel

public UIPanel(int edge);

Creates a UIPanel container with the specified edge.

Parameter Description
edge The style of the panel's edge. You can pass one of the following values.
  • IFxGraphicsConstants.BDR_RAISED
  • IFxGraphicsConstants.BDR_SUNKEN
  • IFxGraphicsConstants.BDR_OUTER
  • IFxGraphicsConstants.BDR_INNER
  • IFxGraphicsConstants.BDR_RAISEDOUTER
  • IFxGraphicsConstants.BDR_RAISEDINNER
  • IFxGraphicsConstants.BDR_SUNKENOUTER
  • IFxGraphicsConstants.BDR_SUNKENINNER
  • IFxGraphicsConstants.BDR_FLAT
  • IFxGraphicsConstants.EDGE_RAISED
  • IFxGraphicsConstants.EDGE_SUNKEN
  • IFxGraphicsConstants.EDGE_ETCHED
  • IFxGraphicsConstants.EDGE_BUMP
  • 0 (No edge style)

Remarks:

By default, the panel uses UIFlowLayout for its layout manager.

Exceptions:

IllegalArgumentException if an undefined edge style was specified.

Methods

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds the specified component to the panel, according to the specified constraints and index.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints, which depend on the current layout manager. For more information about possible values, see the layout manager's addLayoutComponent method.
index | The zero-based index at which to insert the component. If the panel has a header component, the header is at index 0, and the first child begins at index 1. Otherwise, the first child begins at index 0. To add the component at the end of the panel, pass -1. (For more information about headers, see the UIPanel overview.)

Remarks:

Other versions of add are inherited from UIContainer.

Overrides:

add(IUIComponent,Object,int) in UIStateContainer.

Exceptions:

ArrayIndexOutOfBoundsException if an invalid index was specified.

See Also: remove

getChild

public IUIComponent getChild(int index);

Retrieves the child component at the specified index. The header component cannot be retrieved through getChild.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
index | The zero-based index of the component to be retrieved. Regardless of whether the panel has a header component, the first child component is at index 0.

Exceptions:

ArrayIndexOutOfBoundsException if an invalid index was specified.

See Also: getComponent, getChildCount

getChildBounds

public Rectangle getChildBounds(IUIComponent child);

Retrieves the bounding rectangle of the specified component.

Return Value:

Returns a Rectangle object identifying the component's bounding area, if successful; otherwise, returns null.

Parameter | Description
child | The component. Specify either the panel's header component or any child component.

See Also: setChildSize

getChildBounds

public Rectangle getChildBounds(int index);

Retrieves the bounding rectangle of the component at the specified index.

Return Value:

Returns a Rectangle object identifying the component's bounding area, if successful; otherwise, returns null.

Parameter | Description
index | The zero-based index of the component. If the panel has a header component, the header is at index 0 and the first child component begins at index 1. Otherwise, the first child begins at index 0.

Exceptions:

ArrayIndexOutOfBoundsException if an invalid index is used.

See Also: setChildBounds

getChildCount

public int getChildCount();

Retrieves the number of components in the panel, excluding the header component.

Return Value:

Returns the number of child components.

See Also: getComponentCount, getChild

getChildLocation

public Point getChildLocation(IUIComponent child);

Retrieves the location of the specified component.

Return Value:

Returns a Point object that contains the upper-left corner of the component, if successful; otherwise, returns null.

Parameter | Description
child | The component. Specify either the panel's header component or any child component.

See Also: setChildLocation

getChildLocation

public Point getChildLocation(int index);

Retrieves the location of the component at the specified index.

Return Value:

Returns a Point object that contains the upper-left corner of the component, if successful; otherwise, returns null.

Parameter | Description
index | The zero-based index of the component. If the panel has a header component, the header is at index 0 and the first child component begins at index 1. Otherwise, the first child begins at index 0.

Exceptions:

ArrayIndexOutOfBoundsException if the index is invalid.

See Also: setChildLocation

getChildSize

public Dimension getChildSize(IUIComponent child);

Retrieves the size (in pixels) of the specified component.

Return Value:

Returns a Dimension object that contains the component's dimensions, if successful; otherwise, returns null.

Parameter | Description
child | The component. Specify either the panel's header component or any child component.

Exceptions:

ArrayIndexOutOfBoundsException if an invalid index is used.

See Also: setChildSize

getChildSize

public Dimension getChildSize(int index);

Retrieves the size (in pixels) of the component at the specified index.

Return Value:

Returns a Dimension object containing the component's dimensions.

Parameter | Description
index | The zero-based index of the component. If the panel has a header component, the header is at index 0 and the first child component begins at index 1. Otherwise, the first child begins at index 0.

See Also: setChildSize

getComponent

public IUIComponent getComponent(int index);

Retrieves the component at the specified index in the panel.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
index | The zero-based index of the component to be retrieved. If the panel has a header component, the header is at index 0, and the first child begins at index 1. Otherwise, the first child begins at index 0.

Exceptions:

ArrayIndexOutOfBoundsException if an invalid index was specified.

See Also: getChild, getComponentCount

getComponentCount

public int getComponentCount();

Retrieves the number of components in the panel, including the header component.

Return Value:

Returns the total number of components.

See Also: getChildCount, getComponent

getHeader

public IUIComponent getHeader();

Retrieves the panel's header component.

Return Value:

Returns the current header component (if the panel has a header); otherwise, returns null. For more information about headers, see the UIPanel overview.

See Also: setHeader

getID

public int getID();

Retrieves the panel's identifier.

Return Value:

Returns the integer associated with the panel.

See Also: setID, getName

getLayout

public IUILayoutManager getLayout();

Retrieves the layout manager of the panel.

Return Value:

Returns the current layout manager (if the panel has a layout manager); otherwise, returns null.

See Also: setLayout

getName

public String getName();

Retrieves the panel's name.

Return Value:

Returns the String that displays the panel's associated name.

See Also: setName, getID

getRoleCode

public int getRoleCode();

Retrieves the panel's Microsoft® Active Accessibility™ role code.

Return Value:

Returns the ROLE_SYSTEM_PANE role code.

move

public boolean move(IUIComponent comp, IUIComponent before);

Moves a component in the panel in front of the specified component.

Return Value:

Returns true if the component was moved successfully; otherwise, returns false.

Parameter | Description
comp | The component to move.
before | The component identifying the position that comp will be placed in front of. If null, comp is placed at the end of the panel.

Remarks:

The parameters comp and before can be either a child component or the header component.

Exceptions:

IllegalArgumentException if either comp or before is not an immediate child of the panel.

move

public boolean move(int from, int to);

Moves a component in the panel, according to the specified indices.

Return Value:

Returns true if the component was moved successfully; otherwise, returns false.

Parameter | Description
from | The zero-based index of the component to move.
to | The zero-based index of the position that the component will be placed in front of. To move the component to the end of the panel, pass -1.

Remarks:

If the panel has a header component, the header is at index 0 and the first child begins at index 1. Otherwise, the first child begins at index 0.

Exceptions:

IllegalArgumentException if an invalid index was specified.

paintAll

public void paintAll(FxGraphics g);

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

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

If the panel's redrawing state is set, this method draws the panel and its child components. If the redrawing state is cleared, paintAll adds the clipping region to the invalid region.

See Also: setRedrawing

remove

public void remove(int index);

Removes the component at the specified index from the panel.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component to be removed. If the panel has a header component, the header is at index 0 and the first child begins at index 1. Otherwise, the first child begins at index 0.

Overrides:

remove(int) in UIStateContainer.

setChildBounds

public void setChildBounds(IUIComponent child, int x, int y, int width, int
        height);

Sets the bounds of the specified component, according to the specified coordinates and dimensions.

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the panel's header component or any child component.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.
width | The width for the component (in pixels).
height | The height for the component (in pixels).

See Also: getChildBounds

setChildBounds

public void setChildBounds(int index, int x, int y, int width, int height);

Sets the bounds of the component at the specified index, according to the specified coordinates and dimensions.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the panel has a header component, the header is at index 0 and the first child component begins at index 1. Otherwise, the first child begins at index 0.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.
width | The width for the component (in pixels).
height | The height for the component (in pixels).

See Also: getChildBounds

setChildBounds

public void setChildBounds(int index, Rectangle rect);

Sets the bounds of the component at the specified index, according to the specified Rectangle object.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the panel has a header component, the header is at index 0 and the first child component begins at index 1. Otherwise, the first child begins at index 0.
rect | The bounding rectangle for the component.

See Also: getChildBounds

setChildLocation

public void setChildLocation(IUIComponent child, int x, int y);

Sets the location of the specified component, according to the specified coordinates.

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the panel's header component or any child component.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.

See Also: getChildLocation

setChildLocation

public void setChildLocation(int index, int x, int y);

Sets the location of the component at the specified index, according to the specified coordinates.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the panel has a header component, the header is at index 0 and the first child component begins at index 1. Otherwise, the first child begins at index 0.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.

See Also: getChildLocation

setChildLocation

public void setChildLocation(int index, Point point);

Sets the location of the component at the specified index, according to the specified Point object.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the panel has a header component, the header is at index 0 and the first child component begins at index 1. Otherwise, the first child begins at index 0.
point | The upper-left corner of the component.

See Also: getChildLocation

setChildSize

public void setChildSize(IUIComponent child, int width, int height);

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

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the panel's header component or any child component.
width | The width for the component (in pixels).
height | The height for the component (in pixels).

See Also: getChildSize

setChildSize

public void setChildSize(int index, int width, int height);

Sets the size of the component at the specified index, according to the specified dimensions.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the panel has a header component, the header is at index 0 and the first child component begins at index 1. Otherwise, the first child begins at index 0.
width | The width for the component (in pixels).
height | The height for the component (in pixels).

See Also: getChildSize

setChildSize

public void setChildSize(int index, Dimension size);

Sets the size of the component at the specified index, according to the specified Dimension object.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the panel has a header component, the header is at index 0 and the first child component begins at index 1. Otherwise, the first child begins at index 0.
size | The dimensions for the component.

See Also: getChildSize

setHeader

public void setHeader(IUIComponent header);

Sets the header component for the panel.

Return Value:

No return value.

Parameter | Description
header | The component to be used as the panel's header component. For more information about headers, see the UIPanel overview.

See Also: getHeader

setID

public void setID(int id);

Sets the panel's identifier.

Return Value:

No return value.

Parameter | Description
id | The value to be associated with the panel.

See Also: getID, setName

setLayout

public void setLayout(IUILayoutManager lm);

Sets the layout manager of the panel.

Return Value:

No return value.

Parameter | Description
lm | The new layout manager of the panel.

Remarks:

This method invalidates the panel. When the panel is later validated, the new layout manager will compute the panel's size and lay out its components.

See Also: getLayout

setName

public void setName(String name);

Sets the panel's name.

Return Value:

No return value.

Parameter | Description
name | The name to be associated with the panel.

See Also: getName, setID

setRedrawing

public void setRedrawing(boolean on);

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

Return Value:

No return value.

Parameter | Description
on | If true, the redrawing state is set; otherwise, it is cleared.

Remarks:

If the on parameter is true, this method paints any invalid region.

Note To retrieve the current drawing state of the panel, call isRedrawing (inherited through UIStateContainer).

Overrides:

setRedrawing(boolean) in UIStateContainer.

See Also: paintAll


Class UIProgress

public class UIProgress extends UIStatus
{
  // Constructors
  public UIProgress();
  public UIProgress(int range);
  public UIProgress(int range, int pos);

  // Methods
  public int getPos();
  public int getRange();
  public int getRoleCode();
  public void paint(FxGraphics g);
  public void setPos(int pos);
  public void setRange(int range);
  public void update(FxGraphics g);
}

This class implements a progress monitoring control.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIStatus
          |
          +--UIProgress

Constructors

UIProgress

public UIProgress();

Creates a progress control.

Remarks:

By default, the control has a range from 0 to 100. The control's initial position is set to 0.

UIProgress

public UIProgress(int range);

Creates a progress control with the specified range and an initial position of 0.

Parameter | Description
range | The maximum range value of the control. The control's range is from 0 to range.

UIProgress

public UIProgress(int range, int pos);

Creates a progress control with the specified range and initial position.

Parameter | Description
range | The maximum range value of the control. The control's range is from 0 to range.
pos | The initial position of the progress control.

Methods

getPos

public int getPos();

Retrieves the position of the progress control within its range.

Return Value:

Returns the control's current position.

getRange

public int getRange();

Retrieves the range of the progress control.

Return Value:

Returns the maximum value in the control's range.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the progress control.

Return Value:

Returns the ROLE_SYSTEM_PROGRESSBAR code.

Overrides:

getRoleCode() in UIStatus.

paint

public void paint(FxGraphics g);

Draws the progress control.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

setPos

public void setPos(int pos);

Sets the position of the progress control within its range.

Return Value:

No return value.

Parameter | Description
pos | The new position of the progress control.

setRange

public void setRange(int range);

Sets the range of the progress control.

Parameter | Description
range | The maximum range value of the control. The control's range is from 0 to range.

update

public void update(FxGraphics g);

Calls paint to draw the progress control.

Return Value:

No return value.

Parameter | Description
g | The graphics context.


Class UIPropertyDialog

public class UIPropertyDialog extends UIDialog
{
  // Fields
  public static final int CENTER;
  public static final int LARGE;
  public static final int LEFT;
  public static final int MEDIUM;
  public static final int RIGHT;
  public static final int SMALL;

  // Constructors
  public UIPropertyDialog(UIFrame frame, String title,
        boolean modal, int pageSize);
  public UIPropertyDialog(UIFrame frame, String title,
        boolean modal);

  // Methods
  public boolean action(Event e, Object o);
  public void addNotify();
  public void addPage(UIPanel comp);
  public void addPage(String name, IUIComponent comp);
  public Object display();
  public boolean doApplyAction(Event e, Object o);
  public boolean doCancelAction(Event e, Object o);
  public boolean doOKAction(Event e, Object o);
  public int getButtonAlignment();
  public Insets getInsets();
  public Dimension getPageDimension();
  public int getPageSize();
  public Insets insets();
  public boolean isApplyable();
  public void setApplyable(boolean apply);
  public void setButtonAlignment(int Align);
  public void setPageSize(int size);
}

This class implements a property dialog window. An UIPropertyDialog control contains a set of UIPropertyPage objects.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow
            |
            +--UIDialog
              |
              +--UIPropertyDialog

Constructors

UIPropertyDialog

public UIPropertyDialog(UIFrame frame, String title, boolean modal,
        int pageSize);

Creates an empty property dialog window.

Comments:To add a page to the dialog window, call addPage.

Note Clicking on the close window button will not close the window if the window is non-modal.

Parameter | Description
frame | The parent frame.
title | The title of the dialog window.
modal | If true, the dialog window is modal (meaning no other window can receive input while this window is visible); otherwise, the dialog window is modeless.
pageSize | The size of the pages in the dialog window. Possible values include SMALL, MEDIUM, and LARGE.

UIPropertyDialog

public UIPropertyDialog(UIFrame frame, String title, boolean modal);

Creates an empty property dialog window.

Comments:
By default, the size of the pages in the property dialog window are set to MEDIUM. To add a page to the dialog window, call addPage.

Note Clicking on the close window button will not close the window if the window is non-modal.

Parameter | Description
frame | The parent frame.
title | The title of the dialog window.
modal | If true, the dialog window is modal (meaning no other window can receive input while this window is visible); otherwise, the dialog window is modeless.

Methods

action

public boolean action(Event e, Object o);

Responds to the buttons in the property dialog window being clicked.

Comments:
Depending on the button that was clicked, action calls one of the following methods.

Button | Method called
OK | doOKAction
Cancel | doCancelAction
Apply | doApplyAction

Note When cancelling the dialog, the method calls UIDialog.dispose.

Return Value:

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

Parameter | Description
e | The event posted to the property dialog window.
o | The object that posted the event.

addNotify

public void addNotify();

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

Comments:This method adds OK, Cancel, and Apply buttons to the property dialog window.

Return Value:

No return value.

addPage

public void addPage(UIPanel comp);

Adds the specified panel to the property dialog window.

Return Value:

No return value.

Parameter | Description
comp | The UIPanel to add to the dialog box. The name of the page is retrieved from the getName method in the UIPanel class.

addPage

public void addPage(String name, IUIComponent comp);

Adds the specified page to the property dialog window.

Return Value:

No return value.

Parameter | Description
name | The name of the page.
comp | The page component to be added. Typically, you pass a UIPropertyPage object.

display

public Object display();

Displays the property dialog window and its pages.

Return Value:

Returns the button that was clicked; otherwise, returns null if the dialog window was cancelled.

doApplyAction

public boolean doApplyAction(Event e, Object o);

Responds to the Apply button being clicked.

Comments:
This method is invoked by action. If the Apply button can change the state of the application, this method calls the doApplyAction method for each page in the dialog window.

Return Value:

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

Parameter | Description
e | The event posted to the property dialog window.
o | The object that posted the event.

See Also: isApplyable

doCancelAction

public boolean doCancelAction(Event e, Object o);

Responds to the Cancel button being clicked.

Comments:
This method is invoked by action, and by default, simply returns true.

Return Value:

Returns true if the event was handled; otherwise, returns false. If this method returns false, the dialog was not dismissed.

Parameter | Description
e | The event posted to the property dialog window.
o | The object that posted the event.

doOKAction

public boolean doOKAction(Event e, Object o);

Responds to the OK button being clicked.

Comments:
This method is invoked by action and by default, calls doApplyAction. If this method returns false, the dialog is not dismissed. If a page returned false from doApplyAction, that page is selected.

Return Value:

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

Parameter | Description
e | The event posted to the property dialog window.
o | The object that posted the event.

getButtonAlignment

public int getButtonAlignment();

Retrieves the alignment of the buttons in the property dialog window.

Return Value:

Returns an integer identifying the button alignment. Possible values include LEFT, CENTER, and RIGHT.

See Also: setButtonAlignment

getInsets

public Insets getInsets();

Retrieves the insets of the property dialog box. This method performs the same function as the insets method.

Return Value:

Returns an Insets object containing the insets.

See Also: insets

getPageDimension

public Dimension getPageDimension();

Retrieves the dimensions of the pages in the property dialog window. Override this method to specify custom page sizes.

Return Value:

Returns the dimensions that correspond to the size of the pages (SMALL, MEDIUM, or LARGE).

See Also: getPageSize

getPageSize

public int getPageSize();

Retrieves the size of the pages in the property dialog window.

Return Value:

Returns an integer identifying the page size. Possible values include SMALL, MEDIUM, and LARGE.

See Also: setPageSize

insets

public Insets insets();

Retrieves the insets of the property dialog window. This method performs the same function as the getInsets method.

Return Value:

Returns an Insets object containing the insets.

See Also: getInsets

isApplyable

public boolean isApplyable();

Determines whether changes made to the property page by the user will be applied when the Apply button is pressed.

Return Value:

Returns true if the isApplyable method of any page in the dialog window returns true; otherwise, returns false.

See Also: setApplyable

setApplyable

public void setApplyable(boolean apply);

Sets the state of the Apply button.

Return Value:

No return value.

Parameter | Description
apply | If true, changes will be applied to the application when the Apply button is pressed; otherwise, changes will not be applied.

See Also: isApplyable

setButtonAlignment

public void setButtonAlignment(int Align);

Sets the alignment of the buttons in the property dialog window.

Return Value:

No return value.

Parameter | Description
Align | The button alignment. Possible values include LEFT, CENTER, and RIGHT.

See Also: getButtonAlignment

setPageSize

public void setPageSize(int size);

Sets the size of the pages in the property dialog window.

Return Value:

No return value.

Parameter | Description
size | The page size. Possible values include SMALL, MEDIUM, and LARGE.

See Also: getPageSize

Fields

CENTER
The buttons in the property dialog window are horizontally centered.
LARGE
The pages in the property dialog window have a width of 235 pixels and a height of 156 pixels.
LEFT
The buttons in the property dialog window are left-aligned.
MEDIUM
The pages in the property dialog window have a width of 210 pixels and a height of 154 pixels.
RIGHT
The buttons in the property dialog window are right-aligned.
SMALL
The pages in the property dialog window have a width of 195 pixels and a height of 127 pixels.


Class UIPropertyPage

public abstract class UIPropertyPage extends UIPanel
             implements IUIPropertyPage
{
  // Constructors
  public UIPropertyPage();
  public UIPropertyPage( UIPropertyDialog sheet);

  // Methods
  public void addAt( IUIComponent comp, int x, int y,
        Dimension dim);
  public void addAt( IUIComponent comp, int x, int y);
  abstract public boolean addContent();
  public boolean doApplyAction();
  public boolean doConstruct();
  public void doNotVisible();
  public void doVisible();
  public Insets getInsets();
  public UIPropertyDialog getSheet();
  public boolean isApplyable();
  public boolean isConstructed();
  public boolean isContentAdded();
  public void setApplyable(boolean apply);
  public void setConstructed(boolean b);
  public void setContentAdded(boolean b);
  public void setSheet(UIPropertyDialog sheet);
  public void setVisible(boolean vis);
}

This class implements an abstract property page. Typically, a UIPropertyPage object is contained in a UIPropertyDialog control.

To implement a property page, extend UIPropertyPage and override the addContent method.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIPropertyPage

Constructors

UIPropertyPage

public UIPropertyPage();

Creates a property page with no content.

Remarks:

To add components to the property page, call addAt.

UIPropertyPage

public UIPropertyPage( UIPropertyDialog sheet);

Creates a property page with no content. The page is contained in the specified dialog window.

Parameter | Description
sheet | The UIPropertyDialog object that will contain the property page.

Remarks:

To add components to the property page, call addAt.

Methods

addAt

public void addAt( IUIComponent comp, int x, int y, Dimension dim);

Adds a component to the property page using the specified coordinates and dimensions.

Return Value:

No return value.

Parameter | Description
comp | The component to be added.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.
dim | The height and width of the component (in pixels).

addAt

public void addAt( IUIComponent comp, int x, int y);

Adds a component to the property page using the specified coordinates.

Return Value:

No return value.

Parameter | Description
comp | The component to be added.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.

addContent

abstract public boolean addContent();

Called the first time the property page is made visible. The default layout manager is UIDialogLayout.

Return Value:

Returns true if the components are added only once; otherwise, returns false.

Remarks:

Override this method to add components to the property page.

doApplyAction

public boolean doApplyAction();

Responds to the Apply button being pressed.

Return Value:

Returns true if the apply action was handled. If the apply action was cancelled, this method returns false.

Remarks:

This method implements doApplyAction in the IUIPropertyPage interface. Override doApplyAction to handle an apply action.

See Also: isApplyable, setApplyable

doConstruct

public boolean doConstruct();

Called the first time the property page is made visible.

Return Value:

Returns true if the construction occurs only once; otherwise, returns false.

Remarks:

Override this method to construct components for the property page.

doNotVisible

public void doNotVisible();

Called when the property page is hidden.

Return Value:

No return value.

Remarks:

Override this method to update the property page when it is made invisible. doNotVisible is automatically invoked whenever the page is hidden.

See Also: doVisible

doVisible

public void doVisible();

Called when the property page is shown.

Return Value:

No return value.

Remarks:

Override this method to update the property page when it is made visible. doVisible is automatically invoked whenever the page is shown.

See Also: doNotVisible

getInsets

public Insets getInsets();

Retrieves the property page's insets, which indicate the nonclient area of the property page control.

Return Value:

Returns an Insets object containing the control's insets.

getSheet

public UIPropertyDialog getSheet();

Retrieves the property dialog window that contains the property page.

Return Value:

Returns the associated UIPropertyDialog object.

Remarks:

This method is automatically called when a new page is added to property dialog, provided the page has not already been set.

See Also: setSheet

isApplyable

public boolean isApplyable();

Determines whether changes made to the property page by the user will be applied when the Apply button is pressed.

Return Value:

Returns true if pressing the Apply button changes the state of the application; otherwise, returns false.

Remarks:

This method implements isApplyable in the IUIPropertyPage interface.

See Also: setApplyable

isConstructed

public boolean isConstructed();

Determines whether the components on the property page have been constructed.

Return Value:

Returns true if the property page's components have been constructed; otherwise, returns false.

See Also: setConstructed, doConstruct

isContentAdded

public boolean isContentAdded();

Determines whether components have been added to a visible page.

Return Value:

Returns true if a component has been added to the page and the page is visible; otherwise, returns false.

See Also: setContentAdded, addContent

setApplyable

public void setApplyable(boolean apply);

Sets the state of the Apply button.

Return Value:

No return value.

Parameter | Description
apply | If true, changes will be applied to the application when the Apply button is pressed; otherwise, changes will not be applied.

Remarks:

This method implements setApplyable in the IUIPropertyPage interface.

See Also: isApplyable, doApplyAction

setConstructed

public void setConstructed(boolean b);

Sets the creation state of the property page's components.

Return Value:

No return value.

Parameter | Description
b | If true, the components have been constructed; otherwise, the components have not been constructed.

Remarks:

This method implements setConstructed in the IUIPropertyPage interface.

See Also: isConstructed, doConstruct

setContentAdded

public void setContentAdded(boolean b);

Sets the content state for the property page.

Return Value:

No return value.

Parameter | Description
b | If true, the property page's components have been added; otherwise, the components are still in the process of being added.

See Also: isContentAdded, addContent

setSheet

public void setSheet(UIPropertyDialog sheet);

Associates the specified property dialog window with the property page.

Return Value:

No return value.

Parameter | Description
sheet | The UIPropertyDialog object that will contain the property page.

See Also: getSheet

setVisible

public void setVisible(boolean vis);

Shows or hides the property page.

Return Value:

No return value.

Parameter | Description
vis | If true, the property page is shown; otherwise, it is hidden.

Remarks:

This method implements setVisible in the IUIPropertyPage interface.

See Also: doVisible, doNotVisible


Class UIPushButton

public class UIPushButton extends UIButton
{
  // Fields
  public static final int FLAT_PRESSED;
  public static final int RAISED;
  public static final int THICK;

  // Constructors
  public UIPushButton();
  public UIPushButton(String text);
  public UIPushButton(String text, int style);
  public UIPushButton(IUIComponent comp);
  public UIPushButton(IUIComponent comp, int style);

  // Methods
  public synchronized void addActionListener(IUIActionListener l);
  public Insets getInsets();
  public int getRoleCode();
  public void paint(FxGraphics g);
  protected void processActionEvent(UIActionEvent e);
  protected void processEvent(UIEvent e);
  public synchronized void removeActionListener(
        IUIActionListener l);
  public void setChecked(boolean on);
  public void setFocused(boolean on);
  public void setHot(boolean on);
  public void setPressed(boolean on);
  public void setStyle(int style);
}

This class implements a push button control. For more information about buttons, see the UIButton overview.

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIButton
          |
          +--UIPushButton

Constructors

UIPushButton

public UIPushButton();

Creates a push button control with no content.

Remarks:

By default, the button's style is RAISED.

UIPushButton

public UIPushButton(String text);

Creates a push button control with the specified text.

Parameter | Description
text | The text to be displayed within the button.

Remarks:

By default, the button is hot-tracked and has a flat style. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

UIPushButton

public UIPushButton(String text, int style);

Creates a push button control with the specified text and style.

Parameter | Description
text | The text to be displayed within the button.
style | The style of the button. Possible values include any bitwise combination of RAISED, TOGGLE, and TRITOGGLE. (Combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter.

Remarks:

By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

UIPushButton

public UIPushButton(IUIComponent comp);

Creates a push button control with the specified component.

Parameter | Description
comp | The component to be displayed within the button.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. By default, the button's style is RAISED. For examples of how to construct buttons, see the UIButton overview.

UIPushButton

public UIPushButton(IUIComponent comp, int style);

Creates a push button control with the specified component and style.

Parameter | Description
comp | The component to be displayed within the button.
style | The style of the button. Possible values include any bitwise combination of RAISED, TOGGLE, and TRITOGGLE. (Combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

addActionListener

public synchronized void addActionListener(IUIActionListener l);

Adds the specified action listener. The listener receives all action events generated for the button.

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

Overrides:

addActionListener(IUIActionListener) in UIButton.

See Also: removeActionListener

getInsets

public Insets getInsets();

Retrieves the button control's insets (in pixels), which identify the non-client area of the control.

Return Value:

Returns an Insets object that contains the control's insets.

Remarks:

The button control's insets are based on its current styles and states.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the push button.

Return Value:

Returns the ROLE_SYSTEM_PUSHBUTTON code.

paint

public void paint(FxGraphics g);

Draws the push button control, according to its current states and styles.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

processActionEvent

protected void processActionEvent(UIActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure that the default event processing continues normally.

Overrides:

processActionEvent(UIActionEvent) in UIButton.

See Also: addActionListener

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.

Event type | Method called
action event | processActionEvent
container event | processContainerEvent (inherited through UIStateContainer)
focus event | processFocusEvent (inherited through UIStateContainer)
key event | processKeyEvent (inherited through UIStateContainer)
mouse event | processMouseEvent (inherited through UIStateContainer)
mouse motion event | processMouseMotionEvent (inherited through UIStateContainer)

When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.

Overrides:

processEvent(UIEvent) in UIButton.

removeActionListener

public synchronized void removeActionListener(IUIActionListener l);

Removes the specified action listener. The listener no longer receives the button's action events.

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

Overrides:

removeActionListener(IUIActionListener) in UIButton.

See Also: addActionListener

setChecked

public void setChecked(boolean on);

Sets or clears the checked state of the button.

Return Value:

No return value.

Parameter | Description
on | If true, the checked state is set; otherwise, it is cleared.

Remarks:

This method lays out the button control to display the new state. For more information about states, see the UIStateContainer overview.

setFocused

public void setFocused(boolean on);

Sets or clears the focus state of the button.

Return Value:

No return value.

Parameter | Description
on | If true, the focus state is set; otherwise, it is cleared.

Remarks:

This method lays out the button control, as needed, to display the new state. For more information about states, see the UIStateContainer overview.

setHot

public void setHot(boolean on);

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

Return Value:

No return value.

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

Remarks:

This method lays out the button control, as needed, to display the new state. For more information about states, see the UIStateContainer overview.

Overrides:

setHot(boolean) in UIButton.

setPressed

public void setPressed(boolean on);

Sets or clears the pressed state of the button.

Return Value:

No return value.

Parameter | Description
on | If true, the pressed state is set; otherwise, it is cleared.

Remarks:

This method lays out the button control to display the new state. For more information about states, see the UIStateContainer overview.

setStyle

public void setStyle(int style);

Sets the current style for the button.

Return Value:

No return value.

Parameter | Description
style | The style of the button. You can pass any bitwise combination of RAISED, TOGGLE, and TRITOGGLE. that combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter.

Overrides:

setStyle(int) in UIButton.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Fields

FLAT_PRESSED
Specifies that the push button has a flat look when pressed.
RAISED
Specifies that the push button is raised.
THICK
Specifies that the push button has a thicker three-dimensional bevel edge.


Class UIRadioButton

public class UIRadioButton extends UICheckButton
{
  // Constructors
  public UIRadioButton();
  public UIRadioButton(String name);
  public UIRadioButton(String name, int style);
  public UIRadioButton(IUIComponent comp);
  public UIRadioButton(IUIComponent comp, int style);

  // Methods
  public int getRoleCode();
  public void paintCheck(FxGraphics g);
}

This class implements a radio button control. By default, UIRadioButton uses the system-defined radio button image.

For more information about buttons, see the UIButton overview.

Note The behavior of the action method is not identical to the behavior of similar AWT components. For more information, see the overview information in UIButton.

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIButton
          |
          +--UICheckButton
            |
            +--UIRadioButton

Constructors

UIRadioButton

public UIRadioButton();

Creates a radio button control with no content.

Remarks:

By default, the button's style is set to TOGGLE.

UIRadioButton

public UIRadioButton(String name);

Creates a radio button control with the specified text.

Parameter | Description
name | The text to be displayed with the radio button image.

Remarks:

By default, the button is hot-tracked and its style is set to TOGGLE. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

UIRadioButton

public UIRadioButton(String name, int style);

Creates a radio button control using the specified text for content and the specified style.

Parameter | Description
name | The text to be displayed with the radio button image.
style | The style of the button. Possible values include TOGGLE or TRITOGGLE.

Remarks:

By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

UIRadioButton

public UIRadioButton(IUIComponent comp);

Creates a radio button control with the specified component.

Parameter | Description
comp | The component to be displayed with the radio button image.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. By default, the button's style is set to TOGGLE. For examples of how to construct buttons, see the UIButton overview.

UIRadioButton

public UIRadioButton(IUIComponent comp, int style);

Creates a radio button control with the specified component and style.

Parameter | Description
comp | The component to be displayed with the radio button image.
style | The style of the button. Possible values include TOGGLE or TRITOGGLE.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the radio button.

Return Value:

Returns the ROLE_SYSTEM_RADIOBUTTON code.

Overrides:

getRoleCode() in UICheckButton.

paintCheck

public void paintCheck(FxGraphics g);

Draws the radio button image, according to the button control's current states.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method is called by paint, inherited through UICheckButton.

Overrides:

paintCheck(FxGraphics) in UICheckButton.


Class UIRadioGroup

public class UIRadioGroup extends UICheckGroup
{
  // Constructors
  public UIRadioGroup();
  public UIRadioGroup(String label);
  public UIRadioGroup(IUIComponent header);

  // Methods
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public IUIComponent add(String name, Object constraints,
        int index);
  public boolean handleEvent(Event e);
}

This class implements a group box control for a list of UIRadioButton objects.

This class is very similar to the java.awt.CheckboxGroup class. The group box control contains a list of radio buttons, where only one radio button can be selected at a time.

Note The default layout manager for the UIRadioGroup class is the UIVerticalFlowLayout manager, so the constraints parameters of any methods that accept them are typically ignored.

A UIRadioGroup object can be created in several ways. The following example shows you how to create a radio group box and add UIRadioButton objects to it.

// Create an empty UIRadioGroup control
// and use the UIGroup.html.setName method inherited from
// UIGroup.htmlto set the label of the control.
UIRadioGroup uirg1 = new UIRadioGroup();
uirg1.setName("Options");

// Add buttons to the control with the add methods.
// You can add buttons in several different ways. Add the first
// button by supplying a String for the button's name.
uirg1.add("UIRadioButton1", null, 0);

// Add the second button by first creating a UIRadioButton,
// and then adding it with the add method.
UIRadioButton uirb = new UIRadioButton("UIRadioButton2");
uirg1.add(uirb, null, 1);

// Add the third button by supplying a component that can be
// used as the label for the UIRadioButton.
UIText uit = new UIText("UIRadioButton3", UIStatic.HOT);
uirg1.add(uit, null, 2);

The result is a group of three UIRadioButton objects contained in a UIRadioGroup control with an Options label.

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIGroup
          |
          +--UICheckGroup
            |
            +--UIRadioGroup

Constructors

UIRadioGroup

public UIRadioGroup();

Creates a UIRadioGroup control with no label.

Remarks:

Use the UIGroup.setName method to add a label.

UIRadioGroup

public UIRadioGroup(String label);

Creates a radio button group box control with the specified label.

Parameter | Description
label | The label for the group control.

UIRadioGroup

public UIRadioGroup(IUIComponent header);

Creates a radio button group box control using the specified component as a label.

Parameter | Description
header | A IUIComponent label for the group control.

Methods

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds a UIRadioButton to the UIRadioGroup control, according to the specified constraints and index.

Return Value:

Returns the UIRadioButton that was added, if successful; otherwise, returns null.

Parameter | Description
comp | A UIRadioButton, or a component to use for the name of the UIRadioButton that is added to the UIRadioGroup.
constraints | The layout constraints, which depend on the current layout manager. If you are using the default layout manager, this parameter is ignored. For more information about possible values, see the layout manager's addLayoutComponent method.
index | The zero-based index at which to insert the component.

Overrides:

add(IUIComponent,Object,int) in UICheckGroup.

add

public IUIComponent add(String name, Object constraints, int index);

Adds a UIRadioButton to the UIRadioGroup control, according to the specified constraints and index.

Return Value:

Returns the UIRadioButton that was added, if successful; otherwise, returns null.

Parameter | Description
name | The name of the UIRadioButton that is added to the UIRadioGroup.
constraints | The layout constraints, which depend on the current layout manager. If you are using the default layout manager, this parameter is ignored. For more information about possible values, see the layout manager's addLayoutComponent method.
index | The zero-based index at which to insert the component.

Overrides:

add(String,Object,int) in UICheckGroup.

handleEvent

public boolean handleEvent(Event e);

Responds to events occurring within the control. This method ensures that only one radio button is selected at any one time.

Return Value:

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

Parameter | Description
e | The event that is posted.

Overrides:

handleEvent(Event) in UICheckGroup.


Class UIRepeatButton

public class UIRepeatButton extends UIPushButton implements
            TimerListener
{
  // Constructors
  public UIRepeatButton();
  public UIRepeatButton(String text);
  public UIRepeatButton(String text, int style);
  public UIRepeatButton(IUIComponent comp);
  public UIRepeatButton(IUIComponent comp, int style);

  // Methods
  public boolean mouseClicked(Event e, int x, int y);
  public void setPressed(boolean on);
  public void timeTriggered(TimerEvent te);
}

This class implements a repeating push button control. When a UIRepeatButton object is pressed, action events are continually generated as long as the button remains pressed. (With a UIPushButton object, an action event is generated when the button is pressed and released.)

For more information about buttons, see the UIButton overview.

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIButton
          |
          +--UIPushButton
            |
            +--UIRepeatButton

Constructors

UIRepeatButton

public UIRepeatButton();

Creates a repeating push button control with no content.

Remarks:

By default, the button has a flat style.

UIRepeatButton

public UIRepeatButton(String text);

Creates a repeating push button control with the specified text.

Parameter | Description
text | The text to be displayed within the button.

Remarks:

By default, the button is hot-tracked and has a flat style. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

UIRepeatButton

public UIRepeatButton(String text, int style);

Creates a repeating push button control with the specified text and style.

Parameter | Description
text | The text to be displayed within button.
style | The style of the button. Possible values include any bitwise combination of RAISED, TOGGLE, and TRITOGGLE. (Combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter.

Remarks:

By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

UIRepeatButton

public UIRepeatButton(IUIComponent comp);

Creates a repeating push button control with the specified component.

Parameter | Description
comp | The component to be displayed within the button.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. By default, the button has a flat style. For examples of how to construct buttons, see the UIButton overview.

UIRepeatButton

public UIRepeatButton(IUIComponent comp, int style);

Creates a repeating push button control with the specified component and style.

Parameter | Description
comp | The component to be displayed within button.
style | The style of the button. Possible values include any bitwise combination of RAISED, TOGGLE, and TRITOGGLE. (Combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

mouseClicked

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

Responds to the mouse button being clicked over the control.

Return Value:

Returns false.

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

setPressed

public void setPressed(boolean on);

Sets or clears the pressed state of the button. As long as the button remains in the pressed state, action events are continually generated.

Return Value:

No return value.

Parameter | Description
on | If true, the pressed state is set; otherwise, it is cleared.

Remarks:

This method is automatically invoked when the mouse button is pressed over the control. setPressed lays out and redraws the button to display the new state. If the on parameter is true, a repeating timer is started. Whenever the timer expires, timeTriggered is invoked to generate an action event. If on is false, the timer is stopped.

For more information about states, see the UIStateContainer overview.

Overrides:

setPressed(boolean) in UIPushButton.

timeTriggered

public void timeTriggered(TimerEvent te);

Posts an action event to the button.

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. The setPressed method starts a repeating timer. Whenever the timer expires, timeTriggered is automatically invoked to generate an action event. As long as the button remains pressed, actions events are continually generated.


Class UIRoot

public class UIRoot extends UIPanel implements IUIRootContainer,
             TimerListener
{
}

This class is for internal use only. It should not be used.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot


Class UIRow

public class UIRow extends UIPanel
{
  // Constructors
  public UIRow();
  public UIRow(Object columns[]);

  // Methods
  public String getName();
  public int getRoleCode();
  public void requestFocus();
  public void setSelected(boolean on);
}

This class implements a row control. Typically,UIRow objects are used to populate a list object, such as UIList, when the viewing object displays data in columns. UIScrollViewer and its derivative, UIColumnViewer, both (typically) use lists populated with UIRow objects. Other containers, such as UIPanel and Panel, can also use UIRow objects for various content.

The following example shows how to construct various UIRow objects.

// You must pass the UIRow constructor an array of IUIComponent
//  or String objects. This array can perhaps represent
// the results of a database query.
 String objectArray[] = {queryResultName, queryResultAddress,
           queryResultCity, queryResultState, queryResultZip};

 UIRow databaseQueryResult = new UIRow(objectArray);

// You can also easy construct a row of different types.
 objectArray[0] = (new UIGraphic(fileImage, UIStatic.LEFT));
 objectArray[1] = names[file.type];
 objectArray[2] = file.lastModified();
 objectArray[3] = "" + file.size + " bytes";

 UIRow fileInformation = new UIRow(objectArray);

// Set the layout of the row using the setLayout
// method. Use the appropriate UILayoutManager for the
// container.
 fileInformation.setLayout(layoutManager);

// Typically, you will handle many row objects in one
// viewer or container.
// Add the current row to some type of list object.
 fileList.add(fileInformation);
// or,
 dbPossibleMatches.add(databaseQueryResult);

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRow

Constructors

UIRow

public UIRow();

Creates a row object with no content.

UIRow

public UIRow(Object columns[]);

Creates a row object using an array of columns.

Parameter | Description
columns | The object array that comprises a row. The row must be either an array of IUIComponent objects or an array of String objects.

Methods

getName

public String getName();

Retrieves the name of the row (this is the name of the first object in the row). If there is one or fewer objects in the row, the method returns the name of the parent component.

Return Value:

Returns the String that displays the row's associated name.

Overrides:

getName() in UIPanel.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the row.

Return Value:

Returns the ROLE_SYSTEM_ROW code.

requestFocus

public void requestFocus();

Requests focus for the row, if the row is keyable.

Return Value:

No return value.

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the row.

Return Value:

No return value.

Parameter | Description
on | If true, the row is selected; otherwise, it is deselected.


Class UIRowLayout

public class UIRowLayout extends UILayoutManager
{
  // Constructors
  public UIRowLayout(int columns);
  public UIRowLayout(IUIComponent header, int columns);
  public UIRowLayout(IUIComponent header, int columns, int widths);
  public UIRowLayout(IUIComponent header, int columns,
        int widths[]);

  // Methods
  public IUIComponent getComponent(IUIContainer cont, int index);
  public Dimension getMinimumSize(IUIContainer parent);
  public int getOrderIndex(int index);
  public Dimension getPreferredSize(IUIContainer parent);
  public int getWidth(int index);
  public int[] getWidths();
  public boolean isOverlapping();
  public boolean isWidthRelative();
  public void layout(IUIContainer target, Rectangle bounds);
  public void moveColumn(int from, int to);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int dir, boolean keyable);
  public void setWidth(int index, int width);
  public void setWidths(int width);
  public void setWidths(int widths[]);
}

This class implements a layout manager for a row of objects or columns. UIHeaderRow uses UIRowLayout for its default layout manager.

UIRowLayout maintains an index and an order for each column. When the layout manager is first created, the index of each column is defined by its initial order. The moveColumn method enables you to change the order of the columns; however, the index of each column does not change.

The following example demonstrates the moveColumn method.

// Construct a UIHeaderRow object. By default,
// UIHeaderRow uses UIRowLayout for its layout
// manager.
String s [] = { "A," "B," "C," "D" };
UIHeaderRow hr = new UIHeaderRow(s);
add(hr);  // Add hr to the container.

// Initially, the columns are indexed and
// ordered as follows:
//         A  B  C  D
// index:  0  1  2  3
// order:  0  1  2  3
//
// Now retrieve the layout manager and move
// column B (index 1) to the location of
// column D (index 3).
IUILayoutManager lm = hr.getLayout();
lm.moveColumns(1, 3);

// The columns are now reordered, but
// their original indexes have not
// changed.
//         A  C  D  B
// index:  0  2  3  1
// order:  0  1  2  3

The getOrderIndex method enables you to retrieve the order of a column at a particular index.

UILayoutManager
  |
  +--UIRowLayout

Constructors

UIRowLayout

public UIRowLayout(int columns);

Creates a row layout manager with the specified number of columns.

Parameter | Description
columns | The number of columns to create.

Exceptions:

IllegalArgumentException if a negative number of columns was specified.

UIRowLayout

public UIRowLayout(IUIComponent header, int columns);

Creates a row layout manager with the specified reference header and number of columns.

Parameter | Description
header | The reference object that all other containers using this layout manager will use to determine their offset.
columns | The number of columns to create.

Exceptions:

IllegalArgumentException if a negative number of columns is specified.

UIRowLayout

public UIRowLayout(IUIComponent header, int columns, int widths);

Creates a row layout manager with the specified reference header, number of columns, and initial width for those columns.

Parameter | Description
header | The reference object that all other containers using this layout manager will use to determine their offset.
columns | The number of columns to create.
widths | The initial width for each column.

Exceptions:

IllegalArgumentException if a negative number of columns is specified.

UIRowLayout

public UIRowLayout(IUIComponent header, int columns, int widths[]);

Creates a row layout manager with the specified reference header, number of columns, and initial widths for those columns.

Parameter | Description
header | The reference object that all other containers using this layout manager will use to determine their offset.
columns | The number of columns to create.
widths | Array of the initial width for each column.

Exceptions:

IllegalArgumentException if a negative number of columns is specified.

Methods

getComponent

public IUIComponent getComponent(IUIContainer cont, int index);

Retrieves the component at the specified index.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
cont | The container of the component.
index | The index of the component to retrieve.

Remarks:

For more information about a column's index, see the UIRowLayout overview.

Overrides:

getComponent(IUIContainer,int) in UILayoutManager.

Exceptions:

IllegalArgumentException if an invalid index was specified.

getMinimumSize

public Dimension getMinimumSize(IUIContainer parent);

Determines the minimum dimensions (in pixels) needed to lay out the components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
parent | The container of the components.

Remarks:

This method is called by the container's getMinimumSize method. The height of the returned Dimension object is the largest of the minimum heights of each column, plus the container's top and bottom insets. The width is the sum of the widths of the columns plus the container's left and right insets. If the setWidth method has been called for a column, this new width is used to compute the container's width; otherwise, the column's minimum width is used.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize

getOrderIndex

public int getOrderIndex(int index);

Retrieves the order of the column at the specified index.

Return Value:

Returns the zero-based order of the column.

Parameter | Description
index | The zero-based index of the column.

Remarks:

For more information about a column's index and order, see the UIRowLayout overview.

Exceptions:

IllegalArgumentException if an invalid index was specified.

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
parent | The container of the components.

Remarks:

This method is called by the container's getPreferredSize method. The height of the returned Dimension object is the largest of the preferred heights of each column. The width is the sum of the widths of the columns. If the setWidth method has been called for a column, this new width is used to compute the container's width; otherwise, the column's preferred width is used.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize

getWidth

public int getWidth(int index);

Retrieves the current width of the column at the specified index.

Return Value:

Returns the width (in pixels) of the specified column.

Parameter | Description
index | The zero-based index of the column.

Remarks:

For more information about a column's index, see the UIRowLayout overview.

Exceptions:

IllegalArgumentException if an invalid index was specified.

See Also: setWidth

getWidths

public int[] getWidths();

Retrieves the current widths for all the columns.

Return Value:

Returns an array of the widths (in pixels) for each of the columns.

Remarks:

For more information about a column's index, see the UIRowLayout overview.

Exceptions:

IllegalArgumentException if an invalid index was specified.

See Also: setWidths

isOverlapping

public boolean isOverlapping();

This method simply returns false, indicated that the UIRowLayout lays out its components such that they never overlap.

Return Value:

Returns false.

Overrides:

isOverlapping() in UILayoutManager.

isWidthRelative

public boolean isWidthRelative();

This method simply returns false indicating that the UIRowLayout does not layout its components based on the width of the container.

Return Value:

Returns false.

Overrides:

isWidthRelative() in UILayoutManager.

See Also: isHeightRelative

layout

public void layout(IUIContainer target, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
target | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

This method is called by the container's layout method. By default, the bounding rectangle's width is divided equally among the number of components, or columns, so that each column has the same width, with no gap between columns. The height of each column is the height of the bounding rectangle. If the setWidth method is later called to change the width of a column, layout uses the new column width.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

moveColumn

public void moveColumn(int from, int to);

Moves a column from one location to another.

Return Value:

No return value.

Parameter | Description
from | The zero-based index that identifies the column to move.
to | The zero-based index that identifies where the column is moving to.

Remarks:

For more information about moving columns, see the UIRowLayout overview.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp, int dir,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
cont | The container where the navigation is occurring.
comp | The tab component to navigate from.
dir The navigation direction. Specify one of the following values defined in IUIAccessible:
  • NAVDIR_LEFT
  • NAVDIR_RIGHT
  • NAVDIR_FIRST
  • NAVDIR_LAST
  • NAVDIR_NEXT
  • NAVDIR_PREV
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

This method handles keyboard navigation in the container. When a component in the container has focus and a key is pressed, navigate is called to move focus to another item in the container.

The following table shows the keys that have corresponding IUIAccessible directions.

Key | IUIAccessible direction
LEFT ARROW and RIGHT ARROW | NAVDIR_LEFT and NAVDIR_RIGHT, respectively.
HOME and END | NAVDIR_FIRST and NAVDIR_LAST, respectively.

Overrides:

navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.

setWidth

public void setWidth(int index, int width);

Sets the width of the column at the specified index.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the column.
width | The new width (in pixels) for the column.

Remarks:

For more information about a column's index, see the UIRowLayout overview.

Exceptions:

IllegalArgumentException if an invalid index was specified.

See Also: getWidth

setWidths

public void setWidths(int width);

Sets the widths of all columns to the specified width.

Return Value:

No return value.

Parameter | Description
widths | The new width (in pixels) for each column.

Remarks:

For more information about a column's index, see the UIRowLayout overview.

Exceptions:

IllegalArgumentException if an invalid index was specified.

See Also: getWidths

setWidths

public void setWidths(int widths[]);

Sets all the column widths to the specified widths.

Return Value:

No return value.

Parameter | Description
widths | The array of new widths (in pixels) for each column.

Remarks:

For more information about a column's index, see the UIRowLayout overview.

Exceptions:

IllegalArgumentException if an invalid index was specified.

See Also: getWidths


Class UIScroll

public class UIScroll extends UIPanel implements IUIScroll,
            IUIPosition
{
  // Fields
  public static final int NOHIDE;
  public static final int NOKEY;
  public static final int NONPROPORTIONAL;
  public static final int NOSHOW;
  public static final int PAGE_DOWN;
  public static final int PAGE_UP;
  public static final int THICK;
  public static final int THUMB;
  public static final int VERTICAL;

  // Constructors
  public UIScroll();
  public UIScroll(int style);
  public UIScroll(int style, int min, int max, int page, int line,
        int pos);

  // Methods
  public boolean action(Event e, Object o);
  public IUIComponent add(int index, IUIComponent comp);
  public synchronized void addAdjustmentListener(
        IUIAdjustmentListener l);
  public IUIComponent getLayoutComponent(int index);
  public Dimension getMinimumSize();
  public Point getPosition();
  public Dimension getPreferredSize();
  public int getRoleCode();
  public int getScrollLine();
  public int getScrollMax();
  public int getScrollMin();
  public int getScrollPage();
  public int getScrollPos();
  public int getStyle();
  public int getXPosition();
  public int getYPosition();
  public boolean isKeyable();
  public boolean isScrollable();
  public void layout();
  public boolean mouseDrag(Event e, int x, int y);
  protected void processAdjustmentEvent(UIAdjustmentEvent e);
  protected void processEvent(UIEvent e);
  public synchronized void removeAdjustmentListener(
        IUIAdjustmentListener l);
  public int scrollEnd();
  public int scrollHome();
  public int scrollLineDown();
  public int scrollLineUp();
  public int scrollPageDown();
  public int scrollPageUp();
  public void setPosition(Point pt);
  public void setPosition(int x, int y);
  public int setScrollInfo(int min, int max, int page, int line,
        int pos, boolean notify);
  public int setScrollInfo(int min, int max, int page, int line,
        int pos);
  public void setScrollLine(int line);
  public int setScrollLine(int line, boolean notify);
  public void setScrollMax(int max);
  public void setScrollMin(int min);
  public void setScrollPage(int page);
  public int setScrollPage(int page, boolean notify);
  public void setScrollPos(int pos);
  public int setScrollPos(int pos, boolean notify);
  public int setScrollRange(int min, int max);
  public void setStyle(int style);
  public void setXPosition(int x);
  public void setYPosition(int y);
}

This class implements a scroll track control. UIScroll defines the following five scroll track styles:

  • VERTICAL
  • NOHIDE
  • NOSHOW
  • NONPROPORTIONAL
  • NOKEY

The following example shows how to construct a scroll track control using the defined styles.

// Construct a vertical scroll track that is always visible.
UIScroll sc1 = new UIScroll(UIScroll.VERTICAL | UIScroll.NOHIDE);

// Add sc1 to the container.
add(sc1);

In addition to setting styles, you can initialize the scroll track control's scroll information by specifying range, page, line, and current position values. The range indicates the possible number of scroll positions associated with the control. The page and line values define increments for adjusting the current position. The following example shows how to construct a scroll track control with specified scroll information.

// Construct a vertical scroll track that is always visible.
// Define its range to be 0 to 100, with a page of 4, a line
// of 2, and an initial position of 50.
UIScroll sc2 = new UIScroll(UIScroll.VERTICAL | UIScroll.NOHIDE,
                            0, 100, 4, 2, 50);
// Add sc2 to the container.
add(sc2);

UIScroll manages three components that allow the user to move the scroll track control's current position. Each component is identified by a layout index, as defined in the following table.

Layout Index | Component
THUMB | The component used to indicate the current position of the scroll track control (by default, a UIScrollThumb object). When the THUMB component is dragged with the mouse, the current position is moved in increments or decrements of one scroll position.
PAGE_UP | The track area above or to the left of the thumb component (by default, a UIRepeatButton object). When the PAGE_UP component is pressed with the mouse, the current position is moved in decrements of one line less than a page.
PAGE_DOWN | The track area below or to the right of the thumb component (by default, a UIRepeatButton object). When the PAGE_DOWN component is pressed with the mouse, the current position is moved in increments of one line less than a page.

UIScrollBar extends UIScroll to implement a scroll bar control. In addition to the three components defined by UIScroll, UIScrollBar adds LINE_UP and LINE_DOWN components to the ends of the scroll track. For a description of these components, see the UIScrollBar overview. Other classes that extend UIScroll include UISlider and UISpinner.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIScroll

Constructors

UIScroll

public UIScroll();

Creates a horizontal scroll track control. By default, the control has a range of 0 to 100.

UIScroll

public UIScroll(int style);

Creates a scroll track control with the specified style. By default, the control has a range of 0 to 100.

Parameter Description
style The style of the control. You can pass any bitwise combination of the following values:
  • VERTICAL
  • NOHIDE (cannot be combined with NOSHOW)
  • NOSHOW (cannot be combined with NOHIDE)
  • NONPROPORTIONAL
  • NOKEY
  • 0 (for a horizontal scroll track)

Exceptions:

IllegalArgumentException if an undefined style was specified.

UIScroll

public UIScroll(int style, int min, int max, int page, int line, int pos);

Creates a scroll track control with the specified style and scroll information.

Parameter | Description
style The style of the control. You can pass any bitwise combination of the following values:
  • VERTICAL
  • NOHIDE (cannot be combined with NOSHOW)
  • NOSHOW (cannot be combined with NOHIDE)
  • NONPROPORTIONAL
  • NOKEY
  • 0 (for a horizontal scroll track)
min | The minimum scroll position in the control's range.
max | The maximum scroll position in the control's range.
page | The number of scroll positions associated with a page.
line | The number of scroll positions associated with a line.
pos | The current scroll position.

Remarks:

If the NONPROPORTIONAL style is not set and the page value is nonzero, the size of the THUMB component represents the ratio of page to range, and the maximum positions the UIScroll object can return are ScrollMaxScrollPage - 1, or ScrollMin (depending on which is larger). Otherwise, the size of the THUMB will be a constant value. For more information about range, page, and line values, see the UIScroll class.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

action

public boolean action(Event e, Object o);

Responds to events sent from the scroll track control's components.

Return Value:

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

Parameter | Description
e | The event posted to the scroll track control.
o | The object that posted the event.

Remarks:

This method adjusts the control's current position, based on one of the following actions:

  • Dragging the THUMB component with the mouse. The current position is moved in increments or decrements of one scroll position.
  • Pressing the PAGE_DOWN or PAGE_UP component with the mouse. The current position is moved in increments or decrements, respectively, of one line less than a full page.
  • Pressing the LINE_DOWN or LINE_UP component with the mouse, if the control is a UIScrollBar object. The current position is moved in increments or decrements, respectively, of one line.

add

public IUIComponent add(int index, IUIComponent comp);

Adds the specified component at the given layout index. If a component already exists at this index, it is replaced with the specified component.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
index | The layout index of the component to be added. Possible values include THUMB, PAGE_UP, or PAGE_DOWN.
comp | The component to be added.

Exceptions:

IllegalArgumentException if an undefined index was specified.

See Also: getLayoutComponent

addAdjustmentListener

public synchronized void addAdjustmentListener(IUIAdjustmentListener l);

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

Return Value:

No return value.

Parameter | Description
l | The adjustment listener to be added.

See Also: removeAdjustmentListener

getLayoutComponent

public IUIComponent getLayoutComponent(int index);

Retrieves the component at the specified layout index.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
index | The layout index of the component to be retrieved. Possible values include THUMB, PAGE_UP, or PAGE_DOWN.

Exceptions:

IllegalArgumentException if an undefined index was specified.

See Also: add

getMinimumSize

public Dimension getMinimumSize();

Retrieves the minimum size (in pixels) of the scroll track control. The minimum size is based on the preferred size of each component.

Return Value:

Returns a Dimension object containing the control's minimum size.

See Also: getPreferredSize

getPosition

public Point getPosition();

Retrieves the position of the scroll track control.

Return Value:

Returns a Point object containing the current position.

Remarks:

This method implements getPosition in the IUIPosition interface. If the scroll track is horizontal, the x coordinate of the returned Point is the current scroll position; the y coordinate is zero. If the scroll track is vertical, the x coordinate is zero; the y coordinate is the current scroll position.

See Also: getScrollPos, getXPosition, getYPosition, setPosition

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred size (in pixels) of the scroll track control. The preferred size is based on the preferred size of each component.

Return Value:

Returns a Dimension object containing the control's preferred size.

See Also: getMinimumSize

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the scroll track control.

Return Value:

Returns the ROLE_SYSTEM_SCROLLBAR code.

getScrollLine

public int getScrollLine();

Retrieves the number of scroll positions associated with a line.

Return Value:

Returns the number of scroll positions in a line.

Remarks:

This method implements getScrollLine method in the IUIScroll interface. For more information about line values, see the UIScroll class.

See Also: setScrollLine

getScrollMax

public int getScrollMax();

Retrieves the maximum value in the scroll track control's range.

Return Value:

Returns the maximum scroll position.

Remarks:

This method implements getScrollMax in the IUIScroll interface.

See Also: getScrollMin, setScrollMax

getScrollMin

public int getScrollMin();

Retrieves the minimum value in the scroll track control's range.

Return Value:

Returns the minimum scroll position.

Remarks:

This method implements getScrollMin in the IUIScroll interface.

See Also: getScrollMax, setScrollMin

getScrollPage

public int getScrollPage();

Retrieves the number of scroll positions associated with a page.

Return Value:

Returns the number of scroll positions in a page.

Remarks:

This method implements getScrollPage in the IUIScroll interface. For more information about page values, see the UIScroll overview.

See Also: setScrollPage

getScrollPos

public int getScrollPos();

Retrieves the position of the scroll track control.

Return Value:

Returns the current scroll position.

Remarks:

This method implements getScrollPos in the IUIScroll interface.

See Also: getPosition, setScrollPos

getStyle

public int getStyle();

Retrieves the current style of the scroll track control.

Return Value:

Returns an integer containing the current style settings. For a list of possible styles, see setStyle.

getXPosition

public int getXPosition();

Retrieves the horizontal scroll position of the scroll track control.

Return Value:

Returns the current scroll position if the control is horizontal; otherwise, returns 0.

Remarks:

This method implements getXPosition in the IUIPosition interface.

See Also: getYPosition, getPosition, setXPosition

getYPosition

public int getYPosition();

Retrieves the vertical scroll position of the scroll track control.

Return Value:

Returns the current scroll position if the control is vertical; otherwise, returns 0.

Remarks:

This method implements getYPosition in the IUIPosition interface.

See Also: getXPosition, getPosition, setYPosition

isKeyable

public boolean isKeyable();

Determines whether the scroll track control can receive keyboard input.

Return Value:

Returns true if the control can receive keyboard input; otherwise, returns false.

Remarks:

If the NOKEY style is set, this method returns false.

isScrollable

public boolean isScrollable();

Determines whether the control supports scrolling, based on its range and page values.

Return Value:

Returns true if the control must scroll; otherwise, returns false if scrolling is unnecessary.

Remarks:

This method implements isScrollable in the IUIScroll interface. If the scroll track control has the NOSHOW style or if scrolling is unnecessary, the control will be hidden. If the NOHIDE style is set, the control will be disabled if scrolling is unnecessary.

layout

public void layout();

Lays out the components of the scroll track control.

Return Value:

No return value.

Remarks:

If the scroll track control has the NOSHOW style or if scrolling is unnecessary, the control will be hidden. If the NOHIDE style is set, the control will be disabled if scrolling is unnecessary.

mouseDrag

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

Responds to the THUMB component being dragged with the mouse.

Return Value:

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

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

As the THUMB component is dragged, this method adjusts its position accordingly.

processAdjustmentEvent

protected void processAdjustmentEvent(UIAdjustmentEvent e);

Processes adjustment events.

Return Value:

No return value.

Parameter | Description
e | The adjustment event.

Remarks:

This method is called by processEvent and dispatches the event to a registered adjustment listener. When overriding this method, call the super method processAdjustmentEvent to ensure the default event processing continues normally.

See Also: addAdjustmentListener

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.

Event type | Method called
adjustment event | processAdjustmentEvent
container event | processContainerEvent (inherited through UIStateContainer)
focus event | processFocusEvent (inherited through UIStateContainer)
key event | processKeyEvent (inherited through UIStateContainer)
mouse event | processMouseEvent (inherited through UIStateContainer)
mouse motion event | processMouseMotionEvent (inherited through UIStateContainer)

When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.

removeAdjustmentListener

public synchronized void removeAdjustmentListener(IUIAdjustmentListener l);

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

Return Value:

No return value.

Parameter | Description
l | The adjustment listener to be removed.

See Also: addAdjustmentListener

scrollEnd

public int scrollEnd();

Moves the current scroll position to the maximum range value.

Return Value:

Returns the control's new scroll position.

Remarks:

This method implements scrollEnd in the IUIScroll interface.

See Also: scrollHome

scrollHome

public int scrollHome();

Moves the current scroll position to the minimum range value.

Return Value:

Returns the control's new scroll position.

Remarks:

This method implements scrollHome in the IUIScroll interface.

See Also: scrollEnd

scrollLineDown

public int scrollLineDown();

Increments the current scroll position by one line.

Return Value:

Returns the control's new scroll position.

Remarks:

This method implements scrollLineDown in the IUIScroll interface. For more information about line values, see the UIScroll overview.

See Also: scrollLineUp

scrollLineUp

public int scrollLineUp();

Decrements the current scroll position by one line.

Return Value:

Returns the control's new scroll position.

Remarks:

This method implements scrollLineUp in the IUIScroll interface. For more information about line values, see the UIScroll overview.

See Also: scrollLineDown

scrollPageDown

public int scrollPageDown();

Increments the current scroll position by one line less than a full page.

Return Value:

Returns the control's new scroll position.

Remarks:

This method implements scrollPageDown in the IUIScroll interface. If the difference between the page and line values is negative or zero, the scroll position is incremented by one scroll position. For more information about page and line values, see the UIScroll overview.

See Also: scrollPageUp

scrollPageUp

public int scrollPageUp();

Decrements the current scroll position by one line less than a full page.

Return Value:

Returns the control's new scroll position.

Remarks:

This method implements scrollPageUp in the IUIScroll interface. If the difference between the page and line values is negative or zero, the scroll position is decremented by one scroll position. For more information about page and line values, see the UIScroll overview.

See Also: scrollPageDown

setPosition

public void setPosition(Point pt);

Sets the position of the scroll track control, based on the specified Point.

Return Value:

No return value.

Parameter | Description
pt | The requested position for the scroll track control. The x and y coordinates of pt specify the horizontal and vertical scroll positions (in pixels), respectively.

Remarks:

This method implements setPosition in the IUIPosition interface. If the scroll track is horizontal, the x coordinate of the returned Point is the new scroll position, and the y coordinate is zero. If the scroll track is vertical, the x coordinate is zero and the y coordinate is the new scroll position. Depending on the control's range, these coordinates may differ from those of the parameter pt.

See Also: setScrollPos, setXPosition, setYPosition, getPosition

setPosition

public void setPosition(int x, int y);

Sets the position of the scroll track control, based on the specified values.

Return Value:

No return value.

Parameter | Description
x | The requested horizontal scroll position (in pixels).
y | The requested vertical scroll position (in pixels).

Remarks:

This method implements setPosition in the IUIPosition interface. If the scroll track is horizontal, the x coordinate of the returned Point is the new scroll position, and the y coordinate is zero. If the scroll track is vertical, the x coordinate is zero and the y coordinate is the scroll position. Depending on the control's range, these coordinates may differ from the x and y parameters.

See Also: setScrollPos, setXPosition, setYPosition, getPosition

setScrollInfo

public int setScrollInfo(int min, int max, int page, int line, int pos,
        boolean notify);

Sets the specified scroll information and adjusts the control's current position accordingly.

Return Value:

Returns the control's new scroll position after setting the specified values.

Parameter | Description
min | The minimum scroll position in the control's range.
max | The maximum scroll position in the control's range.
page | The number of scroll positions associated with a page.
line | The number of scroll positions associated with a line.
pos | The current scroll position.
notify | Set this parameter to true if the object should post events when the scroll information has changed.

Remarks:

If the NONPROPORTIONAL style is not set and the page value is nonzero, the size of the THUMB component represents the ratio of page to range, and the maximum positions the UIScroll object can return are ScrollMaxScrollPage - 1, or ScrollMin (depending on which is larger). Otherwise, the size of the THUMB will be a constant value. For more information about range, page, and line values, see the UIScroll overview.

setScrollInfo

public int setScrollInfo(int min, int max, int page, int line, int pos);

Sets the specified scroll information and adjusts the control's current position accordingly. This method does not post events.

Return Value:

Returns the control's new scroll position after setting the specified values.

Parameter | Description
min | The minimum scroll position in the control's range.
max | The maximum scroll position in the control's range.
page | The number of scroll positions associated with a page.
line | The number of scroll positions associated with a line.
pos | The current scroll position.

Remarks:

This method implements setScrollInfo in the IUIScroll interface. If the NONPROPORTIONAL style is not set and the page value is nonzero, the size of the THUMB component represents the ratio of page to range. Otherwise, the size of the THUMB represents a scroll position.

For more information about range, page, and line values, see the UIScroll overview.

setScrollLine

public void setScrollLine(int line);

Sets the number of scroll positions associated with a line, and adjusts the control's current position accordingly. This method does not post events.

Return Value:

No return value.

Parameter | Description
line | The number of scroll positions to be associated with a line.

Remarks:

This method implements setScrollLine in the IUIScroll interface. For more information about line values, see the UIScroll class.

See Also: getScrollLine

setScrollLine

public int setScrollLine(int line, boolean notify);

Sets the number of scroll positions associated with a line, and adjusts the control's current position accordingly. If notify is true, the object will post appropriate events when the scroll information has changed.

Return Value:

Returns the control's new scroll position after setting the specified value.

Parameter | Description
line | The number of scroll positions to be associated with a line.
notify | Set this parameter to true if the object should post events when the scroll information has changed.

Remarks:

For more information about line values, see the UIScroll overview.

See Also: getScrollLine

setScrollMax

public void setScrollMax(int max);

Sets the maximum range value and adjusts the control's current position accordingly.

Return Value:

No return value.

Parameter | Description
max | The maximum scroll position.

Remarks:

This method implements setScrollMax in the IUIScroll interface.

See Also: setScrollMin, getScrollMax

setScrollMin

public void setScrollMin(int min);

Sets the minimum range value and adjusts the control's current position accordingly.

Return Value:

No return value.

Parameter | Description
min | The minimum scroll position.

Remarks:

This method implements setScrollMin in the IUIScroll interface.

See Also: setScrollMax, getScrollMin

setScrollPage

public void setScrollPage(int page);

Sets the number of scroll positions associated with a page, and adjusts the control's current position accordingly. This method does not post events.

Return Value:

No return value.

Parameter | Description
page | The number of scroll positions to be associated with a page.

Remarks:

If the NONPROPORTIONAL style is not set and the page value is nonzero, the size of the THUMB component represents the ratio of page to range, and the maximum positions the UIScroll object can return are ScrollMaxScrollPage - 1, or ScrollMin (depending on which is larger). Otherwise, the size of the THUMB will be a constant value. For more information about range, page, and line values, see the UIScroll overview.

See Also: getScrollPage

setScrollPage

public int setScrollPage(int page, boolean notify);

Sets the number of scroll positions associated with a page, and adjusts the control's current position accordingly. If notify is true, the object will post appropriate events when the scroll information has changed.

Return Value:

Returns the control's new scroll position after setting the specified value.

Parameter | Description
page | The number of scroll positions to be associated with a page.
notify | Set this parameter to true if the object should post events when the scroll information has changed.

Remarks:

If the NONPROPORTIONAL style is not set and the page value is nonzero, the size of the THUMB component represents the ratio of page to range. Otherwise, the size of the THUMB represents a scroll position. For more information about page values, see the UIScroll overview.

See Also: getScrollPage

setScrollPos

public void setScrollPos(int pos);

Sets the control's current position to the specified scroll position. This method does not post events.

Return Value:

No return value.

Parameter | Description
pos | The position for the scroll track control.

Remarks:

This method implements setScrollPos in the IUIScroll interface. Depending on the control's range, the returned position may differ from the pos parameter.

See Also: setPosition, getScrollPos

setScrollPos

public int setScrollPos(int pos, boolean notify);

Sets the control's current position to the specified scroll position. If notify is true, the object will post appropriate events when the scroll information has changed.

Return Value:

Returns the control's new scroll position after setting the specified value.

Parameter | Description
pos | The position for the scroll track control.
notify | Set this parameter to true if the object should post events when the scroll information has changed.

Remarks:

Depending on the control's range, the returned position may differ from the pos parameter.

See Also: setPosition, getScrollPos

setScrollRange

public int setScrollRange(int min, int max);

Sets the scroll track control's range, and adjusts the control's current position accordingly.

Return Value:

Returns the control's new scroll position after setting the specified values.

Parameter | Description
min | The minimum scroll position.
max | The maximum scroll position.

Remarks:

This method implements setScrollRange in the IUIScroll interface.

setStyle

public void setStyle(int style);

Sets the current style for the scroll track control.

Return Value:

No return value.

Parameter Description
style The style of the control. You can pass any bitwise combination of the following values:
  • VERTICAL
  • NOHIDE (cannot be combined with NOSHOW)
  • NOSHOW (cannot be combined with NOHIDE)
  • NONPROPORTIONAL
  • NOKEY
  • 0 (for a horizontal scroll track)

Exceptions:

IllegalArgumentException if an undefined style was specified.

See Also: getStyle

setXPosition

public void setXPosition(int x);

Sets the horizontal scroll position of the control.

Return Value:

No return value.

Parameter | Description
x | The requested horizontal scroll position.

Remarks:

This method implements setXPosition in the IUIPosition interface. If the scroll track is horizontal, the returned position may differ from the x parameter, depending on the control's range.

See Also: setYPosition, setPosition, getXPosition

setYPosition

public void setYPosition(int y);

Sets the vertical scroll position of the control.

Return Value:

No return value.

Parameter | Description
y | The requested vertical scroll position.

Remarks:

This method implements setYPosition in the IUIPosition interface. If the scroll track is vertical, the returned position may differ from the y parameter, depending on the control's range.

See Also: setXPosition, setPosition, getYPosition

Fields

NOHIDE
Specifies that an unneeded scroll track will be disabled rather than hidden.
NOKEY
Specifies that the scroll track control cannot receive keyboard input.
NONPROPORTIONAL
Specifies that the size of the thumb component is constant, rather than the ratio of page to range. This style is used with a UISlider object.
NOSHOW
Specifies that the scroll track control will always be hidden.
PAGE_DOWN
The layout index for the track area below or to the right of the thumb.
PAGE_UP
The layout index for the track area above or to the left of the thumb.
THICK
Specifies that the thumb has a thick edge.
THUMB
The layout index for the thumb component, which indicates the current position of the scroll track control.
VERTICAL
Specifies that the scroll track control will be vertical.


Class UIScrollBar

public class UIScrollBar extends UIScroll
{
  // Fields
  public static final int LINE_DOWN;
  public static final int LINE_UP;

  // Constructors
  public UIScrollBar();
  public UIScrollBar(int style);
  public UIScrollBar(int style, int min, int max, int page,
        int line, int pos);

  // Methods
  public IUIComponent add(int index, IUIComponent comp);
  public Insets getInsets();
  public IUIComponent getLayoutComponent(int index);
  public Dimension getMinimumSize();
  public Dimension getPreferredSize();
  public void layout();
  public void setStyle(int style);
}

This class implements a scroll bar control. UIScrollBar manages five components that enable you to move the scroll bar control's current position. Each component is identified by a layout index, described in the following table.

Layout Index | Component
THUMB | See the UIScroll overview.
PAGE_UP | See the UIScroll overview.
PAGE_DOWN | See the UIScroll overview.
LINE_UP | The component that lies above or to the left of the track area. (By default, it is a UIRepeatButton object that displays the system-defined up or left arrow.) When the LINE_UP component is pressed with the mouse, the current position is moved in decrements of one line.
LINE_DOWN | The component that lies below or to the right of the track area. (By default, it is a UIRepeatButton object that displays the system-defined down or right arrow.) When the LINE_DOWN component is pressed with the mouse, the current position is moved in increments of one line.

Typically, you'll attach a scroll bar to another object; for example, you may want to add scroll bars to a list control. In these cases, consider using UIScrollViewer, which combines a content component with UIScrollBar objects to create a single control. Unlike UIScrollBar, UIScrollViewer automatically repositions the content in response to changes in the scroll bars' positions.

For information about constructing UIScrollBar objects, see the UIScroll overview.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIScroll
          |
          +--UIScrollBar

Constructors

UIScrollBar

public UIScrollBar();

Creates a horizontal scroll bar control. By default, the control has a range of 0 to 100.

UIScrollBar

public UIScrollBar(int style);

Creates a scroll bar control with the specified style. By default, the control has a range of 0 to 100.

Parameter Description
style The style of the control. You can pass any bitwise combination of the following values:
  • UIScroll.VERTICAL
  • UIScroll.NOHIDE
  • UIScroll.NOSHOW
  • UIScroll.NONPROPORTIONAL
  • UIScroll.NOKEY
  • 0 (for a horizontal scroll bar)

Exceptions:

IllegalArgumentException if an undefined style was specified.

UIScrollBar

public UIScrollBar(int style, int min, int max, int page, int line,
        int pos);

Creates a scroll bar control with the specified style and scroll information.

Parameter | Description
style The style of the control. You can pass any bitwise combination of the following values:
  • UIScroll.VERTICAL
  • UIScroll.NOHIDE
  • UIScroll.NOSHOW
  • UIScroll.NONPROPORTIONAL
  • UIScroll.NOKEY
  • 0 (for a horizontal scroll bar)
min | The minimum scroll position in the control's range.
max | The maximum scroll position in the control's range.
page | The number of scroll positions that are associated with a page. The size of the THUMB component is proportional to the total number of pages, unless the style is specified as UIScroll.NONPROPORTIONAL. The more pages, the smaller the THUMB component.
line | The number of scroll positions that are associated with a line.
pos | The current scroll position.

Remarks:

For more information about range, page, and line values, see the UIScroll overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

add

public IUIComponent add(int index, IUIComponent comp);

Adds the specified component at the given layout index. If a component already exists at this index, it is replaced with the specified component.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
index The layout index of the component to be added. You can pass one of the following values:
  • UIScroll.THUMB
  • UIScroll.PAGE_UP
  • UIScroll.PAGE_DOWN
  • LINE_UP
  • LINE_DOWN
comp | The component to be added.

Overrides:

add(int,IUIComponent) in UIScroll.

Exceptions:

IllegalArgumentException if an undefined index was specified.

See Also: getLayoutComponent

getInsets

public Insets getInsets();

Retrieves the scroll bar control's insets (in pixels), which identify the nonclient area of the control.

Return Value:

Returns an Insets object that contains the scroll bar's insets.

getLayoutComponent

public IUIComponent getLayoutComponent(int index);

Retrieves the component at the specified layout index.

Return Value:

Returns the specified component, if found. The value of the component may be null.

Parameter Description
index The layout index of the component to be retrieved. You can pass one of the following values:
  • UIScroll.THUMB
  • UIScroll.PAGE_UP
  • UIScroll.PAGE_DOWN
  • LINE_UP
  • LINE_DOWN

Overrides:

getLayoutComponent(int) in UIScroll.

Exceptions:

IllegalArgumentException if an undefined layout index was specified.

See Also: add

getMinimumSize

public Dimension getMinimumSize();

Retrieves the minimum size (in pixels) of the scroll bar control. The minimum size is based on the preferred size of each of the control's components.

Return Value:

Returns a Dimension object that contains the control's minimum size.

Overrides:

getMinimumSize() in UIScroll.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred size (in pixels) of the scroll track control. The preferred size is based on the preferred size of each of the control's components.

Return Value:

Returns a Dimension object containing the control's preferred size.

Overrides:

getPreferredSize() in UIScroll.

See Also: getMinimumSize

layout

public void layout();

Lays out the components of the scroll bar control.

Return Value:

No return value.

Remarks:

If the scroll bar control has the NOSHOW style, or if scrolling is unnecessary, the control will be hidden.

Note If the NOHIDE style is set, the control will be disabled if scrolling is unnecessary.

Overrides:

layout() in UIScroll.

setStyle

public void setStyle(int style);

Sets the current style for the scroll bar control.

Return Value:

No return value.

Parameter Description
style The style of the control. You can pass one or a combination of the following values:
  • UIScroll.VERTICAL
  • UIScroll.NOHIDE (cannot be combined with UIScroll.NOSHOW)
  • UIScroll.NOSHOW (cannot be combined with UIScroll.NOHIDE)
  • UIScroll.NONPROPORTIONAL
  • UIScroll.NOKEY
  • 0 (for a horizontal scroll bar)

Overrides:

setStyle(int) in UIScroll.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Fields

LINE_DOWN
The layout index for the component that lies below or to the right of the track area. By default, this component displays the system-defined down arrow or right arrow.
LINE_UP
The layout index for the component that lies above or to the left of the track area. By default, this component displays the system-defined up arrow or left arrow.


Class UIScrollThumb

public class UIScrollThumb extends UIThumb
{
  // Fields
  public static final int THICK;

  // Constructors
  public UIScrollThumb();
  public UIScrollThumb(IUIComponent comp);

  // Methods
  public Insets getInsets();
  public int getStyle();
  public void paint(FxGraphics g);
  public void setStyle(int style);
}

This class implements a scroll thumb control. UIScrollThumb is used by UIScroll and UIScrollBar, and responds to various mouse events.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIThumb
          |
          +--UIScrollThumb

Constructors

UIScrollThumb

public UIScrollThumb();

Creates a scroll thumb control with no content.

UIScrollThumb

public UIScrollThumb(IUIComponent comp);

Creates a scroll thumb control using the specified component for content.

Parameter | Description
comp | The component to be displayed within the control.

Methods

getInsets

public Insets getInsets();

Retrieves the scroll thumb control's insets (in pixels), which identify the nonclient area of the control.

Return Value:

Returns an Insets object containing the scroll thumb's insets.

Remarks:

By default, all insets are 2 pixels each.

getStyle

public int getStyle();

Retrieves the thumb's current style settings.

Return Value:

Returns an integer containing the current style settings.

See Also: setStyle

paint

public void paint(FxGraphics g);

Draws the scroll thumb control.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

setStyle

public void setStyle(int style);

Sets the current style for the thumb.

Return Value:

No return value.

Parameter | Description
style | The style of the thumb. You can pass THICK to specify a thick border around the thumb.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Fields

THICK
Specifies that the thumb has a thick edge.


Class UIScrollViewer

public class UIScrollViewer extends UIPanel implements
            IUIPosition
{
  // Fields
  public final static int CONT;
  public final static Integer CONTENT;
  public final static int H_CORNER;
  public final static int H_HORZ;
  public final static int H_VERT;
  public final static int HEADER_BOTTOM;
  public final static Integer HEADER_CORNER;
  public final static Integer HEADER_HORZ;
  public final static int HEADER_RIGHT;
  public final static Integer HEADER_VERT;
  public final static int S_CORNER;
  public final static int S_HORZ;
  public final static int S_VERT;
  public final static Integer SCROLL_CORNER;
  public final static Integer SCROLL_HORZ;
  public final static int SCROLL_LEFT;
  public final static int SCROLL_TOP;
  public final static Integer SCROLL_VERT;

  // Constructors
  public UIScrollViewer();
  public UIScrollViewer(IUIComponent comp);
  public UIScrollViewer(IUIComponent comp, int style);
  public UIScrollViewer(IUIComponent comp, int hLine, int vLine);
  public UIScrollViewer(IUIComponent comp, int hLine, int vLine,
        int style);
  public UIScrollViewer(IUIComponent comp, int hLine, int vLine,
        int style, int scrollStyle);
  public UIScrollViewer(IUIComponent comp, int hLine, int vLine,
        int style, int hstyle, int vstyle);

  // Methods
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public void addNotify();
  public boolean ensureVisible(Rectangle rect);
  public IUIComponent getContent();
  public int getHLine();
  public IUIComponent getLayoutComponent(Object constraints);
  public Point getLine();
  public Dimension getMinimumSize();
  public Point getPosition();
  public Dimension getPreferredSize();
  public int getRoleCode();
  public int getVLine();
  public int getXPosition();
  public int getYPosition();
  public boolean handleEvent(Event e);
  public boolean isKeyable();
  public boolean keyDown(Event e, int key);
  public void layout();
  public void remove(IUIComponent comp);
  public IUIComponent replace(IUIComponent comp,
        Object constraints);
  public void requestFocus();
  public void setContent(IUIComponent content);
  public void setHLine(int line);
  public void setLine(int hLine, int vLine);
  public void setPosition(Point pt);
  public void setPosition(int x, int y);
  public void setScrollStyle(int scroller, int style);
  public void setScrollStyle(int style);
  public void setVLine(int line);
  public void setXPosition(int x);
  public void setYPosition(int y);
}

This class implements a scroll viewer control.

Typically, UIScrollViewer uses a UIViewer object for content, which displays another component. The scroll viewer control also displays other components, such as scroll bars and header bars. Note Content objects besides UIViewer objects are not fully supported (even when they implement the IUIPosition interface.

When creating a UIScrollViewer object, you specify the content component, optional scroll line increments, and optional style flags. You can pass any bitwise combination of the following flags for the scroll viewer's style.

Scroll Viewer Style | Description
SCROLL_TOP | Places the horizontal scroll bar on the top of the scroll viewer panel. The default position is on the bottom.
SCROLL_LEFT | Places the vertical scroll bar on the left side of the scroll viewer panel. The default position is on the right.
HEADER_BOTTOM | Places the horizontal header bar on the bottom of the scroll viewer panel. The default position is on the top.
HEADER_RIGHT | Places the vertical header bar on the right side of the scroll viewer panel. The default position is on the left.

The following example shows several ways of constructing UIScrollViewer objects.

// Construct a scroll viewer that displays the graphical
// image stored in the variable myImage. Accept the default
// scroll line increments and the default style.
UIScrollViewer sv1 = new UIScrollViewer(new UIGraphic(myImage));

// Construct a scroll viewer that displays the UIList
// object myList. Specify scroll line increments of
// 15 pixels. Position the horizontal scroll bar on
// the top of the scroll viewer panel.
UIScrollViewer sv2 =
   new UIScrollViewer(myList, 15, 15, UIScrollViewer.SCROLL_TOP);

// Now add sv1 and sv2 to the container.
add(sv1);
add(sv2);

You can also specify a style for each scroll bar. The following flags define valid scroll bar styles.

Scroll Bar Style | Description
UIScroll.NOHIDE | Always displays the scroll bar; the scroll bar is disabled if it is not needed. By default, scroll bars are displayed only when necessary.
UIScroll.NOSHOW | Always hides the scroll bar. By default, scroll bars are displayed only when necessary. Use this in place of removing the scroll bars.
UIScroll.NONPROPORTIONAL | The size of the scroll bar's thumb component is not proportional to the scroll bar's range.

Note By default, each scroll bar has the UIScroll.NOKEY style set; therefore, the scroll bars cannot receive keyboard input.

The following example shows how to construct a UIScrollViewer object with scroll bar styles. You can specify a style for both scroll bars in one parameter, or you can specify a separate style for each scroll bar in two parameters.

// Construct a scroll viewer that displays the UITree
// object myTree1. Always show both scroll bars.
UIScrollViewer sv3 =
   new UIScrollViewer(myTree1, 15, 15, UIScrollViewer.SCROLL_TOP,
                      UIScroll.NOHIDE);

// Construct a scroll viewer that displays the UITree
// object myTree2. Always show the horizontal scroll
// bar and always hide the vertical scroll bar.
UIScrollViewer sv4 =
   new UIScrollViewer(myTree2, 15, 15, UIScrollViewer.SCROLL_TOP,
                      UIScroll.NOHIDE, UIScroll.NOSHOW);

// Add sv3 and sv4 to the container.
add(sv3);
add(sv4);

When a UIScrollViewer object is created, it contains only content and scroll bar components. To add other components, or replace existing components, call the add method. Each type of component that can be displayed is identified by a constraint, described by the following table.

Constraint Object | Component
CONTENT | The content component.
SCROLL_HORZ | The horizontal scroll bar (by default, a UIScrollBar object).
SCROLL_VERT | The vertical scroll bar (by default, a UIScrollBar object).
SCROLL_CORNER | The corner component between the scroll bars.
HEADER_HORZ | The horizontal header bar.
HEADER_VERT | The vertical header bar.
HEADER_CORNER | The corner component between the header bars.

Note The SCROLL_HORZ and SCROLL_VERT components must implement the IUIScroll interface; otherwise, they cannot be added. The CONTENT, HEADER_HORZ, and HEADER_VERT components must implement IUIPosition. If they do not, add first converts them to UIViewer objects before adding them to the scroll viewer control.

To set the scroll viewer's content, you can also call the setContent method, which returns the previous content component. The following example shows how to add (or replace) components.

// Construct a scroll viewer that displays the UIList
// object myList. When a UIScrollViewer object is created,
// the content is first added to a UIViewer object, which
// is then added to the scroll viewer.
UIScrollViewer sv = new UIScrollViewer(myList);
add(sv);  // Add sv to the container.

// Now add the UIHeaderRow object myHeader to sv as
// a horizontal header bar.
sv.add(UIScrollViewer.HEADER_HORZ, myHeader);

// Replace the content in sv with the UITree object myTree.
sv.add(UIScrollViewer.CONTENT, myTree);

// Call setContent to replace the content in sv with the
// graphical image stored in myImage. Save the previous content
// component in the variable oldContents.
IUIComponent oldContents = sv.setContent(new UIGraphic(myImage));

The UIColumnViewer class extends UIScrollViewer to display a set of columns inside the viewer control. UIColumnViewer automatically adds a UIHeaderRow object as the HEADER_HORZ component.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIScrollViewer

Constructors

UIScrollViewer

public UIScrollViewer();

Creates a scroll viewer control with no content.

Remarks:

To add a content component to the control, call add or setContent. The control displays scroll bars only when they are needed to view the content component. The content component's horizontal and vertical scroll line increments are 10 pixels each.

By default, the horizontal scroll bar is placed at the bottom of the scroll viewer control. The vertical scroll bar is placed at the right. The horizontal and vertical header bars are placed at the top and at the left of the control, respectively.

UIScrollViewer

public UIScrollViewer(IUIComponent comp);

Creates a scroll viewer control with the specified component.

Parameter | Description
comp | The component to be displayed within the scroll viewer control.

Remarks:

The control displays scroll bars only when they are needed to view the content component. The content component's horizontal and vertical scroll line increments are 10 pixels each. To change the content component, call add or setContent.

By default, the horizontal scroll bar is placed at the bottom of the scroll viewer control. The vertical scroll bar is placed at the right. The horizontal and vertical header bars are placed at the top and at the left of the control, respectively.

UIScrollViewer

public UIScrollViewer(IUIComponent comp, int style);

Creates a scroll viewer control with the specified component and style.

Parameter | Description
comp | The component to be displayed within the scroll viewer control.
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: SCROLL_TOP, SCROLL_LEFT, HEADER_BOTTOM, and HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control, and places header bars at the top and at the left.

Remarks:

By default, the control displays scroll bars only when they are needed to view the content component. The content component's horizontal and vertical scroll line increments are 10 pixels each. To change the content component, call add or setContent.

Exceptions:

IllegalArgumentException if an undefined style was specified.

UIScrollViewer

public UIScrollViewer(IUIComponent comp, int hLine, int vLine);

Creates a scroll viewer control with the specified component and scroll line increments.

Parameter | Description
comp | The component to be displayed within the scroll viewer control.
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).

Remarks:

By default, the control displays scroll bars only when they are needed to view the content component. The horizontal scroll bar is placed at the bottom of the scroll viewer control. The vertical scroll bar is placed at the right. The horizontal and vertical header bars are placed at the top and at the left of the control, respectively.

To change the content component, call add or setContent.

UIScrollViewer

public UIScrollViewer(IUIComponent comp, int hLine, int vLine, int style);

Creates a scroll viewer control with the specified component, scroll line increments, and style.

Parameter | Description
comp | The component to be displayed within the scroll viewer control.
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: SCROLL_TOP, SCROLL_LEFT, HEADER_BOTTOM, and HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control, and places header bars at the top and at the left.

Remarks:

By default, the control displays scroll bars only when they are needed to view the content component. To change the content component, call add or setContent.

Exceptions:

IllegalArgumentException if an undefined style was specified.

UIScrollViewer

public UIScrollViewer(IUIComponent comp, int hLine, int vLine, int style,
        int scrollStyle);

Creates a scroll viewer control with the specified component, scroll line increments, and styles.

Parameter | Description
comp | The component to be displayed within the scroll viewer control.
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: SCROLL_TOP, SCROLL_LEFT, HEADER_BOTTOM, and HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control, and places header bars at the top and at the left.
scrollStyle | The style of both scroll bars. Possible values include UIScroll.NOHIDE, UIScroll.NOSHOW, or UIScroll.NONPROPORTIONAL.

Remarks:

To change the content component, call add or setContent.

Exceptions:

IllegalArgumentException if an undefined style was specified.

UIScrollViewer

public UIScrollViewer(IUIComponent comp, int hLine, int vLine, int style,
        int hstyle, int vstyle);

Creates a scroll viewer control with the specified component, scroll line increments, and styles.

Parameter | Description
comp | The component to be displayed within the scroll viewer control.
hLine | The horizontal increment for scrolling the component (in pixels).
vLine | The vertical increment for scrolling the component (in pixels).
style | The style of the scroll viewer control. This parameter specifies where the scroll bars and header bars will be positioned. You can pass any bitwise combination of the following values: SCROLL_TOP, SCROLL_LEFT, HEADER_BOTTOM, and HEADER_RIGHT. You can also pass 0 for the default style, which places scroll bars at the bottom and at the right of the control, and places header bars at the top and at the left.
hstyle | The style of the horizontal scroll bar. Possible values include UIScroll.NOHIDE, UIScroll.NOSHOW, or UIScroll.NONPROPORTIONAL.
vstyle | The style of the vertical scroll bar. Possible values include UIScroll.NOHIDE, UIScroll.NOSHOW, or UIScroll.NONPROPORTIONAL.

Remarks:

To change the content component, call add or setContent.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds the specified component with the specified constraints. If a component already exists at this index, it is replaced with the specified component.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The component to be added.
constraints The layout constraints identifying where to add the component. This must be one of the following constraints, or the method performs no operation and returns null.
SCROLL_VERT SCROLL_HORZ SCROLL_CORNER
HEADER_VERT HEADER_HORZ HEADER_CORNER
CONTENT
index | The z-order index of the component to be added or replaced.

Remarks:

When adding components, the SCROLL_HORZ and SCROLL_VERT components must implement the IUIScroll interface; otherwise, they cannot be added. The CONTENT, HEADER_HORZ, and HEADER_VERT components must implement IUIPosition. If they do not, add first converts them to UIViewer objects before adding them to the scroll viewer control. To set the content, you can also call the setContent method, which returns the previous content component. For examples of how to call add and setContent, see the UIScrollViewer overview.

Overrides:

add(IUIComponent,Object,int) in UIPanel.

Exceptions:

IllegalArgumentException if an undefined constraint object was specified.

See Also: getLayoutComponent, remove

addNotify

public void addNotify();

Invokes addNotify for each component in the associated root container.

Return Value:

No return value.

See Also: removeNotify

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.

Parameter | Description
rect | The rectangle identifying the area to be made visible.

Remarks:

This method is called when the scroll viewer control has focus. If the entire rectangle does not fit inside the viewer control, the upper-right corner of the rectangle is favored.

getContent

public IUIComponent getContent();

Retrieves the component currently being displayed in the scroll viewer control.

Return Value:

Returns the content component. If the scroll viewer's content is a UIViewer object, the content component of the UIViewer object is returned.

Remarks:

To retrieve other components in the scroll viewer (such as scroll bars and header bars), call the getLayoutComponent method. Be aware that calling getContent is different than calling getLayoutComponent with the CONTENT index. If the scroll viewer's content is a UIViewer object, getLayoutComponent returns the UIViewer object, while getContent returns the content of the UIViewer object.

For more information about scroll viewers and their content, see the UIScrollViewer overview.

See Also: setContent

getHLine

public int getHLine();

Retrieves the number of pixels associated with a horizontal scroll position.

Return Value:

Returns the number of pixels in the horizontal scroll bar's scroll line.

See Also: getVLine, getLine, setHLine

getLayoutComponent

public IUIComponent getLayoutComponent(Object constraints);

Retrieves the component at the specified constraint.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter Description
constraints The layout constraints identifying where to add the component. This value depends on the layout manager of the underlying UI object. This must be one of the following constraints, or the method performs no operation and returns null.
SCROLL_VERT SCROLL_HORZ SCROLL_CORNER
HEADER_VERT HEADER_HORZ HEADER_CORNER
CONTENT

Remarks:

Calling getLayoutComponent with the CONTENT constraint is different than calling getContent. If the scroll viewer's content is a UIViewer object, getLayoutComponent returns the UIViewer object, while getContent returns the content of the UIViewer object.

For more information about scroll viewers and their content, see the UIScrollViewer overview.

Exceptions:

IllegalArgumentException if an undefined constraint object was specified.

See Also: add, remove

getLine

public Point getLine();

Retrieves the number of pixels associated with the horizontal and vertical scroll positions.

Return Value:

Returns a Point object that contains the number of pixels in a scroll line. The x coordinate specifies the horizontal scroll line; the y coordinate specifies the vertical scroll line.

See Also: getHLine, getVLine, setLine

getMinimumSize

public Dimension getMinimumSize();

Retrieves the minimum size (in pixels) of the scroll viewer control. The minimum size is based on the preferred size of each component.

Return Value:

Returns a Dimension object that contains the minimum size.

See Also: getPreferredSize

getPosition

public Point getPosition();

Retrieves the current position of the scroll viewer's content.

Return Value:

Returns a Point object that contains the content component's position. The x and y coordinates specify the horizontal and vertical positions (in pixels), respectively.

Remarks:

This method implements getPosition in the IUIPosition interface.

See Also: getXPosition, getYPosition, setPosition

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred size (in pixels) of the scroll viewer control. The preferred size is based on the preferred size of each component.

Return Value:

Returns a Dimension object that contains the preferred size (in pixels).

See Also: getMinimumSize

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the scroll viewer control.

Return Value:

Returns the ROLE_SYSTEM_PANE code.

getVLine

public int getVLine();

Retrieves the number of pixels associated with a vertical scroll position.

Return Value:

Returns the number of pixels in the vertical scroll bar's scroll line.

See Also: getHLine, getLine, setVLine

getXPosition

public int getXPosition();

Retrieves the horizontal position of the scroll viewer's content component.

Return Value:

Returns the horizontal position (in pixels).

Remarks:

This method implements getXPosition in the IUIPosition interface.

See Also: getYPosition, getPosition, setXPosition

getYPosition

public int getYPosition();

Retrieves the vertical position of the scroll viewer's content component.

Return Value:

Returns the vertical position (in pixels).

Remarks:

This method implements getYPosition in the IUIPosition interface.

See Also: getXPosition, getPosition, setYPosition

handleEvent

public boolean handleEvent(Event e);

Responds to scroll events sent from the horizontal and vertical scroll bars by adjusting the content, header, and scroll bar components.

Return Value:

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

Parameter | Description
e | The event.

isKeyable

public boolean isKeyable();

Determines whether the control can receive keyboard input.

Return Value:

Returns true if the control can receive keyboard input; otherwise, returns false.

keyDown

public boolean keyDown(Event e, int key);

Scrolls the content component according to the key being pressed.

Return Value:

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

Parameter | Description
e | The event posted to the scroll viewer control.
key | The key that has been pressed.

Remarks:

This method is called when the control has focus and a key is pressed. keyDown responds to the following key values.

Key | Response
HOME, END, PAGEUP, PAGEDOWN, UP ARROW, DOWN ARROW | Adjusts the vertical scroll bar and the vertical position of the content component accordingly.
LEFT ARROW, RIGHT ARROW | Adjusts the horizontal scroll bar and the horizontal position of the content component accordingly.

layout

public void layout();

Lays out the scroll viewer control and its components according to constraints specified in the layout manager.

Return Value:

No return value.

Remarks:

When laying out the scroll bar components, this method adjusts the position of each scroll bar to reflect the content component's current scroll position.

remove

public void remove(IUIComponent comp);

Removes the specified component from the scroll viewer control.

Return Value:

No return value.

Parameter | Description
comp | The component to be removed.

Remarks:

You can use the getLayoutComponent method to specify the component to be removed, as shown in the following example.

// Remove the horizontal scroll bar from
// the UIScrollViewer object sv.
sv.setScrollStyle(sv.getLayoutComponent(UIScrollViewer.SCROLL_HORZ),NOSHOW);

To add a component to the scroll viewer control, call the add method.

replace

public IUIComponent replace(IUIComponent comp, Object constraints);

Replaces the current component with the new component according to the specified constraints.

Return Value:

Returns the newly replaced component, or null.

Parameter Description
comp The new component. The constraints identifying where to replace the component. This value depends on the layout manager of the underlying UI object. This must be one of the following constraints, or the method performs no operation and returns null.
SCROLL_VERT SCROLL_HORZ SCROLL_CORNER
HEADER_VERT HEADER_HORZ HEADER_CORNER
CONTENT

requestFocus

public void requestFocus();

Transfers focus to the viewer control's content component.

Return Value:

No return value.

setContent

public void setContent(IUIComponent content);

Sets the scroll viewer control's content to the specified component.

Return Value:

No return value.

Parameter | Description
content | The component to be displayed within the scroll viewer control.

Remarks:

To set the other components in the scroll viewer (such as scroll bars and header bars), call the add method. Be aware that calling setContent is different from calling add with the CONTENT constraint. setContent automatically converts the specified component to a UIViewer object, while add only converts the component if it does not implement the IUIPosition interface.

For more information about scroll viewers and their content, see the UIScrollViewer overview.

See Also: getContent

setHLine

public void setHLine(int line);

Sets the number of pixels associated with a horizontal scroll position.

Return Value:

No return value.

Parameter | Description
line | The number of pixels for the horizontal scroll bar's scroll line.

See Also: setVLine, setLine, getHLine

setLine

public void setLine(int hLine, int vLine);

Sets the number of pixels associated with horizontal and vertical scroll positions.

Return Value:

No return value.

Parameter | Description
hLine | The number of pixels for the horizontal scroll bar's scroll line.
vLine | The number of pixels for the vertical scroll bar's scroll line.

See Also: setHLine, setVLine, getLine

setPosition

public void setPosition(Point pt);

Moves the scroll viewer's content to the scroll position given by the specified point.

Return Value:

No return value. the new position.

Parameter | Description
pt | The requested position for the content component. The x and y coordinates of pt specify the horizontal and vertical positions (in pixels), respectively.

Remarks:

This method implements setPosition in the IUIPosition interface.

See Also: setXPosition, setYPosition, getPosition

setPosition

public void setPosition(int x, int y);

Moves the scroll viewer's content to the position given by the specified values.

Return Value:

No return value. the new position.

Parameter | Description
x | The requested horizontal position for the content component (in pixels).
y | The requested vertical position for the content component (in pixels).

Remarks:

This method implements setPosition in the IUIPosition interface.

See Also: setXPosition, setYPosition, getPosition

setScrollStyle

public void setScrollStyle(int scroller, int style);

Sets the style of the specified scroll bar.

Return Value:

No return value.

Parameter | Description
scroller | The scroll bar whose style is being set. Pass S_VERT for the vertical scroll bar, or S_HORZ for the horizontal scroll bar.
style The style of the scroll bar. You can pass one of the following values:
  • UIScroll.NOHIDE
  • UIScroll.NOSHOW
  • UIScroll.NONPROPORTIONAL

Remarks:

To apply the style to both scroll bars, you can pass only the style to setScrollStyle, as shown in the following example.

// Give both scroll bars the NOHIDE style.
myScrollViewer.setScrollStyle(UIScroll.NOHIDE);

setScrollStyle

public void setScrollStyle(int style);

Sets the style of the scroll bars.

Return Value:

No return value.

Parameter Description
style The style of the scroll bars. You can pass one of the following values:
  • UIScroll.NOHIDE
  • UIScroll.NOSHOW
  • UIScroll.NONPROPORTIONAL

Remarks:

This method applies the specified style to both scroll bars. To individually set the style of each scroll bar, pass the scroll bar type to setScrollStyle, as shown in the following example.

// Set the horizontal scroll bar to NOHIDE
// and the vertical scroll bar to NOSHOW.
myScrollViewer.setScrollStyle(UIScrollViewer.S_HORZ, UIScroll.NOHIDE);
myScrollViewer.setScrollStyle(UIScrollViewer.S_VERT, UIScroll.NOSHOW);

setVLine

public void setVLine(int line);

Sets the number of pixels associated with a vertical scroll position.

Return Value:

No return value.

Parameter | Description
line | The number of pixels for the vertical scroll bar's scroll line.

See Also: setHLine, setLine, getVLine

setXPosition

public void setXPosition(int x);

Moves the scroll viewer's content in the horizontal direction by the specified amount.

Return Value:

No return value.

Parameter | Description
x | The requested horizontal position for the content component (in pixels).

Remarks:

This method implements setXPosition in the IUIPosition interface.

See Also: setYPosition, setPosition, getXPosition

setYPosition

public void setYPosition(int y);

Moves the scroll viewer's content in the vertical direction by the specified amount.

Return Value:

No return value.

Parameter | Description
y | The requested vertical position for the content component (in pixels).

Remarks:

This method implements setYPosition in the IUIPosition interface.

See Also: setXPosition, setPosition, getYPosition

Fields

CONT
The constant used to construct the CONTENT constraint.
CONTENT
The constraint of the content component.
H_CORNER
The constant used to construct the HEADER_CORNER index.
H_HORZ
The constant used to construct the HEADER_HORZ index.
H_VERT
The constant used to construct the HEADER_VERT index.
HEADER_BOTTOM
Positions the horizontal header bar on the bottom of the scroll viewer panel. The default position is on the top.
HEADER_CORNER
The constraint of the corner component between the header bar components.
HEADER_HORZ
The constraint of the horizontal header bar component.
HEADER_RIGHT
Positions the vertical header bar on the right side of the scroll viewer panel. The default position is on the left.
HEADER_VERT
The constraint of the vertical header bar component.
S_CORNER
The constant used to construct the SCROLL_CORNER index.
S_HORZ
The constant used to construct the SCROLL_HORZ index.
S_VERT
The constant used to construct the SCROLL_VERT index.
SCROLL_CORNER
The constraint of the corner component between the scroll bar components.
SCROLL_HORZ
The constraint of the horizontal scroll bar component.
SCROLL_LEFT
Positions the vertical scroll bar on the left side of the scroll viewer panel. The default position is on the right.
SCROLL_TOP
Positions the horizontal scroll bar on the top of the scroll viewer panel. The default position is on the bottom.
SCROLL_VERT
The constraint of the vertical scroll bar component.


Class UISelector

public abstract class UISelector extends UIPanel implements
            IUISelector, TimerListener
{
  // Constructors
  public UISelector();
  public UISelector(int selMode);

  // Methods
  public synchronized void addActionListener(IUIActionListener l);
  public synchronized void addItemListener(IUIItemListener l);
  public void addSelectedIndex(int index);
  public void addSelectedIndex(int index, boolean notify);
  public void addSelectedIndices(int indices[]);
  public void addSelectedIndices(int indices[], boolean notify);
  public void addSelectedItem(IUIComponent comp);
  public void addSelectedItem(IUIComponent comp, boolean notify);
  public void addSelectedItems(IUIComponent comps[]);
  public void addSelectedItems(IUIComponent comps[],
        boolean notify);
  public IUIComponent find(String prefix);
  public IUIComponent find(String prefix, boolean fromFocus);
  public IUIComponent find(String prefix, IUIComponent compStart);
  public IUIComponent find(String prefix, IUIComponent compStart,
        boolean keyable);
  public IUIComponent getAnchorItem();
  public IUIComponent getExtensionItem();
  public int getRoleCode();
  public int getSelectedIndex();
  public int[] getSelectedIndices();
  public IUIComponent getSelectedItem();
  public IUIComponent[] getSelectedItems();
  public int getSelectionMode();
  public int getStateCode();
  public boolean gotFocus(Event e, Object o);
  public boolean keyDown(Event e, int key);
  public boolean lostFocus(Event e, Object o);
  public boolean mouseDown(Event e, int x, int y);
  public boolean mouseDrag(Event e, int x, int y);
  protected void processActionEvent(UIActionEvent e);
  protected void processEvent(UIEvent e);
  protected void processItemEvent(UIItemEvent e);
  public void remove(int index);
  public void remove(IUIComponent comp);
  public synchronized void removeActionListener(
        IUIActionListener l);
  public synchronized void removeItemListener(IUIItemListener l);
  public void removeSelectedIndex(int index);
  public void removeSelectedIndex(int index, boolean notify);
  public void removeSelectedIndices(int indices[]);
  public void removeSelectedIndices(int indices[], boolean notify);
  public void removeSelectedItem(IUIComponent comp);
  public void removeSelectedItem(IUIComponent comp, boolean notify);
  public void removeSelectedItems(IUIComponent comps[]);
  public void removeSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setAnchorItem(IUIComponent comp);
  public void setExtensionItem(IUIComponent comp);
  public void setSelected(boolean on);
  public void setSelectedIndex(int index);
  public void setSelectedIndex(int index, boolean notify);
  public void setSelectedIndices(int indices[]);
  public void setSelectedIndices(int indices[], boolean notify);
  public void setSelectedItem(IUIComponent comp);
  public void setSelectedItem(IUIComponent comp, boolean notify);
  public void setSelectedItems(IUIComponent comps[]);
  public void setSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setSelectionMode(int selMode);
  public void timeTriggered(TimerEvent te);
}

This class implements an abstract selector control. The following diagram shows the classes that extend UISelector.

UISelector
|
+--UIList
|
+--UITabList
|
+--UITree

By implementing the IUISelector interface, UISelector supports the selection modes in the following table.
SINGLESELECT | The user may only select one item at a time.
MULTISELECT | The user may select or deselect any item by clicking it.
EXTENDSELECT | Behaves like SINGLESELECT, except when either the SHIFT or the CTRL key is down. SHIFT+click extends selection to current position. CTRL+click selects or deselects the currently focused item, without affecting any other selections. CTRL+SHIFT+click is a combination of the two.
NOSELECT | Items may only be selected programatically.

The following examples show how to call some of these methods for a UIList control.

// Create two list controls.
UIList fruits = new UIList();  // SINGLESELECT by default.
UIList vegetables = new UIList(UISelector.MULTISELECT);

// Add items to the fruits list.
IUIComponent f1 = fruits.add("apple");
IUIComponent f2 = fruits.add("banana");
IUIComponent f3 = fruits.add("cherry");
add(fruits);  // Add the control to the container.

// Set the selection in the fruits list to the first item,
// at index 0. A list select event will not be generated.
fruits.setSelectedIndex(0);

// Now add items to the vegetables list.
IUIComponent v1 = vegetables.add("carrot");
IUIComponent v2 = vegetables.add("broccoli");
IUIComponent v3 = vegetables.add("zucchini");
add(vegetables);  // Add the control to the container.

// Create an array of components that will set the
// selection to the first and third items in the
// vegetables list.
UIComponent selComps[] = new UIComponent[2];
selComps[0] = v1;
selComps[1] = v3;

// Set the selection to the components
// identified by the selComps array. Specify
// that a list select event will be generated.
vegetables.setSelectedItems(selComps, true);

// Trap the list select event.
public boolean handleEvent(Event e)
{
   // A list select event is always generated
   // when the user selects an item. Calls to
   // the setSelectedXXX and selectXXX methods
   // can optionally generate this event.
   if (e.id == Event.LIST_SELECT)
   {
      if (e.target == vegetables)
      {
         // Do something here.
         return true;
      }
      else if (e.target == fruits)
      {
         // Do something here.
         return true;
      }
   }
   return false;
}

The addSelectedIndex and addSelectedItem methods are similar to setSelectedIndex and setSelectedItem, respectively. All four methods enable you to set an item's selected state. To clear a selection call fruits.removeSelectedIndex(i) or fruits.setSelectedIndex(-1). The first call will clear the ith selection. The last call will clear all selections.

The optional boolean argument in these methods is used to specify whether a LIST_SELECT or DESELECT event should be generated. For example, fruits.addSelectedIndex(i, false),will select the item at index i, without affecting anything else and will not generate a LIST_SELECT.

Comments:

Calls to the setSelectedXXX, removeSelectedXXX and addSelectedXXX methods should be made from the outermost level of the selector. For example, suppose you have a tree called food and this tree contains trees called fruit, vegetables, and meat. Suppose that the fruit tree has a banana item. To select the banana item, call food.setSelectedItem(banana) not fruit.setSelectedItem(banana).

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UISelector

Constructors

UISelector

public UISelector();

Creates a selector control with the SINGLESELECT selection mode.

UISelector

public UISelector(int selMode);

Creates a selector control with the specified selection mode.

Parameter | Description
selMode | The selection mode. Possible values include SINGLESELECT, MULTISELECT, or EXTENDSELECT.

Exceptions:

IllegalArgumentException if an undefined selection mode was specified.

Methods

addActionListener

public synchronized void addActionListener(IUIActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

Remarks:

This method implements addActionListener in the IUISelector interface.

See Also: removeActionListener

addItemListener

public synchronized void addItemListener(IUIItemListener l);

Adds the specified item listener. The listener receives all item events generated for the control. (Item events are generated when the state of an item changes.)

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

Remarks:

This method implements addItemListener in the IUISelector interface.

See Also: removeItemListener

addSelectedIndex

public void addSelectedIndex(int index);

Selects the component at the specified index, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.

addSelectedIndex

public void addSelectedIndex(int index, boolean notify);

Selects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedIndices

public void addSelectedIndices(int indices[]);

Selects the components at the specified indices, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.

addSelectedIndices

public void addSelectedIndices(int indices[], boolean notify);

Selects the components at the specified indices, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedItem

public void addSelectedItem(IUIComponent comp);

Selects the specified component, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.

addSelectedItem

public void addSelectedItem(IUIComponent comp, boolean notify);

Selects the specified component, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedItems

public void addSelectedItems(IUIComponent comps[]);

Selects the specified components, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be selected.

addSelectedItems

public void addSelectedItems(IUIComponent comps[], boolean notify);

Selects the specified components, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

find

public IUIComponent find(String prefix);

Searches the selector control for a keyable item whose name begins with the specified prefix, starting at the first item in the control.

Note find will return a UITab component when a UITabList object is used. Since a UITree object can have anything as its child, the child object will simply be returned.

Return Value:

Returns the first matching component; otherwise, returns null.

Parameter | Description
prefix | The prefix string to search for.

find

public IUIComponent find(String prefix, boolean fromFocus);

Searches the selector control for a keyable item whose name begins with the specified prefix. The search begins from either the current focus, or the first item in the selector.

Note find will return a UITab item when a UITabList object is used. It will return a UITree item when a UITree object is used. The tree must be visible before calling find.

Return Value:

Returns the first matching component; otherwise, returns null.

Parameter | Description
prefix | The prefix string to search for.
fromFocus | If true, the search begins from the current focus. Otherwise, the search begins with the first item in the selector.

find

public IUIComponent find(String prefix, IUIComponent compStart);

Searches the selector control for a keyable item whose name begins with the specified prefix. The search begins at compStart.

Note find will return a UITab item when a UITabList object is used. It will return a UITree item when a UITree object is used. The tree must be visible before calling find.

Return Value:

Returns the first matching component; otherwise, returns null.

Parameter | Description
prefix | The prefix string to search for.
compStart | The component at which the search begins. If it is null, search will begin at the first item (according to navigate).

find

public IUIComponent find(String prefix, IUIComponent compStart,
        boolean keyable);

Searches the selector control for an item whose name begins with the specified prefix. The search begins at compStart, and can be performed on all components (keyable = false), or only keyable components (keyable = true).

Note Components in an unexpanded tree are not keyable. Specify (keyable = false) to search all items in a tree, regardless of whether the items are in a collapsed state.

Return Value:

Returns the first matching component; otherwise, returns null.

Parameter | Description
prefix | The prefix string to search for.
compStart | The component at which the search begins. If it is null, the search will begin at the first item.
keyable | If true, only keyable components are searched. Otherwise, all components are searched.

getAnchorItem

public IUIComponent getAnchorItem();

Retrieves the component that is the current anchor in extend select mode.

Return Value:

Returns the component that is the anchor.

getExtensionItem

public IUIComponent getExtensionItem();

Retrieves the item from which a selection last extended from the anchor item.

Note This method is only used in the EXTENDSELECT mode.

Return Value:

Returns the extension item.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the selector control.

Return Value:

Returns the ROLE_SYSTEM_LIST code.

getSelectedIndex

public int getSelectedIndex();

Retrieves the zero-based index of the currently selected item.

Return Value:

Returns the index of the selected item, if an item is selected; otherwise, returns null. If the root node of a UITree object displays an item, this item is at index 0 and the first child item is at index 1. Otherwise, the first child item begins at index 0. For UIList and UITabList objects, the first item is always at index 0.

Remarks:

This method implements getSelectedIndex in the IUISelector interface. If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call getSelectedIndices.

For related code examples, see the UISelector overview.

See Also: getSelectedItem, setSelectedIndex

getSelectedIndices

public int[] getSelectedIndices();

Retrieves the zero-based indices of all currently selected items.

Return Value:

Returns an array of the indices of the selected items, if an item is selected; otherwise, returns null. If the root node of a UITree object displays an item, this item is at index 0 and the first child item is at index 1. Otherwise, the first child item begins at index 0. For UIList and UITabList objects, the first item is always at index 0.

Remarks:

This method implements getSelectedIndices in the IUISelector interface. For related code examples, see the UISelector overview.

See Also: getSelectedIndex, getSelectedItems, setSelectedIndices

getSelectedItem

public IUIComponent getSelectedItem();

Retrieves the currently selected item.

Return Value:

Returns the selected component, if a component is selected; otherwise, returns null.

Remarks:

This method implements getSelectedItem in the IUISelector interface. If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call getSelectedItems.

For related code examples, see the UISelector overview.

See Also: getSelectedIndex, setSelectedItem

getSelectedItems

public IUIComponent[] getSelectedItems();

Retrieves all currently selected items.

Return Value:

Returns an array of the selected components, if a component is selected; otherwise, returns null.

Remarks:

This method implements getSelectedItems in the IUISelector interface. For related code examples, see the UISelector overview.

See Also: getSelectedItem, getSelectedIndices, setSelectedItems

getSelectionMode

public int getSelectionMode();

Retrieves the selection mode of the control.

Return Value:

Returns one of the following three selection modes: SINGLESELECT, MULTISELECT, or EXTENDSELECT.

Remarks:

This method implements getSelectionMode in the IUISelector interface.

See Also: setSelectionMode

getStateCode

public int getStateCode();

Retrieves the state of the selector control.

Return Value:

Returns the combination of STATE_SYSTEM codes that best describes the state of the control.

Remarks:

The returned code contains the STATE_SYSTEM_MULTISELECTABLE flag (if the selection mode is MULTISELECT), or the STATE_SYSTEM_EXTSELECTABLE flag (if the selection mode is EXTENDSELECT).

gotFocus

public boolean gotFocus(Event e, Object o);

Responds to the selector control receiving focus.

Return Value:

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

Parameter | Description
e | The event posted to the control.
o | The object that posted the event (always null).

keyDown

public boolean keyDown(Event e, int key);

Handles keyboard navigation for the selector control.

Return Value:

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

Parameter | Description
e | The event posted to the control.
key | The key that has been pressed.

Remarks:

This method is called when the control has focus and a key is pressed. keyDown responds to the following key values.

Key | Response
HOME, END, PAGEUP, PAGEDOWN, all ARROW keys | Navigates through the items in the control.
BACKSPACE | Clears the previous key pressed during an incremental type search.
ESC | Stops an incremental type search.
All other keys | Begins an incremental type search for a component that begins with the characters pressed (limited by a timer). If a match is found, the match component receives focus.

lostFocus

public boolean lostFocus(Event e, Object o);

Responds to the selector control losing focus.

Return Value:

Returns false.

Parameter | Description
e | The event posted to the control.
o | The object that posted the event (always null).

mouseDown

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

Determines whether an item in the selector control was double-clicked, and if so, generates an action event for that item.

Return Value:

Returns false.

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

Depending on the control's selection mode, this method responds to the mouse being clicked on an item, as shown in the following table.

Selection mode | Response
SINGLESELECT | Selects the item at the mouse's current location and clears any previous selection. A list select event is generated.
MULTISELECT | Changes the selection state of the item that is clicked, without changing the state of any other item. In a MULTISELECT control, an item is selected when it is clicked with the mouse.
EXTENDSELECT | Behaves like SINGLESELECT unless there is a CTRL or SHIFT modifier. SHIFT+click extends selection to current position. CTRL+click selects or deselects the currently focused item, without affecting any other selections. CTRL-SHIFT+click is a combination of the two.

mouseDrag

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

Selects items in the selector control, according to the current selection mode.

Return Value:

Returns false.

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

Depending on the control's selection mode, this method responds to the mouse being dragged across an item, as shown in the following table.

Selection mode | Response
SINGLESELECT | Selects the item at the mouse's current location and clears any previous selection. A list select event is generated.
MULTISELECT | Does nothing. In a MULTISELECT control, an item is selected when it is clicked with the mouse.
EXTENDSELECT | Selects the item at the mouse's current location without clearing any previous selection. A list select event is generated.

processActionEvent

protected void processActionEvent(UIActionEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is invoked automatically if a listener has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.

Event type | Method called
action event | processActionEvent
item event | processItemEvent
container event | processContainerEvent (inherited through UIStateContainer)
focus event | processFocusEvent (inherited through UIStateContainer)
key event | processKeyEvent (inherited through UIStateContainer)
mouse event | processMouseEvent (inherited through UIStateContainer)
mouse motion event | processMouseMotionEvent (inherited through UIStateContainer)

When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(UIItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

remove

public void remove(int index);

Removes the component at the specified index from the selector control, without affecting other selections.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component to be removed. If the root node of a UITree object displays an item, this item is at index 0 and the first child item is at index 1. Otherwise, the first child item begins at index 0. For UIList and UITabList objects, the first item is always at index 0.

Remarks:

The following example shows how to remove an item from a UIList control.

UIList colors = new UIList();

// Add items to the list.
colors.add("Red");
colors.add("Blue");
add(colors);  // Add the list to the container.

// Now remove the first component.
colors.remove(0);

Overrides:

remove(int) in UIPanel.

remove

public void remove(IUIComponent comp);

Removes the specified component from the selector control, without affecting other selections.

Return Value:

No return value.

Parameter | Description
comp | The component to be removed.

Remarks:

The following example shows how to remove an item from a UIList control.

UIList colors = new UIList();

// Add items to the list.
IUIComponent c1 = colors.add("Red");
IUIComponent c2 = colors.add("Blue");
add(colors);  // Add the list to the container.

// Now remove the "Red" component.
colors.remove(c1);

removeActionListener

public synchronized void removeActionListener(IUIActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

Remarks:

This method implements removeActionListener in the IUISelector interface.

See Also: addActionListener

removeItemListener

public synchronized void removeItemListener(IUIItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

Remarks:

This method implements removeItemListener in the IUISelector interface.

See Also: addItemListener

removeSelectedIndex

public void removeSelectedIndex(int index);

Deselects the component at the specified index, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.

removeSelectedIndex

public void removeSelectedIndex(int index, boolean notify);

Deselects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedIndices

public void removeSelectedIndices(int indices[]);

Deselects the components at the specified indices, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.

removeSelectedIndices

public void removeSelectedIndices(int indices[], boolean notify);

Deselects the components at the specified indices, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedItem

public void removeSelectedItem(IUIComponent comp);

Deselects the specified component, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.

removeSelectedItem

public void removeSelectedItem(IUIComponent comp, boolean notify);

Deselects the specified component, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[]);

Deselects the specified components, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be deselected.

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[], boolean notify);

Deselects the specified components, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

setAnchorItem

public void setAnchorItem(IUIComponent comp);

Sets the item used as an anchor in EXTENDSELECT mode. The anchor item cannot be set to null.

Return Value:

No return value.

Parameter | Description
comp | The component that will be the new anchor.

Remarks:

The anchor is set whenever you click or CTRL+click an item. When you SHIFT+click an item, all the items from the anchor to where you SHIFT+clicked are selected.

SHIFT+clickdoes not set the anchor; it sets the extension item (see setExtensionItem). Click an item to set the anchor, and then SHIFT+click above and below it; the anchor will be obvious.

Although the anchor is set when the user clicks an item, it is also possible to set the anchor programatically with setAnchorItem. You can not set the anchor item to be null.

Note Resetting the anchor automatically sets the current extension item to null. If it is intended to set both to specific items, call setAnchorItem, followed by setExtensionItem.

Setting the anchor in an IUISelector, other than the outermost one, has no effect.

Exceptions:

IllegalArgumentException if the component is not a child of the selector, or if the component is null.

See Also: setAnchorItem, setExtensionItem

setExtensionItem

public void setExtensionItem(IUIComponent comp);

Sets the item to which a selection extends from an anchor.

Note Calling setAnchorItem automatically resets this item to null.

Return Value:

No return value.

Parameter | Description
comp | The component that will be the new extension item.

Exceptions:

IllegalArgumentException if comp is not a child of the selector.

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the selector control.

Return Value:

No return value.

Parameter | Description
on | If true, the selected state is set; otherwise, it is cleared.

setSelectedIndex

public void setSelectedIndex(int index);

Sets the selection to the component at the specified index. By default, a list select event is not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected. If the root node of a UITree object displays an item, this item is at index 0 and the first child item is at index 1. Otherwise, the first child item begins at index 0. For UIList and UITabList objects, the first item is always at index 0.

Remarks:

This method implements setSelectedIndex in the IUISelector interface, and clears any previous selection. If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call setSelectedIndices to select multiple items at a time.

For related code examples, see the UISelector overview.

See Also: setSelectedItem, addSelectedIndex, getSelectedIndex

setSelectedIndex

public void setSelectedIndex(int index, boolean notify);

Sets the selection to the component at the specified index, and optionally generates a list select event.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected. If the root node of a UITree object displays an item, this item is at index 0 and the first child item is at index 1. Otherwise, the first child begins at index 0. For UIList and UITabList objects, the first item is always at index 0.
notify | If true, a list select event will be generated; otherwise, a list select event will not be generated.

Remarks:

This method implements setSelectedIndex in the IUISelector interface, and clears any previous selection. If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call setSelectedIndices to select multiple items at a time.

For related code examples, see the UISelector overview.

See Also: setSelectedItem, addSelectedIndex, getSelectedIndex

setSelectedIndices

public void setSelectedIndices(int indices[]);

Sets the selection to the components at the specified indices. List select events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the zero-based indices of the items to be selected. If the root node of a UITree object displays an item, this item is at index 0 and the first child item is at index 1. Otherwise, the first child begins at index 0. For UIList and UITabList objects, the first item is always at index 0.

Remarks:

This method implements setSelectedIndices in the IUISelector interface, and clears any previous selection. If the control's selection mode is SINGLESELECT, you can also call setSelectedIndex.

For related code examples, see the UISelector overview.

See Also: setSelectedItems, getSelectedIndices

setSelectedIndices

public void setSelectedIndices(int indices[], boolean notify);

Sets the selection to the components at the specified indices, and optionally generates list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the zero-based indices of the items to be selected. If the root node of a UITree object displays an item, this item is at index 0 and the first child item is at index 1. Otherwise, the first child item begins at index 0. For UIList and UITabList objects, the first item is always at index 0.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method implements setSelectedIndices in the IUISelector interface, and clears any previous selection. If the control's selection mode is SINGLESELECT, you can also call setSelectedIndex.

For related code examples, see the UISelector overview.

See Also: setSelectedItems, getSelectedIndices

setSelectedItem

public void setSelectedItem(IUIComponent comp);

Sets the selection to the specified component. A list select event is not generated.

Return Value:

No return value.

Parameter | Description
comp | The item to be selected.

Remarks:

This method implements setSelectedItem in the IUISelector interface, and clears any previous selection. If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call setSelectedItems to select multiple items at a time.

For related code examples, see the UISelector overview.

Exceptions:

IllegalArgumentException if the specified component is not an immediate child of the selector control.

See Also: setSelectedIndex, addSelectedItem, getSelectedItem

setSelectedItem

public void setSelectedItem(IUIComponent comp, boolean notify);

Sets the selection to the specified component, and optionally generates a list select event.

Return Value:

No return value.

Parameter | Description
comp | The item to be selected.
notify | If true, a list select event will be generated; otherwise, a list select event will not be generated.

Remarks:

This method implements setSelectedItem in the IUISelector interface, and clears any previous selection. If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call setSelectedItems to select multiple items at a time.

For related code examples, see the UISelector overview.

Exceptions:

IllegalArgumentException if the specified component is not an immediate child of the selector control.

See Also: setSelectedIndex, addSelectedItem, getSelectedItem

setSelectedItems

public void setSelectedItems(IUIComponent comps[]);

Sets the selection to the specified components. List select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected.

Remarks:

This method implements setSelectedItems in the IUISelector interface, and clears any previous selection. If the control's selection mode is SINGLESELECT, you can also call setSelectedItem.

For related code examples, see the UISelector overview.

Exceptions:

IllegalArgumentException if any component in the array is not an immediate child of the selector control.

See Also: setSelectedIndices, getSelectedItems

setSelectedItems

public void setSelectedItems(IUIComponent comps[], boolean notify);

Sets the selection to the specified components, and optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method implements setSelectedItems in the IUISelector interface, and clears any previous selection. If the control's selection mode is SINGLESELECT, you can also call setSelectedItem.

For related code examples, see the UISelector overview.

Exceptions:

IllegalArgumentException if any component in the array is not an immediate child of the selector control.

See Also: setSelectedIndices, getSelectedItems

setSelectionMode

public void setSelectionMode(int selMode);

Sets the selection mode of the control.

Return Value:

No return value.

Parameter | Description
selMode | The selection mode for the control. Possible values include SINGLESELECT, MULTISELECT, EXTENDSELECT, or NOSELECT.

Remarks:

This method implements setSelectionMode in the IUISelector interface.

Exceptions:

IllegalArgumentException if an undefined selection mode was specified.

See Also: getSelectionMode

timeTriggered

public void timeTriggered(TimerEvent te);

Stops an incremental type search of the selector.

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. The keyDown method starts a timer to begin an incremental type search. When the timer expires, timeTriggered is automatically invoked to stop the search.


Class UISingleContainer

public class UISingleContainer extends UIStateContainer
{
  // Constructors
  public UISingleContainer();
  public UISingleContainer(int edge);

  // Methods
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public IUIComponent getChild(int index);
  public Rectangle getChildBounds(int index);
  public int getChildCount();
  public Point getChildLocation(int index);
  public Dimension getChildSize(int index);
  public IUIComponent getComponent(int index);
  public int getComponentCount();
  public IUIComponent getHeader();
  public void layout();
  public boolean mouseExit(Event e, int x, int y);
  public void relayout();
  public void remove(int index);
  public void setFocused(boolean on);
  public void setHeader(IUIComponent header);
  public void setID(int id);
  public void setName(String name);
}

This class implements a container for a single header component. Header components are used to represent the container itself; for example, the text displayed on a button is used as its header component. Unlike UIPanel, a UISingleContainer object cannot contain child components. UISingleContainer provides the getHeader and setHeader methods to retrieve and set the current header component.

The following diagram shows the classes that extend UISingleContainer.

UISingleContainer
|
+--UIButton
|
+--UIMenuLauncher
|
+--UIStatus
|
+--UITab
|
+--UIThumb

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer

Constructors

UISingleContainer

public UISingleContainer();

Creates a UISingleContainer object with no edge.

UISingleContainer

public UISingleContainer(int edge);

Creates a UISingleContainer object with the specified edge.

Parameter Description
edge The style of the container's edge. You can pass one of the following values:
  • IFxGraphicsConstants.BDR_RAISED
  • IFxGraphicsConstants.BDR_SUNKEN
  • IFxGraphicsConstants.BDR_OUTER
  • IFxGraphicsConstants.BDR_INNER
  • IFxGraphicsConstants.BDR_RAISEDOUTER
  • IFxGraphicsConstants.BDR_RAISEDINNER
  • IFxGraphicsConstants.BDR_SUNKENOUTER
  • IFxGraphicsConstants.BDR_SUNKENINNER
  • IFxGraphicsConstants.BDR_FLAT
  • IFxGraphicsConstants.EDGE_RAISED
  • IFxGraphicsConstants.EDGE_SUNKEN
  • IFxGraphicsConstants.EDGE_ETCHED
  • IFxGraphicsConstants.EDGE_BUMP
  • 0 (No edge style)

Exceptions:

IllegalArgumentException if an undefined edge style was specified.

Methods

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds the specified component to the container, according to the specified constraints and index.

Return Value:

Returns the component that was added (if successful); otherwise, returns null.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints, which depend on the current layout manager. For more information, see the layout manager's addLayoutComponent method.
index | The zero-based index at which to insert the component. Because the component can only be added as a header, possible index values include 0 or -1. (For more information about header components, see the UISingleContainer overview.)

Remarks:

Other versions of add are inherited from UIContainer.

Overrides:

add(IUIComponent,Object,int) in UIStateContainer.

Exceptions:

ArrayIndexOutOfBoundsException if an invalid index was specified.

See Also: remove

getChild

public IUIComponent getChild(int index);

Retrieves the child component at the specified index.

Return Value:

Returns null, because the container can only contain a header component and no child components.

Parameter | Description
index | The zero-based index of the child component to be retrieved.

See Also: getComponent, getChildCount

getChildBounds

public Rectangle getChildBounds(int index);

Retrieves the bounding rectangle of the component at the specified index.

Return Value:

Returns a Rectangle object that identifies the component's bounding area (if the component is the container's header); otherwise, returns null.

Parameter | Description
index | The zero-based index of the component. Because the container can only contain a header component, this method returns null if an index other than 0 is passed.

getChildCount

public int getChildCount();

Retrieves the number of child components in the container, excluding the header component.

Return Value:

Returns 0, because the container can only contain a header component.

See Also: getComponentCount, getChild

getChildLocation

public Point getChildLocation(int index);

Retrieves the location of the component at the specified index.

Return Value:

Returns a Point object containing the top-left corner of the component (if the component is the container's header); otherwise, returns null.

Parameter | Description
index | The zero-based index of the component. Because the container can only contain a header component, this method returns null if an index other than 0 is passed.

getChildSize

public Dimension getChildSize(int index);

Retrieves the size of the component at the specified index.

Return Value:

Returns a Dimension object containing the component's dimensions (if the component is the container's header); otherwise, returns null.

Parameter | Description
index | The zero-based index of the component. Because the container can only contain a header component, this method returns null if an index other than 0 is passed.

getComponent

public IUIComponent getComponent(int index);

Retrieves the component at the specified index.

Return Value:

Returns the component at the specified index, if found; otherwise, returns null.

Parameter | Description
index | The zero-based index of the component to be retrieved. Because the container can only contain a header component, pass 0 to retrieve the header. This method returns null if any other index is passed.

See Also: getChild, getComponentCount

getComponentCount

public int getComponentCount();

Retrieves the number of components in the container.

Return Value:

Returns 1 if a header component is set; otherwise, returns 0.

See Also: getChildCount, getComponent

getHeader

public IUIComponent getHeader();

Retrieves the container's header component.

Return Value:

Returns the current header component (if the container has a header); otherwise, returns null. For more information about headers, see the UISingleContainer overview.

See Also: setHeader

layout

public void layout();

Lays out the container.

Return Value:

No return value.

Remarks:

This method is invoked when the container is validated.

See Also: relayout

mouseExit

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

Responds to a mouse exit event.

Return Value:

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

Parameter | Description
e | The event posted to the container.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method prevents excess flickering when the mouse is moved in and out of the container. A mouse exit event is generated when the mouse exits the container's insets and enters the header component, and vice versa. In these cases, the mouseExit method simply returns false.

relayout

public void relayout();

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

Return Value:

No return value.

See Also: layout

remove

public void remove(int index);

Removes the component at the specified index.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component to be removed. Because the container can only contain a header component, pass 0 to remove the header.

Overrides:

remove(int) in UIStateContainer.

See Also: add

setFocused

public void setFocused(boolean on);

Sets or clears the focus state of the button.

Return Value:

No return value.

Parameter | Description
on | If true, the focus state is set; otherwise, it is cleared.

Remarks:

For more information about states, see the UIStateContainer overview.

Overrides:

setFocused(boolean) in UIStateContainer.

setHeader

public void setHeader(IUIComponent header);

Sets the header component for the container.

Return Value:

No return value.

Parameter | Description
header | The component to be used as the container's header component. For more information about headers, see the UISingleContainer overview.

See Also: getHeader

setID

public void setID(int id);

Sets the container's identifier.

Return Value:

No return value.

Parameter | Description
id | The value to be associated with the container.

See Also: setName

setName

public void setName(String name);

Sets the container's name.

Return Value:

No return value.

Parameter | Description
name | The name to be associated with the container.

See Also: setID


Class UISlider

public class UISlider extends UIScroll
{
  // Fields
  public static final int DEFAULTSPACING;
  public static final int POINTDOWN;
  public static final int POINTLEFT;
  public static final int POINTRIGHT;
  public static final int POINTSABOVE;
  public static final int POINTSBELOW;
  public static final int POINTUP;
  public static final int RANGESELECT;
  public static final int TICKS_ABOVE;
  public static final int TICKS_BELOW;
  public static final int TICKSABOVE;
  public static final int TICKSBELOW;
  public static final int VERTICAL;

  // Constructors
  public UISlider();
  public UISlider(int style);
  public UISlider(int style, int min, int max, int page, int line,
        int pos, int spacing);

  // Methods
  public IUIComponent add(int index, IUIComponent comp);
  public void clearSelection();
  public Insets getInsets();
  public IUIComponent getLayoutComponent(int index);
  public Dimension getMinimumSize();
  public Dimension getPreferredSize();
  public int getSelectionEnd();
  public int getSelectionStart();
  public int getStyle();
  public int getTickSpacing();
  public void layout();
  public void removeAll();
  public void setSelection(int start, int end);
  public void setSelectionEnd(int end);
  public void setSelectionStart(int start);
  public int setSliderInfo(int min, int max, int page, int line,
        int pos, int spacing);
  public void setStyle(int style);
  public void setTickSpacing(int spacing);
}

This class implements a slider control. Slider controls are often used as a selector for a continuous range of values, such as volume control, contrast, or brightness.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIScroll
          |
          +--UISlider

Constructors

UISlider

public UISlider();

Creates a horizontal slider control with a range of 0-10 and default spacing of the tick marks.

UISlider

public UISlider(int style);

Creates either a horizontal or vertical slider control with a range of 0-10 and a default spacing of tick marks.

Parameter Description
style The style of slider. This can be one or a combination of the following style flags:
VERTICAL 0 (for a horizontal slider)
POINTSABOVE POINTSBELOW
TICKSABOVE TICKSBELOW
RANGESELECT

UISlider

public UISlider(int style, int min, int max, int page, int line, int pos,
        int spacing);

Creates a slider control with the given metrics and with the specified style.

Parameter | Description
style The style of slider. This can be one or a combination of the following style flags:
VERTICAL 0 (for a horizontal slider)
POINTSABOVE POINTSBELOW
TICKSABOVE TICKSBELOW
RANGESELECT
min | The minimum value of the slider's range.
max | The maximum value of the slider's range.
page | The amount to scroll for a page up or page down. By default, this value is 0.
line | The amount to scroll for a line up or line down. Typically, this value is 1.
pos | The current position of the slider thumb. By default, this value is set to 0.
spacing | The number of scroll positions between the tick marks (this can be DEFAULTSPACING).

Methods

add

public IUIComponent add(int index, IUIComponent comp);

Adds a component or replaces the specified existing component with the given component.

Return Value:

Returns the previous component if it was replaced by the added component.

Parameter | Description
index The layout index of component to replace. This can be one of the following layout indices:
THUMB
PAGE_UP
PAGE_DOWN
TICKS_ABOVE
TICKS_BELOW
comp | The component to use in the slider.

Overrides:

add(int,IUIComponent) in UIScroll.

clearSelection

public void clearSelection();

Removes the selection highlight.

Return Value:

No return value.

getInsets

public Insets getInsets();

Retrieves the insets for the slider relative to its parent component, in pixels. This method is not called directly by the application. It is used in the layout method to lay out the slider control relative to its parent component.

Return Value:

Returns a set of Insets for the slider control.

getLayoutComponent

public IUIComponent getLayoutComponent(int index);

Retrieves the layout component at the given index.

Return Value:

Returns the component at that layout index; returns null if there is no component at the given index.

Parameter Description
index The layout index of component. This can be one of the following layout indices:
THUMB
PAGE_UP
PAGE_DOWN
TICKS_ABOVE
TICKS_BELOW

Overrides:

getLayoutComponent(int) in UIScroll.

getMinimumSize

public Dimension getMinimumSize();

Retrieves the minimum layout size of the slider control, in pixels. This method is not called directly by the application. It is used in the layout method and other private methods to lay out the slider control.

Return Value:

Returns a Dimension that describes the minimum layout size.

Overrides:

getMinimumSize() in UIScroll.

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred layout size of the slider control, in pixels. This method is not called directly by the application. It is used in the layout method and other private methods to lay out the slider control.

Return Value:

Returns a Dimension that describes the preferred layout size.

Overrides:

getPreferredSize() in UIScroll.

getSelectionEnd

public int getSelectionEnd();

Retrieves the end position of the selection range.

Return Value:

Returns the end position of the selection range.

See Also: getSelectionStart, setSelectionEnd

getSelectionStart

public int getSelectionStart();

Retrieves the start position of the selection range.

Return Value:

Returns start position of the selection range.

See Also: getSelectionEnd, setSelectionStart

getStyle

public int getStyle();

Retrieves the style for the slider.

Return Value:

Returns the current style settings for the slider. For a list of possible values, see setStyle.

Overrides:

getStyle() in UIScroll.

getTickSpacing

public int getTickSpacing();

Retrieves the spacing of the tick marks on the slider track.

Return Value:

Returns the spacing of the tick marks.

See Also: setTickSpacing

layout

public void layout();

This method is used to lay out the slider control.

Return Value:

No return value.

Overrides:

layout() in UIScroll.

removeAll

public void removeAll();

Removes all the current components from the slider control. This includes tick marks and the thumb object.

Return Value:

No return value.

setSelection

public void setSelection(int start, int end);

Sets the selection range for the slider.

Return Value:

No return value.

Parameter | Description
start | The start position of the selection range.
end | The end position of the selection range.

setSelectionEnd

public void setSelectionEnd(int end);

Set the end position of the selected range. This method ensures that the specified end position is within the range of the slider.

Return Value:

No return value.

Parameter | Description
end | The end position of the selected range.

setSelectionStart

public void setSelectionStart(int start);

Sets the start position of the selection range. This method ensures that the specified start position is within the range of the slider.

Return Value:

No return value.

Parameter | Description
start | The start position of the selected range.

setSliderInfo

public int setSliderInfo(int min, int max, int page, int line, int pos, int
        spacing);

Sets the slider control's metrics.

Return Value:

Returns the scroll position after setting its value.

Parameter | Description
min | The minimum value of the slider's range.
max | The maximum value of the slider's range.
page | The amount to scroll for a page up or page down.
line | The amount to scroll for a line up or line down.
pos | The current position of the slider thumb.
spacing | The spacing of the tick marks. Typically, this is set to DEFAULTSPACING for sliders with small ranges.

setStyle

public void setStyle(int style);

Sets the current style for the slider.

Return Value:

No return value.

Parameter Description
style The style of slider. This can be one or a combination of the following style flags:
VERTICAL 0 (for a horizontal slider)
POINTSABOVE POINTSBELOW
TICKSABOVE TICKSBELOW
RANGESELECT

Overrides:

setStyle(int) in UIScroll.

setTickSpacing

public void setTickSpacing(int spacing);

Sets the spacing of the tick marks.

Return Value:

No return value.

Parameter | Description
spacing | The spacing of the tick marks. This is typically set to DEFAULTSPACING.

Remarks:

The spacing is the number of scroll positions between tick marks. If the track has a range of 1 - 10, and the amount of scroll for a line up or line down is set to 1, 10 tick marks are on the track and the spacing is 1.

See Also: getTickSpacing

Fields

DEFAULTSPACING
A value indicating default spacing for tick marks.
POINTDOWN
The flag that specifies a horizontal slider points down, with tick marks below, on a horizontal slider track.
POINTLEFT
The flag that specifies a vertical slider points left, with tick marks on the left side of a vertical slider track.
POINTRIGHT
The flag that specifies a vertical slider points right with tick marks on the right side of a vertical slider track.
POINTSABOVE
The flag used to make an arrow point up or left, depending on the orientation of the slider track.
POINTSBELOW
The flag used to make an arrow point down or right, depending on the orientation of the slider track.
POINTUP
The flag that specifies a horizontal slider that points up, with tick marks above, on a horizontal slider track.
RANGESELECT
The flag used to allow a selection range in the slider. All selection methods are ignored if this style is not set.
TICKS_ABOVE
The layout index for the tick marks above the slider control.
TICKS_BELOW
The layout index for the tick marks below the slider control.
TICKSABOVE
The flag used to draw tick marks above or left, depending on the orientation of the slider track.
TICKSBELOW
The flag used to draw tick marks below or right, depending on the orientation of the slider track.
VERTICAL
A slider style used to make a vertical slider control track.


Class UISpinner

public class UISpinner extends UIScroll
{
  // Fields
  public static final int BUDDY;
  public static final int CIRCULAR;
  public static final int LINE_DOWN;
  public static final int LINE_UP;
  public static final int RAISED;

  // Constructors
  public UISpinner();
  public UISpinner(int style);
  public UISpinner(int style, int min, int max, int page, int line,
        int pos);

  // Methods
  public IUIComponent add(int index, IUIComponent comp);
  public IUIComponent getLayoutComponent(int index);
  public Dimension getMinimumSize();
  public Dimension getPreferredSize();
  public int getRoleCode();
  public int getScrollPos();
  public void layout();
  public int scrollLineDown();
  public int scrollLineUp();
  public int scrollPageDown();
  public int scrollPageUp();
  public int setScrollInfo(int min, int max, int page, int line,
        int pos);
  public void setStyle(int style);
}

This class implements a spinner control and its buttons. UISpinner is closely related to the UISpinnerEdit class.

UISpinner controls have no associated text control, so they can be used with any other type of control.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIScroll
          |
          +--UISpinner

Constructors

UISpinner

public UISpinner();

Creates a horizontal spinner control with a range of 0-100. By default, the style of the spinner control is RAISED.

UISpinner

public UISpinner(int style);

Creates a spinner control with a range of 0-100 and with the specified button style.

Parameter | Description
style | The style of spinner. This can be one or a combination of RAISED, VERTICAL, or CIRCULAR.

UISpinner

public UISpinner(int style, int min, int max, int page, int line, int pos);

Creates a spinner control with the given metrics and with the specified style.

Parameter | Description
style | The style of spinner. This can be one or a combination of RAISED, VERTICAL, or CIRCULAR.
min | The minimum value of the spinner's range.
max | The maximum value of the spinner's range.
page | The number of scroll positions associated with a full page up or page down event.
line | The number to add or subtract when a line up or line down event is processed.
pos | The starting position inside the spinner's range.

Methods

add

public IUIComponent add(int index, IUIComponent comp);

Adds or replaces the specified spinner component with the given component.

Return Value:

Returns the component that was replaced by the added component.

Parameter | Description
index The layout index of component to replace. This can be one of the following indices.
LINE_UP LINE_DOWN BUDDY
comp | The new component to use in the spinner.

Remarks:

This method adds a UI component to the spinner, typically a UIEdit, UIText or similar object commonly associated with spinner controls (although any component can be added).

Overrides:

add(int,IUIComponent) in UIScroll.

getLayoutComponent

public IUIComponent getLayoutComponent(int index);

Retrieves the layout component at the specified index.

Return Value:

Returns the component at that layout index, or null if there is none.

Parameter Description
index The layout index of component to retrieve. This can be one of the following indices:
LINE_UP
LINE_DOWN
BUDDY

Overrides:

getLayoutComponent(int) in UIScroll.

getMinimumSize

public Dimension getMinimumSize();

Retrieves the preferred layout size for the spinner control's two buttons (in pixels).

Return Value:

Returns a Dimension that represents the minimum layout size needed for the two buttons.

Remarks:

This method is not called directly by the application. It is used in the layout method and other private methods to lay out the spinner control.

Overrides:

getMinimumSize() in UIScroll.

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred layout size for the spinner control's two buttons (in pixels).

Return Value:

Returns a Dimension that represents the preferred layout size needed for the two buttons.

Remarks:

This method is not called directly by the application. It is used in the layout method and other private methods to lay out the spinner control.

Overrides:

getPreferredSize() in UIScroll.

getRoleCode

public int getRoleCode();

Retrieves the Microsoft® Active Accessibility™ role code of the current object.

Return Value:

Returns the ROLE_SYSTEM_SCROLLBAR role code.

Overrides:

getRoleCode() in UIScroll.

getScrollPos

public int getScrollPos();

Retrieves the position of the spinner.

Return Value:

Returns the current scroll position.

Overrides:

getScrollPos() in UIScroll.

layout

public void layout();

Lays out the spinner control's buttons.

Return Value:

No return value.

Overrides:

layout() in UIScroll.

scrollLineDown

public int scrollLineDown();

Decrements the spinner position by one selection.

Return Value:

Returns the new spinner position after setting the value.

Overrides:

scrollLineDown() in UIScroll.

scrollLineUp

public int scrollLineUp();

Increments the spinner position one selection.

Return Value:

Returns the new spinner position after setting the value.

Overrides:

scrollLineUp() in UIScroll.

scrollPageDown

public int scrollPageDown();

Decrements the spinner position by one page.

Return Value:

Returns the new spinner position after setting the value.

Remarks:

If you use a constructor where page is not a user- specified parameter, page is set to zero by default.

Overrides:

scrollPageDown() in UIScroll.

scrollPageUp

public int scrollPageUp();

Increments the spinner position by one page.

Return Value:

Returns the new spinner position after setting the value.

Remarks:

If you use a constructor where page is not a user- specified parameter, page is set to zero by default.

Overrides:

scrollPageUp() in UIScroll.

setScrollInfo

public int setScrollInfo(int min, int max, int page, int line, int pos);

Sets the specified scroll information in the spinner and adjusts the control's current position accordingly.

Return Value:

Returns the control's new scroll position after setting the specified values.

Parameter | Description
min | The minimum value of the spinner's range.
max | The maximum value of the spinner's range.
page | The number of scroll positions associated with a full page up or page down event.
line | The number to add or subtract when a line up or line down event is processed.
pos | The starting position inside the spinner's range.

Overrides:

setScrollInfo(int,int,int,int,int) in UIScroll.

setStyle

public void setStyle(int style);

Set the current style for this spinner.

Return Value:

No return value.

Parameter | Description
style | The style of spinner. This can be one or a combination of RAISED, VERTICAL, or CIRCULAR.

Overrides:

setStyle(int) in UIScroll.

Exceptions:

IllegalArgumentException if any undefined style bits are specified.

Fields

BUDDY
The control associated with the spinner that is laid out to the left of the spinner (UISpinnerEdit uses an edit control).
CIRCULAR
The spinner cycles through its range of values in a closed loop.
LINE_DOWN
The layout index for the down arrow on the spinner control.
LINE_UP
The layout index for the up arrow on the spinner control.
RAISED
A raised button style for the spinner control's buttons.


Class UISpinnerEdit

public class UISpinnerEdit extends UISpinner
{
  // Fields
  public static final int BORDER;
  public static final int CENTER;
  public static final int LEFT;
  public static final int RIGHT;

  // Constructors
  public UISpinnerEdit();
  public UISpinnerEdit(int style, int editStyle);
  public UISpinnerEdit(int style, int editStyle, int min, int max,
        int page, int line, int pos);

  // Methods
  public int getEditStyle();
  public void setEditStyle(int editStyle);
}

This class implements a spin box control with its associated buttons and edit box. The edit control takes any number in a range of numerical values. To attach a listener to the edit control inside UISpinnerEdit, call getLayoutComponent. The following code demonstrates this usage.

UISpinnerEdit spin = new UISpinnerEdit (UISpinnerEdit.RAISED |
                                          UISpinnerEdit.CIRCULAR,
                                          UISpinnerEdit.BORDER |
                                          UISpinnerEdit.CENTER,
                                          0,128,6,1,12));

IUIComponent comp = spin.getLayoutComponent (UISpinner.BUDDY);
if (comp instanceof UIEdit)
 {
   UIEdit e = (UIEdit)comp;
   e.addTextListener (this);
 }

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIScroll
          |
          +--UISpinner
            |
            +--UISpinnerEdit

Constructors

UISpinnerEdit

public UISpinnerEdit();

Creates a spinner edit box control with a range of 0-100. By default, the button style is RAISED.

UISpinnerEdit

public UISpinnerEdit(int style, int editStyle);

Creates a Spinner edit box control with a range of 0-100 and with the specified button style. By default, the edit box associated with the spinner has a border.

Parameter | Description
style | The style of spinner. This can be one or a combination of RAISED, VERTICAL, or CIRCULAR.
editStyle The edit box style for the spinner control. This style can be a combination of BORDER and one of the following: LEFT, CENTER, or RIGHT.

If some other style is needed (for example, vertical centering or read-only), you can use the getLayoutComponent method to retrieve the IUISpinnerBuddy helper class.

UISpinnerEdit

public UISpinnerEdit(int style, int editStyle, int min, int max, int page,
        int line, int pos);

Creates a Spin Box control with the given metrics and with the specified style.

Parameter | Description
style | The style of spinner. This can be one or a combination of RAISED, VERTICAL, or CIRCULAR.
editStyle The edit box style for the spinner control. This style can be a combination of BORDER and one of the following: LEFT, CENTER, or RIGHT.

If some other style is needed (for example, vertical centering or read-only), you can use the getLayoutComponent method to retrieve the IUISpinnerBuddy helper class.

Note The page parameter is used internally when the scrollPageUp or scrollPageDown are called.

min | The minimum value of the spinner's range.
max | The maximum value of the spinner's range.
page | The number of scroll positions associated with a full page.
line | The number to add or subtract when a lineUp or lineDown operation is processed.
pos | The starting position inside the spinner's range.

Methods

getEditStyle

public int getEditStyle();

Retrieves the spinner control's edit box style.

Return Value:

Returns the current style of the spinner's edit box. By default, the edit style is BORDER.

See Also: setEditStyle

setEditStyle

public void setEditStyle(int editStyle);

Sets the style of the spinner control's edit box.

Return Value:

No return value.

Parameter | Description
editStyle | The edit box style for the spinner control. This style can be a combination of BORDER and one of the following: LEFT, CENTER, or RIGHT.

See Also: getEditStyle

Fields

BORDER
The edit control associated with the spinner has a border.
CENTER
The text in the edit box associated with the Spin Box control is center-aligned.
LEFT
The text in the edit box associated with the Spin Box control is left-aligned.
RIGHT
The text in the edit box associated with the Spin Box control is right-aligned.


Class UISplitLayout

public class UISplitLayout extends UILayoutManager
{
  // Fields
  public static final int HORIZONTAL;

  // Constructors
  public UISplitLayout();
  public UISplitLayout(int flags);
  public UISplitLayout(int flags, int pos);

  // Methods
  public void addLayoutComponent(IUIContainer parent,
        IUIComponent comp, Object constraints);
  public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp,
        Dimension oldSize, Dimension newSize);
  public IUIComponent getComponent(IUIContainer parent,
        Object constraints);
  public Dimension getMinimumSize(IUIContainer target);
  public int getPos();
  public Dimension getPreferredSize(IUIContainer target);
  public boolean isOverlapping();
  public void layout(IUIContainer target, Rectangle bounds);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int dir, boolean keyable);
  public void removeLayoutComponent(IUIContainer target,
        IUIComponent comp);
  public void setPos(int pos);
}

This class implements a layout manager for a split viewer control. UISplitViewer uses UISplitLayout for its default layout manager. UISplitLayout creates either a vertical split (the default) or a horizontal split, and manages the following layout components.

Component | Description
"nw" | The component in the top (north) pane if the split is horizontal, or the left (west) pane if the split is vertical.
"se" | The component in the bottom (south) pane if the split is horizontal, or the right (east) pane if the split is vertical.
Use "0" for a vertical split, HORIZONTAL for a horizontal split. | The component that divides the two panes.

UISplitLayout manages the split position for the split viewer control. A negative split position means the height or width of the "nw" component is a percentage of the split viewer's total height or width. A positive split position specifies the height or width as an absolute value, in pixels. You can initially set the split position in the constructor (the default value is -50), as shown in the following example.

// Specify a horizontal split and a split position of 150.
// This means the "nw" component will be 150 pixels in height.
// The remainder of the split viewer's content area will be
// filled with the splitter component and the "se" component.
UISplitLayout sl = new UISplitLayout(UISplitLayout.HORIZONTAL, 150);

UISplitLayout also defines the getPos and setPos methods to retrieve and set the split position. The split position cannot be less than -100.

UILayoutManager
  |
  +--UISplitLayout

Constructors

UISplitLayout

public UISplitLayout();

Creates a split layout manager.

Remarks:

By default, the layout manager uses a vertical split and an initial split position of -50. For more information about split positions, see the UISplitLayout overview.

UISplitLayout

public UISplitLayout(int flags);

Creates a split layout manager with the specified style flags.

Parameter | Description
flags | The style of the layout manager. Possible values include HORIZONTAL for a horizontal split, or 0 for a vertical split.

Remarks:

By default, the initial split position is -50. For more information about split positions, see the UISplitLayout overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

UISplitLayout

public UISplitLayout(int flags, int pos);

Creates a split layout manager with the specified style flags and split position.

Parameter | Description
flags | The style of the layout manager. Possible values include HORIZONTAL for a horizontal split, or 0 for a vertical split.
pos | The initial split position. A negative split position means the height or width of the "nw" component is a percentage of the split viewer's total height or width. A positive split position specifies the height or width as an absolute value in pixels. For more information, see the UISplitLayout overview.

Exceptions:

IllegalArgumentException if an undefined style was specified or the split position was less than -100.

Methods

addLayoutComponent

public void addLayoutComponent(IUIContainer parent, IUIComponent comp,
        Object constraints);

Adds the specified component to the container, according to the specified constraints.

Return Value:

No return value.

Parameter | Description
parent | The container of the component.
comp | The component to be added.
constraints | Identifies where the component will be added. You can pass a String or Integer value, as described in the Remarks section.

Remarks:

This method is called by the container's add method. The following table lists possible values for the constraints parameter.

String value | Integer value | Location of the component
"nw" | 0 | The top (north) or left (west) pane of the container.
"se" | 1 | The bottom (south) or right (east) pane of the container.
"splitter" | 2 | Between the two panes.

Note The String values are not case-sensitive.

Overrides:

addLayoutComponent(IUIContainer,IUIComponent,Object) in UILayoutManager.

Exceptions:

IllegalArgumentException if an undefined constraint was specified.

See Also: getComponent, removeLayoutComponent

adjustLayoutSize

public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp, Dimension oldSize,
        Dimension newSize);

Called to adjust the layout size of the specified component in the specified container.

Return Value:

Returns a Dimension object containing the new preferred size of the container.

Parameter | Description
parent | The container of the component.
oldParentSize | The previous layout size of the container.
comp | The component being sized.
oldSize | The previous layout size of the component.
newSize | The new layout size of the component.

Overrides:

adjustLayoutSize(IUIContainer,Dimension,IUIComponent,Dimension,Dimension) in UILayoutManager.

getComponent

public IUIComponent getComponent(IUIContainer parent, Object constraints);

Retrieves a component from the container, according to the specified constraints.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
parent | The container of the component.
constraints | Identifies the component to be retrieved. You can pass a String or Integer value, as described in the Remarks section.

Remarks:

The following table lists possible values for the constraints parameter.

String value | Integer value | Component
"nw" | 0 | The component in the top (north) or left (west) pane.
"se" | 1 | The component in the bottom (south) or right (east) pane.
"splitter" | 2 | The component that divides the two panes.

Note The String values are not case-sensitive.

Overrides:

getComponent(IUIContainer,Object) in UILayoutManager.

Exceptions:

IllegalArgumentException if an undefined constraint was specified.

See Also: addLayoutComponent, removeLayoutComponent

getMinimumSize

public Dimension getMinimumSize(IUIContainer target);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
target | The container of the components.

Remarks:

If the layout manager has a horizontal split, the height of the returned Dimension object is the sum of the minimum heights of the "nw", "se", and splitter components. The Dimension object's width is the largest of the minimum widths of each component.

Similarly, if the layout manager's split is vertical, the Dimension object's width is the sum of the minimum widths of the components. The height is the largest of the minimum heights of each component.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize

getPos

public int getPos();

Retrieves the current split position.

Return Value:

Returns the split position used by the layout manager.

Remarks:

For more information about split positions, see the UISplitLayout overview.

See Also: setPos

getPreferredSize

public Dimension getPreferredSize(IUIContainer target);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
target | The container of the components.

Remarks:

If the layout manager has a horizontal split, the height of the returned Dimension object is the sum of the preferred heights of the "nw", "se", and splitter components. The Dimension object's width is the largest of the preferred widths of each component.

Similarly, if the layout manager's split is vertical, the Dimension object's width is the sum of the preferred widths of the components. The height is the largest of the preferred heights of each component.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize

isOverlapping

public boolean isOverlapping();

This method simply returns false, indicating that the UISplitLayout lays out its components such that they never overlap.

Return Value:

Returns false.

Overrides:

isOverlapping() in UILayoutManager.

layout

public void layout(IUIContainer target, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
target | The container of the components being laid out.
bounds | The bounding rectangle in which to lay out the components

Remarks:

If the layout manager has a horizontal split, the splitter component's width is the bounding rectangle width, and the height is 4 pixels. The location of the splitter component depends on the layout manager's current split position. The "nw" and "se" components lie above and below the splitter component, respectively.

Similarly, if the layout manager's split is vertical, the splitter component's height is the bounding rectangle height, and the width is 4 pixels. The "nw" and "se" components lie to the left and to the right, respectively, of the splitter component.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp, int dir,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns null, indicating no component can be navigated to.

Parameter | Description
cont | The container where the navigation is occurring.
comp | The component to navigate from.
dir | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

Typically, this method is used to handle keyboard navigation in the container. However, UISplitLayout does not provide this functionality.

Overrides:

navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.

removeLayoutComponent

public void removeLayoutComponent(IUIContainer target, IUIComponent comp);

Removes the specified component from the container.

Return Value:

No return value.

Parameter | Description
target | The container of the component.
comp | The component to be removed.

Remarks:

This method is called by the container's remove method.

Overrides:

removeLayoutComponent(IUIContainer,IUIComponent) in UILayoutManager.

See Also: addLayoutComponent, getComponent

setPos

public void setPos(int pos);

Sets the current split position.

Return Value:

No return value.

Parameter | Description
pos | The split position to be used by the layout manager. For more information, see the UISplitLayout overview.

Exceptions:

IllegalArgumentException if the split position was less than -100.

See Also: getPos

Fields

HORIZONTAL
A horizontal layout style. The split layout manager creates a horizontal split, where the container consists of top (north) and bottom (south) panes. The default style is a vertical split with left (west) and right (east) panes.


Class UISplitViewer

public class UISplitViewer extends UIPanel
{
  // Fields
  public final static int HORIZONTAL;

  // Constructors
  public UISplitViewer();
  public UISplitViewer(IUIComponent nw, IUIComponent se);
  public UISplitViewer(IUIComponent nw, IUIComponent se, int style);
  public UISplitViewer(IUIComponent nw, IUIComponent se, int style,
        int size);
  public UISplitViewer(IUIComponent nw, IUIComponent se, int style,
        int size, boolean addScroll);

  // Methods
  public IUIComponent getComponent(String name);
  public IUIComponent getFloater();
  public int getPos();
  public int getStyle();
  public boolean mouseDown(Event e, int x, int y);
  public boolean mouseDrag(Event e, int x, int y);
  public boolean mouseUp(Event e, int x, int y);
  public void setPos(int pos);
}

This class implements a split viewer control. UISplitViewer uses UISplitLayout to manage three components, identified as follows.

Component | Description
"nw" | The component in the top (north) pane if the split is horizontal, or the left (west) pane if the split is vertical.
"se" | The component in the bottom (south) pane if the split is horizontal, or the right (east) pane if the split is vertical.
"0" for a vertical split and HORIZONTAL for a horizontal split. | The component that divides the two panes. By default, UISplitViewer uses UIThumb to implement the split.

When you create a UISplitViewer object, you can specify whether the split will be vertical (the default) or horizontal. You can also set the size of the "nw" component by specifying its height (if the split is horizontal) or its width (if the split is vertical). A negative size means the height or width is a percentage of the split viewer's total height or width. A positive size specifies the height or width as an absolute value in pixels. The remainder of the split viewer control is filled with the splitter and "se" components.

You can also specify that scroll bars be added to each pane when they are needed. The following example shows different ways to construct UISplitViewer objects.

UISplitViewer sv1, sv2;
UIList lst1, lst2;
UIGraphic gr1, gr2;

... // Construct lst1, lst2, gr1, and gr2.

// Construct a horizontal split viewer where the height of
// the "nw" component is 40% of the viewer's total height.
// By default, no scroll bars will be added to the top
// and bottom panes.
sv1 = new UISplitViewer(lst1, gr1, UISplitViewer.HORIZONTAL, -40);

// Construct a vertical split viewer where the width of
// the "nw" component is 75 pixels. Allow scroll bars to
// be added to each pane when necessary.
sv2 = new UISplitViewer(lst2, gr2, 0, 75, true);

// Add sv1 and sv2 to the container.
add(sv1);
add(sv2);

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UISplitViewer

Constructors

UISplitViewer

public UISplitViewer();

Creates a vertical split viewer control with no content.

Remarks:

To add components to the control, call the add method (inherited through UIPanel), as shown in the following example:

UISplitViewer sv = new UISplitViewer();
add(sv);  // Add sv to the container.

// Add components to the left and right panes.
// The layout constraints passed to add are
// defined by the layout manager, UISplitLayout.
sv.add(new UIText("Left component"), "nw");
sv.add(new UIText("Right component"), "se");

By default, the size of the left component is -50 and neither pane displays scroll bars. For more information about component sizes, see the UISplitViewer overview.

UISplitViewer

public UISplitViewer(IUIComponent nw, IUIComponent se);

Creates a vertical split viewer control with the specified components.

Parameter | Description
nw | The content component for the left (west) pane of the control.
se | The content component for the right (east) pane of the control.

Remarks:

By default, the size of the nw component is -50 and neither pane displays scroll bars. For more information about component sizes, see the UISplitViewer overview.

UISplitViewer

public UISplitViewer(IUIComponent nw, IUIComponent se, int style);

Creates a split viewer control with the specified components and style.

Parameter | Description
nw | The content component for the top (north) or left (west) pane of the control.
se | The content component for the bottom (south) or right (east) pane of the control.
style | The style of the control. Possible values include HORIZONTAL for a horizontal split, or 0 for a vertical split.

Remarks:

By default, the size of the nw component is -50 and neither pane displays scroll bars. For more information about component sizes, see the UISplitViewer overview.

UISplitViewer

public UISplitViewer(IUIComponent nw, IUIComponent se, int style, int size);

Creates a split viewer control with the specified components, style, and size.

Parameter | Description
nw | The content component for the top (north) or left (west) pane of the control.
se | The content component for the right (east) pane of the control.
style | The style of the control. Possible values include HORIZONTAL for a horizontal split, or 0 for a vertical split.
size | The size of the nw component. A negative value means the height or width is a percentage of the split viewer's total height or width. A positive value specifies the absolute height or width in pixels. For more information, see the UISplitViewer overview.

Remarks:

By default, neither pane displays scroll bars.

Exceptions:

IllegalArgumentException if the size parameter was less than -100.

UISplitViewer

public UISplitViewer(IUIComponent nw, IUIComponent se, int style, int size,
        boolean addScroll);

Creates a split viewer control with the specified components, style, and size, and optional scroll bar support.

Parameter | Description
nw | The content component for the top (north) or left (west) pane of the control.
se | The content component for the right (east) pane of the control.
style | The style of the control. Possible values include HORIZONTAL for a horizontal split, or 0 for a vertical split.
size | The size of the nw component. A negative value means the height or width is a percentage of the split viewer's total height or width. A positive value specifies the absolute height or width in pixels. For more information, see the UISplitViewer overview.
addScroll | If true, scroll bars will be added to each pane when they are needed; otherwise, neither pane will provide scroll bars.

Exceptions:

IllegalArgumentException if the size parameter was less than -100.

Methods

getComponent

public IUIComponent getComponent(String name);

Retrieves the component at the specified layout position.

Return Value:

Returns the specified component.

Parameter Description
name The layout name that identifies the component to be retrieved. You can pass one of the following values:
"nw" | Retrieves the component in the top (north) or left (west) pane.
"se" | Retrieves the component in the bottom (south) or right (east) pane.
"splitter" | Retrieves the component that divides the two panes.

Remarks:

The name parameter is not case-sensitive.

Exceptions:

IllegalArgumentException if an undefined name was specified.

getFloater

public IUIComponent getFloater();

Retrieves the floating component in this container, if there is one. The floating component is the component that is superceding the standard z-order of the container's children by being first in the z-order. This method is most commonly used when a component is being dragged, such as a column header or a scroll thumb.

Return Value:

Returns the current floating component, or null if there is none.

getPos

public int getPos();

Retrieves the current split position.

Return Value:

Returns the split position that is used by the layout manager.

Remarks:

This method retrieves the split position of the control's layout manager, which is based on the size of the "nw" component. For more information about split positions, see the UISplitLayout overview.

See Also: setPos

getStyle

public int getStyle();

Retrieves the style of the split viewer control.

Return Value:

Returns an integer that contains the current style setting. Possible style values include HORIZONTAL for a horizontal split, or 0 for a vertical split.

mouseDown

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

Responds to the mouse button being pressed while it is over the splitter component.

Return Value:

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

Parameter | Description
e | The event posted to the split viewer control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method darkens the splitter component's background color. The color remains darkened while the mouse button is pressed or dragged. When the mouse button is released, the original color is restored.

See Also: mouseUp, mouseDrag

mouseDrag

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

Responds to the splitter component being dragged with the mouse.

Return Value:

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

Parameter | Description
e | The event posted to the split viewer control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

As the splitter component is dragged, this method adjusts its position accordingly. When the mouse button is released, the layout of all components is updated to reflect the new position of the splitter component.

See Also: mouseDown, mouseUp

mouseUp

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

Responds to the mouse button being released while it is over the splitter component.

Return Value:

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

Parameter | Description
e | The event posted to the split viewer control.
x | The x coordinate of the event.
y | The y coordinate of the event.

Remarks:

This method compares the position of the splitter component when the mouse button was first pressed to its position when the mouse button is released. If the position has changed, mouseUp sets the new split position and validates the control to update the layout of all components.

When the mouse button is first pressed, the mouseDown method darkens the splitter component's background color. mouseUp restores the original color.

See Also: mouseDrag

setPos

public void setPos(int pos);

Sets the current split position.

Return Value:

No return value.

Parameter | Description
pos | The split position to be used by the layout manager.

Remarks:

This method sets the split position of the control's layout manager, which is based on the size of the "nw" component. The "nw" and "se" components are then invalidated to reflect the new split position. For more information about split positions, see the UISplitLayout overview.

Exceptions:

IllegalArgumentException if the specified position was less than -100.

See Also: getPos

Fields

HORIZONTAL
Specifies that the split layout manager will create a horizontal split, where the container consists of top (north) and bottom (south) panes. The default style is a vertical split with left (west) and right (east) panes.


Class UIStateComponent

abstract public class UIStateComponent extends UIComponent
{
  // Methods
  public synchronized void addFocusListener(IUIFocusListener l);
  public synchronized void addKeyListener(IUIKeyListener l);
  public synchronized void addMouseListener(IUIMouseListener l);
  public synchronized void addMouseMotionListener(
        IUIMouseMotionListener l);
  public void addNotify();
  public void adjustLayoutSize(Dimension oldSize,
        Dimension newSize);
  protected final void disableEvents(long eventsToDisable);
  protected final void enableEvents(long eventsToEnable);
  public Color getBackground();
  public Dimension getCachedPreferredSize();
  public Cursor getCursor();
  public int getFlags();
  public Font getFont();
  public Color getForeground();
  public int getIndex();
  public IUIContainer getParent();
  public boolean isChecked();
  public boolean isEnabled();
  public boolean isFocused();
  public boolean isHot();
  public boolean isIndeterminate();
  public boolean isInvalidating();
  public boolean isNotified();
  public boolean isPressed();
  public boolean isRedrawing();
  public boolean isSelected();
  public boolean isValid();
  public boolean isValid();
  public boolean isVisible();
  protected void processEvent(UIEvent e);
  protected void processFocusEvent(UIFocusEvent e);
  protected void processKeyEvent(UIKeyEvent e);
  protected void processMouseEvent(UIMouseEvent e);
  protected void processMouseMotionEvent(UIMouseEvent e);
  public void recalcPreferredSize();
  public synchronized void removeFocusListener(IUIFocusListener l);
  public synchronized void removeKeyListener(IUIKeyListener l);
  public synchronized void removeMouseListener(IUIMouseListener l);
  public synchronized void removeMouseMotionListener(
        IUIMouseMotionListener l);
  public void removeNotify();
  public void setBackground(Color color);
  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 setIndeterminate(boolean on);
  public void setIndex(int index);
  public void setInvalidating(boolean on);
  public void setParent(IUIContainer parent);
  public void setPressed(boolean on);
  public void setRedrawing(boolean on);
  public void setSelected(boolean on);
  public void setValid(boolean valid);
  public void setVisible(boolean show);
}

This class implements a component having different states. UIStateComponent extends UIComponent to manage the states shown in the following table.

State | Description
checked | Typically applies to buttons. For example, when a check box button is checked, its check box image displays a check. When the button is unchecked, the check box image is cleared.
enabled | The object can respond to user input.
focused | All subsequent keyboard input is sent to the object.
hot-tracked | Identifies the object currently under the mouse. When the mouse enters the object, any text displayed by the object turns blue (by default). When the mouse exits, the text's original color is restored.
indeterminate | Typically applies to buttons. For example, when a check box button's indeterminate state is set, the check box image displays a gray check.
notified | An object is notified when the graphics context first becomes available.
pressed | The mouse button is currently being pressed over the object. When the mouse button is released, the object is unpressed.
redrawing | Controls the painting of the object. When a paint request is made, the object will be redrawn only if its redrawing state set.
selected | Indicates the user's selection. For example, when the user clicks a UIText item in a single-selection list box, that item becomes selected, and any previously selected item is deselected.
valid | The layout of the object is current. For example, when the size of the object changes, the object is marked as invalid. When the size is recomputed and the layout is updated, the object is valid again.
visible | The object is showing.

UIStateComponent defines methods to determine and set the component's current states.

UIStateComponent also allows a Listener to "consume" an input (key or mouse) event before passing it to the underlying UIComponent.

UICanvas extends UIStateComponent.

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.

UIComponent
  |
  +--UIStateComponent

Methods

addFocusListener

public synchronized void addFocusListener(IUIFocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be added.

Overrides:

addFocusListener(IUIFocusListener) in UIComponent.

See Also: removeFocusListener

addKeyListener

public synchronized void addKeyListener(IUIKeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be added.

Overrides:

addKeyListener(IUIKeyListener) in UIComponent.

See Also: removeKeyListener

addMouseListener

public synchronized void addMouseListener(IUIMouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be added.

Overrides:

addMouseListener(IUIMouseListener) in UIComponent.

See Also: removeMouseListener

addMouseMotionListener

public synchronized 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.

Parameter | Description
l | The mouse motion listener to be added.

Overrides:

addMouseMotionListener(IUIMouseMotionListener) in UIComponent.

See Also: removeMouseMotionListener

addNotify

public void addNotify();

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

Return Value:

No return value.

Remarks:

This method invalidates the component and sets its notified state. The addNotify method of the superclass is then invoked.

Overrides:

addNotify() in UIComponent.

See Also: removeNotify

adjustLayoutSize

public void adjustLayoutSize(Dimension oldSize, Dimension newSize);

Invalidates the component and adjusts its layout size.

Return Value:

No return value.

Parameter | Description
oldSize | The previous layout size of the component (in pixels).
newSize | The new layout size of the component (in pixels).

Remarks:

This method is automatically invoked when the component's size has changed.

Overrides:

adjustLayoutSize(Dimension,Dimension) in UIComponent.

disableEvents

protected final void disableEvents(long eventsToDisable);

Disables the events defined by the specified event mask parameter from being delivered to this component.

Return Value:

No return value.

Parameter | Description
eventsToDisable | The event mask defining the event types.

enableEvents

protected final void enableEvents(long eventsToEnable);

Enables the events defined by the specified event mask parameter to be delivered to this component.

Return Value:

No return value.

Parameter | Description
eventsToEnable | The event mask defining the event types.

Remarks:

Event types are automatically enabled when a listener for that type is added to the component. As a result, this method only needs to be invoked by subclasses of a component that require the specified event types delivered to processEvent, regardless of whether a listener is registered.

getBackground

public Color getBackground();

Retrieves the background color of the component.

Return Value:

Returns a Color object containing the component's background color.

Remarks:

If the component itself does not have a background color, this method returns the background color of the component's parent.

Overrides:

getBackground() in UIComponent.

See Also: setBackground, getParent

getCachedPreferredSize

public Dimension getCachedPreferredSize();

Retrieves the component's preferred size (in pixels).

Return Value:

Returns a Dimension object containing the preferred size.

Overrides:

getCachedPreferredSize() in UIComponent.

getCursor

public Cursor getCursor();

Retrieves the component's cursor.

Return Value:

Returns a Cursor object containing the component's cursor.

Remarks:

If the component itself does not have a cursor, this method returns the cursor of the component's parent.

Overrides:

getCursor() in UIComponent.

See Also: setFont, getParent

getFlags

public int getFlags();

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

Return Value:

Returns an integer containing the current user-defined settings.

Overrides:

getFlags() in UIComponent.

See Also: setFlags

getFont

public Font getFont();

Retrieves the font of the component.

Return Value:

Returns a Font object containing the component's font.

Remarks:

If the component itself does not have a font, this method returns the font of the component's parent.

Overrides:

getFont() in UIComponent.

See Also: setFont, getParent

getForeground

public Color getForeground();

Retrieves the foreground color of the component.

Return Value:

Returns a Color object containing the component's foreground color.

Remarks:

If the component itself does not have a foreground color, this method returns the foreground color of the component's parent.

Overrides:

getForeground() in UIComponent.

See Also: setForeground, getParent

getIndex

public int getIndex();

Retrieves the index of the control within its parent container.

Return Value:

Returns the control's index.

Overrides:

getIndex() in UIComponent.

See Also: setIndex

getParent

public IUIContainer getParent();

Retrieves the component's parent.

Return Value:

Returns the parent container of the component.

Overrides:

getParent() in UIComponent.

See Also: setParent

isChecked

public boolean isChecked();

Determines whether the component's checked state is set.

Return Value:

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

Overrides:

isChecked() in UIComponent.

See Also: setChecked

isEnabled

public boolean isEnabled();

Determines whether the component's enabled state is set.

Return Value:

Returns true if the component is enabled; returns false if disabled.

Overrides:

isEnabled() in UIComponent.

See Also: setEnabled

isFocused

public boolean isFocused();

Determines whether the component's focus state is set.

Return Value:

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

Overrides:

isFocused() in UIComponent.

See Also: setFocused

isHot

public boolean isHot();

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

Return Value:

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

Overrides:

isHot() in UIComponent.

See Also: setHot

isIndeterminate

public boolean isIndeterminate();

Determines whether the component's indeterminate state is set.

Return Value:

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

Overrides:

isIndeterminate() in UIComponent.

See Also: setIndeterminate

isInvalidating

public boolean isInvalidating();

Retrieves 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).

Overrides:

isInvalidating() in UIComponent.

isNotified

public boolean isNotified();

Determines whether the component's notified state is set.

Return Value:

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

Overrides:

isNotified() in UIComponent.

See Also: addNotify, removeNotify

isPressed

public boolean isPressed();

Determines whether the component's pressed state is set.

Return Value:

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

Overrides:

isPressed() in UIComponent.

See Also: setPressed

isRedrawing

public boolean isRedrawing();

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

Return Value:

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

Overrides:

isRedrawing() in UIComponent.

See Also: setRedrawing

isSelected

public boolean isSelected();

Determines whether the component's selected state is set.

Return Value:

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

Overrides:

isSelected() in UIComponent.

See Also: setSelected

isValid

public boolean isValid();

Determines whether the component is valid.

Return Value:

Returns true if the component is valid; returns false if invalid.

Overrides:

isValid() in UIComponent.

See Also: setValid

isValid

public boolean isValid();

Determines whether the component is valid.

Return Value:

Returns true if the component is valid; returns false if invalid.

Overrides:

isValid() in UIComponent.

See Also: setValid

isVisible

public boolean isVisible();

Determines whether the component's visible state is set.

Return Value:

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

Overrides:

isVisible() in UIComponent.

See Also: setVisible

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods .

Event type | Method called
focus event | processFocusEvent
key event | processKeyEvent
mouse event | processMouseEvent
mouse motion event | processMouseMotionEvent

When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.

processFocusEvent

protected void processFocusEvent(UIFocusEvent e);

Processes focus events.

Return Value:

No return value.

Parameter | Description
e | The focus event.

Remarks:

This method is called by processEvent and dispatches the event to a registered focus listener. When overriding this method, call the super method processFocusEvent to ensure the default event processing continues normally.

See Also: addFocusListener

processKeyEvent

protected void processKeyEvent(UIKeyEvent e);

Processes key events.

Return Value:

No return value.

Parameter | Description
e | The key event.

Remarks:

This method is called by processEvent and dispatches the event to a registered key listener. When overriding this method, call the super method processKeyEvent to ensure the default event processing continues normally. If there is no listener registered, the processKeyEvent method does nothing.

See Also: addKeyListener

processMouseEvent

protected void processMouseEvent(UIMouseEvent e);

Processes mouse events.

Return Value:

No return value.

Parameter | Description
e | The mouse event.

Remarks:

This method is called by processEvent and dispatches the event to a registered mouse listener. When overriding this method, call the super method processMouseEvent to ensure the default event processing continues normally. If there is no listener registered, the method returns immediately; otherwise, the event is passed to the child component to process.

See Also: addMouseListener

processMouseMotionEvent

protected void processMouseMotionEvent(UIMouseEvent e);

Processes mouse motion events.

Return Value:

No return value.

Parameter | Description
e | The mouse motion event.

Remarks:

This method is called by processEvent and dispatches the event to a registered mouse motion listener. When overriding this method, call the super method processMouseMotionEvent to ensure the default event processing continues normally. If there is no listener registered, the processMouseMotionEvent method does nothing.

See Also: addMouseMotionListener

recalcPreferredSize

public void recalcPreferredSize();

Recalculates the component's preferred size (in pixels).

Return Value:

No return value.

Overrides:

recalcPreferredSize() in UIComponent.

removeFocusListener

public synchronized void removeFocusListener(IUIFocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be removed.

Overrides:

removeFocusListener(IUIFocusListener) in UIComponent.

See Also: addFocusListener

removeKeyListener

public synchronized void removeKeyListener(IUIKeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be removed.

Overrides:

removeKeyListener(IUIKeyListener) in UIComponent.

See Also: addKeyListener

removeMouseListener

public synchronized void removeMouseListener(IUIMouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be removed.

Overrides:

removeMouseListener(IUIMouseListener) in UIComponent.

See Also: addMouseListener

removeMouseMotionListener

public synchronized 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.

Parameter | Description
l | The mouse motion listener to be removed.

Overrides:

removeMouseMotionListener(IUIMouseMotionListener) in UIComponent.

See Also: addMouseMotionListener

removeNotify

public void removeNotify();

Called when the graphics context first becomes unavailable.

Return Value:

No return value.

Remarks:

This method clears the notified state and invokes the removeNotify method of the superclass.

Overrides:

removeNotify() in UIComponent.

See Also: addNotify

setBackground

public void setBackground(Color color);

Sets the component's background color.

Return Value:

No return value.

Parameter | Description
color | The background color for the component.

Overrides:

setBackground(Color) in UIComponent.

See Also: getBackground

setChecked

public void setChecked(boolean on);

Sets or clears the checked state of the component.

Return Value:

No return value.

Parameter | Description
on | If true, the checked state is set; otherwise, it is cleared.

Overrides:

setChecked(boolean) in UIComponent.

See Also: isChecked

setCursor

public void setCursor(Cursor cursor);

Sets the component's cursor.

Return Value:

No return value.

Parameter | Description
cursor | The cursor for the component.

Overrides:

setCursor(Cursor) in UIComponent.

See Also: getCursor

setEnabled

public void setEnabled(boolean on);

Sets or clears the enabled state of the component.

Return Value:

No return value.

Parameter | Description
on | If true, the enabled state is set; otherwise, it is cleared.

Overrides:

setEnabled(boolean) in UIComponent.

See Also: isEnabled

setFlags

public void setFlags(int flags);

Sets the user-defined bits for the component.

Return Value:

No return value.

Parameter | Description
flags | The user-defined settings for the component. You can set any bit in the mask 0xFFF00000.

Overrides:

setFlags(int) in UIComponent.

Exceptions:

IllegalArgumentException if an undefined bit was specified.

See Also: getFlags

setFocused

public void setFocused(boolean on);

Sets or clears the focus state of the component.

Return Value:

No return value.

Parameter | Description
on | If true, the focus state is set; otherwise, it is cleared.

Remarks:

This method is automatically invoked when the component receives or loses focus.

Overrides:

setFocused(boolean) in UIComponent.

See Also: isFocused

setFont

public void setFont(Font font);

Sets the component's font.

Return Value:

No return value.

Parameter | Description
font | The font for the component.

Overrides:

setFont(Font) in UIComponent.

See Also: getFont

setForeground

public void setForeground(Color color);

Sets the component's foreground color.

Return Value:

No return value.

Parameter | Description
color | The foreground color for the component.

Overrides:

setForeground(Color) in UIComponent.

See Also: getForeground

setHot

public void setHot(boolean on);

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

Return Value:

No return value.

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

Remarks:

This method is automatically invoked when the mouse enters and exits the component.

Overrides:

setHot(boolean) in UIComponent.

See Also: isHot

setIndeterminate

public void setIndeterminate(boolean on);

Sets or clears the indeterminate state of the component.

Return Value:

No return value.

Parameter | Description
on | If true, the indeterminate state is set and the checked state is cleared. If false, the indeterminate state is cleared.

Overrides:

setIndeterminate(boolean) in UIComponent.

See Also: isIndeterminate, setChecked

setIndex

public void setIndex(int index);

Sets the index of the component within its parent container.

Parameter | Description
index | The index for the component.

Overrides:

setIndex(int) in UIComponent.

See Also: getIndex

setInvalidating

public void setInvalidating(boolean on);

Sets the invalidating state of this object.

Return Value:

No return value.

Parameter | Description
on | Sets the invalidating state to true or false.

Overrides:

setInvalidating(boolean) in UIComponent.

setParent

public void setParent(IUIContainer parent);

Sets the component's parent. If the component already has a parent, it is removed from that parent's hierarchy.

Return Value:

No return value.

Parameter | Description
parent | The new parent container for the component.

Overrides:

setParent(IUIContainer) in UIComponent.

See Also: getParent

setPressed

public void setPressed(boolean on);

Sets or clears the pressed state of the component.

Return Value:

No return value.

Parameter | Description
on | If true, the pressed state is set; otherwise, it is cleared.

Remarks:

This method is automatically invoked when the mouse button is pressed, released, or dragged over the component.

Overrides:

setPressed(boolean) in UIComponent.

See Also: isPressed

setRedrawing

public void setRedrawing(boolean on);

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

Return Value:

No return value.

Parameter | Description
on | If true, the redrawing state is set; otherwise, it is cleared.

Overrides:

setRedrawing(boolean) in UIComponent.

See Also: isRedrawing

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the component.

Return Value:

No return value.

Parameter | Description
on | If true, the selected state is set; otherwise, it is cleared.

Overrides:

setSelected(boolean) in UIComponent.

See Also: isSelected

setValid

public void setValid(boolean valid);

Sets or clears the valid state of the component.

Return Value:

No return value.

Parameter | Description
valid | If true, the component's valid state is set and the component is validated; otherwise, the component is invalidated.

Overrides:

setValid(boolean) in UIComponent.

See Also: isValid

setVisible

public void setVisible(boolean show);

Sets or clears the visible state of the component.

Return Value:

No return value.

Parameter | Description
show | If true, the component is shown; otherwise, the component is hidden.

Overrides:

setVisible(boolean) in UIComponent.

See Also: isVisible


Class UIStateContainer

abstract public class UIStateContainer extends UIContainer
{
  // Constructors
  public UIStateContainer();
  public UIStateContainer(int edge);

  // Methods
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public synchronized void addContainerListener(
        IUIContainerListener l);
  public synchronized void addFocusListener(IUIFocusListener l);
  public synchronized void addKeyListener(IUIKeyListener l);
  public synchronized void addMouseListener(IUIMouseListener l);
  public synchronized void addMouseMotionListener(
        IUIMouseMotionListener l);
  public void addNotify();
  public void adjustLayoutSize(Dimension oldSize,
        Dimension newSize);
  protected final void disableEvents(long eventsToDisable);
  protected final void enableEvents(long eventsToEnable);
  public Color getBackground();
  public Dimension getCachedPreferredSize();
  public Cursor getCursor();
  public int getEdge();
  public int getFlags();
  public Font getFont();
  public Color getForeground();
  public int getIndex();
  public IUIContainer getParent();
  public boolean isChecked();
  public boolean isEnabled();
  public boolean isFocused();
  public boolean isHot();
  public boolean isIndeterminate();
  public boolean isInvalidating();
  public boolean isNotified();
  public boolean isPressed();
  public boolean isRedrawing();
  public boolean isSelected();
  public boolean isValid();
  public boolean isVisible();
  public boolean postEvent(Event evt);
  protected void processContainerEvent(UIContainerEvent e);
  protected void processEvent(UIEvent e);
  protected void processFocusEvent(UIFocusEvent e);
  protected void processKeyEvent(UIKeyEvent e);
  protected void processMouseEvent(UIMouseEvent e);
  protected void processMouseMotionEvent(UIMouseEvent e);
  public void recalcPreferredSize();
  public void remove(int index);
  public synchronized void removeContainerListener(
        IUIContainerListener l);
  public synchronized void removeFocusListener(IUIFocusListener l);
  public synchronized void removeKeyListener(IUIKeyListener l);
  public synchronized void removeMouseListener(IUIMouseListener l);
  public synchronized void removeMouseMotionListener(
        IUIMouseMotionListener l);
  public void removeNotify();
  public void setBackground(Color color);
  public void setChecked(boolean on);
  public void setCursor(Cursor cursor);
  public void setEdge(int edge);
  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 setIndeterminate(boolean on);
  public void setIndex(int index);
  public void setInvalidating(boolean on);
  public void setParent(IUIContainer parent);
  public void setPressed(boolean on);
  public void setRedrawing(boolean on);
  public void setSelected(boolean on);
  public void setValid(boolean valid);
  public void setVisible(boolean show);
}

This class implements a container having different states. UIStateContainer extends UIContainer to manage the states shown in the following table.

State | Description
checked | Typically applies to buttons. For example, when a UICheckButton object is checked, its check box image displays a check. When the button is unchecked, the check box image is cleared.
enabled | The object can respond to user input.
focused | All subsequent keyboard input is sent to the object.
hot-tracked | Identifies the object currently under the mouse. When the mouse enters the object, any text displayed by the object turns blue (by default). When the mouse exits, the text's original color is restored.
indeterminate | Typically applies to buttons. For example, when a UICheckButton object's indeterminate state is set, the check box image displays a gray check.
notified | An object is notified when the graphics context first becomes available.
pressed | The mouse button is currently being pressed over the object. When the mouse button is released, the object is unpressed.
redrawing | Controls the painting of the object. When a paint request is made, the object will be redrawn only if its redrawing state set.
selected | Indicates the user's selection. For example, when the user clicks an item in a single-selection UIList object, that item becomes selected, and any previously selected item is deselected.
valid | The layout of the object is current. For example, when the size of the object changes, the object is marked as invalid. When the size is recomputed and the layout is updated, the object is valid again.
visible | The object is showing.

Two classes that extend UIStateContainer include UIPanel and UISingleContainer. A UIPanel object can contain multiple child components and a header component. A UISingleContainer object contains only a header component. Header components are used to represent the container itself. For example, the text displayed on a button is used as its header component.

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer

Constructors

UIStateContainer

public UIStateContainer();

Creates a state container with no edge.

UIStateContainer

public UIStateContainer(int edge);

Creates a state container with the specified edge.

Parameter Description
edge The style of the container's edge. You can pass one of the following values for an edge style:
  • IFxGraphicsConstants.BDR_RAISED
  • IFxGraphicsConstants.BDR_SUNKEN
  • IFxGraphicsConstants.BDR_OUTER
  • IFxGraphicsConstants.BDR_INNER
  • IFxGraphicsConstants.BDR_RAISEDOUTER
  • IFxGraphicsConstants.BDR_RAISEDINNER
  • IFxGraphicsConstants.BDR_SUNKENOUTER
  • IFxGraphicsConstants.BDR_SUNKENINNER
  • IFxGraphicsConstants.BDR_FLAT
  • IFxGraphicsConstants.EDGE_RAISED
  • IFxGraphicsConstants.EDGE_SUNKEN
  • IFxGraphicsConstants.EDGE_ETCHED
  • IFxGraphicsConstants.EDGE_BUMP
  • 0 (No edge style)

Exceptions:

IllegalArgumentException if an undefined edge style was specified.

Methods

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds the specified component to the container, according to the specified constraints and index.

Return Value:

Returns the component that was added if successful; otherwise, returns null.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints, which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.
index | The zero-based index at which to insert the component. If the container has a header component, the header is at index 0, and the first child component begins at index 1; otherwise, the first child begins at index 0. To add the component at the end of the container, pass -1. (For more information about header components, see the UIStateContainer overview.)

Overrides:

add(IUIComponent,Object,int) in UIContainer.

See Also: remove

addContainerListener

public synchronized void addContainerListener(IUIContainerListener l);

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

Return Value:

No return value.

Parameter | Description
l | The container listener to be added.

See Also: removeContainerListener

addFocusListener

public synchronized void addFocusListener(IUIFocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be added.

See Also: removeFocusListener

addKeyListener

public synchronized void addKeyListener(IUIKeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be added.

See Also: removeKeyListener

addMouseListener

public synchronized void addMouseListener(IUIMouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be added.

See Also: removeMouseListener

addMouseMotionListener

public synchronized 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.

Parameter | Description
l | The mouse motion listener to be added.

See Also: removeMouseMotionListener

addNotify

public void addNotify();

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

Return Value:

No return value.

Remarks:

This method invalidates the container and sets its notified state. The addNotify method is then invoked for each component in the container.

Overrides:

addNotify() in UIContainer.

See Also: removeNotify

adjustLayoutSize

public void adjustLayoutSize(Dimension oldSize, Dimension newSize);

Adjusts the layout size of the container.

Return Value:

No return value.

Parameter | Description
oldSize | The previous layout size of the container (in pixels).
newSize | The new layout size of the container (in pixels).

Remarks:

This method is automatically invoked when the container's size has changed.

disableEvents

protected final void disableEvents(long eventsToDisable);

Disables the events defined by the specified event mask parameter from being delivered to this component.

Return Value:

No return value.

Parameter | Description
eventsToDisable | the event mask defining the event types.

enableEvents

protected final void enableEvents(long eventsToEnable);

Enables the events defined by the specified event mask parameter to be delivered to this component.

Return Value:

No return value.

Parameter | Description
eventsToEnable | the event mask defining the event types.

Remarks:

Event types are automatically enabled when a listener for that type is added to the component; therefore, this method only needs to be invoked by subclasses of a component that require the specified event types delivered to processEvent, regardless of whether a listener is registered.

getBackground

public Color getBackground();

Retrieves the background color of the container.

Return Value:

Returns a Color object containing the container's background color.

Remarks:

If the container itself does not have a background color, this method returns the background color of the container's parent.

See Also: setBackground, getParent

getCachedPreferredSize

public Dimension getCachedPreferredSize();

Retrieves the container's preferred size (in pixels).

Return Value:

Returns a Dimension object containing the preferred size.

getCursor

public Cursor getCursor();

Retrieves the container's cursor.

Return Value:

Returns a Cursor object containing the container's cursor.

Remarks:

If the container itself does not have a cursor, this method returns the cursor of the container's parent.

See Also: setFont, getParent

getEdge

public int getEdge();

Retrieves the style of the container's edge.

Return Value:

Returns an integer containing the current style settings for the container's edge. For a list of possible values, see setEdge.

Overrides:

getEdge() in UIContainer.

getFlags

public int getFlags();

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

Return Value:

Returns an integer containing the current user-defined settings.

See Also: setFlags

getFont

public Font getFont();

Retrieves the font of the container.

Return Value:

Returns a Font object containing the container's font.

Remarks:

If the container itself does not have a font, this method returns the font of the container's parent.

See Also: setFont, getParent

getForeground

public Color getForeground();

Retrieves the foreground color of the container.

Return Value:

Returns a Color object containing the container's foreground color.

Remarks:

If the container itself does not have a foreground color, this method returns the foreground color of the container's parent.

See Also: setForeground, getParent

getIndex

public int getIndex();

Retrieves the index of the container within its parent.

Return Value:

Returns the container's index.

See Also: setIndex

getParent

public IUIContainer getParent();

Retrieves the container's parent.

Return Value:

Returns the parent container.

See Also: setParent

isChecked

public boolean isChecked();

Determines whether the container's checked state is set.

Return Value:

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

See Also: setChecked

isEnabled

public boolean isEnabled();

Determines whether the container's enabled state is set.

Return Value:

Returns true if the container is enabled; returns false if disabled.

See Also: setEnabled

isFocused

public boolean isFocused();

Determines whether the container's focus state is set.

Return Value:

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

See Also: setFocused

isHot

public boolean isHot();

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

Return Value:

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

See Also: setHot

isIndeterminate

public boolean isIndeterminate();

Determines whether the container's indeterminate state is set.

Return Value:

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

See Also: setIndeterminate

isInvalidating

public boolean isInvalidating();

Retrieves 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).

isNotified

public boolean isNotified();

Determines whether the container's notified state is set.

Return Value:

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

See Also: addNotify, removeNotify

isPressed

public boolean isPressed();

Determines whether the container's pressed state is set.

Return Value:

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

See Also: setPressed

isRedrawing

public boolean isRedrawing();

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

Return Value:

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

See Also: setRedrawing

isSelected

public boolean isSelected();

Determines whether the container's selected state is set.

Return Value:

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

See Also: setSelected

isValid

public boolean isValid();

Determines whether the container is valid.

Return Value:

Returns true if the container is valid; returns false if invalid.

See Also: setValid

isVisible

public boolean isVisible();

Determines whether the container's visible state is set.

Return Value:

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

See Also: setVisible

postEvent

public boolean postEvent(Event evt);

Posts the specified event to the container.

Return Value:

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

Parameter | Description
evt | The event.

processContainerEvent

protected void processContainerEvent(UIContainerEvent e);

Processes container events.

Return Value:

No return value.

Parameter | Description
e | The container event.

Remarks:

This method is called by processEvent and dispatches the event to a registered key listener. When overriding this method, call the super method processContainerEvent to ensure the default event processing continues normally.

See Also: addContainerListener

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.

Event type | Method called
container event | processContainerEvent
focus event | processFocusEvent
key event | processKeyEvent
mouse event | processMouseEvent
mouse motion event | processMouseMotionEvent

When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.

processFocusEvent

protected void processFocusEvent(UIFocusEvent e);

Processes focus events.

Return Value:

No return value.

Parameter | Description
e | The focus event.

Remarks:

This method is called by processEvent and dispatches the event to a registered focus listener. When overriding this method, call the super method processFocusEvent to ensure the default event processing continues normally.

See Also: addFocusListener

processKeyEvent

protected void processKeyEvent(UIKeyEvent e);

Processes key events.

Return Value:

No return value.

Parameter | Description
e | The key event.

Remarks:

This method is called by processEvent and dispatches the event to a registered key listener. When overriding this method, call the super method processKeyEvent to ensure the default event processing continues normally.

See Also: addKeyListener

processMouseEvent

protected void processMouseEvent(UIMouseEvent e);

Processes mouse events.

Return Value:

No return value.

Parameter | Description
e | The mouse event.

Remarks:

This method is called by processEvent and dispatches the event to a registered mouse listener. When overriding this method, call the super method processMouseEvent to ensure the default event processing continues normally.

See Also: addMouseListener

processMouseMotionEvent

protected void processMouseMotionEvent(UIMouseEvent e);

Processes mouse motion events.

Return Value:

No return value.

Parameter | Description
e | The mouse motion event.

Remarks:

This method is called by processEvent and dispatches the event to a registered mouse motion listener. When overriding this method, call the super method processMouseMotionEvent to ensure the default event processing continues normally.

See Also: addMouseMotionListener

recalcPreferredSize

public void recalcPreferredSize();

Recalculates the container's preferred size (in pixels).

Return Value:

No return value.

remove

public void remove(int index);

Removes the component at the specified index from the container.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component to be removed. If the container has a header component, the header is at index 0 and the first child componentbegins at index 1; otherwise, the first child begins at index 0. (For more information about header components, see the UIStateContainer overview.)

Overrides:

remove(int) in UIContainer.

See Also: add

removeContainerListener

public synchronized void removeContainerListener(IUIContainerListener l);

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

Return Value:

No return value.

Parameter | Description
l | The container listener to be removed.

See Also: addContainerListener

removeFocusListener

public synchronized void removeFocusListener(IUIFocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be removed.

See Also: addFocusListener

removeKeyListener

public synchronized void removeKeyListener(IUIKeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be removed.

See Also: addKeyListener

removeMouseListener

public synchronized void removeMouseListener(IUIMouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be removed.

See Also: addMouseListener

removeMouseMotionListener

public synchronized 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.

Parameter | Description
l | The mouse motion listener to be removed.

See Also: addMouseMotionListener

removeNotify

public void removeNotify();

Called when the graphics context first becomes unavailable.

Return Value:

No return value.

Remarks:

This method clears the notified state and invokes removeNotify for each component in the container.

Overrides:

removeNotify() in UIContainer.

See Also: addNotify

setBackground

public void setBackground(Color color);

Sets the container's background color.

Return Value:

No return value.

Parameter | Description
color | The background color for the container.

See Also: getBackground

setChecked

public void setChecked(boolean on);

Sets or clears the checked state of the container.

Return Value:

No return value.

Parameter | Description
on | If true, the checked state is set; otherwise, it is cleared.

See Also: isChecked

setCursor

public void setCursor(Cursor cursor);

Sets the container's cursor.

Return Value:

No return value.

Parameter | Description
cursor | The cursor for the container.

See Also: getCursor

setEdge

public void setEdge(int edge);

Sets the style of the container's edge.

Return Value:

No return value.

Parameter Description
edge The style of the container's edge. You can pass one of the following values:
  • IFxGraphicsConstants.BDR_RAISED
  • IFxGraphicsConstants.BDR_SUNKEN
  • IFxGraphicsConstants.BDR_OUTER
  • IFxGraphicsConstants.BDR_INNER
  • IFxGraphicsConstants.BDR_RAISEDOUTER
  • IFxGraphicsConstants.BDR_RAISEDINNER
  • IFxGraphicsConstants.BDR_SUNKENOUTER
  • IFxGraphicsConstants.BDR_SUNKENINNER
  • IFxGraphicsConstants.BDR_FLAT
  • IFxGraphicsConstants.EDGE_RAISED
  • IFxGraphicsConstants.EDGE_SUNKEN
  • IFxGraphicsConstants.EDGE_ETCHED
  • IFxGraphicsConstants.EDGE_BUMP
  • 0 (No edge style)

Overrides:

setEdge(int) in UIContainer.

Exceptions:

IllegalArgumentException if an undefined edge style was specified.

See Also: getEdge

setEnabled

public void setEnabled(boolean on);

Sets or clears the enabled state of the container.

Return Value:

No return value.

Parameter | Description
on | If true, the enabled state is set; otherwise, it is cleared.

See Also: isEnabled

setFlags

public void setFlags(int flags);

Sets the user-defined bits for the container.

Return Value:

No return value.

Parameter | Description
flags | The user-defined settings for the container. You can set any bit in the mask 0xFFF00000.

Exceptions:

IllegalArgumentException if an undefined bit was specified.

See Also: getFlags

setFocused

public void setFocused(boolean on);

Sets or clears the focus state of the container.

Return Value:

No return value.

Parameter | Description
on | If true, the focus state is set; otherwise, it is cleared.

Remarks:

This method is automatically invoked when the container receives or loses focus.

See Also: isFocused

setFont

public void setFont(Font font);

Sets the container's font.

Return Value:

No return value.

Parameter | Description
font | The font for the container.

See Also: getFont

setForeground

public void setForeground(Color color);

Sets the container's foreground color.

Return Value:

No return value.

Parameter | Description
color | The foreground color for the container.

See Also: getForeground

setHot

public void setHot(boolean on);

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

Return Value:

No return value.

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

Remarks:

This method is automatically invoked when the mouse enters and exits the container.

See Also: isHot

setIndeterminate

public void setIndeterminate(boolean on);

Sets or clears the indeterminate state of the container.

Return Value:

No return value.

Parameter | Description
on | If true, the indeterminate state is set and the checked state is cleared. If false, the indeterminate state is cleared.

See Also: isIndeterminate, setChecked

setIndex

public void setIndex(int index);

Sets the index of the container within its parent.

Parameter | Description
index | The index for the container.

See Also: getIndex

setInvalidating

public void setInvalidating(boolean on);

Sets the invalidating state of this object.

Return Value:

No return value.

Parameter | Description
on | The invalidating state setting.

setParent

public void setParent(IUIContainer parent);

Sets the container's parent. If the container already has a parent, it is removed from that parent's hierarchy.

Return Value:

No return value.

Parameter | Description
parent | The new parent container.

See Also: getParent

setPressed

public void setPressed(boolean on);

Sets or clears the pressed state of the container.

Return Value:

No return value.

Parameter | Description
on | If true, the pressed state is set; otherwise, it is cleared.

Remarks:

This method is automatically invoked when the mouse button is pressed, released, or dragged over the container.

See Also: isPressed

setRedrawing

public void setRedrawing(boolean on);

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

Return Value:

No return value.

Parameter | Description
on | If true, the redrawing state is set; otherwise, it is cleared.

See Also: isRedrawing

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the container.

Return Value:

No return value.

Parameter | Description
on | If true, the selected state is set; otherwise, it is cleared.

See Also: isSelected

setValid

public void setValid(boolean valid);

Sets or clears the valid state of the container.

Return Value:

No return value.

Parameter | Description
valid | If true, the container's valid state is set and the container is validated; otherwise, the container is invalidated.

setVisible

public void setVisible(boolean show);

Sets or clears the visible state of the container.

Return Value:

No return value.

Parameter | Description
show | If true, the container is shown; otherwise, the container is hidden.

See Also: isVisible


Class UIStatic

public abstract class UIStatic extends UICanvas
{
  // Fields
  public static final int BOTTOM;
  public static final int BOTTOMLEFT;
  public static final int BOTTOMRIGHT;
  public static final int CENTERED;
  public static final int HCENTER;
  public static final int HOTTRACK;
  public static final int LEFT;
  public static final int NOEDGE;
  public static final int NOKEY;
  public static final int RIGHT;
  public static final int TOP;
  public static final int TOPLEFT;
  public static final int TOPRIGHT;
  public static final int VCENTER;

  // Constructors
  public UIStatic();
  public UIStatic(int style);

  // Methods
  public Dimension calcString(String text);
  public Dimension calcString(FxGraphics g, String text);
  public void drawString(FxGraphics g, String text, Rectangle rect);
  public Rectangle getContentBounds();
  public boolean isKeyable();
  public void paint(FxGraphics g);
  public void paint(FxGraphics g, Rectangle rect);
  public void setFlags(int style);
  public void setHot(boolean on);
}

This class implements an abstract static control. A UIStatic object simply displays static information (such as a text string or a graphical image), and is typically used for the content of another object. The following diagram shows the classes that extend UIStatic.

UIStatic
|
+--UIText
|
+--UIGraphic
|
+--UIItem

UIStatic defines the HOTTRACK style, which allows the control's hot-tracked state to be set. For a list of other style and alignment flags, see the setFlags method.

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.

UIComponent
  |
  +--UIStateComponent
    |
    +--UICanvas
      |
      +--UIStatic

Constructors

UIStatic

public UIStatic();

Creates a static control with a style of CENTERED.

UIStatic

public UIStatic(int style);

Creates a static control with the specified style.

Parameter | Description
style | The alignment and style of the control. You can pass any bitwise combination of an alignment flag and a style flag. For a list of possible flags, see setFlags.

Remarks:

If a vertical alignment is not specified, VCENTER is used (by default). Similarly, if a horizontal alignment is not specified, HCENTER is used.

Exceptions:

IllegalArgumentException if more than one vertical alignment, more than one horizontal alignment, or an undefined style was specified.

Methods

calcString

public Dimension calcString(String text);

Calculates the dimensions of the specified text (in pixels), based on the font of the current graphics context.

Return Value:

Returns a Dimension object containing the width and height of the text.

Parameter | Description
text | The text string.

Remarks:

This method is used by UIText and UIItem when the dimensions of the associated text strings are needed.

calcString

public Dimension calcString(FxGraphics g, String text);

Calculates the dimensions of the specified text (in pixels), based on the font of the specified graphics context.

Return Value:

Returns a Dimension object containing the width and height of the text.

Parameter | Description
g | The graphics context. If null, the graphics context of the control is used.
text | The text string.

Remarks:

This method is used by UIText and UIItem when the dimensions of the associated text strings are needed.

drawString

public void drawString(FxGraphics g, String text, Rectangle rect);

Draws the specified text within the given rectangle, using the specified graphics context.

Return Value:

No return value.

Parameter | Description
g | The graphics context.
text | The text to be drawn.
rect | The rectangle to draw the text in.

Remarks:

This method draws the text according to the control's current states. drawString is called by UIText.paint and UIItem.paint.

getContentBounds

public Rectangle getContentBounds();

Retrieves the bounding rectangle of the control's contents.

Return Value:

Returns a Rectangle object that defines the content area within the control's coordinate space.

Remarks:

This method is called by paint(FxGraphics g) to draw the control's contents in the bounding rectangle.

isKeyable

public boolean isKeyable();

Determines whether the static control can receive keyboard input.

Return Value:

Returns true if the control can receive keyboard input; otherwise, returns false.

Remarks:

If the NOKEY style is set, this method returns false.

paint

public void paint(FxGraphics g);

Draws the static control.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method determines the bounding rectangle of the control's contents, and then calls paint(FxGraphics g, Rectangle rect) to draw the contents in this region.

paint

public void paint(FxGraphics g, Rectangle rect);

Draws the static control's contents within the specified rectangle.

Return Value:

No return value.

Parameter | Description
g | The graphics context.
rect | The rectangle in which to draw the control's contents.

Remarks:

This method is called by paint(FxGraphics g), which passes the rectangle returned from getContentBounds. By default, the UIStatic implementation of this method does nothing; however, it is fully implemented in UIText and UIItem.

setFlags

public void setFlags(int style);

Sets the alignment and style of the static control.

Return Value:

No return value.

Parameter Description
style The alignment and style of the control. You can pass any bitwise combination of an alignment flag and a style flag. Possible flags include those shown in the following table.

Alignment flags Style flags
LEFT HOTTRACK
RIGHT NOEDGE
TOP
BOTTOM
TOPLEFT
TOPRIGHT
BOTTOMLEFT
BOTTOMRIGHT
HCENTER
VCENTER
CENTERED

Remarks:

This method redraws the control to reflect the new style. If a vertical alignment is not specified, VCENTER is used (by default). Similarly, if a horizontal alignment is not specified, HCENTER is used.

Exceptions:

IllegalArgumentException if more than one vertical alignment, more than one horizontal alignment, or an undefined style was specified.

setHot

public void setHot(boolean on);

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

Return Value:

No return value.

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

Remarks:

The control must have the HOTTRACK style for the hot-tracked state to be set or cleared.

Fields

BOTTOM
Specifies that the content is vertically bottom-aligned to the bottom of the control.
BOTTOMLEFT
Specifies that the content is horizontally left-aligned and vertically bottom-aligned.
BOTTOMRIGHT
Specifies that the content is horizontally right-aligned and vertically bottom-aligned.
CENTERED
Specifies that the content is both horizontally and vertically centered within the control.
HCENTER
Specifies that the content is horizontally centered horizontally within the control.
HOTTRACK
Specifies that the control is hot-tracked. When this style flag is set, the control's hot-tracked state can be toggled through calls to the setHot method. When the hot-tracked state is set, any text displayed by the control is drawn in the hot-tracked color. By default, the hot-tracked state is set when the mouse enters the control; the state is cleared when the mouse exits. This behavior allows the control that is currently under the mouse to be identified.
LEFT
Specifies that the content is horizontally left-aligned within the control.
NOEDGE
Specifies that the control has no edge of padding around the content; normally, there is a 2 pixel border around all sides when computing the preferred size.
NOKEY
Specifies that the control is not keyable. This style is used when the control is not part of a control component and will never need to have the keyboard focus. A label is an example of this style.
RIGHT
Specifies that the content is horizontally right-aligned within the control.
TOP
Specifies that the content is vertically top-aligned to the top of the control.
TOPLEFT
Specifies that the content is horizontally left-aligned and vertically top-aligned.
TOPRIGHT
Specifies that the content is horizontally right-aligned and vertically top-aligned.
VCENTER
Specifies that the content is vertically centered within the control.


Class UIStatus

public class UIStatus extends UISingleContainer
{
  // Constructors
  public UIStatus();
  public UIStatus(String text);
  public UIStatus(String text, int style);
  public UIStatus(IUIComponent comp);

  // Methods
  public int getRoleCode();
  public boolean isKeyable();
}

This class implements a status bar control. Typically, a UIStatus object is used as an output-only informational window, located along the bottom of an application. Common uses for a status bar include displaying helpful information for the user and noting the current state of shift keys, such as NUM LOCK, CAPS LOCK, and SCROLL LOCK.

You can create a UIStatus object in several ways. For example, you can specify a text string with an optional style for justification, or you can create a component and display it on the UIStatus object. The following sample shows how to use UIStatus to display a component.

// Construct a text component that
// displays mouse coordinates.
txtCmpnt = new UIText("X:   Y:");

// Construct the status bar.
stbMousePos = new UIStatus(txtCmpnt);

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIStatus

Constructors

UIStatus

public UIStatus();

Creates a status bar control with no content.

UIStatus

public UIStatus(String text);

Creates a status bar control with the specified text.

Parameter | Description
text | The text to be displayed within the control.

Remarks:

By default, the text is left-aligned.

UIStatus

public UIStatus(String text, int style);

Creates a status bar control with the specified text and style.

Parameter | Description
text | The text to be displayed within the control.
style | The style of the control. For a list of possible values, see the alignment flags described in the UIStatic.setFlags method.

UIStatus

public UIStatus(IUIComponent comp);

Creates a status bar control with the specified component.

Parameter | Description
comp | The component to be displayed within the control.

Methods

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the status bar control.

Return Value:

Returns the ROLE_SYSTEM_STATUSBAR code.

isKeyable

public boolean isKeyable();

Determines whether the status bar control can receive keyboard input.

Return Value:

Returns false, which indicates that the control cannot receive keyboard input.


Class UITab

public class UITab extends UISingleContainer
{
  // Constructors
  public UITab();
  public UITab(String s);
  public UITab(IUIComponent comp);

  // Methods
  public Insets getInsets();
  public int getRoleCode();
  public boolean gotFocus(Event e, Object o);
  public void paint(FxGraphics g);
  public void setSelected(boolean on);
}

This class implements a tab control. UITab is used by UITabList to manage a collection of tabs. Typically, you'll use UITabViewer instead of UITab or UITabList. UITabViewer manages a collection of tabs and their associated pages.

Note When a UITab object is created with a String, the tab is automatically hot-tracked. To override this default, construct the tab with a UIText object, as shown in the following example.

UITab t1, t2, t3;

// Construct a tab with a String. By default, the tab
// is hot-tracked and the text is left-aligned.
t1 = new UITab("Hot-tracked text");

// Construct a tab that is not hot-tracked, using a
// UIText object. By default, the text is centered.
t2 = new UITab(new UIText("Text not hot-tracked"));

// To create a hot-tracked tab using UIText, specify
// the UIStatic.HOTTRACK style. To left-align the text,
// include the UIStatic.LEFT style.
t3 = new UITab(new UIText("Hot-tracked UIText",
                          UIStatic.HOTTRACK | UIStatic.LEFT));
add(t1);
add(t2);
add(t3);

For more information about hot-tracking, see the UIText overview.

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UITab

Constructors

UITab

public UITab();

Creates a tab control with no content.

UITab

public UITab(String s);

Creates a tab control with the specified text.

Parameter | Description
s | The text to be displayed on the tab.

Remarks:

By default, the tab control is hot-tracked. To create a tab that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITab overview.

UITab

public UITab(IUIComponent comp);

Creates a tab control with the specified component.

Parameter | Description
comp | The component to be displayed on the tab.

Remarks:

Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. For examples of how to construct tabs,see the UITab overview.

Methods

getInsets

public Insets getInsets();

Retrieves the tab control's insets (in pixels), which identify the nonclient area of the control.

Return Value:

Returns an Insets object containing the control's insets.

Remarks:

If the tab is currently selected, the bottom inset is incremented by 4 pixels.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the tab control.

Return Value:

Returns the ROLE_SYSTEM_PAGETAB code.

gotFocus

public boolean gotFocus(Event e, Object o);

Responds to the control receiving input focus. If the control does not have the focus, ensureVisible is called to bring the control into focus. Calls UIComponent.gotFocus.

Return Value:

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

Parameter | Description
e | The event posted to the control.
o | The object that posted the event.

See Also: com.ms.ui.UIContainer.ensureVisible, com.ms.ui.UIComponent.gotFocus

paint

public void paint(FxGraphics g);

Draws the tab control.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

Remarks:

This method draws the tab's top, left, and right edges, with rounded corners.

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the control.

Return Value:

No return value.

Parameter | Description
on | If true, the selected state is set; otherwise, it is cleared.


Class UITabLayout

public class UITabLayout extends UILayoutManager
{
  // Constructors
  public UITabLayout();

  // Methods
  public Dimension getMinimumSize(IUIContainer parent);
  public Dimension getPreferredSize(IUIContainer parent);
  public void layout(IUIContainer parent, Rectangle bounds);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int dir, boolean keyable);
}

This class implements a layout manager for a collection of tab controls and their pages. UITabLayout is used by UITabViewer, which manages a UITabList object and a set of associated pages. The tabs contained in the UITabList object are laid out consecutively, and in a single row. Because UITabViewer only displays the page of the tab that is currently selected, UITabLayout only lays out the page that is currently visible.

UILayoutManager
  |
  +--UITabLayout

Constructors

UITabLayout

public UITabLayout();

Creates a tab layout manager.

Methods

getMinimumSize

public Dimension getMinimumSize(IUIContainer parent);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
parent | The container of the components.

Remarks:

Typically, the container is a UITabViewer control, which manages a UITabList object and a set of associated pages. The width of the returned Dimension object is the minimum width of the page that is currently displayed. The Dimension object's height is the sum of the minimum height of the displayed page, the minimum layout height of the UITabList object.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
parent | The container of the components.

Remarks:

Typically, the container is a UITabViewer control, which manages a UITabList object and a set of associated pages. The width of the returned Dimension object is the preferred width of the page that is currently displayed. The Dimension object's height is the sum of the preferred height of the displayed page, the preferred layout height of the UITabList object.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize

layout

public void layout(IUIContainer parent, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
parent | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

Typically, the container is a UITabViewer control, which manages a UITabList object and a set of associated pages. layout lays out the UITabList object at the top-left corner of the UITabViewer control. The height and width of the UITabList object are set to its preferred height and the UITabViewer control's width, respectively. The tabs contained in the UITabList object are laid out consecutively, and in a single row.

Note UITabViewer only displays the page of the tab that is currently selected. As a result, layout only lays out the page component that is currently visible.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp, int dir,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
cont | The container where the navigation is occurring.
comp | The component to navigate from.
dir | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

Typically, this method is used to handle keyboard navigation in the container. However, UITabLayout does not provide this functionality.

Overrides:

navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.


Class UITabList

public class UITabList extends UISelector
{
  // Constructors
  public UITabList();

  // Methods
  public IUIComponent add(String s);
  public IUIComponent add(String s, int pos);
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int pos);
  public IUIComponent getFloater();
  public int getRoleCode();
  public void layout();
  public void paint(FxGraphics g);
  public IUIComponent passFocus(int dir);
  public void setSelectedItem(IUIComponent comp, boolean notify);
}

This class manages a collection of tabs. Each tab in the collection is a UITab object. UITabList uses UITabListLayout for its layout manager, and allows only one tab in the collection to be selected at a time.

Note UITabList only manages a set of tabs, not any associated pages. Typically, you'll use UITabViewer rather than using UITabList directly. UITabViewer uses UITabList internally to manage a collection of tabs and their associated pages.

A UITabList object is empty when it is first created. The add method allows you to insert tabs into the tab list control. This is shown in the following example.

// Construct a tab list control.
UITabList tl = new UITabList();

// Add two tabs to tl.
tl.add("tab 1");
tl.add("tab 2");

// Now add tl to the container.
add(tl);

Note When you call add with a String, the tab is automatically hot-tracked. To override this default, call add with a UIText object, as shown in the following example.

// Add a tab that displays a String.
// By default, the tab is hot-tracked.
tl.add("hot");

// Add a tab that is not hot-tracked, using UIText.
tl.add(new UIText("not hot"));

// To create a hot-tracked tab using UIText,
// specify the UIStatic.HOTTRACK style.
tl.add(new UIText("hot UIText", UIStatic.HOTTRACK));

For more information about hot-tracking, see the UIText overview.

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UISelector
          |
          +--UITabList

Constructors

UITabList

public UITabList();

Creates an empty tab list control.

Remarks:

Call the add method to add tabs to the list.

Methods

add

public IUIComponent add(String s);

Adds a tab containing the specified text to the end of the tab list control.

Return Value:

Returns the tab component that was added.

Parameter | Description
s | The text to be displayed on the tab.

Remarks:

By default, the tab is hot-tracked. To add a tab that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITabList overview.

To remove a tab from the tab list control, call the remove method (inherited through UISelector).

add

public IUIComponent add(String s, int pos);

Adds a tab containing the specified text to the tab list control. The tab is added at the specified position.

Return Value:

Returns the tab component that was added.

Parameter | Description
s | The text to be displayed on the tab.
pos | The zero-based index at which to add the tab. To add the tab at the end of the control, pass -1.

Remarks:

By default, the tab is hot-tracked. To add a tab that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITabList overview.

To remove a tab from the tab list control, call the remove method (inherited through UISelector).

add

public IUIComponent add(IUIComponent comp);

Adds a tab containing the specified component to the end of the tab list control.

Return Value:

Returns the tab component that was added.

Parameter | Description
comp | The component to be displayed on the tab. If comp is already a UITab object, this tab is added. Otherwise, a new UITab object that displays comp is added.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. To remove a tab from the tab list control, call the remove method (inherited through UISelector).

add

public IUIComponent add(IUIComponent comp, int pos);

Adds a tab containing the specified component to the tab list control. The tab is added at the specified position.

Return Value:

Returns the tab component that was added.

Parameter | Description
comp | The component to be displayed on the tab. If comp is already a UITab object, this tab is added. Otherwise, a new UITab object that displays comp is added.
pos | The zero-based index at which to add the tab. To add the tab at the end of the control, pass -1.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. To remove a tab from the tab list control, call the remove method (inherited through UISelector).

getFloater

public IUIComponent getFloater();

This method simply returns the floating component in this container, if there is one. The floating component is the component which is superceding the standard z-order of the container's children by being first in the z-order. This is most commonly used when a component is being dragged, such as a column header or a scroll thumb.

Return Value:

Returns the current floating component; returns null if there is none.

getRoleCode

public int getRoleCode();

Returns the Microsoft® Active Accessibility™ role code for the tab list object.

Return Value:

Returns the ROLE_SYSTEM_PAGETABLIST role code.

layout

public void layout();

Lays out the components in the associated root container.

Return Value:

No return value.

paint

public void paint(FxGraphics g);

Draws the tab list control.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

passFocus

public IUIComponent passFocus(int dir);

Retrieves the component that should receive input focus when navigating to the container in the specified direction.

Return Value:

Returns the component, or the container itself, that should receive input focus.

Parameter | Description
dir | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.

Remarks:

This method implements passFocus in the IUIContainer interface.

setSelectedItem

public void setSelectedItem(IUIComponent comp, boolean notify);

Sets the control's currently selected item.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.
notify | If true, a list select event will be generated; otherwise, a list select event will not be generated.

Overrides:

setSelectedItem(IUIComponent,boolean) in UISelector.


Class UITabListLayout

public class UITabListLayout extends UILayoutManager
{
  // Constructors
  public UITabListLayout();

  // Methods
  public Dimension getMinimumSize(IUIContainer parent);
  public Dimension getPreferredSize(IUIContainer parent);
  public boolean isWidthRelative();
  public void layout(IUIContainer parent, Rectangle bounds);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int dir, boolean keyable);
}

This class implements a layout manager for a collection of tab controls. UITabListLayout lays out the container's tabs consecutively and in a single row, and handles navigation across the tab collection. UITabList uses UITabListLayout for its layout manager.

UILayoutManager
  |
  +--UITabListLayout

Constructors

UITabListLayout

public UITabListLayout();

Creates a tab list layout manager.

Methods

getMinimumSize

public Dimension getMinimumSize(IUIContainer parent);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
parent | The container of the components.

Remarks:

This method is called by the container's getMinimumSize method. Typically, the container is a UITabList control, which manages a collection of tab components. The width of the returned Dimension object is the sum of the minimum widths of each tab. The Dimension object's height is the largest of the minimum heights of each tab.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
parent | The container of the components.

Remarks:

This method is called by the container's getPreferredSize method. Typically, the container is a UITabList control, which manages a collection of tab components. The width of the returned Dimension object is the sum of the preferred widths of each tab. The Dimension object's height is the largest of the preferred heights of each tab.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize

isWidthRelative

public boolean isWidthRelative();

This method simply returns false, indicating that the layout manager does not use the width of the container to lay out its children.

Return Value:

Returns false. The UITabListLayout layout manager does not lay out components based on the width of the container.

Overrides:

isWidthRelative() in UILayoutManager.

See Also: isHeightRelative

layout

public void layout(IUIContainer parent, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
parent | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

This method is called by the container's layout method. Typically, the container is a UITabList control, which manages a collection of tab components. layout lays out the tabs consecutively, and in a single row. The width of each tab is its respective preferred width; each tab's height is the height of the bounding rectangle. If the tab is currently selected, its height and width both increase by 2 edges.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp, int dir,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
cont | The container where the navigation is occurring.
comp | The tab component to navigate from.
dir The navigation direction. Specify one of the following values defined in IUIAccessible:
  • NAVDIR_LEFT
  • NAVDIR_RIGHT
  • NAVDIR_FIRST
  • NAVDIR_LAST
  • NAVDIR_NEXT
  • NAVDIR_PREV
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

This method handles keyboard navigation in the container. Typically, the container is a UITabList control, which manages a collection of tab components. When a tab in the UITabList container has focus and a key is pressed, navigate is called to move focus to another tab in the container. The following table shows the keys that have corresponding IUIAccessible directions.

Key | IUIAccessible direction
LEFT ARROW and RIGHT ARROW | NAVDIR_LEFT and NAVDIR_RIGHT, respectively
HOME and END | NAVDIR_FIRST and NAVDIR_LAST, respectively

Overrides:

navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.


Class UITabViewer

public class UITabViewer extends UIPanel
{
  // Constructors
  public UITabViewer();

  // Methods
  public IUIComponent add(String name, IUIComponent comp);
  public synchronized void addItemListener(IUIItemListener l);
  public void addNotify();
  public IUIComponent addTab(IUIComponent tab,
        IUIComponent content);
  public Insets getInsets();
  public int getSelectedIndex();
  public IUIComponent getSelectedItem();
  public boolean handleEvent(Event e);
  public void paint(FxGraphics g);
  public boolean postEvent(Event e);
  protected void processEvent(UIEvent e);
  protected void processItemEvent(UIItemEvent e);
  public synchronized void removeItemListener(IUIItemListener l);
  public void removeTab(int index);
  public void removeTab(IUIComponent comp);
  public void requestFocus();
  public void setSelectedIndex(int index);
  public void setSelectedItem(IUIComponent comp);
}

This class implements a tab viewer control. UITabViewer works in conjunction with UITabList to display a list of tabs and their associated pages. UITabViewer uses UITabLayout for its layout manager.

A UITabViewer object is empty when it is first created. The add and addTab methods enable you to insert tabs and their pages. The following example shows how to use these methods.

// Construct a UITabViewer object.
UITabViewer tv = new UITabViewer();

// Add a tab and a page that both display text.
tv.add("Tab 1", new UIText("Page 1"));

// Add a tab that displays the graphical image stored
// in the variable myImage, with a page that displays
// a check box button.
tv.addTab(new UIGraphic(myImage),
          new UICheckButton("Button on Page 2"));

// Add a UITab object with a page that displays the
// UIList object myList.
UITab t = new UITab("Tab 3");
tv.addTab(t, myList);

// Now add the tab viewer to the container.
add(tv);

Note When you call add with a String, the tab is automatically hot-tracked. To override this default, call addTab with a UIText object, as shown in the following example.

// Add a tab that displays a String.
// By default, the tab is hot-tracked.
tv.add("hot", myPage);

// Add a tab that is not hot-tracked, using UIText.
tv.addTab(new UIText("not hot"), myPage);

// To create a hot-tracked tab using UIText,
// specify the UIStatic.HOTTRACK style.
tv.addTab(new UIText("hot UIText", UIStatic.HOTTRACK), myPage);

For more information about hot-tracking, see the UIText overview.

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.

Comments: UITabViewer will put scroll arrows on the control if the tabs do not fit the control.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UITabViewer

Constructors

UITabViewer

public UITabViewer();

Creates an empty tab viewer control.

Remarks:

Call add or addTab to insert a tab and its associated page into the control.

Methods

add

public IUIComponent add(String name, IUIComponent comp);

Adds a tab and its associated page to the tab viewer control. The tab displays the specified text and the page displays the specified component.

Return Value:

Returns the page component that was added, if successful; otherwise, returns null.

Parameter | Description
name | The text to be displayed on the tab.
comp | The component to be displayed on the page that is associated with the tab.

Remarks:

If the name parameter identifies a tab that already exists in the tab viewer, this tab's page is updated with comp. Otherwise, a new tab and page are added. A tab's page is displayed only when the tab is selected.

By default, the tab is hot-tracked. To add a tab that is not hot-tracked, call the addTab method and pass a UIText object. For more information about hot-tracking, see the UITabViewer overview.

addItemListener

public synchronized void addItemListener(IUIItemListener l);

Adds the specified item listener. The listener receives all item events generated for the control. (Item events are generated when the state of an item changes.)

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

addNotify

public void addNotify();

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

Return Value:

No return value.

Remarks:

This method determines whether a tab is selected. If no tab is selected, addNotify sets the selection to the first tab in the tab viewer control.

addTab

public IUIComponent addTab(IUIComponent tab, IUIComponent content);

Adds a tab and its associated page to the tab viewer control. The tab and page display the specified components.

Return Value:

Returns the page component that was added, if successful; otherwise, returns null.

Parameter | Description
tab | The component to be displayed on the tab. If comp is a UITab object, this tab is added. Otherwise, a new UITab object that displays comp is added.
content | The component to be displayed on the page that is associated with the tab.

Remarks:

If the name parameter identifies a tab that already exists in the tab viewer, this tab's page is updated with content. Otherwise, a new tab and page are added. A tab's page is displayed only when the tab is selected.

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to add tabs, see the UITabViewer overview.

getInsets

public Insets getInsets();

Retrieves the tab viewer control's insets (in pixels), which identify the nonclient area of the control.

Return Value:

Returns an Insets object containing control's insets.

getSelectedIndex

public int getSelectedIndex();

Retrieves the zero-based index of the tab that is currently selected.

Return Value:

Returns the index of the selected tab, or -1 if no tab is selected.

See Also: getSelectedItem, setSelectedIndex

getSelectedItem

public IUIComponent getSelectedItem();

Retrieves the tab that is currently selected.

Return Value:

Returns the selected tab, or null if no tab is selected.

See Also: getSelectedItem, setSelectedIndex

handleEvent

public boolean handleEvent(Event e);

Determines whether a tab in the list has been selected, and if so, shows its associated page.

Return Value:

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

Parameter | Description
e | The event.

paint

public void paint(FxGraphics g);

Draws the tab viewer control.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

postEvent

public boolean postEvent(Event e);

Posts the specified event to the control.

Return Value:

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

Parameter | Description
e | The event.

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.

Event type | Method called
item event | processItemEvent
container event | processContainerEvent (inherited through UIStateContainer)
focus event | processFocusEvent (inherited through UIStateContainer)
key event | processKeyEvent (inherited through UIStateContainer)
mouse event | processMouseEvent (inherited through UIStateContainer)
mouse motion event | processMouseMotionEvent (inherited through UIStateContainer)

When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(UIItemEvent e);

Processes item events.

Return Value:

No return value.

Parameter | Description
e | The item event.

Remarks:

This method is called by processEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

removeItemListener

public synchronized void removeItemListener(IUIItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener

removeTab

public void removeTab(int index);

Removes the tab and page from the tab viewer.

Return Value:

No return value.

Parameter | Description
index | The index of the tab and its associated page to remove.

removeTab

public void removeTab(IUIComponent comp);

Removes the tab and page from the tab viewer.

Return Value:

No return value.

Parameter | Description
comp | Specifies either the tab or the page of the tab-page pair that is to be removed.

requestFocus

public void requestFocus();

Transfers the focus to the tab viewer control's content component.

Return Value:

No return value.

setSelectedIndex

public void setSelectedIndex(int index);

Selects the tab at the specified index.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the tab to be selected.

Remarks:

When the specified tab is selected, its associated page is shown.

See Also: setSelectedItem

setSelectedItem

public void setSelectedItem(IUIComponent comp);

Selects the tab that is identified by the specified component.

Return Value:

No return value.

Parameter | Description
comp | The component identifying the tab to be selected. If comp is a tab object, this tab is selected. If comp is the component displayed on a tab, the tab containing comp is selected.

Remarks:

When the specified tab is selected, its associated page is shown.

See Also: setSelectedIndex


Class UIText

public class UIText extends UIStatic
{
  // Constructors
  public UIText();
  public UIText(String text);
  public UIText(String text, int style);

  // Methods
  public Dimension getPreferredSize();
  public int getRoleCode();
  public void paint(FxGraphics g, Rectangle rect);
  public void setFocused(boolean on);
  public void setHot(boolean on);
  public void setName(String text);
  public void setSelected(boolean on);
}

This class implements a static text control. Typically, UIText object is used to display text on another control, such as a button. When you create a UIText object, you specify the text to be displayed and an optional alignment or style. The following example shows how to use UIText to create other objects.

// Construct a check box button that uses
// UIText to display the "Check Box" text string.
// Left-align the text.
UICheckButton c =
   new UICheckButton(new UIText("Check Box", UIStatic.LEFT));
add(c);  // Add c to the container.

UIText overrides the paint method to reflect the control's current states. For example, if the control is hot-tracked, the text changes colors when the mouse enters the control. The color is restored when the mouse exits. If the control is currently selected, the text is white on a dark background. Whenever the state of the control changes, paint is called to redraw the control.

Note For a control to be hot-tracked, you must specify the HOTTRACK style when you create it. When the mouse enters the control, the hot-tracked state is then set through a call to setHot, and the text turns blue. When the mouse exits, the hot-tracked state is cleared. Be aware that calling setHot will have no effect if the HOTTRACK style was never set.

The following example demonstrates the use of the HOTTRACK style flag. Many classes have a default mechanism for creating hot-tracked controls. For example, when constructing a button with a String, the HOTTRACK style is set internally, and the control is automatically hot-tracked.

// Construct a push button using UIText.
// Specify that the control is hot-tracked
// by using the HOTTRACK flag.
UIPushButton p1 =
   new UIPushButton(new UIText("Hot-tracked with UIText",
                               UIStatic.HOTTRACK));

// Construct a push button using a String.
// The control is automatically hot-tracked.
UIPushButton p2 = new UIPushButton("Hot-tracked by default");

// Construct a push button that is not hot-tracked.
// In this case, the button must be created with UIText.
UIPushButton p3 = new UIPushButton(new UIText("Not hot-tracked"));

add(p1);
add(p2);
add(p3);

In addition to using UIText, you can use UIGraphic and UIItem to create other static objects.

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.

UIComponent
  |
  +--UIStateComponent
    |
    +--UICanvas
      |
      +--UIStatic
        |
        +--UIText

Constructors

UIText

public UIText();

Creates a static text control with no text.

Remarks:

By default, any text added to the control will be aligned both horizontally and vertically.

UIText

public UIText(String text);

Creates a static text control with the specified text.

Parameter | Description
text | The text to be displayed within the control.

Remarks:

By default, the text is aligned both horizontally and vertically.

UIText

public UIText(String text, int style);

Creates a static text control with the specified text and style.

Parameter | Description
text | The text to be displayed within the control.
style | The alignment and style of the control. You can pass any bitwise combination of an alignment flag and a style flag. For a list of possible flags, see the UIStatic.setFlags method.

Remarks:

If a vertical alignment is not specified, VCENTER is used by default. Similarly, if a horizontal alignment is not specified, HCENTER is used.

Exceptions:

IllegalArgumentException if more than one vertical alignment, more than one horizontal alignment, or an undefined style was specified.

Methods

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred size (in pixels) of the static text control.

Return Value:

Returns a Dimension object containing the preferred size.

Remarks:

The preferred size is based on the dimensions of the control's text in the current font.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the static text control.

Return Value:

Returns the ROLE_SYSTEM_STATICTEXT code.

paint

public void paint(FxGraphics g, Rectangle rect);

Called by paint(Graphics g), inherited through UIStatic, to draw the control's text.

Return Value:

No return value.

Parameter | Description
g | The graphics context.
rect | The rectangle in which to draw the control's text.

Remarks:

This method draws the control's text and background to reflect the control's current states. For more information about states, see the UIText overview.

Overrides:

paint(FxGraphics,Rectangle) in UIStatic.

setFocused

public void setFocused(boolean on);

Sets or clears the focus state of the static text control.

Return Value:

No return value.

Parameter | Description
on | If true, the focus state is set; otherwise, it is cleared.

Remarks:

This method redraws the control to display the new state. For more information about states, see the UIText overview.

setHot

public void setHot(boolean on);

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

Return Value:

No return value.

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

Remarks:

This method redraws the control to display the new state.

Note The control must have the HOTTRACK style for the hot-tracked state to be set or cleared. For more information about hot-tracking, see the UIText overview.

Overrides:

setHot(boolean) in UIStatic.

setName

public void setName(String text);

Sets the control's text.

Return Value:

No return value.

Parameter | Description
text | The text to be displayed within the control.

Remarks:

The getName method (inherited through UICanvas) enables you to retrieve the control's current text.

setSelected

public void setSelected(boolean on);

Sets or clears the selected state of the static text control.

Return Value:

No return value.

Parameter | Description
on | If true, the selected state is set; otherwise, it is cleared.

Remarks:

This method redraws the control to display the new state. For more information about states, see the UIText overview.


Class UIThreePanelLayout

public class UIThreePanelLayout extends UILayoutManager
{
  // Constructors
  public UIThreePanelLayout();
  public UIThreePanelLayout(int hgap, int vgap);

  // Methods
  public void addLayoutComponent(IUIContainer cont,
        IUIComponent comp, Object constraints);
  public IUIComponent getComponent(Object constraints);
  public IUIComponent getComponent(IUIContainer cont,
        Object constraints);
  public Dimension getForcedBounds(Object constraints);
  public Dimension getMinimumSize(IUIContainer target);
  public Dimension getPreferredSize(IUIContainer target);
  public void layout(IUIContainer target, Rectangle bounds);
  public void removeForcedBounds();
  public void removeLayoutComponent(IUIContainer cont, IUIComponent
        comp);
  public void setForcedBounds(Object constraints, Dimension dim);
}

This class implements a layout manager for three panels, consisting of an image, a content component, and a set of buttons. UIThreePanelLayout lays the panels in two rows. The first row contains the image and content panels, with the image to the left of the content. The second row contains the buttons.

UIThreePanelLayout is the default layout manager for UIMessageBox, UIPropertyDialog, and UIWizard.

UILayoutManager
  |
  +--UIThreePanelLayout

Constructors

UIThreePanelLayout

public UIThreePanelLayout();

Creates a three-panel layout.

Remarks:

By default, the horizontal and vertical gaps (used for spacing between panels) are 7 pixels each.

UIThreePanelLayout

public UIThreePanelLayout(int hgap, int vgap);

Creates a three-panel layout manager with the specified horizontal and vertical gaps.

Parameter | Description
hgap | The number of pixels used for horizontal spacing between panels.
vgap | The number of pixels used for vertical spacing between panels.

Methods

addLayoutComponent

public void addLayoutComponent(IUIContainer cont, IUIComponent comp, Object
        constraints);

Adds the specified component to the container, according to the specified constraints.

Return Value:

No return value.

Parameter | Description
cont | The container of the component.
comp | The component to be added.
constraints | Identifies where the component will be added. You can pass a String or Integer value, as described in the Remarks section.

Remarks:

The following table lists possible values for the constraints parameter.

String value | Integer value | Component
"image" | 0 | The component to be used as the image panel, which is laid in the first row of the container, and to the left of the content panel.
"buttons" | 1 | The component to be used as the buttons panel, which is laid in the second row of the container.
"content" | 2 | The component to be used as the content panel, which is laid in the first row of the container, and to the right of the image panel.

Note The String values are not case-sensitive.

Overrides:

addLayoutComponent(IUIContainer,IUIComponent,Object) in UILayoutManager.

Exceptions:

IllegalArgumentException if an undefined constraint was specified.

See Also: removeLayoutComponent

getComponent

public IUIComponent getComponent(Object constraints);

Retrieves the component identified by the specified constraints.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
constraints | Identifies the component being retrieved. You can pass a String or Integer value, as described in the Remarks section.

Remarks:

The following table lists possible values for the constraints parameter.

String value | Integer value | Component
"image" | 0 | The component to be retrieved.
"buttons" | 1 | The component to be retrieved.
"content" | 2 | The component to be retrieved.

Note The String values are not case-sensitive.

Exceptions:

IllegalArgumentException if an undefined layout name was specified.

getComponent

public IUIComponent getComponent(IUIContainer cont, Object constraints);

Retrieves the component identified by the specified constraints.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
cont | The container of the component.
constraints | Identifies the panel of the component to be retrieved. You can pass a String or Integer value, as described in the Remarks section.

Remarks:

The following table lists possible values for the constraints parameter.

String value | Integer value | Component
"image" | 0 | The component to be retrieved.
"buttons" | 1 | The component to be retrieved.
"content" | 2 | The component to be retrieved.

Note The String values are not case-sensitive.

Overrides:

getComponent(IUIContainer,Object) in UILayoutManager.

Exceptions:

IllegalArgumentException if an undefined layout name was specified.

getForcedBounds

public Dimension getForcedBounds(Object constraints);

Retrieves the forced dimensions (in pixels) of the specified panel.

Return Value:

Returns a Dimension object containing the forced dimensions (if the panel has forced bounds); otherwise, returns null.

Parameter | Description
constraints | Identifies the panel of the component. You can pass a String or Integer value, as described in the Remarks section.

Remarks:

By default, a component has no forced bounds, meaning the component's preferred and minimum dimensions are used in calculating the layout's preferred and minimum layout sizes, respectively. However, you can force specific dimensions on a given component by calling setForcedBounds.

Remarks:

The following table lists possible values for the constraints parameter.

String value | Integer value | Component
"image" | 0 | The component whose dimensions are being retrieved.
"buttons" | 1 | The component whose dimensions are being retrieved.
"content" | 2 | The component whose dimensions are being retrieved.

Note The String values are not case-sensitive.

getMinimumSize

public Dimension getMinimumSize(IUIContainer target);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
target | The container of the components.

Remarks:

The layout size of the container is based on the size of each component, or panel. If any panel has forced bounds, those dimensions are used; otherwise, the minimum dimensions are used.

Because the image and content panels are laid in one row and the buttons panel in another, getMinimumSize determines the larger of the width of the buttons and the combined length of the image's width, the content's width, and the horizontal gap between the image and content. The width of the returned Dimension object is then the sum of this larger value. The Dimension object's height is the sum of the button panel's height, the larger of the heights of the image and content panels, and the vertical gap.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize, getForcedBounds

getPreferredSize

public Dimension getPreferredSize(IUIContainer target);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
target | The container of the components.

Remarks:

The layout size of the container is based on the size of each component, or panel. If any panel has forced bounds, those dimensions are used; otherwise, the preferred dimensions are used.

Because the image and content panels are laid in one row and the buttons panel in another, getPreferredSize determines the larger of the width of the buttons and the combined length of the image's width, the content's width, and the horizontal gap between the image and content. The width of the returned Dimension object is then the sum of this larger value. The Dimension object's height is the sum of the button panel's height, the larger of the heights of the image and content panels, and the vertical gap.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize, getForcedBounds

layout

public void layout(IUIContainer target, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
target | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

The image panel is laid in the top-left corner of the bounding rectangle. If the image panel has forced bounds, these dimensions are used; otherwise, the panel's preferred width and height are used.

The content panel is laid to the right of the image panel, with the horizontal gap in between them. The content's height (forced or preferred) is compared against the height of the image, and if smaller, is increased to the image's height. The content's width depends on the width of the buttons panel, which is laid below the image and content, separated by the vertical gap and left-aligned with the image. The width of the buttons panel (forced or preferred) is compared against the combined length of the image's width, the horizontal gap, and the content's width (forced or preferred), and if smaller, is increased to this combined length. Otherwise, the content's width is increased so that the combined length equals the width of the buttons panel.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

See Also: getForcedBounds

removeForcedBounds

public void removeForcedBounds();

Removes the forced dimensions from all panels.

Return Value:

No return value.

See Also: setForcedBounds

removeLayoutComponent

public void removeLayoutComponent(IUIContainer cont, IUIComponent comp);

Removes the specified component from the container.

Return Value:

No return value.

Parameter | Description
cont | The container of the component.
comp | The component to be removed.

Remarks:

This method is called by the container's remove method.

Overrides:

removeLayoutComponent(IUIContainer,IUIComponent) in UILayoutManager.

See Also: addLayoutComponent

setForcedBounds

public void setForcedBounds(Object constraints, Dimension dim);

Forces the specified dimensions on the specified panel.

Return Value:

No return value.

Parameter | Description
constraints | Identifies the panel of the component. You can pass a String or Integer value, as described in the Remarks section.
dim | The forced dimensions for the panel (in pixels).

Remarks:

By default, a panel has no forced bounds, meaning the panel's preferred and minimum dimensions are used in calculating the container's preferred and minimum layout sizes, respectively. However, setForcedBounds allows specific dimensions to be used.

Remarks:

The following table lists possible values for the constraints parameter.

String value | Integer value | Component
"image" | 0 | The component whose forced bounds are being set.
"buttons" | 1 | The component whose forced bounds are being set.
"content" | 2 | The component whose forced bounds are being set.

Note The String values are not case-sensitive.

See Also: getForcedBounds, removeForcedBounds


Class UIThumb

public class UIThumb extends UISingleContainer
{
  // Constructors
  public UIThumb();
  public UIThumb(IUIComponent comp);

  // Methods
  public Point getDragStart();
  public int getRoleCode();
  public boolean isKeyable();
  public boolean mouseDown(Event e, int x, int y);
  public boolean mouseDrag(Event e, int x, int y);
  public boolean mouseUp(Event e, int x, int y);
}

This class implements a thumb control. UISplitViewer uses UIThumb to create the splitter component between its content panes. UIBandThumb and UIScrollThumb extend UIThumb.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UISingleContainer
        |
        +--UIThumb

Constructors

UIThumb

public UIThumb();

Creates a thumb control with no content.

UIThumb

public UIThumb(IUIComponent comp);

Creates a thumb control using the specified component for content.

Parameter | Description
comp | The component to be displayed within the thumb control.

Methods

getDragStart

public Point getDragStart();

Retrieves the point where the mouse down event occurred on the current thumb drag operation.

Return Value:

Returns a Point object representing the position of the original mouse down event.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the thumb control.

Return Value:

Returns the ROLE_SYSTEM_GRIP code.

isKeyable

public boolean isKeyable();

Determines whether the thumb control can receive keyboard input.

Return Value:

Returns true if the control can accept keyboard input; otherwise, returns false.

mouseDown

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

Responds to the mouse button being pressed over the thumb control. The location of the mouse is recorded internally.

Return Value:

Returns false, indicating that the event is to be given to the parent.

Parameter | Description
e | 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 e, int x, int y);

Responds to the mouse button being dragged over the thumb control. This method records the difference between the current position of the mouse and its location when it was last pressed.

Return Value:

Returns false, indicating that the event is to be given to the parent.

Parameter | Description
e | 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 e, int x, int y);

Responds to the mouse button being released over the thumb control. This method records the difference between the location of the mouse when it was released and its location when it was last pressed.

Return Value:

Returns false, indicating that the event is to be given to the parent.

Parameter | Description
e | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.


Class UITip

public class UITip extends UIWindow
{
}

This class is for internal use only. It should not be used.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow
            |
            +--UITip


Class UITree

public class UITree extends UISelector implements IUITree
{
  // Constructors
  public UITree();
  public UITree(String s);
  public UITree(Image i, String s);
  public UITree(IUIComponent comp);
  public UITree(IUIComponent comp, int indent);

  // Methods
  public boolean action(Event e, Object o);
  public IUIComponent add(String s);
  public IUIComponent add(String s, int pos);
  public IUIComponent add(Image i, String s);
  public IUIComponent add(Image i, String s, int pos);
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int pos);
  public Rectangle getAttachRect();
  public IUIComponent getExpander();
  public int getRoleCode();
  public int getStateCode();
  public boolean hasChildren();
  public boolean isExpanded();
  public boolean keyDown(Event e, int key);
  public void remove(IUIComponent comp);
  public void remove(int index);
  public void setChecked(boolean on);
  public void setExpanded(boolean expanded);
  public void setExpanded(boolean expanded, boolean notify);
  public void setExpander(IUIComponent to);
  public void setLayout(IUILayoutManager lm);
}

This class implements a tree control. Each UITree object represents an expandable tree node. Use the add method, to insert child components, including other tree nodes. The following example demonstrates this process.

UITree t0, t1;

// Construct the root tree node with the "Colors" text string.
t0 = new UITree("Colors");

// Add two text child items to t0.
t0.add("Red");
t0.add("Yellow");

// Construct a child node that itself has two children.
{
   t1 = new UITree("Blue");
   t1.add("Navy");
   t1.add("Royal");
}
t0.add(t1);  // Add node t1 to t0.

// Now add t0 to the container.
add(t0);

Note The item displayed by the root node of a tree control is the tree's header component. UITree inherits the getHeader and setHeader methods to retrieve and set this item. The following example shows how to change the header of a tree node.

// Change the text displayed by t0. Pass a UIText
// object that displays the "Primary Colors" text string.
t0.setHeader(new UIText("Primary Colors"));

For more information about header components, see the UIPanel overview.

When a String is used to create a tree node or to add a child item, the component is automatically hot-tracked. To override this default, use a UIText object, as shown in the following example.

// Construct a tree control using UIText.
// By default, the node is not hot-tracked.
UITree t2 = new UITree(new UIText("Not hot-tracked"));

// Add three child items to t2. By default, the String item
// will be hot-tracked. To create a hot-tracked item with
// UIText, specify the UIStatic.HOTTRACK style.
t2.add("Hot-tracked by default");
t2.add(new UIText("Not hot-tracked"));
t2.add(new UIText("Hot-tracked with UIText", UIStatic.HOTTRACK));

// Add two child items that display an image and text.
// Use UIItem to create an item that is not hot-tracked.
t2.add(myImage, "Hot-tracked by default");
t2.add(new UIItem(myImage, "Not hot-tracked"));

// Add t2 to the container.
add(t2);

For more information about hot-tracking, see the UIText overview.

Typically, a UITree object uses UITreeLayout for its layout manager, which handles the drawing of the attaching lines between a node and its child components. By default, all UITree node children use UIExpandButton to create the tree's expand button. Initially, UITree nodes are not set in the expanded state. To manually expand or collapse a tree node, call its setExpanded method, as shown in the following example.

// Force t0 to display all children.
t0.setExpanded(true);

UITree permits only one child item to be selected at a time, and by default, a list select event is generated when an item is clicked.

Be aware that UITree objects alone have no scrolling capabilities. The easiest way to add this support is to create a UIScrollViewer object that contains the tree control. UIScrollViewer automatically inserts scroll bars when necessary. Also, by using a fixed size layout manager such as UIScrollViewer, the size of the component will be fixed.

The following example adds a tree control to a UIScrollViewer object.

UITree myTree = new UITree();
myTree.add("first item"); // Add an item to myTree.
...  // Continue adding items to myTree.

// Now create a UIScrollViewer object to contain myTree.
UIScrollViewer sv = new UIScrollViewer(myTree);

// Add sv to the container.
add(sv);

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UISelector
          |
          +--UITree

Constructors

UITree

public UITree();

Creates a tree control with no content.

Remarks:

Call the add method to add child items to the tree control. To add an item to the root node itself, call setHeader (inherited through UIPanel). For an example of calling setHeader, see the UITree overview.

UITree

public UITree(String s);

Creates a tree control with the specified text.

Parameter | Description
s | The text to be displayed by the node.

Remarks:

By default, the tree node is hot-tracked. To create a node that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITree overview.

To add child items to the tree control, call the add method.

UITree

public UITree(Image i, String s);

Creates a tree control with the specified image and text.

Parameter | Description
i | The image to be displayed by the node.
s | The text to be displayed by the node.

Remarks:

By default, the tree node is hot-tracked. To create a node that is not hot-tracked, pass a UIItem object instead of an Image and String. For more information about hot-tracking, see the UITree overview.

To add child items to the tree control, call the add method.

UITree

public UITree(IUIComponent comp);

Creates a tree control with the specified component.

Parameter | Description
comp | The component to be displayed by the node.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. To add child items to the tree control, call the add method.

UITree

public UITree(IUIComponent comp, int indent);

Creates a tree control with the specified component and indent.

Parameter | Description
comp | The component to be displayed by the node.
indent | The indent (in pixels) to be used when laying out node children.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. To add child items to the tree control, call the add method.

Methods

action

public boolean action(Event e, Object o);

Determines whether the tree control was double-clicked, and if so, toggles the expanded state.

Return Value:

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

Parameter | Description
e | The event posted to the tree control.
o | The object that posted the event.

add

public IUIComponent add(String s);

Adds the specified text to the end of the tree control.

Return Value:

Returns the text component that was added.

Parameter | Description
s | The text to be added.

Remarks:

The newly-added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITree overview.

See Also: remove

add

public IUIComponent add(String s, int pos);

Adds the specified text to the tree control at the specified position.

Return Value:

Returns the text component that was added.

Parameter | Description
s | The text to be added.
pos | The zero-based index at which to add the text. If the root node itself displays an item (a header component), this item is at index 0 and the first child begins at index 1. To add a child item at the end of the tree control, pass -1.

Remarks:

The newly-added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITree overview.

Note If the tree node has a header, adding an item at index 0 will insert the item as the new header and shift all other components by one index position. As a result, the previous header becomes the first child item. To simply replace the header without shifting its position, call the setHeader method (inherited through UIPanel). For an example of calling setHeader, see the UITree overview.

See Also: remove

add

public IUIComponent add(Image i, String s);

Adds the specified image and text to the end of the tree control.

Return Value:

Returns the item component that was added.

Parameter | Description
i | The image to be added.
s | The text to be added.

Remarks:

The newly-added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIItem object instead of an Image and String. For more information about hot-tracking, see the UITree overview.

See Also: remove

add

public IUIComponent add(Image i, String s, int pos);

Adds the specified image and text to the tree control at the specified position.

Return Value:

Returns the item component that was added.

Parameter | Description
i | The image to be added.
s | The text to be added.
pos | The zero-based index at which to add the text and image. If the root node itself displays an item (a header component), this item is at index 0 and the first child begins at index 1. To add a child item at the end of the tree control, pass -1.

Remarks:

The newly-added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIItem object instead of an Image and String. For more information about hot-tracking, see the UITree overview.

Note If the tree node has a header, adding an item at index 0 will insert the item as the new header and shift all other components by one index position. As a result, the previous header becomes the first child item. To simply replace the header without shifting its position, call the setHeader method (inherited through UIPanel). For an example of calling setHeader, see the UITree overview.

See Also: remove

add

public IUIComponent add(IUIComponent comp);

Adds the specified component to the end of the tree control.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. The newly-added child component is shown or hidden, according to the tree control's expanded state.

See Also: remove

add

public IUIComponent add(IUIComponent comp, int pos);

Adds the specified component to the tree control at the specified position.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
pos | The zero-based index at which to add the component. If the root node itself displays an item (a header component), this item is at index 0 and the first child begins at index 1. To add a child item at the end of the tree control, pass -1.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. The newly-added child component is shown or hidden, according to the tree control's expanded state.

Note If the tree node has a header, adding an item at index 0 will insert the item as the new header and shift all other components by one index position. As a result, the previous header becomes the first child item. To simply replace the header without shifting its position, call the setHeader method (inherited through UIPanel). For an example of calling setHeader, see the UITree overview.

See Also: remove

getAttachRect

public Rectangle getAttachRect();

Determines where the attaching line will be drawn from the tree node's parent to the tree node.

Return Value:

Returns the node's bounding rectangle.

Remarks:

This method implements getAttachRect in the IUITree interface, and is called by the layout manager's layoutContainer method.

getExpander

public IUIComponent getExpander();

Retrieves the tree control's expand button, which indicates whether the node is expanded or collapsed.

Return Value:

Returns the component currently being used as the expand button.

Remarks:

This method implements getExpander in the IUITree interface. By default, a UITree control uses a UIExpandButton object for its expand button. The setExpander method enables you to specify the component that will be used.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the tree control.

Return Value:

Returns the ROLE_SYSTEM_OUTLINE code.

Overrides:

getRoleCode() in UISelector.

getStateCode

public int getStateCode();

Retrieves the state of the tree control.

Return Value:

Returns the combination of STATE_SYSTEM codes that best describe the state of the control.

Remarks:

If the tree node is expanded, the returned code contains the STATE_SYSTEM_EXPANDED flag. Otherwise, the returned code contains the STATE_SYSTEM_COLLAPSED flag.

Overrides:

getStateCode() in UISelector.

hasChildren

public boolean hasChildren();

Determines whether the tree control has child items.

Return Value:

Returns true if the node has child items; otherwise, returns false.

Remarks:

This method implements hasChildren in the IUITree interface.

isExpanded

public boolean isExpanded();

Determines whether the tree control is expanded.

Return Value:

Returns true if the node is expanded; otherwise, returns false.

Remarks:

This method implements isExpanded in the IUITree interface. To set or clear the expanded state, call setExpanded.

keyDown

public boolean keyDown(Event e, int key);

Determines whether the RIGHT ARROW key or the LEFT ARROW key is being pressed, and if so, expands or collapses the tree control accordingly.

Return Value:

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

Parameter | Description
e | The event posted to the tree control.
key | The key that has been pressed.

Remarks:

This method is called when the tree control has focus and a key is pressed. The RIGHT ARROW key expands the node; the LEFT ARROW key collapses the node.

Overrides:

keyDown(Event,int) in UISelector.

remove

public void remove(IUIComponent comp);

Removes the specified component from the tree control.

Return Value:

No return value.

Parameter | Description
comp | The child component to be removed.

Remarks:

For an example of calling remove, see UISelector.remove. To add a child component to the tree control, call the add method.

Overrides:

remove(IUIComponent) in UISelector.

remove

public void remove(int index);

Removes the component at the specified index from the tree control.

Return Value:

No return value.

Parameter | Description
index | The child component to be removed.

Remarks:

For an example of calling remove, see UISelector.remove. To add a child component to the tree control, call the add method.

Overrides:

remove(int) in UISelector.

setChecked

public void setChecked(boolean on);

Sets or clears the checked state of the tree control.

Return Value:

No return value.

Parameter | Description
on | If true, the checked state is set; otherwise, it is cleared.

Remarks:

This method additionally sets or clears the checked state of the component that is displayed by the tree node.

setExpanded

public void setExpanded(boolean expanded);

Expands or collapses the tree control to show or hide the node's children.

Return Value:

No return value.

Parameter | Description
expanded | If true, the node will be expanded; otherwise, the node will be collapsed.

Remarks:

This method implements setExpanded in the IUITree interface. The display of the node's expand button is updated to reflect the new state.

See Also: isExpanded

setExpanded

public void setExpanded(boolean expanded, boolean notify);

Expands or collapses the tree node to show or hide the node's children.

Return Value:

No return value.

Parameter | Description
expanded | If true, the node will be expanded; otherwise, the node will be collapsed.
notify | If true, the node will generate an action event and post it to the tree node's parent.

setExpander

public void setExpander(IUIComponent to);

Sets the tree control's expand button to the specified component. The expand button indicates whether the node is expanded or collapsed.

Return Value:

No return value.

Parameter | Description
to | The component to be used for the expand button.

Remarks:

This method implements setExpander in the IUITree interface. By default, a UITree control uses a UIExpandButton object for its expand button.

Note Call this method only after the control has been added to a parent container.

See Also: getExpander

setLayout

public void setLayout(IUILayoutManager lm);

Sets the layout manager for the tree control.

Return Value:

No return value.

Parameter | Description
lm | The new layout manager to be used.

Remarks:

When a new UITree object is created with the default indent, it uses the layout manager that is identified by the TREE_LAYOUT index as defined in UISystem. Otherwise, its default layout manager is UITreeLayout.


Class UITreeLayout

public class UITreeLayout extends UILayoutManager
{
  // Constructors
  public UITreeLayout();
  public UITreeLayout(int indent);
  public UITreeLayout(int indent, int vgap);

  // Methods
  public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp,
        Dimension oldSize, Dimension newSize);
  public void drawLine(FxGraphics g, int x1, int y1, int x2,
        int y2);
  public Dimension getMinimumSize(IUIContainer target);
  public Dimension getPreferredSize(IUIContainer target);
  public boolean isHeightRelative();
  public boolean isOverlapping();
  public boolean isWidthRelative();
  public void layout(IUIContainer target, Rectangle bounds);
  public void paintContainer(IUIContainer target, FxGraphics g);
}

This class implements a layout manager for tree nodes. UITreeLayout handles the drawing of the lines that connect a tree node to its children. UITree typically uses UITreeLayout for its default layout manager.

By default, UISystem defines UITreeLayout at the TREE_LAYOUT index.

UILayoutManager
  |
  +--UITreeLayout

Constructors

UITreeLayout

public UITreeLayout();

Creates a tree layout manager.

Remarks:

By default, the vertical spacing between all components is 2 pixels. A tree node's child components will be laid out with an indent of 16 pixels.

UITreeLayout

public UITreeLayout(int indent);

Creates a tree layout manager with the specified indent.

Parameter | Description
indent | The indent (in pixels) used when laying out child components.

Remarks:

By default, the vertical spacing between all components is 2 pixels.

UITreeLayout

public UITreeLayout(int indent, int vgap);

Creates a tree layout manager with the specified indent and vertical gap.

Parameter | Description
indent | The indent (in pixels) used when laying out child components.
vgap | The vertical spacing (in pixels) between components.

Methods

adjustLayoutSize

public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp, Dimension oldSize,
        Dimension newSize);

Called to adjust the layout size of the specified component in the specified container.

Return Value:

Returns a Dimension object containing the new preferred size of the container.

Parameter | Description
parent | The container of the component.
oldParentSize | The previous layout size of the container.
comp | The component being sized.
oldSize | The previous layout size of the component.
newSize | The new layout size of the component.

Overrides:

adjustLayoutSize(IUIContainer,Dimension,IUIComponent,Dimension,Dimension) in UILayoutManager.

drawLine

public void drawLine(FxGraphics g, int x1, int y1, int x2, int y2);

Draws a line from one point to another.

Return Value:

No return value.

Parameter | Description
g | The graphics context.
x1 | The x coordinate of the line's starting point.
y1 | The y coordinate of the line's starting point.
x2 | The x coordinate of the line's ending point.
y2 | The y coordinate of the line's ending point.

Remarks:

This method is called by paintContainer to draw the lines that connect a tree node to its children.

getMinimumSize

public Dimension getMinimumSize(IUIContainer target);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
target | The container of the components.

Remarks:

The height of the returned Dimension object is the sum of the minimum heights of each item displayed by the tree node and all its children, plus the vertical gaps between each item. The Dimension object's width is the largest of the minimum widths of the items (including the indent).

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer target);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
target | The container of the components.

Remarks:

The height of the returned Dimension object is the sum of the preferred heights of each item displayed by the tree node and all its children, plus the vertical gaps between each item. The Dimension object's width is the largest of the preferred widths of the items (including the indent).

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize

isHeightRelative

public boolean isHeightRelative();

This method simply returns false, indicating that the UITreeLayout does not lay out its components based on the height of the container.

Return Value:

Returns false.

Overrides:

isHeightRelative() in UILayoutManager.

See Also: isWidthRelative

isOverlapping

public boolean isOverlapping();

This method simply returns false, indicating that the UITreeLayout lays out its components such that they never overlap.

Return Value:

Returns false.

Overrides:

isOverlapping() in UILayoutManager.

isWidthRelative

public boolean isWidthRelative();

This method simply returns false, indicating that the UITreeLayout does not lay out its components based on the width of the container.

Return Value:

Returns false.

Overrides:

isWidthRelative() in UILayoutManager.

See Also: isHeightRelative

layout

public void layout(IUIContainer target, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
target | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

The height and width of each component is based on the component's respective preferred height and width. The vertical gap (defined when the layout manager was created) is used for vertical spacing between each component.

For each tree node's expand button, layoutContainer determines where the attaching line must be drawn from the node to its parent, based on the node's getAttachRect method and the layout manager's defined indent. The paintContainer method is then invoked to draw all connecting lines between a node and its children.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

paintContainer

public void paintContainer(IUIContainer target, FxGraphics g);

Draws the container.

Return Value:

No return value.

Parameter | Description
target | The container.
g | The graphics context of the container.

Remarks:

This method is automatically invoked during a call to the container's paint method. If the tree node is expanded, paintContainer calls drawLine to connect the node to its children.

Overrides:

paintContainer(IUIContainer,FxGraphics) in UILayoutManager.


Class UIVerticalFlowLayout

public class UIVerticalFlowLayout extends UILayoutManager
{
  // Fields
  public static final int FILL;
  public static final int MULTICOLUMN;

  // Constructors
  public UIVerticalFlowLayout();
  public UIVerticalFlowLayout(int style);
  public UIVerticalFlowLayout(int style, int gap);

  // Methods
  public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp,
        Dimension oldSize, Dimension newSize);
  public Dimension getMinimumSize(IUIContainer parent);
  public Dimension getMinimumSize(IUIContainer parent,
        Dimension bounds);
  public Dimension getPreferredSize(IUIContainer parent);
  public Dimension getPreferredSize(IUIContainer parent,
        Dimension bounds);
  public boolean isHeightRelative();
  public boolean isOverlapping();
  public boolean isWidthRelative();
  public void layout(IUIContainer parent, Rectangle bounds);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int dir, boolean keyable);
  public void setStyle(int style);
}

This class implements a vertical flow layout manager. UIList uses UIVerticalFlowLayout as its default layout manager. UIVerticalFlowLayout enables components in the list to be laid in one vertical column (the default layout) or in multiple columns (if the MULTICOLUMN layout style is set). UIVerticalFlowLayout also defines the FILL style, which extends the width of each component's selectable area to the width of the component's column. This means the component can be selected, even when the horizontal area outside of its immediate label is clicked.

UILayoutManager
  |
  +--UIVerticalFlowLayout

Constructors

UIVerticalFlowLayout

public UIVerticalFlowLayout();

Creates a vertical flow layout manager.

Remarks:

By default, components will be laid out in one vertical column. If the layout manager's style is set to MULTICOLUMN, a horizontal gap of 15 pixels will be added between columns.

UIVerticalFlowLayout

public UIVerticalFlowLayout(int style);

Creates a vertical flow layout manager with the specified style.

Parameter | Description
style | The style of the layout manager. You can pass any bitwise combination of MULTICOLUMN and FILL, or pass 0 for the default style, which is single column with no fill.

Remarks:

Components will be laid out and accessed according to the specified style. If the style is MULTICOLUMN, a horizontal gap of 15 pixels is added between columns.

Exceptions:

IllegalArgumentException if an undefined style was specified.

UIVerticalFlowLayout

public UIVerticalFlowLayout(int style, int gap);

Creates a vertical flow layout manager with the specified style and horizontal gap.

Parameter | Description
style | The style of the layout manager. You can pass any bitwise combination of MULTICOLUMN and FILL, or pass 0 for the default style, which is single column with no fill.
gap | The horizontal spacing (in pixels) between columns, if the style is MULTICOLUMN.

Remarks:

Components will be laid out and accessed according to the specified style.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

adjustLayoutSize

public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp, Dimension oldSize,
        Dimension newSize);

Called to adjust the layout size of the specified component in the specified container.

Return Value:

Returns a Dimension object containing the new preferred size of the container.

Parameter | Description
parent | The container of the component.
oldParentSize | The previous layout size of the container.
comp | The component being sized.
oldSize | The previous layout size of the component.
newSize | The new layout size of the component.

Overrides:

adjustLayoutSize(IUIContainer,Dimension,IUIComponent,Dimension,Dimension) in UILayoutManager.

getMinimumSize

public Dimension getMinimumSize(IUIContainer parent);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
parent | The container of the components.

Remarks:

The width of the returned Dimension object is the largest of the minimum widths of the components, plus the horizontal gaps between each column (if the layout style is MULTICOLUMN). The Dimension object's height is based on the sum of the minimum heights of the components that make up a column.

Overrides:

getMinimumSize(IUIContainer) in UILayoutManager.

See Also: getPreferredSize

getMinimumSize

public Dimension getMinimumSize(IUIContainer parent, Dimension bounds);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object containing the minimum layout size.

Parameter | Description
parent | The container of the components.
bounds | A Dimension object used to force the minimum size of a component or container.

Remarks:

The width of the returned Dimension object is the largest of the minimum widths of the components, plus the horizontal gaps between each column (if the layout style is MULTICOLUMN). The Dimension object's height is based on the sum of the minimum heights of the components that comprise a column. Components do not always return the correct minimum size when their parent or containers have been resized (in particular, edit controls that handle word wrapping). The Dimension passed forces the layout manager to adjust appropriately in these cases.

See Also: getPreferredSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
parent | The container of the components.

Remarks:

The width of the returned Dimension object is the largest of the preferred widths of the components, plus the horizontal gaps between each column (if the layout style is MULTICOLUMN). The Dimension object's height is based on the sum of the preferred heights of the components that make up a column.

Overrides:

getPreferredSize(IUIContainer) in UILayoutManager.

See Also: getMinimumSize

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent, Dimension bounds);

Determines the preferred dimensions (in pixels) for laying out the components in the specified container, using a specified Dimension to force the sizing of components in special cases.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
parent | The container of the components.
bounds | A Dimension object used to force the preferred size of a component or container.

Remarks:

Components do not always return the correct preferred size when their parent or containers have been resized (in particular, edit controls that handle word wrapping). The Dimension passed forces the layout manager to adjust appropriately in these cases.

Overrides:

getPreferredSize(IUIContainer,Dimension) in UILayoutManager.

See Also: getMinimumSize, com.ms.ui.IUIComponent.getPreferredSize

isHeightRelative

public boolean isHeightRelative();

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

Return Value:

Returns true if in multicolumn, false otherwise. Returning false also means that the container's layout method doesn't need to be called on a horizontal re-sizing.

Overrides:

isHeightRelative() in UILayoutManager.

See Also: isWidthRelative

isOverlapping

public boolean isOverlapping();

This method simply returns false by default indicating that the UIVerticalFlow component lays out its children such that they never overlap.

Return Value:

Returns false.

Overrides:

isOverlapping() in UILayoutManager.

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; false otherwise. (The default is true.) Returning false also means that the container's layout method doesn't need to be called on a vertical resizing

Overrides:

isWidthRelative() in UILayoutManager.

See Also: isHeightRelative

layout

public void layout(IUIContainer parent, Rectangle bounds);

Lays out the components in the specified container.

Return Value:

No return value.

Parameter | Description
parent | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

Remarks:

Depending on the layout manager's style, the components are laid out in either one vertical column or in multiple columns, based on their preferred widths and heights. If the style is MULTICOLUMN, the horizontal gap (defined when the layout manager was created) is used for spacing between each column.

If the FILL style is set, layout extends the width of each component's selectable area to the width of the component's column.

Overrides:

layout(IUIContainer,Rectangle) in UILayoutManager.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp, int dir,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
cont | The container where the navigation is occurring.
comp | The component to navigate from.
dir | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

Remarks:

This method handles keyboard navigation in the container. For example, when an item in a UIList object has focus and a key is pressed, navigate is called to move focus to another item in the list. The following table shows the keys that have corresponding IUIAccessible directions.

Key | IUIAccessible direction
UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW | NAVDIR_UP, NAVDIR_DOWN, NAVDIR_LEFT, and NAVDIR_RIGHT, respectively
HOME and END | NAVDIR_FIRST and NAVDIR_LAST, respectively

Overrides:

navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.

setStyle

public void setStyle(int style);

Sets the style of the layout manager.

Return Value:

No return value.

Parameter | Description
style | The style of the layout manager. You can pass any bitwise combination of MULTICOLUMN and FILL, or pass 0 for the default style, which is single column with no fill.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Fields

FILL
Extends the width of each component's selectable area to the width of the component's column.
MULTICOLUMN
Specifies that components will be laid out in multiple columns, as needed. The horizontal gap (defined when the layout manager was created) is used for spacing between columns.


Class UIViewer

public class UIViewer extends UIPanel implements IUIPosition,
            TimerListener
{
  // Constructors
  public UIViewer(IUIComponent comp);
  public UIViewer(IUIComponent comp, int x, int y);

  // Methods
  public boolean ensureVisible(Rectangle rect);
  public IUIComponent getContent();
  public Point getPosition();
  public int getRoleCode();
  public int getXPosition();
  public int getYPosition();
  public boolean isKeyable();
  public boolean isOverlapping();
  public void layout();
  public boolean mouseDown(Event evt, int x, int y);
  public boolean mouseDrag(Event evt, int x, int y);
  public boolean mouseUp(Event evt, int x, int y);
  public void requestFocus();
  public void setContent(IUIComponent comp);
  public void setPosition(Point pt);
  public void setPosition(int x, int y);
  public void setXPosition(int x);
  public void setYPosition(int y);
  public void timeTriggered(TimerEvent te);
}

This class implements a viewer control. A UIViewer object uses another component for content and enables you to move this component within the viewer control. For example, UIMarquee extends UIViewer to create a scrolling marquee object. UIViewer implements the IUIPosition interface to handle the repositioning of the viewer's content. Implements the TimerListener to enables timer event notifications to be received.

The following example shows how to create a UIViewer object and reposition its content.

// Construct a UIViewer object that displays the
// graphical image stored in the variable myImage.
UIViewer v = new UIViewer(new UIGraphic(myImage));

// Add the viewer control to the container.
add(v);

// Now move the viewer's image 15 pixels to
// the right and 10 pixels down.
v.setPosition(15, 10);

Note UIViewer does not provide scroll bars. To add this support, consider using the UIScrollViewer class, which automatically adds scroll bars to the viewer control when necessary.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIViewer

Constructors

UIViewer

public UIViewer(IUIComponent comp);

Creates a viewer control with the specified component.

Parameter | Description
comp | The component to be displayed within the viewer control.

Remarks:

By default, the top-left corner of the content component is positioned at the top-left corner of the viewer control.

UIViewer

public UIViewer(IUIComponent comp, int x, int y);

Creates a viewer control with the specified component and scroll position.

Parameter | Description
comp | The component to be displayed within the viewer control.
x | The initial horizontal scroll position for the content component.
y | The initial vertical scroll position for the content component.

Methods

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.

Parameter | Description
rect | The rectangle identifying the area to be made visible.

Remarks:

This method is called when the viewer control has focus. If the entire rectangle does not fit inside the viewer control, the upper-right corner of the rectangle is displayed.

See Also: timeTriggered

getContent

public IUIComponent getContent();

Retrieves the viewer control's content.

Return Value:

Returns the component currently being displayed in the viewer control.

See Also: setContent

getPosition

public Point getPosition();

Retrieves the current scroll position of the viewer control's content.

Return Value:

Returns a Point object containing the content component's scroll position. The x and y coordinates specify the horizontal and vertical scroll positions (in pixels), respectively.

Remarks:

This method implements getPosition in the IUIPosition interface.

See Also: getXPosition, getYPosition, setPosition

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the viewer control.

Return Value:

Returns the ROLE_SYSTEM_PANE code.

getXPosition

public int getXPosition();

Retrieves the horizontal scroll position of the viewer's content component.

Return Value:

Returns the horizontal scroll position (in pixels).

Remarks:

This method implements getXPosition in the IUIPosition interface.

See Also: getYPosition, getPosition, setXPosition

getYPosition

public int getYPosition();

Retrieves the vertical scroll position of the viewer's content component.

Return Value:

Returns the vertical scroll position (in pixels).

Remarks:

This method implements getYPosition in the IUIPosition interface.

See Also: getXPosition, getPosition, setYPosition

isKeyable

public boolean isKeyable();

Determines whether the control can receive keyboard input.

Return Value:

Returns true if the control can receive keyboard input; otherwise, returns false.

Remarks:

A control can receive keyboard input if it is enabled and visible.

isOverlapping

public boolean isOverlapping();

Determines if this layout manager lays out its children so they overlap either completely or partially.

Return Value:

Returns true if the children overlap; otherwise, returns false. (The default is true.) Returning false also means that only the sibling floater window, if one exists, needs to be clipped by the manager.

layout

public void layout();

Lays out the content component within the viewer control.

Return Value:

No return value.

mouseDown

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

Processes a mouse down event.

Return Value:

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

Parameter | Description
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);

Processes a mouse drag event.

Return Value:

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

Parameter | Description
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);

Processes a mouse up event.

Return Value:

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

Parameter | Description
evt | The event posted to the control.
x | The x coordinate of the event.
y | The y coordinate of the event.

requestFocus

public void requestFocus();

Transfers the focus to the viewer control's content component.

Return Value:

No return value.

setContent

public void setContent(IUIComponent comp);

Sets the viewer control's content to the specified component.

Return Value:

No return value.

Parameter | Description
comp | The component to be displayed within the viewer control.

See Also: getContent

setPosition

public void setPosition(Point pt);

Moves the viewer control's content to the scroll position, based on the specified Point.

Return Value:

No return value.

Parameter | Description
pt | The requested position for the content component. The x and y coordinates of pt specify the horizontal and vertical positions (in pixels), respectively.

Remarks:

This method implements setPosition in the IUIPosition interface.

See Also: setXPosition, setYPosition, getPosition

setPosition

public void setPosition(int x, int y);

Moves the viewer control's content to the scroll position, based on the specified values.

Return Value:

No return value.

Parameter | Description
x | The requested horizontal position for the content component (in pixels).
y | The requested vertical position for the content component (in pixels).

Remarks:

This method implements setPosition in the IUIPosition interface.

See Also: setXPosition, setYPosition, getPosition

setXPosition

public void setXPosition(int x);

Moves the viewer control's content in the horizontal direction by the specified amount.

Return Value:

No return value.

Parameter | Description
x | The requested horizontal position for the content component (in pixels).

Remarks:

This method implements setXPosition in the IUIPosition interface.

See Also: setYPosition, setPosition, getXPosition

setYPosition

public void setYPosition(int y);

Moves the viewer control's content in the vertical direction by the specified amount.

Return Value:

No return value.

Parameter | Description
y | The requested vertical position for the content component (in pixels).

Remarks:

This method implements setYPosition in the IUIPosition interface.

See Also: setXPosition, setPosition, getYPosition

timeTriggered

public void timeTriggered(TimerEvent te);

Executes the latest ensureVisible method.

Return Value:

No return value.

Parameter | Description
te | A TimerEvent object that describes the timer event.

Remarks:

This method implements the timeTriggered method in the TimerListener interface to delay ensureVisible calls when there is a enough scrolling activity to cause the viewer to auto-scroll too quickly.

See Also: ensureVisible


Class UIWindow

public class UIWindow extends UIRoot
{
  // Constructors
  public UIWindow(UIFrame frame);
  public UIWindow(Frame frame);
  public UIWindow(UIFrame frame, int edge);
  public UIWindow(Frame frame, int edge);

  // Methods
  public synchronized void addWindowListener(IUIWindowListener l);
  public void dispose();
  public void hide();
  public IUIComponent navigate(IUIComponent comp, int dir,
        boolean keyable);
  public void pack();
  protected void processEvent(UIEvent e);
  protected void processWindowEvent(UIWindowEvent e);
  public synchronized void removeWindowListener(
        IUIWindowListener l);
  public void reshape(int x, int y, int w, int h);
  public void resize(int w,int h);
  public void setBounds(int x, int y, int width, int height);
  public void setBounds(Rectangle r);
  public synchronized void setCursor(Cursor cursor);
  public synchronized void setCursor(int cursorType);
  public void setFont(Font font);
  public void setLocation(int x, int y);
  public void setLocation(Point point);
  public void setSize(int w, int h);
  public void setSize(Dimension size);
  public void setVisible(boolean show);
  public void show(boolean show);
  public void show();
}

This class implements a top-level window. UIWindow extends the UIRoot class. Initially, the root container is empty; to add components, call add.

A window is initially hidden when it is first created. You must call the window's setVisible to make the window visible.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow

Constructors

UIWindow

public UIWindow(UIFrame frame);

Creates a window using the specified parent UIFrame.

Parameter | Description
frame | The parent frame of the window.

Remarks:

By default, the window uses BorderLayout for its layout manager. The host is then added to the center of the window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.

The window is initially hidden. You must call the window's show method to make the window visible.

Applications extending UIWindow must call the super method handleEvent() inside the local handleEvent to use ToolTips. Applications extending UIWindow and implementing the TimerListener interface, must call the super method TimerTriggered(event).

UIWindowEvent events are supported by this window.

See Also: setLayout, com.ms.ui.event.IUIWindowListener, com.ms.ui.event.IUIMouseListener, com.ms.util.TimerListener

UIWindow

public UIWindow(Frame frame);

Creates a window using the specified parent java.awt.Frame.

Parameter | Description
frame | The parent frame of the window.

Remarks:

By default, the window uses BorderLayout for its layout manager. The host is then added to the center of the window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.

The window is initially hidden. You must call the window's show method to make the window visible.

See Also: setLayout

UIWindow

public UIWindow(UIFrame frame, int edge);

Creates a window using the specified parent UIFrame and the the specified edge style.

Parameter | Description
frame | The parent frame of the window.
edge | The edge style of the window's root container. For a list of possible styles, see UIContainer.setEdge.

Remarks:

By default, the window uses BorderLayout for its layout manager. The host is then added to the center of the window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.

The window is initially hidden. You must call the window's show method to make the window visible.

See Also: setLayout

UIWindow

public UIWindow(Frame frame, int edge);

Creates a window using the specified parent java.awt.Frame and the the specified edge style.

Parameter | Description
frame | The parent frame of the window.
edge | The edge style of the window's root container. For a list of possible styles, see UIContainer.setEdge.

Remarks:

By default, the window uses BorderLayout for its layout manager. The host is then added to the center of the window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.

The window is initially hidden. You must call the window's show method to make the window visible.

See Also: setLayout

Methods

addWindowListener

public synchronized void addWindowListener(IUIWindowListener l);

Adds the specified window listener to receive window events from this window.

Return Value:

No return value.

Parameter | Description
l | The window listener.

dispose

public void dispose();

Disposes the window. This method must be called to release the resources that are used for the window.

Return Value:

No return value.

hide

public void hide();

Note As of JDK version 1.1, replaced by setVisible(boolean).

navigate

public IUIComponent navigate(IUIComponent comp, int dir, boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
comp | The component to navigate from.
dir | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

pack

public void pack();

Packs the components of the Window.

Return Value:

No return value.

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

Parameter | Description
e | The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.

Event type | Method called
action event | processActionEvent
component event | processComponentEvent (inherited through UIStateContainer)
container event | processContainerEvent (inherited through UIStateContainer)
focus event | processFocusEvent (inherited through UIStateContainer)
key event | processKeyEvent (inherited through UIStateContainer)
mouse event | processMouseEvent (inherited through UIStateContainer)
mouse motion event | processMouseMotionEvent (inherited through UIStateContainer)

When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.

processWindowEvent

protected void processWindowEvent(UIWindowEvent e);

Processes action events.

Return Value:

No return value.

Parameter | Description
e | The action event.

Remarks:

This method is called by processEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure that the default event processing continues normally.

See Also: addActionListener

removeWindowListener

public synchronized void removeWindowListener(IUIWindowListener l);

Removes the specified window listener so that it no longer receives window events from this window.

Return Value:

No return value.

Parameter | Description
l | The window listener.

reshape

public void reshape(int x, int y, int w, int h);

Note As of JDK version 1.1, replaced by setBounds(int, int, int, int).

resize

public void resize(int w,int h);

Note As of JDK version 1.1, replaced by setSize(int, int).

setBounds

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

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

Return Value:

No return value.

Parameter | Description
x | The x coordinate for the upper-left corner of the window, relative to the parent.
y | The y coordinate for the upper-left corner of the window, relative to the parent.
width | The new width of the window.
height | The new height of the window.

setBounds

public void setBounds(Rectangle r);

Sets the bounding rectangle of the window, according to the specified Rectangle object.

Return Value:

No return value.

Parameter | Description
r | The rectangle identifying the coordinates for the window's upper-left corner and the window's new width and height.

setCursor

public synchronized void setCursor(Cursor cursor);

Sets a specific cursor to the window.

Return Value:

No return value.

Parameter | Description
cursor | The Cursor object to associate with the window.

setCursor

public synchronized void setCursor(int cursorType);

Sets a specific cursor to the window. This method has been deprecated and replaced by the setCursor(Cursor) method.

Return Value:

No return value.

Parameter | Description
cursorType | The type of cursor to set. Valid types are defined in the java.awt Cursor class.

setFont

public void setFont(Font font);

Sets the font for the UIWindow.

Return Value:

No return value.

Parameter | Description
font | The font for the window.

setLocation

public void setLocation(int x, int y);

Sets the location of the window, relative to its parent frame.

Return Value:

No return value.

Parameter | Description
x | The x coordinate for the upper-left corner of the window, relative to the parent frame.
y | The y coordinate for the upper-left corner of the window, relative to the parent frame.

setLocation

public void setLocation(Point point);

Sets the location of the UIWindow, relative to its parent frame.

Return Value:

No return value.

Parameter | Description
point | The upper-left corner of the window, relative to the parent frame.

setSize

public void setSize(int w, int h);

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

Return Value:

No return value.

Parameter | Description
w | The new width for the window.
h | The new height for the window.

setSize

public void setSize(Dimension size);

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

Return Value:

No return value.

Parameter | Description
size | The new width and height for the window.

setVisible

public void setVisible(boolean show);

Sets or clears the visible state of the UIWindow.

Return Value:

No return value.

Parameter | Description
show | If true, the visible state is set; otherwise, it is cleared.

show

public void show(boolean show);

Note As of JDK version 1.1, replaced by setVisible(boolean).

show

public void show();

Note As of JDK version 1.1, replaced by setVisible(boolean).


Class UIWinEvent

public class UIWinEvent
{
  // Fields
  public static final int EVENT_OBJECT_ACCELERATORCHANGE;
  public static final int EVENT_OBJECT_CREATE;
  public static final int EVENT_OBJECT_DEFACTIONCHANGE;
  public static final int EVENT_OBJECT_DESCRIPTIONCHANGE;
  public static final int EVENT_OBJECT_DESTROY;
  public static final int EVENT_OBJECT_FOCUS;
  public static final int EVENT_OBJECT_HELPCHANGE;
  public static final int EVENT_OBJECT_HIDE;
  public static final int EVENT_OBJECT_LOCATIONCHANGE;
  public static final int EVENT_OBJECT_NAMECHANGE;
  public static final int EVENT_OBJECT_PARENTCHANGE;
  public static final int EVENT_OBJECT_REORDER;
  public static final int EVENT_OBJECT_SELECTION;
  public static final int EVENT_OBJECT_SELECTIONADD;
  public static final int EVENT_OBJECT_SELECTIONREMOVE;
  public static final int EVENT_OBJECT_SELECTIONWITHIN;
  public static final int EVENT_OBJECT_SHOW;
  public static final int EVENT_OBJECT_STATECHANGE;
  public static final int EVENT_OBJECT_VALUECHANGE;
  public static final int EVENT_SYSTEM_ALERT;
  public static final int EVENT_SYSTEM_CAPTUREEND;
  public static final int EVENT_SYSTEM_CAPTURESTART;
  public static final int EVENT_SYSTEM_CONTEXTHELPEND;
  public static final int EVENT_SYSTEM_CONTEXTHELPSTART;
  public static final int EVENT_SYSTEM_DIALOGEND;
  public static final int EVENT_SYSTEM_DIALOGSTART;
  public static final int EVENT_SYSTEM_DRAGDROPEND;
  public static final int EVENT_SYSTEM_DRAGDROPSTART;
  public static final int EVENT_SYSTEM_FOREGROUND;
  public static final int EVENT_SYSTEM_MENUEND;
  public static final int EVENT_SYSTEM_MENUPOPUPEND;
  public static final int EVENT_SYSTEM_MENUPOPUPSTART;
  public static final int EVENT_SYSTEM_MENUSTART;
  public static final int EVENT_SYSTEM_MINIMIZEEND;
  public static final int EVENT_SYSTEM_MINIMIZESTART;
  public static final int EVENT_SYSTEM_MOVESIZEEND;
  public static final int EVENT_SYSTEM_MOVESIZESTART;
  public static final int EVENT_SYSTEM_SCROLLINGEND;
  public static final int EVENT_SYSTEM_SCROLLINGSTART;
  public static final int EVENT_SYSTEM_SOUND;
  public static final int EVENT_SYSTEM_SWITCHEND;
  public static final int EVENT_SYSTEM_SWITCHSTART;
  public static final int OBJID_WINDOW;

  // Methods
  public static Object getObject(int id);
  public static void notify(int event, Object obj);
}

This class implements a window event notification method. This method allows any object to track the events occurring in any child or parent container. The list of constants represent events that may be used to track the changes in the state of an object. This list of constants may be extended to include additional events that may need to be tracked.

Methods

getObject

public static Object getObject(int id);

This method retrieves an object based on the ID.

Return Value:

Returns The object that is identified by the value of the ID.

Parameter | Description
id | The id of the object to find.

notify

public static void notify(int event, Object obj);

Notifies the object when an event occurs. For example, notification could be sent to the parent when a child component changed its location.

Return Value:

No return value.

Parameter | Description
event | The event to send.
obj | The object to be notified.

Fields

EVENT_OBJECT_ACCELERATORCHANGE
This event is sent when the keyboard accelerator has changed.
EVENT_OBJECT_CREATE
This event is sent when a visible object is created.
EVENT_OBJECT_DEFACTIONCHANGE
This event is sent when the default action has changed.
EVENT_OBJECT_DESCRIPTIONCHANGE
This event is sent when the object's description has changed.
EVENT_OBJECT_DESTROY
This event is sent when a visible object is destroyed.
EVENT_OBJECT_FOCUS
This event is sent when the object is receiving focus.
EVENT_OBJECT_HELPCHANGE
This event is sent when the object's Help has changed.
EVENT_OBJECT_HIDE
This event is sent when a visible object is hidden.
EVENT_OBJECT_LOCATIONCHANGE
This event is sent when the object's locatin (move/size) has changed.
EVENT_OBJECT_NAMECHANGE
This event is sent when the object's name has changed.
EVENT_OBJECT_PARENTCHANGE
This event is sent when the object's parent has changed.
EVENT_OBJECT_REORDER
This event is sent when the order of the objects has changed.
EVENT_OBJECT_SELECTION
This event is sent when the item with the selection is moving to a different item within a container.
EVENT_OBJECT_SELECTIONADD
This event is sent when a new item has been added to the selection with a container. Use this event when the number of newly selected items is very small.
EVENT_OBJECT_SELECTIONREMOVE
This event is sent when a new item has been removed from the selection within a container. Use this event when the number of newly selected items is very small.
EVENT_OBJECT_SELECTIONWITHIN
This event is sent when the selected items within a control have changed substantially. Rather than propagate a large number of events to reflect a multitude of changes, the SELECTIONWITHIN event is sent. The user should query the container control for more detailed information about which events have occurred.
EVENT_OBJECT_SHOW
This event is sent when a visual object is shown.
EVENT_OBJECT_STATECHANGE
This event is sent when the object's state has changed.
EVENT_OBJECT_VALUECHANGE
This event is sent when the object's value has changed.
EVENT_SYSTEM_ALERT
This event is sent when an alert needs to be given to the user. For example, alerts are generated in UIMessageBox.
EVENT_SYSTEM_CAPTUREEND
This event is sent when a window releases the capture.
EVENT_SYSTEM_CAPTURESTART
This event is sent when a window takes the capture.
EVENT_SYSTEM_CONTEXTHELPEND
This event is sent when a window leaves context sensitive help mode.
EVENT_SYSTEM_CONTEXTHELPSTART
This event is sent when a window enters context-sensitive help mode.
EVENT_SYSTEM_DIALOGEND
This event is sent just before the dialog disappears.
EVENT_SYSTEM_DIALOGSTART
This event is sent when a dialog appears.
EVENT_SYSTEM_DRAGDROPEND
This event is sent when a window leaves drag-drop mode.
EVENT_SYSTEM_DRAGDROPSTART
This event is sent when a window enters drag-drop mode.
EVENT_SYSTEM_FOREGROUND
This event is sent when the foreground (active) window changes, even if it is changing to another window in the same thread as the previous one.
EVENT_SYSTEM_MENUEND
This event is sent when leaving menu mode.
EVENT_SYSTEM_MENUPOPUPEND
This event is sent right before a menu pop-up disappears.
EVENT_SYSTEM_MENUPOPUPSTART
This event is sent when a menu pop-up appears.
EVENT_SYSTEM_MENUSTART
This event is sent when entering into menu mode.
EVENT_SYSTEM_MINIMIZEEND
This event is sent just before the window is restored from minimize mode.
EVENT_SYSTEM_MINIMIZESTART
This event is sent when a window is minimized.
EVENT_SYSTEM_MOVESIZEEND
This event is sent when a window leaves move-size dragging mode.
EVENT_SYSTEM_MOVESIZESTART
This event is sent when a window enters move-size dragging mode.
EVENT_SYSTEM_SCROLLINGEND
This event is sent when the tracking of a scroll bar ends.
EVENT_SYSTEM_SCROLLINGSTART
This event is sent when the tracking of a scroll bar begins.
EVENT_SYSTEM_SOUND
This event is sent when a sound is played.
EVENT_SYSTEM_SWITCHEND
This event is sent when ending the ALT-TAB mode to switch windows.
EVENT_SYSTEM_SWITCHSTART
This event is sent when entering the ALT-TAB mode to switch windows.
OBJID_WINDOW
This is the standard ID value for a window.


Class UIWizard

public class UIWizard extends UIDialog
{
  // Fields
  public final static int CENTER;
  public final static int LEFT;
  public final static int RIGHT;

  // Constructors
  public UIWizard(UIFrame frame, String title);

  // Methods
  public boolean action(Event e, Object o);
  public void addNotify();
  public void addStep(IUIWizardStep page);
  public void doBackAction(Event e, Object o);
  public boolean doCancelAction(Event e, Object o);
  public boolean doFinishAction(Event e, Object o);
  public Object doModal();
  public void doNextAction(Event e, Object o);
  public IUIWizardStep getBeingShown();
  public int getButtonAlignment();
  public IUIWizardStep getFirstStep();
  public Insets getInsets();
  public IUIWizardStep getNextStep();
  public IUIWizardStep getPreviousStep();
  public IUIWizardStep getVisibleStep();
  public boolean isFinishStep();
  public boolean isLastStep();
  public void setButtonAlignment(int Align);
  public void setForcedBounds(String name, Dimension dim);
  public void setVisibleStep(IUIWizardStep page);
}

This class implements a wizard dialog box that maintains a history. A UIWizard object maintains and organizes a series of UIWizardStep pages that each contain an image and content.

Returning null from getPreviousStep will cause the undo stack to be used. When the wizard transitions from one page to the next, the previous page is added to the undo stack. If the current page is returned from getNextStep, the pages do not change and this page is not added to the undo stack. If null is returned from getNextStep, the next page is transitioned to provided one exists.

Also see getNextStep, getPreviousStep

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UIRoot
          |
          +--UIWindow
            |
            +--UIDialog
              |
              +--UIWizard

Constructors

UIWizard

public UIWizard(UIFrame frame, String title);

Creates an empty wizard, with no content and default dimensions for images and content.

Parameter | Description
frame | The parent frame associated with the wizard dialog window.
title | The title of the wizard dialog window.

Remarks:

The default dimension set for images is 50 x 150 pixels, and the default dimension set for content is 200 x 150 pixels.

Methods

action

public boolean action(Event e, Object o);

Performs operations depending on which button was pushed inside the wizard.

Note When cancelling the dialog box, this method calls UIDialog.dispose.

Return Value:

Returns true if the action was successfully executed; otherwise, returns false.

Parameter | Description
e | The event, such as a KEY_RELEASE or MOUSE_UP, generated within the message box.
o | The button that was pushed.

See Also: doNextAction, doBackAction, doCancelAction, doFinishAction

addNotify

public void addNotify();

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

Return Value:

No return value.

Remarks:

This method creates the wizard's buttons.

addStep

public void addStep(IUIWizardStep page);

Adds a page to the wizard.

Return Value:

No return value.

Parameter | Description
page | The page to add.

Remarks:

You must add the wizard's pages before calling the doModal method.

doBackAction

public void doBackAction(Event e, Object o);

Handles a selection of the Back button. This method is called by the action method to retrieve the previous page in the wizard.

Return Value:

No return value.

Parameter | Description
e | The event received by the handleEvent method.
o | The object that posted the event.

doCancelAction

public boolean doCancelAction(Event e, Object o);

This method is called by the action method to handle a selection of the Cancel button.

Return Value:

Returns true to allow the cancel; returns false to prevent the cancel.

Parameter | Description
e | The event received by the handleEvent method.
o | The object received by the handleEvent method.

doFinishAction

public boolean doFinishAction(Event e, Object o);

Handles a click on the Finish button. This method is called by the action method to perform the Finish action for the wizard.

Return Value:

Returns true to dismiss the wizard.

Parameter | Description
e | The event received by the handleEvent method.
o | The object that posted the event.

Remarks:

Override this to skip steps in the wizard or to complete the steps in the wizard.

doModal

public Object doModal();

Displays the wizard and its pages and only returns when the user has pressed a button or cancelled the message box.

Return Value:

Returns the button pressed; returns null if cancelled.

Remarks:

A modal wizard requires the user to interact with the wizard before continuing in any other of the application's windows. This method is called only after the wizard is created and all the pages have been added.

doNextAction

public void doNextAction(Event e, Object o);

Handles a selection of the Next button. This method is called by the action method to retrieve the next page in the wizard.

Return Value:

No return value.

Parameter | Description
e | The event received by the handleEvent method.
o | The object that posted the event.

getBeingShown

public IUIWizardStep getBeingShown();

Retrieves the page that is in the process of being shown.

Return Value:

Returns the page to be shown.

See Also: getVisibleStep

getButtonAlignment

public int getButtonAlignment();

Retrieves the current button alignment.

Return Value:

Returns either RIGHT, LEFT, or CENTER.

See Also: setButtonAlignment

getFirstStep

public IUIWizardStep getFirstStep();

Retrieves the first page in the series of pages managed by the wizard.

Return Value:

Returns the wizard's first page.

getInsets

public Insets getInsets();

Retrieves the insets for the wizard relative to its parent component, in pixels.

Return Value:

Returns an Insets object containing the wizard's insets.

Remarks:

This method is used internally by the layout method.

getNextStep

public IUIWizardStep getNextStep();

Retrieves the next page in the series of pages managed by the wizard.

Return Value:

Returns the wizard's next page.

Remarks:

If null is returned, the next page is transitioned to, and the previous page is put on the undo stack.

Return the current page (use getVisibleStep) to stay on the same page. This is used when the content on the page is validated but is missing information. Typically, a message box is displayed to the user indicating the missing or incorrect information and the user is returned to the current page. This page is not added to the undo stack.

getPreviousStep

public IUIWizardStep getPreviousStep();

Retrieves the previous page in the series of pages managed by the wizard.

Return Value:

Returns the wizard's previous page; otherwise, returns null.

Remarks:

Return null to use the undo stack.

getVisibleStep

public IUIWizardStep getVisibleStep();

Retrieves the page that is currently being viewed.

Return Value:

Returns s the wizard's currently visible page.

isFinishStep

public boolean isFinishStep();

Determines if the currently viewed page allows a valid selection of the Finish button.

Return Value:

Returns true if the current page is a Finish step; otherwise, returns false.

Remarks:

A Finish step is not necessarily the last step, as a user may be able to press the Finish button on some previous page and allow the wizard to set default values for the remaining pages in the series. The last step is the last logical page managed by the wizard, where the Next button is not a valid choice.

See Also: isLastStep

isLastStep

public boolean isLastStep();

Determines if the currently viewed page is the last page in the series.

Return Value:

Returns true if the page is the last step; the Next button is shaded.

setButtonAlignment

public void setButtonAlignment(int Align);

Sets the alignment of the buttons in the wizard.

Return Value:

No return value.

Parameter | Description
Align | The button alignment. This can be either RIGHT, LEFT, or CENTER.

See Also: getButtonAlignment

setForcedBounds

public void setForcedBounds(String name, Dimension dim);

Sets the dimensions of a component within the wizard.

Return Value:

No return value.

Parameter | Description
name The name of the component to set the dimensions for. This can be one of the following:
"image"
The image to be displayed to the left of content.
"content"
The content for the wizard.
"buttons"
The buttons to be used.
dim | The Dimension to set for the component.

setVisibleStep

public void setVisibleStep(IUIWizardStep page);

Displays the specified page.

Return Value:

No return value.

Parameter | Description
page | The page to be viewed.

See Also: getVisibleStep

Fields

CENTER
The buttons in the wizard are centered.
LEFT
The buttons in the wizard are aligned on the left side of the dialog box.
RIGHT
The buttons in the wizard are aligned on the right side of the dialog box.


Class UIWizardStep

public class UIWizardStep implements IUIWizardStep
{
  // Constructors
  public UIWizardStep( IUIComponent image, IUIComponent content,
        boolean last);
  public UIWizardStep( IUIComponent image, IUIComponent content);

  // Methods
  public IUIComponent getContent();
  public IUIComponent getImage();
  public UIWizardStep getNextStep();
  public UIWizard getWizard();
  public boolean isFinishStep();
  public boolean isLastStep();
  public IUIWizardStep nextStep();
  public IUIWizardStep previousStep();
  public void setNextStep(UIWizardStep step);
  public void setWizard(UIWizard parent);
}

This class implements a wizard page. Each UIWizardStep page is managed by an associated UIWizard object.

Constructors

UIWizardStep

public UIWizardStep( IUIComponent image, IUIComponent content,
        boolean last);

Creates a wizard page using the specified image and content component. You can also designate this page as the wizard's last step.

Parameter | Description
image | The image to be displayed by the page.
content | The component to be displayed by the page. Typically, this component is a String or a UIText object.
last | If true, the page will be the last step in the wizard.

UIWizardStep

public UIWizardStep( IUIComponent image, IUIComponent content);

Creates a wizard page with the specified image and content.

Parameter | Description
image | The image to be displayed by the page.
content | The component to be displayed by the page. Typically, this component is a String or a UIText object.

Methods

getContent

public IUIComponent getContent();

Retrieves the component used for the page's content.

Return Value:

Returns the current content component.

getImage

public IUIComponent getImage();

Retrieves the image displayed by the page.

Return Value:

Returns the current image.

getNextStep

public UIWizardStep getNextStep();

Retrieves the next page in the series of pages managed by an associated wizard.

Return Value:

Returns the next page.

getWizard

public UIWizard getWizard();

Retrieves the wizard associated with the page.

Return Value:

Returns the associated UIWizard object.

See Also: setWizard

isFinishStep

public boolean isFinishStep();

Determines whether the currently viewed page allows a valid selection of the Finish button.

Return Value:

Returns true if the current page is a Finish step; otherwise, returns false.

isLastStep

public boolean isLastStep();

Determines whether the currently viewed page is the last page in the series. If this method returns true, the Next button is replaced by the Finish button.

Return Value:

Returns true if the page is the last step.

nextStep

public IUIWizardStep nextStep();

Retrieves the next page in the series managed by an associated wizard. The previous page is put on the undo stack.

Return Value:

Returns the next page in the series.

See Also: previousStep

previousStep

public IUIWizardStep previousStep();

Retrieves the previous page in the series managed by an associated wizard.

Return Value:

Returns null.

setNextStep

public void setNextStep(UIWizardStep step);

Sets the next page in the series of pages managed by an associated wizard.

Return Value:

No return value.

Parameter | Description
step | The page to be next.

setWizard

public void setWizard(UIWizard parent);

Sets the wizard associated with the page.

Return Value:

No return value.

Parameter | Description
parent | The wizard to be associated with the page.

See Also: getWizard


Interface IAwtUIAdjustable

public interface IAwtUIAdjustable extends Adjustable
{
}

This interface extends the Adjustable interface so that AFC classes can implement its functionality for both JDK 1.1 and JDK 1.0.2-compatible virtual machines.


Interface IAwtUIItemSelectable

public interface IAwtUIItemSelectable extends ItemSelectable
{
}

This interface extends the ItemSelectable interface so that AFC classes can implement its functionality for both JDK 1.1 and JDK 1.0.2-compatible virtual machines.


Interface IUIAccessible

public interface IUIAccessible
{
  // Fields
  public static final int CHILDID_SELF;
  public static final int DISP_E_MEMBERNOTFOUND;
  public static final int E_INVALIDARG;
  public static final int E_NOTIMPL;
  public static final int NAVDIR_DOWN;
  public static final int NAVDIR_FIRST;
  public static final int NAVDIR_LAST;
  public static final int NAVDIR_LEFT;
  public static final int NAVDIR_NEXT;
  public static final int NAVDIR_PREV;
  public static final int NAVDIR_RIGHT;
  public static final int NAVDIR_UP;
  public static final int ROLE_SYSTEM_ALERT;
  public static final int ROLE_SYSTEM_ANIMATION;
  public static final int ROLE_SYSTEM_APPLICATION;
  public static final int ROLE_SYSTEM_BORDER;
  public static final int ROLE_SYSTEM_BUTTONDROPDOWN;
  public static final int ROLE_SYSTEM_BUTTONDROPDOWNGRID;
  public static final int ROLE_SYSTEM_BUTTONMENU;
  public static final int ROLE_SYSTEM_CARET;
  public static final int ROLE_SYSTEM_CELL;
  public static final int ROLE_SYSTEM_CHARACTER;
  public static final int ROLE_SYSTEM_CHART;
  public static final int ROLE_SYSTEM_CHECKBUTTON;
  public static final int ROLE_SYSTEM_CLIENT;
  public static final int ROLE_SYSTEM_CLOCK;
  public static final int ROLE_SYSTEM_COLUMN;
  public static final int ROLE_SYSTEM_COLUMNHEADER;
  public static final int ROLE_SYSTEM_COMBOBOX;
  public static final int ROLE_SYSTEM_CURSOR;
  public static final int ROLE_SYSTEM_DIAGRAM;
  public static final int ROLE_SYSTEM_DIAL;
  public static final int ROLE_SYSTEM_DIALOG;
  public static final int ROLE_SYSTEM_DOCUMENT;
  public static final int ROLE_SYSTEM_DROPLIST;
  public static final int ROLE_SYSTEM_EQUATION;
  public static final int ROLE_SYSTEM_GRAPHIC;
  public static final int ROLE_SYSTEM_GRIP;
  public static final int ROLE_SYSTEM_GROUPING;
  public static final int ROLE_SYSTEM_HELPBALLOON;
  public static final int ROLE_SYSTEM_HOTKEYFIELD;
  public static final int ROLE_SYSTEM_INDICATOR;
  public static final int ROLE_SYSTEM_LINK;
  public static final int ROLE_SYSTEM_LIST;
  public static final int ROLE_SYSTEM_LISTITEM;
  public static final int ROLE_SYSTEM_MENUBAR;
  public static final int ROLE_SYSTEM_MENUITEM;
  public static final int ROLE_SYSTEM_MENUPOPUP;
  public static final int ROLE_SYSTEM_OUTLINE;
  public static final int ROLE_SYSTEM_OUTLINEITEM;
  public static final int ROLE_SYSTEM_PAGETAB;
  public static final int ROLE_SYSTEM_PAGETABLIST;
  public static final int ROLE_SYSTEM_PANE;
  public static final int ROLE_SYSTEM_PROGRESSBAR;
  public static final int ROLE_SYSTEM_PROPERTYPAGE;
  public static final int ROLE_SYSTEM_PUSHBUTTON;
  public static final int ROLE_SYSTEM_RADIOBUTTON;
  public static final int ROLE_SYSTEM_ROW;
  public static final int ROLE_SYSTEM_ROWHEADER;
  public static final int ROLE_SYSTEM_SCROLLBAR;
  public static final int ROLE_SYSTEM_SEPARATOR;
  public static final int ROLE_SYSTEM_SLIDER;
  public static final int ROLE_SYSTEM_SOUND;
  public static final int ROLE_SYSTEM_SPINBUTTON;
  public static final int ROLE_SYSTEM_STATICTEXT;
  public static final int ROLE_SYSTEM_STATUSBAR;
  public static final int ROLE_SYSTEM_TABLE;
  public static final int ROLE_SYSTEM_TEXT;
  public static final int ROLE_SYSTEM_TITLEBAR;
  public static final int ROLE_SYSTEM_TOOLBAR;
  public static final int ROLE_SYSTEM_TOOLTIP;
  public static final int ROLE_SYSTEM_WHITESPACE;
  public static final int ROLE_SYSTEM_WINDOW;
  public static final int S_FALSE;
  public static final int SELFLAG_ADDSELECTION;
  public static final int SELFLAG_EXTENDSELECTION;
  public static final int SELFLAG_NONE;
  public static final int SELFLAG_REMOVESELECTION;
  public static final int SELFLAG_TAKEFOCUS;
  public static final int SELFLAG_TAKESELECTION;
  public static final int STATE_SYSTEM_ANIMATED;
  public static final int STATE_SYSTEM_BUSY;
  public static final int STATE_SYSTEM_CHECKED;
  public static final int STATE_SYSTEM_COLLAPSED;
  public static final int STATE_SYSTEM_DEFAULT;
  public static final int STATE_SYSTEM_EXPANDED;
  public static final int STATE_SYSTEM_EXTSELECTABLE;
  public static final int STATE_SYSTEM_FLOATING;
  public static final int STATE_SYSTEM_FOCUSABLE;
  public static final int STATE_SYSTEM_FOCUSED;
  public static final int STATE_SYSTEM_HOTTRACKED;
  public static final int STATE_SYSTEM_INVISIBLE;
  public static final int STATE_SYSTEM_LINKED;
  public static final int STATE_SYSTEM_MARQUEED;
  public static final int STATE_SYSTEM_MIXED;
  public static final int STATE_SYSTEM_MOVEABLE;
  public static final int STATE_SYSTEM_MULTISELECTABLE;
  public static final int STATE_SYSTEM_OFFSCREEN;
  public static final int STATE_SYSTEM_PRESSED;
  public static final int STATE_SYSTEM_READONLY;
  public static final int STATE_SYSTEM_SELECTABLE;
  public static final int STATE_SYSTEM_SELECTED;
  public static final int STATE_SYSTEM_SELFVOICING;
  public static final int STATE_SYSTEM_SIZEABLE;
  public static final int STATE_SYSTEM_TRAVERSED;
  public static final int STATE_SYSTEM_UNAVAILABLE;
  public static final int STATE_SYSTEM_VALID;

  // Methods
  public void doDefaultAction();
  public Rectangle getBounds(IUIComponent comp);
  public String getDefaultAction();
  public String getDescription();
  public String getHelp();
  public String getKeyboardShortcut();
  public int getRoleCode();
  public int getStateCode();
  public String getValueText();
  public IUIComponent navigate(IUIComponent comp, int direction,
        boolean keyable);
  public void setValueText(String value);
}

This interface is used to access control information that could otherwise be retrieved only by viewing the graphical user interface (GUI). UIComponent implements IUIAccessible.

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

doDefaultAction

public void doDefaultAction();

Performs the default action for the object. For example, the default action for a button is to be pressed.

Return Value:

No return value.

getBounds

public Rectangle getBounds(IUIComponent comp);

Retrieves the bounding rectangle of the object, relative to the specified component.

Return Value:

Returns the rectangle identifying the object's bounding area, in the coordinate space of the specified component.

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

getDefaultAction

public String getDefaultAction();

Retrieves the default action for the object.

Return Value:

Returns a string describing the object's default action. For example, a button's default action is "Press".

getDescription

public String getDescription();

Retrieves a description of the object.

Return Value:

Returns a string describing the object, beyond the information provided by getRoleCode, getStateCode, and getName.

getHelp

public String getHelp();

Retrieves the Help text for the object.

Return Value:

Returns a string describing the function of the object. This value expands on the information provided by getRoleCode, getStateCode, and getName.

Remarks:

This method can be used to set a ToolTip that describes the object.

getKeyboardShortcut

public String getKeyboardShortcut();

Retrieves the keyboard shortcut for the object.

Return Value:

Returns a string describing the sequence of keystrokes that transfer input focus to the object.

getRoleCode

public int getRoleCode();

Retrieves the role of the object.

Return Value:

Returns the ROLE_SYSTEM code that best describes the role of the object.

getStateCode

public int getStateCode();

Retrieves the state of the object.

Return Value:

Returns the combination of STATE_SYSTEM codes that best describes the state of the object.

getValueText

public String getValueText();

Retrieves the value of the object.

Return Value:

Returns a string describing the visual information contained in the object. This value expands on the information provided by getRoleCode, getStateCode, and getName.

navigate

public IUIComponent navigate(IUIComponent comp, int direction,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
comp | The component to navigate from.
direction | The navigation direction. Specify one of the NAVDIR field values.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

setValueText

public void setValueText(String value);

Sets the value of the object.

Return Value:

No return value.

Parameter | Description
value | The string that describes the visual information contained in the object. This value expands on the information provided by getRoleCode, getStateCode, and getName.

Fields

CHILDID_SELF
The identifier of the object itself.
DISP_E_MEMBERNOTFOUND
COM error that indicates the specified member was not found.
E_INVALIDARG
COM error that indicates an invalid argument.
E_NOTIMPL
COM error that indicates no implementation.
NAVDIR_DOWN
Specifies that the navigation direction is down.
NAVDIR_FIRST
Navigates to the first object.
NAVDIR_LAST
Navigates to the last object.
NAVDIR_LEFT
Specifies that the navigation direction is to the left.
NAVDIR_NEXT
Navigates to the next object.
NAVDIR_PREV
Navigates to the previous object.
NAVDIR_RIGHT
Specifies that the navigation direction is to the right.
NAVDIR_UP
Specifies that the navigation direction is up.
ROLE_SYSTEM_ALERT
The role code that describes an alert message.
ROLE_SYSTEM_ANIMATION
The role code that describes an animation. UIMarquee.getRoleCode returns this code.
ROLE_SYSTEM_APPLICATION
The role code that describes an application.
ROLE_SYSTEM_BORDER
The role code that describes a border object.
ROLE_SYSTEM_BUTTONDROPDOWN
The role code that describes a button that when pressed, opens a drop-down object.
ROLE_SYSTEM_BUTTONDROPDOWNGRID
The role code that describes a button, when pressed, opens a drop-down grid.
ROLE_SYSTEM_BUTTONMENU
The role code that describes a button, when pressed, opens a menu.
ROLE_SYSTEM_CARET
The role code that describes a caret.
ROLE_SYSTEM_CELL
The role code that describes a cell within a grid.
ROLE_SYSTEM_CHARACTER
The role code that describes a single character.
ROLE_SYSTEM_CHART
The role code that describes a chart.
ROLE_SYSTEM_CHECKBUTTON
The role code that describes a check box button. UICheckButton.getRoleCode returns this code.
ROLE_SYSTEM_CLIENT
The role code that describes a client object.
ROLE_SYSTEM_CLOCK
The role code that describes a clock control.
ROLE_SYSTEM_COLUMN
The role code that describes a column within a grid.
ROLE_SYSTEM_COLUMNHEADER
The role code that describes a column header. UIColumnHeader.getRoleCode returns this code.
ROLE_SYSTEM_COMBOBOX
The role code that describes a combo box. UIChoice.getRoleCode returns this code.
ROLE_SYSTEM_CURSOR
The role code that describes a cursor.
ROLE_SYSTEM_DIAGRAM
The role code that describes a diagram.
ROLE_SYSTEM_DIAL
The role code that describes a dial control.
ROLE_SYSTEM_DIALOG
The role code that describes a dialog box.
ROLE_SYSTEM_DOCUMENT
The role code that describes a document.
ROLE_SYSTEM_DROPLIST
The role code that describes a drop-down list box.
ROLE_SYSTEM_EQUATION
The role code that describes an equation.
ROLE_SYSTEM_GRAPHIC
The role code that describes a graphic object. UIGraphic.getRoleCode and UIItem.getRoleCode return this code.
ROLE_SYSTEM_GRIP
The role code that describes the thumb control of a scroll bar. UIThumb.getRoleCode returns this code.
ROLE_SYSTEM_GROUPING
The role code that describes a grouping.
ROLE_SYSTEM_HELPBALLOON
The role code that describes a Help balloon.
ROLE_SYSTEM_HOTKEYFIELD
The role code that describes a keyboard shortcut.
ROLE_SYSTEM_INDICATOR
The role code that describes an indicator control.
ROLE_SYSTEM_LINK
The role code that describes a link between two objects.
ROLE_SYSTEM_LIST
The role code that describes a list. UISelector.getRoleCode returns this code.
ROLE_SYSTEM_LISTITEM
The role code that describes an item in a list.
ROLE_SYSTEM_MENUBAR
The role code that describes a menu bar.
ROLE_SYSTEM_MENUITEM
The role code that describes an item on a menu bar.
ROLE_SYSTEM_MENUPOPUP
The role code that describes a pop-up menu. UIPopup.getRoleCode returns this code.
ROLE_SYSTEM_OUTLINE
The role code that describes a hierarchical list object, such as a tree. UITree.getRoleCode returns this code.
ROLE_SYSTEM_OUTLINEITEM
The role code that describes an item within a hierarchical list.
ROLE_SYSTEM_PAGETAB
The role code that describes a tab control. UITab.getRoleCode returns this code.
ROLE_SYSTEM_PAGETABLIST
The role code that describes a list of tab controls.
ROLE_SYSTEM_PANE
The role code that describes a contained window. UIScrollViewer.getRoleCode and UIViewer.getRoleCode return this code.
ROLE_SYSTEM_PROGRESSBAR
The role code that describes a progress bar. UIProgress.getRoleCode returns this code.
ROLE_SYSTEM_PROPERTYPAGE
The role code that describes a Properties page.
ROLE_SYSTEM_PUSHBUTTON
The role code that describes a push button. UIPushButton.getRoleCode returns this code.
ROLE_SYSTEM_RADIOBUTTON
The role code that describes a radio button. UIRadioButton.getRoleCode returns this code.
ROLE_SYSTEM_ROW
The role code that describes a row within a grid. UIRow.getRoleCode returns this code.
ROLE_SYSTEM_ROWHEADER
The role code that describes a row header.
ROLE_SYSTEM_SCROLLBAR
The role code that describes a scroll bar. UIScroll.getRoleCode returns this code.
ROLE_SYSTEM_SEPARATOR
The role code that describes an object that separates two fields.
ROLE_SYSTEM_SLIDER
The role code that describes a slider control.
ROLE_SYSTEM_SOUND
The role code that describes a sound.
ROLE_SYSTEM_SPINBUTTON
The role code that describes a spin button.
ROLE_SYSTEM_STATICTEXT
The role code that describes a static text object. UIText.getRoleCode returns this code.
ROLE_SYSTEM_STATUSBAR
The role code that describes a status bar. UIStatus.getRoleCode returns this code.
ROLE_SYSTEM_TABLE
The role code that describes a table.
ROLE_SYSTEM_TEXT
The role code that describes an editable text object.
ROLE_SYSTEM_TITLEBAR
The role code that describes a title bar.
ROLE_SYSTEM_TOOLBAR
The role code that describes a toolbar. UIBand.getRoleCode, UIBandBox.getRoleCode, and UILine.getRoleCode return this code.
ROLE_SYSTEM_TOOLTIP
The role code that describes a ToolTip.
ROLE_SYSTEM_WHITESPACE
The role code that describes white space on a page of text.
ROLE_SYSTEM_WINDOW
The role code that describes a top-level window.
S_FALSE
COM error that indicates a false return value.
SELFLAG_ADDSELECTION
Indicates the object is added to a multiple selection.
SELFLAG_EXTENDSELECTION
Indicates the object is added to an extended selection.
SELFLAG_NONE
Indicates no object is selected.
SELFLAG_REMOVESELECTION
Indicates the object is deselected.
SELFLAG_TAKEFOCUS
Indicates focus is transferred to the selected object.
SELFLAG_TAKESELECTION
Indicates the object is the only selected item in the container.
STATE_SYSTEM_ANIMATED
The state code that indicates the object is animated.
STATE_SYSTEM_BUSY
The state code that indicates the object is busy.
STATE_SYSTEM_CHECKED
The state code that indicates the object is checked. See UIComponent.getStateCode.
STATE_SYSTEM_COLLAPSED
The state code that indicates the object is collapsed. See UITree.getStateCode.
STATE_SYSTEM_DEFAULT
The state code that indicates the object is the default item.
STATE_SYSTEM_EXPANDED
The state code that indicates the object is expanded. See UITree.getStateCode.
STATE_SYSTEM_EXTSELECTABLE
The state code that indicates the object supports extended selection. See UISelector.getStateCode.
STATE_SYSTEM_FLOATING
The state code that indicates the object is owned, not contained, by another object.
STATE_SYSTEM_FOCUSABLE
The state code that indicates the object can receive focus. See UIComponent.getStateCode.
STATE_SYSTEM_FOCUSED
The state code that indicates the object has focus. See UIComponent.getStateCode.
STATE_SYSTEM_HOTTRACKED
The state code that indicates the object is hot-tracked. See UIComponent.getStateCode.
STATE_SYSTEM_INVISIBLE
The state code that indicates the object is hidden. See UIComponent.getStateCode.
STATE_SYSTEM_LINKED
The state code that indicates the object is linked to another object (a hypertext link, for example).
STATE_SYSTEM_MARQUEED
The state code that indicates the object's content can scroll. See UIMarquee.getStateCode.
STATE_SYSTEM_MIXED
The state code that indicates the object is indeterminate. See UIComponent.getStateCode.
STATE_SYSTEM_MOVEABLE
The state code that indicates the object can be moved. See UIComponent.getStateCode.
STATE_SYSTEM_MULTISELECTABLE
The state code that indicates the object supports multiple selection. See UISelector.getStateCode.
STATE_SYSTEM_OFFSCREEN
The state code that indicates the object is off the screen.
STATE_SYSTEM_PRESSED
The state code that indicates the object is pressed. See UIComponent.getStateCode.
STATE_SYSTEM_READONLY
The state code that indicates the object's contents are static
STATE_SYSTEM_SELECTABLE
The state code that indicates the object can be selected. See UIComponent.getStateCode.
STATE_SYSTEM_SELECTED
The state code that indicates the object is selected. See UIComponent.getStateCode.
STATE_SYSTEM_SELFVOICING
The state code that indicates the Text To Speech (TTS) feature can be used to make the object audible.
STATE_SYSTEM_SIZEABLE
The state code that indicates the object can be resized. See UIComponent.getStateCode.
STATE_SYSTEM_TRAVERSED
The state code that indicates a link has been traversed. See STATE_SYSTEM_LINKED.
STATE_SYSTEM_UNAVAILABLE
The state code that indicates the object is disabled.
STATE_SYSTEM_VALID
The state code that indicates the object is valid.


Interface IUIBand

public interface IUIBand
{
  // Methods
  public boolean getBreak();
  public boolean getDragBreak();
  public int getRestoredWidth();
  public void setBreak(boolean on);
  public void setDragBreak(boolean on);
  public void setRestoredWidth(int width);
}

This interface is used to retrieve and set properties of band objects. UIBand implements IUIBand.

Methods

getBreak

public boolean getBreak();

Determines whether the band begins a new row.

Return Value:

Returns true if the band begins a new row. If the method returns false, the band continues on the current row.

getDragBreak

public boolean getDragBreak();

Determines whether the band begins a new row when there isn't sufficient space for it on the current row.

Return Value:

Returns true if the band begins a new row. If the method returns false, the band continues on the current row.

getRestoredWidth

public int getRestoredWidth();

Retrieves the width that the object will be restored to.

Return Value:

Returns the width (in pixels) of the restored object.

setBreak

public void setBreak(boolean on);

Sets or clears the band's break state.

Return Value:

No return value.

Parameter | Description
on | Set to true if the band begins a new row.

setDragBreak

public void setDragBreak(boolean on);

Sets or clears the band's drag break state.

Return Value:

No return value.

Parameter | Description
on | Set to true if the band begins a new row due to lack of space on the current row. there isn't sufficient space in

Remarks:

This method is called by the parent container when laying out its bands, and is not typically called by an application. Use the setBreak(boolean) method to start a band on a new row (or the same row).

setRestoredWidth

public void setRestoredWidth(int width);

Sets the width that the object will be restored to.

Return Value:

No return value.

Parameter | Description
width | The width (in pixels) of the restored object.


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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
font | The font for the control.

setForeground

public void setForeground(Color color);

Sets the control's foreground color.

Return Value:

No return value.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
index | The index for the control.

setInvalidating

public void setInvalidating(boolean on);

Sets the invalidating state of this object.

Return Value:

No return value.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
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.

Parameter | Description
g | The graphics context.

validate

public void validate();

Note This method is replaced by setValid.


Interface IUIContainer

public interface IUIContainer extends IUIComponent
{
  // Methods
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int index);
  public IUIComponent add(IUIComponent comp, Object constraints);
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public IUIComponent add(String name, IUIComponent comp);
  public void addContainerListener(IUIContainerListener l);
  public void addFocusListener(IUIFocusListener l);
  public void addKeyListener(IUIKeyListener l);
  public void addMouseListener(IUIMouseListener l);
  public void addMouseMotionListener(IUIMouseMotionListener l);
  public void adjustLayoutSize(IUIComponent comp,
        Dimension oldSize, Dimension newSize);
  public boolean continueInvalidate(IUIComponent comp);
  public boolean ensureVisible(int index);
  public IUIComponent getChild(int index);
  public Rectangle getChildBounds(IUIComponent child);
  public Rectangle getChildBounds(int index);
  public int getChildCount();
  public int getChildIndex(IUIComponent comp);
  public Point getChildLocation(IUIComponent child);
  public Point getChildLocation(int index);
  public Dimension getChildSize(IUIComponent child);
  public Dimension getChildSize(int index);
  public Rectangle getClientRect();
  public IUIComponent getComponent(int index);
  public IUIComponent getComponent(IUIComponent comp);
  public int getComponentCount();
  public IUIComponent getComponentFromID(int id);
  public int getComponentIndex(IUIComponent comp);
  public IUIComponent[] getComponents();
  public int getEdge();
  public IUIComponent getFloater();
  public IUIComponent getFocusComponent();
  public IUIComponent getHeader();
  public Insets getInsets();
  public IUILayoutManager getLayout();
  public boolean isOverlapping();
  public boolean move(IUIComponent comp, IUIComponent before);
  public boolean move(int from, int to);
  public IUIComponent navigate(IUIComponent comp, int direction,
        boolean keyable);
  public void paintComponents(FxGraphics g);
  public IUIComponent passFocus(int dir);
  public void remove(int index);
  public void remove(IUIComponent comp);
  public void removeAll();
  public void removeAllChildren();
  public void removeContainerListener(IUIContainerListener l);
  public void removeFocusListener(IUIFocusListener l);
  public void removeKeyListener(IUIKeyListener l);
  public void removeMouseListener(IUIMouseListener l);
  public void removeMouseMotionListener(IUIMouseMotionListener l);
  public IUIComponent replace(IUIComponent comp, IUIComponent old);
  public IUIComponent replace(IUIComponent comp, int index);
  public IUIComponent replace(IUIComponent comp,
        Object constraints, IUIComponent old);
  public IUIComponent replace(IUIComponent comp,
        Object constraints, int index);
  public IUIComponent replace(IUIComponent comp,
        Object constraints);
  public void setChildBounds(IUIComponent child, int x, int y,
        int width, int height);
  public void setChildBounds(IUIComponent child, Rectangle rect);
  public void setChildBounds(int index, int x, int y, int width,
        int height);
  public void setChildBounds(int index, Rectangle rect);
  public void setChildLocation(IUIComponent child, int x, int y);
  public void setChildLocation(IUIComponent child, Point point);
  public void setChildLocation(int index, int x, int y);
  public void setChildLocation(int index, Point point);
  public void setChildSize(IUIComponent child, int width,
        int height);
  public void setChildSize(IUIComponent child, Dimension size);
  public void setChildSize(int index, int width, int height);
  public void setChildSize(int index, Dimension size);
  public void setComponent(int index, IUIComponent comp);
  public void setEdge(int edge);
  public void setHeader(IUIComponent header);
  public void setLayout(IUILayoutManager lm);
}

This interface defines methods associated with a container class. For example, IUIContainer specifies how to add, remove, and retrieve components from a container. UIContainer implements this interface.

Containers in AFC hold either a single header component or multiple child components with an optional header. Header components represent the container itself; for example, the text displayed on a button is used as its header component.

IUIContainer extends IUIComponent.

IUIComponent
  |
  +--IUIContainer

Methods

add

public IUIComponent add(IUIComponent comp);

Adds the specified component to the end of the container.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The component to be added.

add

public IUIComponent add(IUIComponent comp, int index);

Adds the specified component to the container at the specified index.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The component to be added.
index | The zero-based index at which to insert the component.

add

public IUIComponent add(IUIComponent comp, Object constraints);

Adds the specified component to the container, according to the specified constraints.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints, which depend on the current layout manager.

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds the specified component to the container, according to the specified constraints and index.

Return Value:

Returns the component that was added, if successful; otherwise, returns null.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints, which depend on the current layout manager.
index | The zero-based index at which to insert the component.

add

public IUIComponent add(String name, IUIComponent comp);

Note This method is replaced by add(IUIComponent comp, Object constraints).

addContainerListener

public void addContainerListener(IUIContainerListener l);

Adds the specified container listener. The listener receives all container events generated for the container.

Return Value:

No return value.

Parameter | Description
l | The container listener to be added.

addFocusListener

public void addFocusListener(IUIFocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be added.

Overrides:

addFocusListener(IUIFocusListener) in IUIComponent.

addKeyListener

public void addKeyListener(IUIKeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be added.

Overrides:

addKeyListener(IUIKeyListener) in IUIComponent.

addMouseListener

public void addMouseListener(IUIMouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be added.

Overrides:

addMouseListener(IUIMouseListener) in IUIComponent.

addMouseMotionListener

public void addMouseMotionListener(IUIMouseMotionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse motion listener to be added.

Overrides:

addMouseMotionListener(IUIMouseMotionListener) in IUIComponent.

adjustLayoutSize

public void adjustLayoutSize(IUIComponent comp, Dimension oldSize,
        Dimension newSize);

Adjusts the layout size of the specified component.

Return Value:

No return value.

Parameter | Description
comp | The component being sized.
oldSize | The previous layout size of the component (in pixels).
newSize | The new layout size of the component (in pixels).

Remarks:

This method is automatically invoked when the specified component's size has changed.

continueInvalidate

public boolean continueInvalidate(IUIComponent comp);

Determines whether the container should be invalidated when the specified child component is invalidated.

Return Value:

Returns true if the container should be invalidated; otherwise, returns false.

Parameter | Description
comp | The component being invalidated.

ensureVisible

public boolean ensureVisible(int index);

Brings the component at the specified index into view.

Return Value:

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

Parameter | Description
index | The zero-based index of the child component to be made visible in the container.

getChild

public IUIComponent getChild(int index);

Retrieves the child component at the specified index. This method cannot retrieve the header component.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
index | The zero-based index of the component to be retrieved.

getChildBounds

public Rectangle getChildBounds(IUIComponent child);

Retrieves the bounding rectangle of the specified component.

Return Value:

Returns a Rectangle object identifying the component's bounding area, if successful; otherwise, returns null.

Parameter | Description
child | The component. Specify either the container's header component or any child component.

getChildBounds

public Rectangle getChildBounds(int index);

Retrieves the bounding rectangle of the component at the specified index.

Return Value:

Returns a Rectangle object identifying the component's bounding area, if successful; otherwise, returns null.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0, and the first child component begins at index 1; otherwise, the first child begins at index 0.

getChildCount

public int getChildCount();

Retrieves the number of child components in the container, excluding the header component.

Return Value:

Returns the number of child components.

getChildIndex

public int getChildIndex(IUIComponent comp);

Retrieves the index of the specified child component.

Return Value:

Returns the zero-based index of the component (if the component belongs to the container); otherwise, returns null.

Parameter | Description
comp | The component to retrieve the index for. This component must be a child component and not the header component.

getChildLocation

public Point getChildLocation(IUIComponent child);

Retrieves the location of the specified component.

Return Value:

Returns a Point object containing the upper-left corner of the component, if successful; otherwise, returns null.

Parameter | Description
child | The component. Specify either the container's header component or any child component.

getChildLocation

public Point getChildLocation(int index);

Retrieves the location of the component at the specified index.

Return Value:

Returns a Point object containing the upper-left corner of the component, if successful; otherwise, returns null.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.

getChildSize

public Dimension getChildSize(IUIComponent child);

Retrieves the size of the specified component.

Return Value:

Returns a Dimension object containing the component's dimensions (in pixels), if successful; otherwise, returns null.

Parameter | Description
child | The component. Specify either the container's header component or any child component.

getChildSize

public Dimension getChildSize(int index);

Retrieves the size of the component at the specified index.

Return Value:

Returns a Dimension object containing the component's dimensions (in pixels).

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0, and the first child component begins at index 1; otherwise, the first child begins at index 0.

getClientRect

public Rectangle getClientRect();

Retrieves the client rectangle of the container.

Return Value:

Returns the bounding rectangle of the container's client area, measured in terms of the container's coordinate space.

Remarks:

The client rectangle is the area that remains after the container's bounding rectangle is reduced by the size of its insets.

getComponent

public IUIComponent getComponent(int index);

Retrieves the component located at the specified index. The header component or any child component can be retrieved.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
index | The zero-based index of the component to be retrieved. If the container has a header component, the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.

getComponent

public IUIComponent getComponent(IUIComponent comp);

Retrieves the component in the container that is the ancestor of the specified component. The header component or any child component can be retrieved.

Return Value:

Returns the container's immediate child or header component that is the ancestor of the specified component. If the specified component is itself an immediate child (or header) of the container, this component is returned. If the container is not an ancestor of the specified component, null is returned.

Parameter | Description
comp | The component to find the ancestor for.

getComponentCount

public int getComponentCount();

Retrieves the number of components in the container, including the header component.

Return Value:

Returns the total number of components.

getComponentFromID

public IUIComponent getComponentFromID(int id);

Retrieves the component with the specified identifier.

Return Value:

Returns null, indicating no component was found with the specified identifier.

Parameter | Description
id | The id of the component to be retrieved.

See Also: setID

getComponentIndex

public int getComponentIndex(IUIComponent comp);

Retrieves the index of the specified component.

Return Value:

Returns the zero-based index of the component (if the component belongs to the container); otherwise, returns null.

Parameter | Description
comp | The component to retrieve the index for. This component can be the header component or any child component.

getComponents

public IUIComponent[] getComponents();

Retrieves all components in the container.

Return Value:

Returns an array of the container's components.

getEdge

public int getEdge();

Retrieves the style of the container's edge.

Return Value:

Returns an integer that specifies the current style settings.

getFloater

public IUIComponent getFloater();

Retrieves the floating component in this container, if one exists.

Return Value:

Returns the current floating component, or null if there is no component.

Remarks:

The floating component is the component which is superceding the standard z-order of the container's children by being first in the z-order. This is most commonly used when a component is being dragged, like a column header or a scroll thumb.

getFocusComponent

public IUIComponent getFocusComponent();

Retrieves the component of the container that currently has input focus.

Return Value:

Returns the component that either has focus itself or is the ancestor of the component that has focus. If no descendant of the container currently has focus, null is returned.

Remarks:

The returned component is either a direct child of the container or the header component. For example, suppose the container has a child component that is itself a container, and a component within this child container has focus. As a result,getFocusComponent returns the child container.

getHeader

public IUIComponent getHeader();

Retrieves the container's header component.

Return Value:

Returns the current header component (if the container has a header); otherwise, returns null.

getInsets

public Insets getInsets();

Retrieves the container's insets (in pixels), which identify the nonclient area of the container.

Return Value:

Returns an Insets object containing the container's insets.

getLayout

public IUILayoutManager getLayout();

Retrieves the layout manager of the container.

Return Value:

Returns the current layout manager (if the container has a layout manager); otherwise, returns null.

isOverlapping

public boolean isOverlapping();

Determines if this layout manager lays out its children so that they overlap either completely or partially; false otherwise.

Return Value:

Returns true if the children overlap; otherwise, returns false. (The default is true.) Returning false also means that only the sibling floater window, if one exists, needs to be clipped by the manager.

move

public boolean move(IUIComponent comp, IUIComponent before);

Moves the component specified in comp in front of the component specified in before. t

Return Value:

Returns true if the component was moved successfully; otherwise, returns false.

Parameter | Description
comp | The component to move.
before | The component to move comp in front of. If null, comp is placed at the end of the container.

move

public boolean move(int from, int to);

Moves a component in the container, according to the specified indices.

Return Value:

Returns true if the component was moved successfully; otherwise, returns false.

Parameter | Description
from | The zero-based index of the component to move.
to | The zero-based index of the position to move the component before. If -1, the component is placed at the end of the container.

navigate

public IUIComponent navigate(IUIComponent comp, int direction,
        boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
comp | The component to navigate from.
direction | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

paintComponents

public void paintComponents(FxGraphics g);

Draws all the components in the container.

Return Value:

No return value.

Parameter | Description
g | The graphics context.

passFocus

public IUIComponent passFocus(int dir);

Retrieves the component that should receive input focus when navigating to the container in the specified direction.

Return Value:

Returns the component or the container itself, that should receive input focus.

Parameter | Description
dir | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.

remove

public void remove(int index);

Removes the component at the specified index from the container.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component to be removed.

remove

public void remove(IUIComponent comp);

Removes the specified component from the container.

Return Value:

No return value.

Parameter | Description
comp | The component to be removed.

removeAll

public void removeAll();

Removes all components from the container, including the header component.

Return Value:

No return value.

removeAllChildren

public void removeAllChildren();

Removes all child components from the container. The header component is not removed.

Return Value:

No return value.

removeContainerListener

public void removeContainerListener(IUIContainerListener l);

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

Return Value:

No return value.

Parameter | Description
l | The container listener to be removed.

removeFocusListener

public void removeFocusListener(IUIFocusListener l);

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

Return Value:

No return value.

Parameter | Description
l | The focus listener to be removed.

Overrides:

removeFocusListener(IUIFocusListener) in IUIComponent.

removeKeyListener

public void removeKeyListener(IUIKeyListener l);

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

Return Value:

No return value.

Parameter | Description
l | The key listener to be removed.

Overrides:

removeKeyListener(IUIKeyListener) in IUIComponent.

removeMouseListener

public void removeMouseListener(IUIMouseListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse listener to be removed.

Overrides:

removeMouseListener(IUIMouseListener) in IUIComponent.

removeMouseMotionListener

public void removeMouseMotionListener(IUIMouseMotionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The mouse motion listener to be removed.

Overrides:

removeMouseMotionListener(IUIMouseMotionListener) in IUIComponent.

replace

public IUIComponent replace(IUIComponent comp, IUIComponent old);

Adds the specified component to the container, replacing the specified component.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
old | The component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, int index);

Adds the specified component to the container, replacing the specified component.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
index | The index of the component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, Object constraints,
        IUIComponent old);

Adds the specified component to the container with the specified constraints, replacing the specified component.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints, which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.
old | The component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, Object constraints,
        int index);

Adds the specified component to the container with the specified constraints, replacing the specified component.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints, which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.
index | The index of the component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, Object constraints);

Adds the specified component to the container, replacing the component with the specified constraints.

Return Value:

Returns the component that was added.

Parameter | Description
comp | The component to be added.
constraints | The layout constraints of the component to be replaced (as well as the component to be added), which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.

See Also: add, remove

setChildBounds

public void setChildBounds(IUIComponent child, int x, int y, int width, int
        height);

Sets the bounds of the specified component, according to the specified coordinates and dimensions.

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.
width | The width for the component (in pixels).
height | The height for the component (in pixels).

setChildBounds

public void setChildBounds(IUIComponent child, Rectangle rect);

Sets the bounds of the specified component. The component's coordinates and dimensions are defined by the specified Rectangle object.

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
rect | The bounding rectangle for the component.

setChildBounds

public void setChildBounds(int index, int x, int y, int width, int height);

Sets the bounds of the component at the specified index, according to the specified coordinates and dimensions.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0, and the first child component begins at index 1; otherwise, the first child begins at index 0.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.
width | The width for the component (in pixels).
height | The height for the component (in pixels).

setChildBounds

public void setChildBounds(int index, Rectangle rect);

Sets the bounds of the component at the specified index. The component's coordinates and dimensions are defined by the specified Rectangle object.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0, and the first child component begins at index 1; otherwise, the first child begins at index 0.
rect | The bounding rectangle for the component.

setChildLocation

public void setChildLocation(IUIComponent child, int x, int y);

Sets the location of the specified component, according to the specified coordinates.

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.

setChildLocation

public void setChildLocation(IUIComponent child, Point point);

Sets the location of the specified component, according to the specified Point object.

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
point | The point that identifies the upper-left corner of the component.

setChildLocation

public void setChildLocation(int index, int x, int y);

Sets the location of the component at the specified index, according to the specified coordinates.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0, and the first child component begins at index 1; otherwise, the first child begins at index 0.
x | The x coordinate for the upper-left corner of the component.
y | The y coordinate for the upper-left corner of the component.

setChildLocation

public void setChildLocation(int index, Point point);

Sets the location of the component at the specified index, according to the specified Point object.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0, and the first child component begins at index 1; otherwise, the first child begins at index 0.
point | The point that identifies the upper-left corner of the component.

setChildSize

public void setChildSize(IUIComponent child, int width, int height);

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

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
width | The width for the component (in pixels).
height | The height for the component (in pixels).

setChildSize

public void setChildSize(IUIComponent child, Dimension size);

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

Return Value:

No return value.

Parameter | Description
child | The component. Specify either the container's header component or any child component.
size | The dimensions for the component (in pixels).

setChildSize

public void setChildSize(int index, int width, int height);

Sets the size of the component at the specified index, according to the specified dimensions.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0, and the first child component begins at index 1; otherwise, the first child begins at index 0.
width | The width for the component (in pixels).
height | The height for the component (in pixels).

setChildSize

public void setChildSize(int index, Dimension size);

Sets the size of the component at the specified index, according to the specified Dimension object.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the component. If the container has a header component, the header is at index 0, and the first child component begins at index 1; otherwise, the first child begins at index 0.
size | The dimensions for the component (in pixels).

setComponent

public void setComponent(int index, IUIComponent comp);

Adds the component to the container.

Return Value:

No return value.

Parameter | Description
index | The index in the container where the component will be inserted.
comp | The component to be inserted.

setEdge

public void setEdge(int edge);

Sets the style of the container's edge.

Return Value:

No return value.

Parameter | Description
edge | The style of the container's edge.

setHeader

public void setHeader(IUIComponent header);

Sets the header component for the container.

Return Value:

No return value.

Parameter | Description
header | The component to be used as the container's header component.

setLayout

public void setLayout(IUILayoutManager lm);

Sets the layout manager of the container.

Return Value:

No return value.

Parameter | Description
lm | The new layout manager to be used.


Interface IUILayoutManager

public interface IUILayoutManager
{
  // Methods
  public void addLayoutComponent(IUIContainer cont,
        IUIComponent comp, Object constraints);
  public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp,
        Dimension oldSize, Dimension newSize);
  public boolean continueInvalidate(IUIContainer cont, IUIComponent
        comp);
  public IUIComponent getComponent(IUIContainer cont, int index);
  public IUIComponent getComponent(IUIContainer cont,
        Object constraints);
  public int getComponentIndex(IUIContainer cont,
        IUIComponent comp);
  public Dimension getMinimumSize(IUIContainer cont);
  public Dimension getPreferredSize(IUIContainer cont);
  public Dimension getPreferredSize(IUIContainer cont,
        Dimension size);
  public boolean isHeightRelative();
  public boolean isOverlapping();
  public boolean isWidthRelative();
  public void layout(IUIContainer cont, Rectangle bounds);
  public IUIComponent navigate(IUIContainer cont,
        IUIComponent comp, int direction, boolean keyable);
  public void paintContainer(IUIContainer cont, FxGraphics g);
  public void removeLayoutComponent(IUIContainer cont, IUIComponent
        comp);
}

This interface defines methods associated with layout managers. UILayoutManager implements IUILayoutManager.

Methods

addLayoutComponent

public void addLayoutComponent(IUIContainer cont, IUIComponent comp, Object
        constraints);

Adds the specified component to the container according to the specified constraints.

Return Value:

No return value.

Parameter | Description
cont | The container of the component.
comp | The component to be added.
constraints | The layout constraints identifying where the component will be added.

adjustLayoutSize

public Dimension adjustLayoutSize(IUIContainer parent,
        Dimension oldParentSize, IUIComponent comp, Dimension oldSize,
        Dimension newSize);

Adjusts the layout size of the specified component in the specified container.

Return Value:

Returns a Dimension object that specifies the new size of the container.

Parameter | Description
parent | The container of the component.
oldParentSize | The previous layout size of the container.
comp | The component being sized.
oldSize | The previous layout size of the component.
newSize | The new layout size of the component.

continueInvalidate

public boolean continueInvalidate(IUIContainer cont, IUIComponent comp);

Currently not implemented.

getComponent

public IUIComponent getComponent(IUIContainer cont, int index);

Retrieves the component at the specified index.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
cont | The container of the component.
index | The zero-based index of the component to retrieve.

getComponent

public IUIComponent getComponent(IUIContainer cont, Object constraints);

Retrieves a component from the container according to the specified constraints.

Return Value:

Returns the specified component, if found; otherwise, returns null.

Parameter | Description
cont | The container of the component.
constraints | Identifies the component to be retrieved.

getComponentIndex

public int getComponentIndex(IUIContainer cont, IUIComponent comp);

Retrieves the layout index of the specified component from the container.

Return Value:

Returns the layout index of the component, or -1 if component is not in the container.

Parameter | Description
cont | The container of the component.
comp | The component whose layout index is being retrieved.

getMinimumSize

public Dimension getMinimumSize(IUIContainer cont);

Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.

Return Value:

Returns a Dimension object that specifies the minimum layout size.

Parameter | Description
cont | The container of the components.

getPreferredSize

public Dimension getPreferredSize(IUIContainer cont);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.

Return Value:

Returns a Dimension object that specifies the preferred layout size.

Parameter | Description
cont | The container of the components.

getPreferredSize

public Dimension getPreferredSize(IUIContainer cont, Dimension size);

Determines the preferred dimensions (in pixels) for laying out the child components in the specified container. Also determines the size of the child components.

Return Value:

Returns a Dimension object containing the preferred layout size.

Parameter | Description
cont | The container of the components.
size | The size of the container.

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 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: isWidthRelative

isOverlapping

public boolean isOverlapping();

Determines if this layout manager lays out its children so that they overlap either completely or partially.

Return Value:

Returns true if the children overlap; otherwise, returns false. (The default is true.) Returning false also means that only the sibling floater window, if one exists, needs to be clipped by the manager.

isWidthRelative

public boolean isWidthRelative();

Determines whether the components relative width state is set.

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 vertical resizing.

See Also: isHeightRelative

layout

public void layout(IUIContainer cont, Rectangle bounds);

Lays out the child components in the specified container.

Return Value:

No return value.

Parameter | Description
cont | The container being laid out.
bounds | The bounding rectangle in which to lay out the components.

navigate

public IUIComponent navigate(IUIContainer cont, IUIComponent comp,
        int direction, boolean keyable);

Navigates from the specified component to another component in the specified direction.

Return Value:

Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.

Parameter | Description
cont | The container where the navigation is occurring.
comp | The component to navigate from.
direction | The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
keyable | If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.

paintContainer

public void paintContainer(IUIContainer cont, FxGraphics g);

Draws the container.

Return Value:

No return value.

Parameter | Description
cont | The container.
g | The graphics context of the container.

removeLayoutComponent

public void removeLayoutComponent(IUIContainer cont, IUIComponent comp);

Removes the specified component from the container.

Return Value:

No return value.

Parameter | Description
cont | The container of the component.
comp | The component to be removed.


Interface IUIMenuLauncher

public interface IUIMenuLauncher
{
  // Methods
  public void cancel();
  public void ended(Event event);
  public IUIContainer getDisplayer();
  public UIMenuList getMenu();
  public Rectangle getPlacement(Dimension size);
  public boolean isLaunched();
  public boolean launch();
  public void raiseEvent(Event e);
  public void setMenu(UIMenuList menu);
}

This interface is used to launch and cancel a pop-up menu. UIMenuLauncher implements IUIMenuLauncher.

Methods

cancel

public void cancel();

Cancels the object's associated pop-up menu.

Return Value:

No return value.

ended

public void ended(Event event);

Called by the control's associated pop-up menu once the menu is closed (either by selecting an item or cancelling menu mode)

Return Value:

No return value.

Parameter | Description
event | The event that will be fired by the caller after end is complete; null if no event will be fired.

Remarks:

This method implements selected in the IUIMenuLauncher interface by resetting its state and generating an action event, if necessary.

getDisplayer

public IUIContainer getDisplayer();

Retrieves the displayer for the pop-up menu associated with the menu launcher control. By default, this will be the pop-up menu itself.

Note Any displayer must have a UIMenuLauncher menu as a child.

Return Value:

Returns the displayer object for the pop-up menu.

getMenu

public UIMenuList getMenu();

Retrieves the pop-up menu associated with the menu launcher object.

Return Value:

Returns the UIMenuList object containing the menu's content.

getPlacement

public Rectangle getPlacement(Dimension size);

Called by the object's pop-up menu when the menu is to be displayed.

Return Value:

Returns the bounding rectangle (in screen coordinates) of the pop-up menu.

Parameter | Description
size | The preferred size of the pop-up menu (in pixels).

isLaunched

public boolean isLaunched();

Determines the launch state of the object's associated pop-up menu.

Return Value:

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

launch

public boolean launch();

Launches the object's associated pop-up menu.

Return Value:

Returns true if the pop-up menu was launched; otherwise, returns false.

raiseEvent

public void raiseEvent(Event e);

Called by the object's pop-up menu when an event occurs.

Return Value:

No return value.

Parameter | Description
e | The event that occurred.

setMenu

public void setMenu(UIMenuList menu);

Sets the pop-up menu to be associated with the menu launcher object.

Return Value:

No return value.

Parameter | Description
menu | The UIMenuList object containing the menu's content.


Interface IUIPosition

public interface IUIPosition
{
  // Methods
  public Point getPosition();
  public int getXPosition();
  public int getYPosition();
  public void setPosition(Point pt);
  public void setPosition(int x, int y);
  public void setXPosition(int x);
  public void setYPosition(int y);
}

This interface is used to expose a spatial position. For example, UIViewer and UIScrollViewer implement IUIPosition to expose their content's position. UIScroll implements this interface to expose the position of the scroll track control.

Methods

getPosition

public Point getPosition();

Retrieves the position of the object.

Return Value:

Returns a Point object containing the current position. The x and y coordinates specify the horizontal and vertical positions (in pixels), respectively.

getXPosition

public int getXPosition();

Retrieves the horizontal position of the object.

Return Value:

Returns the horizontal position (in pixels).

getYPosition

public int getYPosition();

Retrieves the vertical position of the object.

Return Value:

Returns the vertical position (in pixels).

setPosition

public void setPosition(Point pt);

Sets the position of the object according to the specified Point.

Return Value:

No return value.

Parameter | Description
pt | The requested position. The x and y coordinates of pt specify the horizontal and vertical positions (in pixels), respectively.

Remarks:

Depending on the object's range checking, the returned position may differ from the requested position.

setPosition

public void setPosition(int x, int y);

Sets the position of the object according to the specified values.

Return Value:

No return value.

Parameter | Description
x | The requested horizontal position (in pixels).
y | The requested vertical position (in pixels).

Remarks:

Depending on the object's range checking, the returned position may differ from the requested position.

setXPosition

public void setXPosition(int x);

Sets the horizontal position of the object.

Return Value:

No return value.

Parameter | Description
x | The requested horizontal position.

Remarks:

Depending on the object's range checking, the returned position may differ from the requested position.

setYPosition

public void setYPosition(int y);

Sets the vertical position of the object.

Return Value:

No return value.

Parameter | Description
y | The requested vertical position.

Remarks:

Depending on the object's range checking, the returned position may differ from the requested position.


Interface IUIPropertyPage

public abstract interface IUIPropertyPage
{
  // Methods
  public boolean doApplyAction();
  public boolean isApplyable();
  public void setApplyable(boolean apply);
  public void setConstructed(boolean construct);
  public void setVisible(boolean visible);
}

This interface defines methods associated with property pages. UIPropertyPage implements IUIPropertyPage.

Methods

doApplyAction

public boolean doApplyAction();

Responds to the Apply button being pressed.

Return Value:

Returns true if the Apply action was handled; otherwise, returns false if the Apply action was cancelled.

isApplyable

public boolean isApplyable();

Determines whether changes made to the property page by the user will be applied when the Apply button is pressed.

Return Value:

Returns true if pressing the Apply button changes the state of the application; otherwise, returns false.

setApplyable

public void setApplyable(boolean apply);

Sets the state of the Apply button.

Return Value:

No return value.

Parameter | Description
apply | If true, changes will be applied to the application when the Apply button is pressed; otherwise, changes will not be applied.

setConstructed

public void setConstructed(boolean construct);

Sets the creation state of the property page components.

Return Value:

No return value.

Parameter | Description
construct | If true, the components have been constructed; otherwise, the components have not been constructed.

setVisible

public void setVisible(boolean visible);

Shows or hides the property page.

Return Value:

No return value.

Parameter | Description
visible | If true, the property page is shown; otherwise, it is hidden.


Interface IUIRootContainer

public interface IUIRootContainer extends IUIContainer
{
  // Methods
  public void endMenu(IUIMenuLauncher ml, Event event);
  public void endTooltip();
  public IUIComponent getFocus();
  public Component getHost();
  public IUIMenuLauncher getLaunchedMenu();
  public void launchMenu(IUIMenuLauncher ml);
  public void launchTooltip(IUIComponent comp, String sTooltip);
  public void needsValidating(IUIComponent comp);
  public void setFocus(IUIComponent comp);
}

This interface is used by all root containers. A root container is a UI object that is hosted by an AwtUI control. UIRoot implements IUIRootContainer.

IUIComponent
  |
  +--IUIContainer
    |
    +--IUIRootContainer

Methods

endMenu

public void endMenu(IUIMenuLauncher ml, Event event);

Terminates the launch of the pop-up menu associated with the specified menu launcher.

Return Value:

No return value.

Parameter | Description
ml | The menu launcher that terminates the launch.
event | The event that will be fired by the caller after end is complete; null if no event will be fired.

endTooltip

public void endTooltip();

Terminates the currently launched ToolTip window.

Return Value:

No return value.

getFocus

public IUIComponent getFocus();

Retrieves the component that currently has focus.

Return Value:

Returns the component with focus.

getHost

public Component getHost();

Retrieves the host component that is associated with the root container.

Return Value:

Returns the component that hosts the root container.

getLaunchedMenu

public IUIMenuLauncher getLaunchedMenu();

Retrieves the menu launcher associated with the currently launched pop-up menu.

Return Value:

Returns the menu launcher object.

launchMenu

public void launchMenu(IUIMenuLauncher ml);

Launches the pop-up menu associated with the specified menu launcher. This method cancels any menu that was previously launched.

Return Value:

No return value.

Parameter | Description
ml | The menu launcher that is requesting the launch.

launchTooltip

public void launchTooltip(IUIComponent comp, String sTooltip);

Launches a ToolTip window using the specified string for content.

Return Value:

No return value.

Parameter | Description
comp | The component used to determine the size and placement of the ToolTip window.
sTooltip | The string to be displayed in the ToolTip window.

needsValidating

public void needsValidating(IUIComponent comp);

Indicates that the specified component needs to be validated.

Return Value:

No return value.

Parameter | Description
comp | The component to be validated.

setFocus

public void setFocus(IUIComponent comp);

Sets focus on the specified component.

Return Value:

No return value.

Parameter | Description
comp | The component to receive focus.


Interface IUIScroll

public interface IUIScroll
{
  // Methods
  public int getScrollLine();
  public int getScrollMax();
  public int getScrollMin();
  public int getScrollPage();
  public int getScrollPos();
  public boolean isScrollable();
  public int scrollEnd();
  public int scrollHome();
  public int scrollLineDown();
  public int scrollLineUp();
  public int scrollPageDown();
  public int scrollPageUp();
  public int setScrollInfo(int min, int max, int page, int line,
        int pos);
  public void setScrollLine(int line);
  public void setScrollMax(int max);
  public void setScrollMin(int min);
  public void setScrollPage(int page);
  public void setScrollPos(int pos);
  public int setScrollRange(int min, int max);
}

This interface defines methods for scrolling within a range. UIScroll implements IUIScroll.

Methods

getScrollLine

public int getScrollLine();

Retrieves the number of scroll positions associated with a line.

Return Value:

Returns the number of scroll positions in a line.

Remarks:

For more information about line values, see the UIScroll overview.

getScrollMax

public int getScrollMax();

Retrieves the maximum value in the object's range.

Return Value:

Returns the maximum scroll position.

getScrollMin

public int getScrollMin();

Retrieves the minimum value in the object's range.

Return Value:

Returns the minimum scroll position.

getScrollPage

public int getScrollPage();

Retrieves the number of scroll positions associated with a page.

Return Value:

Returns the number of scroll positions in a page.

Remarks:

For more information about page values, see the UIScroll overview.

getScrollPos

public int getScrollPos();

Retrieves the position of the object.

Return Value:

Returns the current scroll position.

isScrollable

public boolean isScrollable();

Determines whether the object supports scrolling, based on its range and page values.

Return Value:

Returns true if the object must scroll; otherwise, returns false if scrolling is unnecessary.

scrollEnd

public int scrollEnd();

Moves the current scroll position to the maximum range value.

Return Value:

Returns the object's new scroll position.

scrollHome

public int scrollHome();

Moves the current scroll position to the minimum range value.

Return Value:

Returns the object's new scroll position.

scrollLineDown

public int scrollLineDown();

Increments the current scroll position by one line.

Return Value:

Returns the object's new scroll position.

Remarks:

For more information about line values, see the UIScroll overview.

scrollLineUp

public int scrollLineUp();

Decrements the current scroll position by one line.

Return Value:

Returns the object's new scroll position.

Remarks:

For more information about line values, see the UIScroll overview.

scrollPageDown

public int scrollPageDown();

Increments the current scroll position by one line less than a full page.

Return Value:

Returns the object's new scroll position.

Remarks:

For more information about page and line values, see the UIScroll overview.

scrollPageUp

public int scrollPageUp();

Decrements the current scroll position by one line less than a full page.

Return Value:

Returns the object's new scroll position.

Remarks:

For more information about page and line values, see the UIScroll overview.

setScrollInfo

public int setScrollInfo(int min, int max, int page, int line, int pos);

Sets the specified scroll information and adjusts the object's current position accordingly.

Return Value:

Returns the object's new scroll position after setting the specified values.

Parameter | Description
min | The minimum scroll position in the object's range.
max | The maximum scroll position in the object's range.
page | The number of scroll positions associated with a page.
line | The number of scroll positions associated with a line.
pos | The current scroll position.

Remarks:

For more information about range, page, and line values, see the UIScroll overview.

setScrollLine

public void setScrollLine(int line);

Sets the number of scroll positions associated with a line and adjusts the object's current position accordingly.

Return Value:

No return value.

Parameter | Description
line | The number of scroll positions to be associated with a line.

Remarks:

For more information about line values, see the UIScroll overview.

setScrollMax

public void setScrollMax(int max);

Sets the maximum range value and adjusts the object's current position accordingly.

Return Value:

No return value.

Parameter | Description
max | The maximum scroll position.

setScrollMin

public void setScrollMin(int min);

Sets the minimum range value and adjusts the object's current position accordingly.

Return Value:

No return value.

Parameter | Description
min | The minimum scroll position.

setScrollPage

public void setScrollPage(int page);

Sets the number of scroll positions associated with a page and adjusts the object's current position accordingly.

Return Value:

No return value.

Parameter | Description
page | The number of scroll positions associated with a page.

Remarks:

For more information about page values, see the UIScroll overview.

setScrollPos

public void setScrollPos(int pos);

Sets the object's current position to the specified scroll position.

Return Value:

No return value.

Parameter | Description
pos | The position for the object.

Remarks:

Depending on the object's range, the returned position may differ from the pos parameter.

setScrollRange

public int setScrollRange(int min, int max);

Sets the scroll track object's range and adjusts the object's current position accordingly.

Return Value:

Returns the object's new scroll position after setting the specified values.

Parameter | Description
min | The minimum scroll position.
max | The maximum scroll position.


Interface IUISelector

public interface IUISelector
{
  // Fields
  public static final int EXTENDSELECT;
  public static final int MULTISELECT;
  public static final int NOSELECT;
  public static final int SINGLESELECT;

  // Methods
  public void addActionListener(IUIActionListener l);
  public void addItemListener(IUIItemListener l);
  public void addSelectedIndex(int index);
  public void addSelectedIndex(int index, boolean notify);
  public void addSelectedIndices(int indices[]);
  public void addSelectedIndices(int indices[], boolean notify);
  public void addSelectedItem(IUIComponent comp);
  public void addSelectedItem(IUIComponent comp, boolean notify);
  public void addSelectedItems(IUIComponent comps[]);
  public void addSelectedItems(IUIComponent comps[],
        boolean notify);
  public IUIComponent getAnchorItem();
  public IUIComponent getExtensionItem();
  public int getSelectedIndex();
  public int[] getSelectedIndices();
  public IUIComponent getSelectedItem();
  public IUIComponent[] getSelectedItems();
  public int getSelectionMode();
  public void removeActionListener(IUIActionListener l);
  public void removeItemListener(IUIItemListener l);
  public void removeSelectedIndex(int index);
  public void removeSelectedIndex(int index, boolean notify);
  public void removeSelectedIndices(int indices[]);
  public void removeSelectedIndices(int indices[], boolean notify);
  public void removeSelectedItem(IUIComponent comp);
  public void removeSelectedItem(IUIComponent comp, boolean notify);
  public void removeSelectedItems(IUIComponent comps[]);
  public void removeSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setAnchorItem(IUIComponent comp);
  public void setExtensionItem(IUIComponent comp);
  public void setSelectedIndex(int index);
  public void setSelectedIndex(int index, boolean notify);
  public void setSelectedIndices(int indices[]);
  public void setSelectedIndices(int indices[], boolean notify);
  public void setSelectedItem(IUIComponent comp);
  public void setSelectedItem(IUIComponent comp, boolean notify);
  public void setSelectedItems(IUIComponent comps[]);
  public void setSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setSelectionMode(int mode);
}

This interface is used to manage the selection of child components. UISelector implements IUISelector.

Methods

addActionListener

public void addActionListener(IUIActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be added.

See Also: removeActionListener

addItemListener

public void addItemListener(IUIItemListener l);

Adds the specified item listener. The listener receives all item events generated for the control. (Item events are generated when the state of an item changes.)

Return Value:

No return value.

Parameter | Description
l | The item listener to be added.

See Also: removeItemListener

addSelectedIndex

public void addSelectedIndex(int index);

Selects the component at the specified index, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.

See Also: removeSelectedIndex

addSelectedIndex

public void addSelectedIndex(int index, boolean notify);

Selects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

See Also: removeSelectedIndex

addSelectedIndices

public void addSelectedIndices(int indices[]);

Selects the components at the specified indices, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.

See Also: removeSelectedIndices

addSelectedIndices

public void addSelectedIndices(int indices[], boolean notify);

Selects the components at the specified indices, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

See Also: removeSelectedIndices

addSelectedItem

public void addSelectedItem(IUIComponent comp);

Selects the specified component, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.

See Also: removeSelectedItem

addSelectedItem

public void addSelectedItem(IUIComponent comp, boolean notify);

Selects the specified component, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comp | The component to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

See Also: removeSelectedItem

addSelectedItems

public void addSelectedItems(IUIComponent comps[]);

Selects the specified components, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be selected.

See Also: removeSelectedItems

addSelectedItems

public void addSelectedItems(IUIComponent comps[], boolean notify);

Selects the specified components, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

See Also: removeSelectedItems

getAnchorItem

public IUIComponent getAnchorItem();

Retrieves the component that is the current anchor in extend select mode.

Return Value:

Returns the component that is the anchor.

See Also: setAnchorItem

getExtensionItem

public IUIComponent getExtensionItem();

Retrieves the item to which a selection last extended from the anchor item.

Return Value:

Returns the extension item.

See Also: setExtensionItem

getSelectedIndex

public int getSelectedIndex();

Retrieves the zero-based index of the currently selected item.

Return Value:

Returns the index of the selected item if an item is selected; otherwise, returns -1.

Remarks:

If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call getSelectedIndices.

See Also: setSelectedIndex

getSelectedIndices

public int[] getSelectedIndices();

Retrieves the zero-based indices of all currently selected items.

Return Value:

Returns an array of the indices of the selected items, if an item is selected; otherwise, returns -1.

See Also: setSelectedIndices

getSelectedItem

public IUIComponent getSelectedItem();

Retrieves the currently selected item.

Return Value:

Returns the selected component, if a component is selected; otherwise, returns null.

Remarks:

If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call getSelectedItems.

See Also: setSelectedItem

getSelectedItems

public IUIComponent[] getSelectedItems();

Retrieves all currently selected items.

Return Value:

Returns an array of the selected components, if a component is selected; otherwise, returns null.

See Also: setSelectedItems

getSelectionMode

public int getSelectionMode();

Retrieves the selection mode of the control.

Return Value:

Returns one of the following three selection modes: SINGLESELECT, MULTISELECT, or EXTENDSELECT.

See Also: setSelectionMode

removeActionListener

public void removeActionListener(IUIActionListener l);

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

Return Value:

No return value.

Parameter | Description
l | The action listener to be removed.

See Also: addActionListener

removeItemListener

public void removeItemListener(IUIItemListener l);

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

Return Value:

No return value.

Parameter | Description
l | The item listener to be removed.

See Also: addItemListener

removeSelectedIndex

public void removeSelectedIndex(int index);

Deselects the component at the specified index, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.

See Also: addSelectedIndex

removeSelectedIndex

public void removeSelectedIndex(int index, boolean notify);

Deselects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

See Also: addSelectedIndex

removeSelectedIndices

public void removeSelectedIndices(int indices[]);

Deselects the components at the specified indices, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.

See Also: addSelectedIndices

removeSelectedIndices

public void removeSelectedIndices(int indices[], boolean notify);

Deselects the components at the specified indices, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

See Also: addSelectedIndices

removeSelectedItem

public void removeSelectedItem(IUIComponent comp);

Deselects the specified component, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.

See Also: addSelectedItem

removeSelectedItem

public void removeSelectedItem(IUIComponent comp, boolean notify);

Deselects the specified component, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comp | The component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

See Also: addSelectedItem

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[]);

Deselects the specified components, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the components to be deselected.

See Also: addSelectedItems

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[], boolean notify);

Deselects the specified components, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the component to be deselected.
notify | If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

See Also: addSelectedItems

setAnchorItem

public void setAnchorItem(IUIComponent comp);

Sets the item used as an anchor in extend select mode. The anchor item cannot be set to null.

Return Value:

No return value.

Parameter | Description
comp | The component that will be the new anchor.

Remarks:

Resetting the anchor automatically sets the current extension item to null. If it is intended to set them both to specific items, call setAnchorItem, followed by setExtensionItem.

Note Setting the anchor in an IUISelector other than the outermost one, has no effect.

Exceptions:

IllegalArgumentException if comp is not a child of the selector, or if comp is null.

See Also: getAnchorItem

setExtensionItem

public void setExtensionItem(IUIComponent comp);

Sets the item to which a selection extends from an anchor.

Note Calling setAnchorItem automatically resets this item to null.

Return Value:

No return value.

Parameter | Description
comp | The component that will be the new extension item.

Exceptions:

IllegalArgumentException if comp is not a component of the selector.

See Also: getExtensionItem

setSelectedIndex

public void setSelectedIndex(int index);

Sets the selection to the component at the specified index. By default, a list select event is not generated.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.

Remarks:

This method clears any previous selection.

See Also: getSelectedIndex

setSelectedIndex

public void setSelectedIndex(int index, boolean notify);

Sets the selection to the component at the specified index and provides the option of generating a list select event.

Return Value:

No return value.

Parameter | Description
index | The zero-based index of the item to be selected.
notify | If true, a list select event will be generated; otherwise, a list select event will not be generated.

Remarks:

This method clears any previous selection.

See Also: getSelectedIndex

setSelectedIndices

public void setSelectedIndices(int indices[]);

Sets the selection to the components at the specified indices. List select events are not generated.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.

Remarks:

This method clears any previous selection.

See Also: getSelectedIndices

setSelectedIndices

public void setSelectedIndices(int indices[], boolean notify);

Sets the selection to the components at the specified indices and provides the option of generating list select events.

Return Value:

No return value.

Parameter | Description
indices | An array containing the indices of the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method clears any previous selection.

See Also: getSelectedIndices

setSelectedItem

public void setSelectedItem(IUIComponent comp);

Sets the selection to the specified component. A list select event is not generated.

Return Value:

No return value.

Parameter | Description
comp | The item to be selected.

Remarks:

This method clears any previous selection.

See Also: getSelectedItem

setSelectedItem

public void setSelectedItem(IUIComponent comp, boolean notify);

Sets the selection to the specified component and provides the option of generating a list select event.

Return Value:

No return value.

Parameter | Description
comp | The item to be selected.
notify | If true, a list select event will be generated; otherwise, a list select event will not be generated.

Remarks:

This method clears any previous selection.

See Also: getSelectedItem

setSelectedItems

public void setSelectedItems(IUIComponent comps[]);

Sets the selection to the specified components. By default, list select events are not generated.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected.

Remarks:

This method clears any previous selection.

See Also: getSelectedItems

setSelectedItems

public void setSelectedItems(IUIComponent comps[], boolean notify);

Sets the selection to the specified components, and provides the option of generating list select events.

Return Value:

No return value.

Parameter | Description
comps | An array containing the items to be selected.
notify | If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method clears any previous selection.

See Also: getSelectedItems

setSelectionMode

public void setSelectionMode(int mode);

Sets the selection mode of the control.

Return Value:

No return value.

Parameter | Description
mode | The selection mode for the control. Possible values include SINGLESELECT, MULTISELECT, or EXTENDSELECT.

See Also: getSelectionMode

Fields

EXTENDSELECT
More than one item can be selected by dragging the mouse over the items or by using the SHIFT key to extend the selection.
MULTISELECT
Multiple items may be selected by clicking each individual item.
NOSELECT
Specifies that no items can be selected by the application.
SINGLESELECT
Only one item may be selected at a time.


Interface IUITree

public interface IUITree
{
  // Methods
  public Rectangle getAttachRect();
  public IUIComponent getExpander();
  public boolean hasChildren();
  public boolean isExpanded();
  public void setExpanded(boolean expanded,boolean notify);
  public void setExpanded(boolean expanded);
  public void setExpander(IUIComponent expander);
}

This interface defines methods associated with tree nodes. UITree implements IUITree.

Methods

getAttachRect

public Rectangle getAttachRect();

Determines where the attaching line from the tree node's parent to the tree node will be drawn.

Return Value:

Returns the node's bounding rectangle.

getExpander

public IUIComponent getExpander();

Retrieves the tree node's expand button, which indicates whether the node is expanded or collapsed.

Return Value:

Returns the component currently being used as the expand button.

hasChildren

public boolean hasChildren();

Determines whether the tree node has child items.

Return Value:

Returns true if the node has child items; otherwise, returns false.

isExpanded

public boolean isExpanded();

Determines whether the tree node is expanded.

Return Value:

Returns true if the node is expanded; otherwise, returns false.

setExpanded

public void setExpanded(boolean expanded,boolean notify);

Expands or collapses the tree node to show or hide the node's children.

Return Value:

No return value.

Parameter | Description
expanded | If true, the node will be expanded; otherwise, the node will be collapsed.
notify | If true, the node will generate an action event and posts it to the Tree node's parent.

setExpanded

public void setExpanded(boolean expanded);

Expands or collapses the tree node to show or hide the node's children.

Return Value:

No return value.

Parameter | Description
expanded | If true, the node will be expanded; otherwise, the node will be collapsed.

setExpander

public void setExpander(IUIComponent expander);

Sets the tree node's expand button to the specified component. The expand button indicates whether the node is expanded or collapsed.

Return Value:

No return value.

Parameter | Description
expander | The component to be used for the expand button.


Interface IUIWizardStep

public abstract interface IUIWizardStep
{
  // Methods
  public IUIComponent getContent();
  public IUIComponent getImage();
  public UIWizard getWizard();
  public boolean isFinishStep() ;
  public boolean isLastStep();
  public IUIWizardStep nextStep();
  public IUIWizardStep previousStep();
  public void setWizard(UIWizard wizard);
}

This interface is used to display properties of wizard pages. UIWizardStep implements IUIWizardStep.

The following example demonstrates a simple implementation of IUIWizardStep.

//Return null to getNextStep(); (The wizard will select the next page.)
//Return null to getPreviousStep(); (The wizard will pick the previous page
                                     from the undo stack.)
//getWizard(); (Automatically set by the wizard when the page is added.)
//isFinishStep(); (Returns true if this page was constructed as the last step;
                   causes the Finish button to light.)
//isLastStep(); (Returns true if this page was constructed as the last step;
                 causes the Next button to dim.)
//nextStep(); (Calls getNextStep();)
//previousStep; (Returns null.)

Methods

getContent

public IUIComponent getContent();

Retrieves the IUIComponent that the current wizard page uses for content.

Return Value:

Returns the component used for content.

getImage

public IUIComponent getImage();

Retrieves the IUIComponent that is used as an image in the current wizard page.

Return Value:

Returns the component used as an image.

getWizard

public UIWizard getWizard();

Retrieves the wizard associated with the page.

Return Value:

Returns the associated UIWizard object.

isFinishStep

public boolean isFinishStep() ;

Determines whether the currently viewed wizard page allows a valid selection of the Finish button.

Return Value:

Returns true if the current page is a Finish step; otherwise, returns false.

Remarks:

A Finish step is not necessarily the last step, as an end user may be able to press the Finish button on some previous page and allow the wizard to set default values for the remaining pages in the series. The last step is the last logical page managed by the wizard, where the Next button is not a valid choice.

isLastStep

public boolean isLastStep();

Determines whether the currently viewed wizard page is the last page in the series. If true, the Next button is replaced with the Finish button.

Return Value:

Returns true if no more pages follow the current page; the Next button is shaded. Return true to isFinishStep; otherwise, returns false.

nextStep

public IUIWizardStep nextStep();

Retrieves the next wizard page object in the series managed by the associated UIWizard object.

Note When overridding this method, return null, and the next page in the vector of pages is transitioned to, and the previous page is put on the undo stack. Return the current page by using (getVisibleStep(), or "this" from getVisibleStep().nextStep()) to remain on this page. This is used when content on the page is validated, and found to be lacking certain information. Typically a message box is displayed to the user indicating the missing/incorrect information, and the user is returned to the current page. This page is not added to the undo stack.

Return Value:

Returns the next page in the series, or null if no more pages exist in the list.

See Also: com.ms.ui.UIWizard.getVisibleStep, previousStep

previousStep

public IUIWizardStep previousStep();

Retrieves the wizard page previous to the current one in the series managed by the associated UIWizard object.

Return Value:

Returns the previous page in the series; returns null if no previous pages exist in the list. Also, when overriding this method,return null to use the undo stack.

setWizard

public void setWizard(UIWizard wizard);

Sets the wizard that isassociated with the page.

Return Value:

No return value.

Parameter | Description
wizard | The wizard that is associated with the page.


Interface IWinEvent

public interface IWinEvent
{
  // Methods
  public Object getObject(int id);
  public void notify(int event, Object obj);
}

This interface defines methods associated with a window event class. The methods allow specific types of windowing events to be reported to the container. By using the flags defined in UIWinEvent, a variety of events can be tracked and managed by the container.

Also see com.ms.ui.UIWinEvent

Methods

getObject

public Object getObject(int id);

Retrieves an object based on the object's ID.

Return Value:

Returns the object whose identification is id.

Parameter | Description
id | The ID of the object to find.

notify

public void notify(int event, Object obj);

Notifies the object when an event occurs. For example, notification could be sent to the parent when a child changed its location.

Return Value:

No return value.

Parameter | Description
event | The event to send.
obj | The object to be notified.


About com.ms.ui.event

The com.ms.ui.event package supports the Java 1.1 Event Model, introduced with JDK 1.1, for the Application Foundation Classes. It includes event classes, adapter classes, and interfaces for many different types of Graphical User Interface (GUI) events. The events are derived from the UIBaseEvent class, which supports the getID and getSource methods.

According to the Java 1.0.2 Event Model, all events are represented by the Event class. Events are processed by the handleEvent method (and related methods, such as action, keyDown, and mouseDrag, for example). Typically, you override these event handling methods in your container or component for user-interactive functionality.

The Java 1.1 model does not use the Event class (there is a set of event classes derived from java.util.EventObject). Events generated by components and containers are propagated to event listeners by invoking one of the listener's methods and passing it the appropriate event object. Event adapter classes are included for situations where it is easier to subclass the adapter and override its methods rather than implement the corresponding interface.

Classes

Class UIActionAdapter
This class is the adapter class for receiving action events.
Class UIActionEvent
This class represents the action semantic event.
Class UIAdjustmentAdapter
This class is the listener adapter for receiving adjustment events.
Class UIAdjustmentEvent
This class represents the adjustment event emitted by components implementing IUIScroll.
Class UIBaseEvent
This class represents the base event for all JDK 1.1 events and defines base level functionality of events.
Class UIContainerAdapter
This interface is the listener interface for receiving container events.
Class UIContainerEvent
This class generates container-level events.
Class UIEvent
This is the class for all the JDK 1.1 events defined in the com.ms.ui package.
Class UIFocusAdapter
This class is the listener adapter for receiving focus events on an IUIComponent.
Class UIFocusEvent
This class represents the component-level focus event.
Class UIInputEvent
This is the root event class for all component-level input events.
Class UIItemAdapter
This class is the listener adapter for receiving item events.
Class UIItemEvent
This class generates an event when an item is selected or cleared.
Class UIKeyAdapter
This class is the listener adapter class for receiving keyboard events.
Class UIKeyEvent
This class generates IUIComponent keyboard events.
Class UIMouseAdapter
This class is the listener adapter for receiving mouse events on a IUIComponent.
Class UIMouseEvent
This class generates mouse events.
Class UIMouseMotionAdapter
This abstract class functions as a MouseMotion Listener.
Class UITextAdapter
This class is the listener adapter for receiving text events.
Class UITextEvent
This class represents a text event.
Class UIWindowAdapter
This class is the listener adapter for receiving UIComponent events.
Class UIWindowEvent
This class represents a window event and is generated for notification purposes when events changes occur to a top level window.

Interfaces

Interface IUIActionListener
This listener interface receives action events.
Interface IUIAdjustmentListener
This interface receives adjustment events.
Interface IUIBaseEventListener
This interface is a tagging interface that all com.ms.ui.event listener interfaces extend from.
Interface IUIContainerListener
This listener interface receives container events.
Interface IUIFocusListener
This listener interface defines methods that determine when an IUIComponent receives or loses keyboard focus.
Interface IUIItemListener
This interface receives item events.
Interface IUIKeyListener
This listener interface receives keyboard events.
Interface IUIMouseListener
This listener interface receives mouse events on a IUIComponent.
Interface IUIMouseMotionListener
This listener interface receives mouse motion events on a IUIComponent.
Interface IUITextListener
This listener interface receives adjustment events.
Interface IUIWindowListener
This listener interface receives window events.

Hierarchy

Object
  |
  +--UIActionAdapter (IUIActionListener)
  |
  +--UIAdjustmentAdapter (IUIAdjustmentListener)
  |
  +--UIContainerAdapter (IUIContainerListener)
  |
  +--UIFocusAdapter (IUIFocusListener)
  |
  +--UIItemAdapter (IUIItemListener)
  |
  +--UIKeyAdapter (IUIKeyListener)
  |
  +--UIMouseAdapter (IUIMouseListener)
  |
  +--UIMouseMotionAdapter (IUIMouseMotionListener)
  |
  +--UITextAdapter (IUITextListener)
  |
  +--UIWindowAdapter (IUIWindowListener)

EventObject
  |
  +--UIBaseEvent
     |
     +--UIEvent
        |
        +--UIActionEvent
        |
        +--UIAdjustmentEvent
        |
        +--UIContainerEvent
        |
        +--UIFocusEvent
        |
        +--UIInputEvent
        |  |
        |  +--UIKeyEvent
        |  |
        |  +--UIMouseEvent
        |
        +--UIItemEvent
        |
        +--UITextEvent
        |
        +--UIWindowEvent

IUIActionListener
IUIBaseEventListener
IUIAdjustmentListener
IUIContainerListener
IUIFocusListener
IUIItemListener
IUIKeyListener
IUIMouseListener
IUIMouseMotionListener
IUITextListener
IUIWindowListener


Class UIActionAdapter

public abstract class UIActionAdapter implements
            IUIActionListener
{
  // Methods
  public void actionPerformed(UIActionEvent e);
}

This class is the adapter class for receiving action events.

Methods

actionPerformed

public void actionPerformed(UIActionEvent e);

Invoked when an action occurs.

Return Value:

No return value.

Parameter | Description
e | The ACTION_PERFORMED event that was posted.


Class UIActionEvent

public class UIActionEvent extends UIEvent
{
  // Fields
  public static final int ACTION_PERFORMED;

  // Constructors
  public UIActionEvent(Object source, int id, IUIComponent item,
        String command);
  public UIActionEvent(Object source, int id, IUIComponent item,
        String command, int modifiers);

  // Methods
  public String getActionCommand();
  public IUIComponent getActionItem();
  public int getModifiers();
  public String paramString();
}

This class represents the action semantic event.

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent
      |
      +--UIActionEvent

Constructors

UIActionEvent

public UIActionEvent(Object source, int id, IUIComponent item,
        String command);

Creates a UIActionEvent object with the specified source object.

Parameter | Description
source | The object where the event originated.
id | The type of event.
item | The item originating the event (command string).
command | The command string for this action event.

UIActionEvent

public UIActionEvent(Object source, int id, IUIComponent item,
        String command, int modifiers);

Creates a UIActionEvent object with the specified source object.

Parameter | Description
source | The object where the event originated.
id | The type of event.
item | The item originating the event (command string).
command | The command string for this action event.
modifiers | The modifiers held down during this action (See UIInputEvent)

Methods

getActionCommand

public String getActionCommand();

Retrieves the command name associated with the action.

Return Value:

Returns the command name associated with the action.

getActionItem

public IUIComponent getActionItem();

Retrieves the IUIComponent item associated with the action.

Return Value:

Returns the component object associated with the action.

getModifiers

public int getModifiers();

Retrieves the modifier keys (or buttons) pressed during the action event.

Return Value:

Returns the modifiers. This can be one or a combination of the following:
SHIFT_MASK CTRL_MASK META_MASK ALT_MASK
BUTTON1_MASK BUTTON2_MASK BUTTON3_MASK

paramString

public String paramString();

This method is used internally by the toString method.

Return Value:

Returns a formatted String object that assists with textual representation of the exception.

Fields

ACTION_PERFORMED
An action performed event type.


Class UIAdjustmentAdapter

public abstract class UIAdjustmentAdapter implements
            IUIAdjustmentListener
{
  // Methods
  public void adjustmentValueChanged(UIAdjustmentEvent e);
}

This class is the listener adapter for receiving adjustment events.

Methods

adjustmentValueChanged

public void adjustmentValueChanged(UIAdjustmentEvent e);

Invoked when the value of the IUIScoll component has changed.

Return Value:

No return value.

Parameter | Description
e | The ADJUSTMENT_VALUE_CHNAGED event that was posted.


Class UIAdjustmentEvent

public class UIAdjustmentEvent extends UIEvent
{
  // Fields
  public static final int ADJUSTMENT_VALUE_CHANGED;
  public static final int BLOCK_DECREMENT;
  public static final int BLOCK_INCREMENT;
  public static final int TRACK;
  public static final int UNIT_DECREMENT;
  public static final int UNIT_INCREMENT;

  // Constructors
  public UIAdjustmentEvent(IUIComponent source, int id, int type,
        int value);

  // Methods
  public int getAdjustmentType();
  public int getValue();
  public String paramString();
}

This class represents the adjustment event emitted by components implementing IUIScroll.

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent
      |
      +--UIAdjustmentEvent

Constructors

UIAdjustmentEvent

public UIAdjustmentEvent(IUIComponent source, int id, int type, int value);

Creates a UIAdjustmentEvent object with the specified IUIScroll source, type, and value.

Parameter | Description
source | The IUIScroll object where the event originated.
id | The event type.
type | The adjustment type.
value | The current value of the adjustment.

Methods

getAdjustmentType

public int getAdjustmentType();

Retrieves the type of adjustment that caused the value changed event.

Return Value:

Returns one of the following adjustment types.
UNIT_INCREMENT UNIT_DECREMENT BLOCK_INCREMENT BLOCK_DECREMENT TRACK

getValue

public int getValue();

Retrieves the current value in the adjustment event.

Return Value:

Returns the value in the event.

paramString

public String paramString();

This method is used internally by the toString method.

Return Value:

Returns a formatted String object that assists with textual representation of the exception.

Fields

ADJUSTMENT_VALUE_CHANGED
The adjustment value changed event.
BLOCK_DECREMENT
The block decrement adjustment type.
BLOCK_INCREMENT
The block increment adjustment type.
TRACK
The absolute tracking adjustment type.
UNIT_DECREMENT
The unit decrement adjustment type.
UNIT_INCREMENT
The unit increment adjustment type.


Class UIBaseEvent

public class UIBaseEvent extends java.util.EventObject
{
  // Constructors
  public UIBaseEvent(Object source,int id);

  // Methods
  public int getID();
  public Object getSource();
  public String paramString();
  public String toString();
}

This class represents the base event for all JDK 1.1 events and defines base level functionality of events.

EventObject
  |
  +--UIBaseEvent

Constructors

UIBaseEvent

public UIBaseEvent(Object source,int id);

Creates a basic event.

Parameter | Description
source | The object where the event originated.
id | The event type.

Methods

getID

public int getID();

Retrieves the identifier of the event.

Return Value:

Returns the identifier.

getSource

public Object getSource();

Retrieves the object that is the target of the event.

Return Value:

Returns the object that is the target of this event.

paramString

public String paramString();

This method is used internally by the toString method.

Return Value:

Returns a formatted String object that assists with textual representation of the exception.

toString

public String toString();

Retrieves a string representation of the event.

Return Value:

Returns a String object representation of the exception.


Class UIContainerAdapter

public abstract class UIContainerAdapter implements
            IUIContainerListener
{
  // Methods
  public void componentAdded(UIContainerEvent e);
  public void componentRemoved(UIContainerEvent e);
}

This interface is the listener interface for receiving container events. Container events are provided for notification purposes only.

Methods

componentAdded

public void componentAdded(UIContainerEvent e);

Invoked when a component has been added to the container.

Return Value:

No return value.

Parameter | Description
e | The COMPONENT_ADDED event that was posted.

componentRemoved

public void componentRemoved(UIContainerEvent e);

Invoked when a component has been removed from the container.

Return Value:

No return value.

Parameter | Description
e | The COMPONENT_REMOVED event that was posted.


Class UIContainerEvent

public class UIContainerEvent extends UIEvent
{
  // Fields
  public static final int COMPONENT_ADDED;
  public static final int COMPONENT_REMOVED;

  // Constructors
  public UIContainerEvent(IUIComponent source, int id, IUIComponent
        child);

  // Methods
  public IUIComponent getChild();
  public IUIContainer getContainer();
  public String paramString();
}

This class generates container-level events. These events are provided for notification purposes only.

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent
      |
      +--UIContainerEvent

Constructors

UIContainerEvent

public UIContainerEvent(IUIComponent source, int id, IUIComponent child);

Constructs a UIContainerEvent object with the specified source container, type, and child that is being added or removed.

Parameter | Description
source | The IUIComponent where the event originated.
id | The event type. This may be either COMPONENT_ADDED or COMPONENT_REMOVED.
child | The child IUIComponent.

Methods

getChild

public IUIComponent getChild();

Retrieves the child component that was added or removed in this event.

Return Value:

Returns the child IUIComponent.

getContainer

public IUIContainer getContainer();

Retrieves the container where this event originated.

Return Value:

Returns the IUIContainer where the event originated.

paramString

public String paramString();

This method is used internally by the toString method.

Return Value:

Returns a formatted String object that assists with textual representation of the exception.

Fields

COMPONENT_ADDED
An event identifier that signifies a component was added to a container.
COMPONENT_REMOVED
An event identifier that signifies a component was removed from a container.


Class UIEvent

public abstract class UIEvent extends UIBaseEvent
{
  // Fields
  public static final int ACTION_EVENT_BASE;
  public final static long ACTION_EVENT_MASK;
  public static final int ADJUST_EVENT_BASE;
  public final static long ADJUSTMENT_EVENT_MASK;
  public static final int CONTAINER_EVENT_BASE;
  public final static long CONTAINER_EVENT_MASK;
  public static final int FOCUS_EVENT_BASE;
  public final static long FOCUS_EVENT_MASK;
  public static final int ITEM_EVENT_BASE;
  public final static long ITEM_EVENT_MASK;
  public static final int KEY_EVENT_BASE;
  public final static long KEY_EVENT_MASK;
  public static final int MOUSE_EVENT_BASE;
  public final static long MOUSE_EVENT_MASK;
  public final static long MOUSE_MOTION_EVENT_MASK;
  public final static int RESERVED_ID_MAX;
  public static final int TEXT_EVENT_BASE;
  public final static long TEXT_EVENT_MASK;
  public static final int WINDOW_EVENT_BASE;
  public final static long WINDOW_EVENT_MASK;

  // Constructors
  public UIEvent(Object source, int id);
}

This is the class for all the JDK 1.1 events defined in the com.ms.ui package. This class defines the base level functionality of UI events. UIEvent objects are defined to match their AWT counterparts.

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent

Constructors

UIEvent

public UIEvent(Object source, int id);

Creates a UIEvent object with the specified source object and type.

Parameter | Description
source | The object where the event originated.
id | The event type.

Fields

ACTION_EVENT_BASE
The base identifier for all UIActionEvent events.
ACTION_EVENT_MASK
The event mask for selecting action events.
ADJUST_EVENT_BASE
The base identifier for all UIAdjustmentEvent events.
ADJUSTMENT_EVENT_MASK
The event mask for selecting adjustment events.
CONTAINER_EVENT_BASE
The base identifier for all UIContainerEvent events.
CONTAINER_EVENT_MASK
The event mask for selecting container events.
FOCUS_EVENT_BASE
The base identifier for all UIFocusEvent events.
FOCUS_EVENT_MASK
The event mask for selecting focus events.
ITEM_EVENT_BASE
The base identifier for all UIItemEvent events.
ITEM_EVENT_MASK
The event mask for selecting item events.
KEY_EVENT_BASE
The base identifier for all UIKeyEvent events.
KEY_EVENT_MASK
The event mask for selecting key events.
MOUSE_EVENT_BASE
The base identifier for all UIMouseEvent events.
MOUSE_EVENT_MASK
The event mask for selecting mouse events.
MOUSE_MOTION_EVENT_MASK
The event mask for selecting mouse motion events.
RESERVED_ID_MAX
The maximum value for reserved UI event identifiers. Programs defining their own event identifiers should use identifiers greater than this value. AFC reserves above AWTEvent.RESERVED_ID_MAX for internally used custom events.
TEXT_EVENT_BASE
The base identifier for all UITextEvent events.
TEXT_EVENT_MASK
The event mask for selecting text events.
WINDOW_EVENT_BASE
The base identifier for all UIWindowEvent events.
WINDOW_EVENT_MASK
The event mask for selecting window events.


Class UIFocusAdapter

public abstract class UIFocusAdapter implements
            IUIFocusListener
{
  // Methods
  public void focusGained(UIFocusEvent e);
  public void focusLost(UIFocusEvent e);
}

This class is the listener adapter for receiving focus events on an IUIComponent.

Methods

focusGained

public void focusGained(UIFocusEvent e);

Invoked when a IUIComponent gains the keyboard focus.

Return Value:

No return value.

Parameter | Description
e | The FOCUS_GAINED event that was posted.

focusLost

public void focusLost(UIFocusEvent e);

Invoked when a IUIComponent loses the keyboard focus.

Return Value:

No return value.

Parameter | Description
e | The FOCUS_LOST event that was posted.


Class UIFocusEvent

public class UIFocusEvent extends UIEvent
{
  // Fields
  public static final int FOCUS_GAINED;
  public static final int FOCUS_LOST;

  // Constructors
  public UIFocusEvent(IUIComponent source, int id);
  public UIFocusEvent(IUIComponent source, int id,
        IUIComponent arg);
  public UIFocusEvent(IUIComponent source, int id,
        boolean temporary);
  public UIFocusEvent(IUIComponent source, int id,
        IUIComponent arg, boolean temporary);

  // Methods
  public IUIComponent getArg();
  public boolean isTemporary();
  public String paramString();
}

This class represents the component-level focus event. Focus change events occur when focus is moved directly from one component to another, such as through calls to requestFocus or as the user presses the TAB key to traverse components.

Focus events are delivered by using the FOCUS_GAINED and FOCUS_LOST event identifiers.

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent
      |
      +--UIFocusEvent

Constructors

UIFocusEvent

public UIFocusEvent(IUIComponent source, int id);

Creates a permanent-level UIFocusEvent object with the specified source component and type.

Parameter | Description
source | The object where the event originated.
id | The event type.

UIFocusEvent

public UIFocusEvent(IUIComponent source, int id, IUIComponent arg);

Creates a permanent-level UIFocusEvent object with the specified source component and type.

Parameter | Description
source | The object where the event originated.
id | The event type.
arg | The target object of the event.

Remarks:

If the identifier is FOCUS_GAINED, the arg component is the component that loses focus. If the identifier is FOCUS_LOST, the arg component is the component that gains focus.

UIFocusEvent

public UIFocusEvent(IUIComponent source, int id, boolean temporary);

Creates a UIFocusEvent object with the specified source component, type, and whether the focus event is a temporary level event.

Parameter | Description
source | The object where the event originated.
id | The event type.
temporary | Set to true if the focus change is temporary.

UIFocusEvent

public UIFocusEvent(IUIComponent source, int id, IUIComponent arg,
        boolean temporary);

Creates a UIFocusEvent object with the specified source component, type, and whether the focus event is a temporary level event.

Parameter | Description
source | The object where the event originated.
id | The event type.
arg | The target object of the event.
temporary | Set to true if the focus change is temporary.

Remarks:

If the identifier is FOCUS_GAINED, the arg component is the component that loses focus. If the identifier is FOCUS_LOST, the arg component is the component that gains focus.

Methods

getArg

public IUIComponent getArg();

Retrieves the target component of the event.

Return Value:

Returns the target IUIComponent of the event.

Remarks:

If the identifier is FOCUS_GAINED, the returned component is the component that loses focus. If the identifier is FOCUS_LOST, the returned component is the component that gains focus.

isTemporary

public boolean isTemporary();

Determines whether this focus change event is a temporary change. Temporary focus change events occur when focus is temporarily gained or lost for a component as the indirect result of another operation, such as window deactivation or a scroll bar drag.

Return Value:

Returns true if the focus change event is a temporary one.

paramString

public String paramString();

This method is used internally by the toString method.

Return Value:

Returns a formatted String object that assists with textual representation of the exception.

See Also: com.ms.ui.event.UIBaseEvent.toString

Fields

FOCUS_GAINED
The focus gained event type.
FOCUS_LOST
The focus lost event type.


Class UIInputEvent

public abstract class UIInputEvent extends UIEvent
{
  // Fields
  public static final int ALT_MASK;
  public static final int BUTTON1_MASK;
  public static final int BUTTON2_MASK;
  public static final int BUTTON3_MASK;
  public static final int CTRL_MASK;
  public static final int META_MASK;
  public static final int SHIFT_MASK;

  // Constructors
  public UIInputEvent(IUIComponent source,int id,long when,
        int modifiers);

  // Methods
  public boolean consume();
  public int getModifiers();
  public long getWhen();
  public boolean isAltDown();
  public boolean isConsumed();
  public boolean isControlDown();
  public boolean isMetaDown();
  public boolean isShiftDown();
}

This is the root event class for all component-level input events. Input events are delivered to listeners before they are processed normally by the source where they originated. This allows listeners and component subclasses to consume the event so that the source will not process them in their default manner. All of the constant values defined match the AWT event definitions.

UIInputEvent also allows a Listener to "consume" an input (key or mouse) event before passing it to the underlying UIComponent.

Also see consume, UIinputEvent

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent
      |
      +--UIInputEvent

Constructors

UIInputEvent

public UIInputEvent(IUIComponent source,int id,long when, int modifiers);

Creates a UIInputEvent object with the specified source IUIComponent, modifiers, and type.

Parameter | Description
source | The object where the event originated.
id | The event type.
when | The time the event occurred.
modifiers | The modifier keys down while event occurred.

Methods

consume

public boolean consume();

Consumes the input event so its not processed by the underlying IUIComponent. This is implemented for the UIEdit control. Key and mouse events may also be consumed by other com.ms.ui components, but not always consistently. This is because some components pass events to other, underlying components, which handle the event.

Return Value:

Returns true if the event is not passed to the underlying component.

See Also: isConsumed

getModifiers

public int getModifiers();

Retrieves the modifiers flag of the event.

Return Value:

Returns the modifiers flag of the event. This can be one or a combination of the following.
SHIFT_MASK CTRL_MASK META_MASK ALT_MASK
BUTTON1_MASK BUTTON2_MASK BUTTON3_MASK

getWhen

public long getWhen();

Retrieves the timestamp of the event.

Return Value:

Returns the timestamp of the event.

isAltDown

public boolean isAltDown();

Returns whether the ALT key is pressed for this event.

Return Value:

Returns true if the ALT key is pressed.

isConsumed

public boolean isConsumed();

Determines the current consume state of the input event.

Return Value:

Returns true if the event is not passed to the underlying component; otherwise, returns false.

See Also: consume

isControlDown

public boolean isControlDown();

Returns whether the CTRL key is pressed for this event.

Return Value:

Returns true if the CTRL key is pressed.

isMetaDown

public boolean isMetaDown();

Returns whether the Meta modifier is pressed for this event.

Return Value:

Returns true if the Meta modifier is pressed.

isShiftDown

public boolean isShiftDown();

Determines whether the SHIFT key is pressed for this event.

Return Value:

Returns true if the SHIFT key is pressed.

Fields

ALT_MASK
The ALT key modifier constant.
BUTTON1_MASK
The left mouse button modifier constant.
BUTTON2_MASK
The right mouse button modifier constant.
BUTTON3_MASK
The third mouse button modifier constant.
CTRL_MASK
The CONTROL key modifier constant.
META_MASK
The Meta key modifier constant.
SHIFT_MASK
The SHIFT key modifier constant.


Class UIItemAdapter

public abstract class UIItemAdapter implements IUIItemListener
{
  // Methods
  public void itemStateChanged(UIItemEvent e);
}

This class is the listener adapter for receiving item events.

Methods

itemStateChanged

public void itemStateChanged(UIItemEvent e);

Invoked when an item's state has been changed.

Return Value:

No return value.

Parameter | Description
e | The ITEM_STATE_CHANGED event that was posted.


Class UIItemEvent

public class UIItemEvent extends UIEvent
{
  // Fields
  public static final int DESELECTED;
  public static final int ITEM_STATE_CHANGED;
  public static final int SELECTED;

  // Constructors
  public UIItemEvent(IUIComponent source, int id, Object item,
        int stateChange);

  // Methods
  public Object getItem();
  public IUIComponent getItemSelectable();
  public int getStateChange();
  public String paramString();
}

This class generates an event when an item is selected or cleared.

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent
      |
      +--UIItemEvent

Constructors

UIItemEvent

public UIItemEvent(IUIComponent source, int id, Object item,
        int stateChange);

Creates a ItemSelectEvent object with the specified IUIComponent source, type, item, and item select state.

Parameter | Description
source | The IUIComponent object where the event originated.
id | The event type.
item | The item where the event occurred.
stateChange | The state change type that caused the event.

Methods

getItem

public Object getItem();

Retrieves the object where the event occurred.

Return Value:

Returns the object where the event occurred.

getItemSelectable

public IUIComponent getItemSelectable();

Retrieves the IUIComponent object where the event originated.

Return Value:

Returns the component where the event originated.

getStateChange

public int getStateChange();

Retrieves the state change type that generated the event.

Return Value:

Returns the state change. This may be either SELECTED or DESELECTED.

paramString

public String paramString();

This method is used internally by the toString method.

Return Value:

Returns a formatted String object that assists with textual representation of the exception.

Fields

DESELECTED
The item cleared state change type.
ITEM_STATE_CHANGED
The item state changed event type.
SELECTED
The item selected state change type.


Class UIKeyAdapter

public abstract class UIKeyAdapter implements IUIKeyListener
{
  // Methods
  public void keyPressed(UIKeyEvent e);
  public void keyReleased(UIKeyEvent e);
  public void keyTyped(UIKeyEvent e);
}

This class is the listener adapter class for receiving keyboard events.

Methods

keyPressed

public void keyPressed(UIKeyEvent e);

Invoked when a key is pressed.

Return Value:

No return value.

Parameter | Description
e | The KEY_PRESSED key event.

keyReleased

public void keyReleased(UIKeyEvent e);

Invoked when a key is released.

Return Value:

No return value.

Parameter | Description
e | The KEY_RELEASED key event.

keyTyped

public void keyTyped(UIKeyEvent e);

Invoked when a key is typed. This event occurs when a key press is followed by a key release.

Return Value:

No return value.

Parameter | Description
e | The KEY_TYPED key event.


Class UIKeyEvent

public class UIKeyEvent extends UIInputEvent
{
  // Fields
  public static final char CHAR_UNDEFINED;
  public static final int KEY_EVENT_BASE;
  public static final int KEY_PRESSED;
  public static final int KEY_RELEASED;
  public static final int KEY_TYPED;
  public static final int VK_0;
  public static final int VK_1;
  public static final int VK_2;
  public static final int VK_3;
  public static final int VK_4;
  public static final int VK_5;
  public static final int VK_6;
  public static final int VK_7;
  public static final int VK_8;
  public static final int VK_9;
  public static final int VK_A;
  public static final int VK_ACCEPT;
  public static final int VK_ADD;
  public static final int VK_ALT;
  public static final int VK_B;
  public static final int VK_BACK_QUOTE;
  public static final int VK_BACK_SLASH;
  public static final int VK_BACK_SPACE;
  public static final int VK_C;
  public static final int VK_CANCEL;
  public static final int VK_CAPS_LOCK;
  public static final int VK_CLEAR;
  public static final int VK_CLOSE_BRACKET;
  public static final int VK_COMMA;
  public static final int VK_CONTROL;
  public static final int VK_CONVERT;
  public static final int VK_D;
  public static final int VK_DECIMAL;
  public static final int VK_DELETE;
  public static final int VK_DIVIDE;
  public static final int VK_DOWN;
  public static final int VK_E;
  public static final int VK_END;
  public static final int VK_ENTER;
  public static final int VK_EQUALS;
  public static final int VK_ESCAPE;
  public static final int VK_F;
  public static final int VK_F1;
  public static final int VK_F10;
  public static final int VK_F11;
  public static final int VK_F12;
  public static final int VK_F2;
  public static final int VK_F3;
  public static final int VK_F4;
  public static final int VK_F5;
  public static final int VK_F6;
  public static final int VK_F7;
  public static final int VK_F8;
  public static final int VK_F9;
  public static final int VK_FINAL;
  public static final int VK_G;
  public static final int VK_H;
  public static final int VK_HELP;
  public static final int VK_HOME;
  public static final int VK_I;
  public static final int VK_INSERT;
  public static final int VK_J;
  public static final int VK_K;
  public static final int VK_KANA;
  public static final int VK_KANJI;
  public static final int VK_L;
  public static final int VK_LEFT;
  public static final int VK_M;
  public static final int VK_META;
  public static final int VK_MODECHANGE;
  public static final int VK_MULTIPLY;
  public static final int VK_N;
  public static final int VK_NONCONVERT;
  public static final int VK_NUM_LOCK;
  public static final int VK_NUMPAD0;
  public static final int VK_NUMPAD1;
  public static final int VK_NUMPAD2;
  public static final int VK_NUMPAD3;
  public static final int VK_NUMPAD4;
  public static final int VK_NUMPAD5;
  public static final int VK_NUMPAD6;
  public static final int VK_NUMPAD7;
  public static final int VK_NUMPAD8;
  public static final int VK_NUMPAD9;
  public static final int VK_O;
  public static final int VK_OPEN_BRACKET;
  public static final int VK_P;
  public static final int VK_PAGE_DOWN;
  public static final int VK_PAGE_UP;
  public static final int VK_PAUSE;
  public static final int VK_PERIOD;
  public static final int VK_PRINTSCREEN;
  public static final int VK_Q;
  public static final int VK_QUOTE;
  public static final int VK_R;
  public static final int VK_RIGHT;
  public static final int VK_S;
  public static final int VK_SCROLL_LOCK;
  public static final int VK_SEMICOLON;
  public static final int VK_SEPARATER;
  public static final int VK_SHIFT;
  public static final int VK_SLASH;
  public static final int VK_SPACE;
  public static final int VK_SUBTRACT;
  public static final int VK_T;
  public static final int VK_TAB;
  public static final int VK_U;
  public static final int VK_UNDEFINED;
  public static final int VK_UP;
  public static final int VK_V;
  public static final int VK_W;
  public static final int VK_X;
  public static final int VK_Y;
  public static final int VK_Z;

  // Constructors
  public UIKeyEvent(IUIComponent source, int id, long when,
        int modifiers, int keyCode, char keyChar);

  // Methods
  public char getKeyChar();
  public int getKeyCode();
  public boolean isActionKey();
  public String paramString();
}

This class generates IUIComponent keyboard events.

The Virtual key codes report which keyboard key has been pressed, rather than any character generated by one or more keys being pressed.

For example, pressing the SHIFT key causes a KEY_PRESSED event with a VK_SHIFT keyCode, and pressing the A key results in a VK_A keyCode. After the A key is released, a KEY_RELEASED event will be fired with VK_A, followed by a KEY_TYPED event with a keyChar value of "A." Key combinations that do not result in characters (such as action keys like F1) will not generate KEY_TYPED events.

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent
      |
      +--UIInputEvent
        |
        +--UIKeyEvent

Constructors

UIKeyEvent

public UIKeyEvent(IUIComponent source, int id, long when, int modifiers,
        int keyCode, char keyChar);

Creates a UIKeyEvent object with the specified source IUIComponent, type, modifiers, and key.

Parameter | Description
source | The object where the event originated.
id | The event type.
when | The time the event occurred.
modifiers | The modifier keys down during the event.
keyCode | The integer code representing the key of the event.
keyChar | Either the Unicode character generated by the event or NULL.

Methods

getKeyChar

public char getKeyChar();

Retrieves the character associated with the key in this event. If no valid Unicode character exists for this key event, keyChar is CHAR_UNDEFINED.

Return Value:

Returns the keyChar of the key that generated the event.

getKeyCode

public int getKeyCode();

Retrieves the integer key code associated with the key in the event. For KEY_TYPED events, the keyCode is VK_UNDEFINED.

Return Value:

Returns the keyCode of the key that generated the event.

isActionKey

public boolean isActionKey();

Determines whether the key in this event is an action key.

Return Value:

Returns true if the key that generated the event is an action key.

paramString

public String paramString();

This method is used internally by the toString method.

Return Value:

Returns a formatted String object that assists with textual representation of the exception.

Fields

CHAR_UNDEFINED
A flag for KEY_PRESSED and KEY_RELEASED events, which do not map to a valid Unicode character.
KEY_EVENT_BASE
The base identifier for all UIKeyEvent events.
KEY_PRESSED
The key pressed event type.
KEY_RELEASED
The key released event type.
KEY_TYPED
The key typed event type, which is generated by a combination of a key press followed by a key release.
VK_0
VK_0 through VK_9 are the same as ASCII "0" through "9" (0x30 - 0x39).
VK_1
A virtual key code for the ASCII "1" key.
VK_2
A virtual key code for the ASCII "2" key.
VK_3
A virtual key code for the ASCII "3" key.
VK_4
A virtual key code for the ASCII "4" key.
VK_5
A virtual key code for the ASCII "5" key.
VK_6
A virtual key code for the ASCII "6" key.
VK_7
A virtual key code for the ASCII "7" key.
VK_8
A virtual key code for the ASCII "8" key.
VK_9
A virtual key code for the ASCII "9" key.
VK_A
VK_A through VK_Z are the same as ASCII "A" through "Z" (0x41 - 0x5A).
VK_ACCEPT
For Asian keyboards.
VK_ADD
A virtual key code for the numeric keypad PLUS SIGN (+) key.
VK_ALT
A virtual key code for the ALT key.
VK_B
A virtual key code for the ASCII "B" key.
VK_BACK_QUOTE
A virtual key code for the apostrophe (`) key.
VK_BACK_SLASH
A virtual key code for the BACKSLASH (\) key.
VK_BACK_SPACE
A virtual key code for the BACKSPACE key.
VK_C
A virtual key code for the ASCII "C" key.
VK_CANCEL
A virtual key code for the CANCEL key.
VK_CAPS_LOCK
A virtual key code for the CAPS LOCK key.
VK_CLEAR
A virtual key code for the CLEAR key.
VK_CLOSE_BRACKET
A virtual key code for the CLOSE BRACKET (]) key.
VK_COMMA
A virtual key code for the COMMA (,) key.
VK_CONTROL
A virtual key code for the CTRL key.
VK_CONVERT
For Asian keyboards.
VK_D
A virtual key code for the ASCII "D" key.
VK_DECIMAL
A virtual key code for the numeric keypad DECIMAL POINT (.) key.
VK_DELETE
A virtual key code for the DELETE key.
VK_DIVIDE
A virtual key code for the numeric keypad DIVISION (/) key.
VK_DOWN
A virtual key code for the DOWN ARROW key.
VK_E
A virtual key code for the ASCII "E" key.
VK_END
A virtual key code for the END key.
VK_ENTER
A virtual key code for the ENTER key.
VK_EQUALS
A virtual key code for the EQUAL SIGN (=) key.
VK_ESCAPE
A virtual key code for the ESC key.
VK_F
A virtual key code for the ASCII "F" key.
VK_F1
A virtual key code for the F1 key.
VK_F10
A virtual key code for the F10 key.
VK_F11
A virtual key code for the F11 key.
VK_F12
A virtual key code for the F12 key.
VK_F2
A virtual key code for the F2 key.
VK_F3
A virtual key code for the F3 key.
VK_F4
A virtual key code for the F4 key.
VK_F5
A virtual key code for the F5 key.
VK_F6
A virtual key code for the F6 key.
VK_F7
A virtual key code for the F7 key.
VK_F8
A virtual key code for the F8 key.
VK_F9
A virtual key code for the F9 key.
VK_FINAL
For Asian keyboards.
VK_G
A virtual key code for the ASCII "G" key.
VK_H
A virtual key code for the ASCII "H" key.
VK_HELP
A virtual key code for the HELP key.
VK_HOME
A virtual key code for the HOME key.
VK_I
A virtual key code for the ASCII "I" key.
VK_INSERT
A virtual key code for the INSERT key.
VK_J
A virtual key code for the ASCII "J" key.
VK_K
A virtual key code for the ASCII "K" key.
VK_KANA
For Asian keyboards.
VK_KANJI
For Asian keyboards.
VK_L
A virtual key code for the ASCII "L" key.
VK_LEFT
A virtual key code for the LEFT ARROW key.
VK_M
A virtual key code for the ASCII "M" key.
VK_META
A virtual key code for the Application key (found on Microsoft® Windows® 95 keyboards).
VK_MODECHANGE
For Asian keyboards.
VK_MULTIPLY
A virtual key code for the numeric keypad MULTIPLICATION (*) key.
VK_N
A virtual key code for the ASCII "N" key.
VK_NONCONVERT
For Asian keyboards.
VK_NUM_LOCK
A virtual key code for the NUM LOCK key.
VK_NUMPAD0
A virtual key code for the numeric keypad "0" key.
VK_NUMPAD1
A virtual key code for the numeric keypad "1" key.
VK_NUMPAD2
A virtual key code for the numeric keypad "2" key.
VK_NUMPAD3
A virtual key code for the numeric keypad "3" key.
VK_NUMPAD4
A virtual key code for the numeric keypad "4" key.
VK_NUMPAD5
A virtual key code for the numeric keypad "5" key.
VK_NUMPAD6
A virtual key code for the numeric keypad "6" key.
VK_NUMPAD7
A virtual key code for the numeric keypad "7" key.
VK_NUMPAD8
A virtual key code for the numeric keypad "8" key.
VK_NUMPAD9
A virtual key code for the numeric keypad "9" key.
VK_O
A virtual key code for the ASCII "O" key.
VK_OPEN_BRACKET
A virtual key code for the OPEN BRACKET ([) key.
VK_P
A virtual key code for the ASCII "P" key.
VK_PAGE_DOWN
A virtual key code for the PAGE DOWN key.
VK_PAGE_UP
A virtual key code for the PAGE UP key.
VK_PAUSE
A virtual key code for the PAUSE (BREAK) key.
VK_PERIOD
A virtual key code for the PERIOD (.) key.
VK_PRINTSCREEN
A virtual key code for the PRINT SCREEN key.
VK_Q
A virtual key code for the ASCII "Q" key.
VK_QUOTE
A virtual key code for the QUOTATION MARK key.
VK_R
A virtual key code for the ASCII "R" key.
VK_RIGHT
A virtual key code for the RIGHT ARROW key.
VK_S
A virtual key code for the ASCII "S" key.
VK_SCROLL_LOCK
A virtual key code for the SCROLL LOCK key.
VK_SEMICOLON
A virtual key code for the SEMICOLON (;) key.
VK_SEPARATER
VK_SHIFT
A virtual key code for the SHIFT key.
VK_SLASH
A virtual key code for the forward slash (/) key.
VK_SPACE
A virtual key code for the SPACEBAR key.
VK_SUBTRACT
A virtual key code for the numeric keypad MINUS SIGN (-) key.
VK_T
A virtual key code for the ASCII "T" key.
VK_TAB
A virtual key code for the TAB key.
VK_U
A virtual key code for the ASCII "U" key.
VK_UNDEFINED
KEY_TYPED events do not have a defined key code.
VK_UP
A virtual key code for the UP ARROW key.
VK_V
A virtual key code for the ASCII "V" key.
VK_W
A virtual key code for the ASCII "W" key.
VK_X
A virtual key code for the ASCII "X" key.
VK_Y
A virtual key code for the ASCII "Y" key.
VK_Z
A virtual key code for the ASCII "Z" key.


Class UIMouseAdapter

public abstract class UIMouseAdapter implements
            IUIMouseListener
{
  // Methods
  public void mouseClicked(UIMouseEvent e);
  public void mouseEntered(UIMouseEvent e);
  public void mouseExited(UIMouseEvent e);
  public void mousePressed(UIMouseEvent e);
  public void mouseReleased(UIMouseEvent e);
}

This class is the listener adapter for receiving mouse events on a IUIComponent.

Methods

mouseClicked

public void mouseClicked(UIMouseEvent e);

Invoked when the mouse has been clicked on a IUIComponent.

Return Value:

No return value.

Parameter | Description
e | The MOUSE_CLICKED mouse button event that was posted.

mouseEntered

public void mouseEntered(UIMouseEvent e);

Invoked when the mouse enters a IUIComponent.

Return Value:

No return value.

Parameter | Description
e | The MOUSE_ENTERED mouse event that was posted.

mouseExited

public void mouseExited(UIMouseEvent e);

Invoked when the mouse exits a IUIComponent.

Return Value:

No return value.

Parameter | Description
e | The MOUSE_EXITED mouse event that was posted.

mousePressed

public void mousePressed(UIMouseEvent e);

Invoked when a mouse button has been pressed on a IUIComponent.

Return Value:

No return value.

Parameter | Description
e | The MOUSE_PRESSED mouse button event that was posted.

mouseReleased

public void mouseReleased(UIMouseEvent e);

Invoked when a mouse button has been released on a IUIComponent.

Return Value:

No return value.

Parameter | Description
e | The MOUSE_RELEASED mouse button event that was posted.


Class UIMouseEvent

public class UIMouseEvent extends UIInputEvent
{
  // Fields
  public static final int MOUSE_CLICKED;
  public static final int MOUSE_DRAGGED;
  public static final int MOUSE_ENTERED;
  public static final int MOUSE_EVENT_BASE;
  public static final int MOUSE_EXITED;
  public static final int MOUSE_MOVED;
  public static final int MOUSE_PRESSED;
  public static final int MOUSE_RELEASED;

  // Constructors
  public UIMouseEvent(IUIComponent source, int id, long when,
        int modifiers, int x, int y, int clickCount,
        boolean popupTrigger);

  // Methods
  public int getClickCount();
  public synchronized Point getPoint();
  public int getX();
  public int getY();
  public boolean isPopupTrigger();
  public String paramString();
}

This class generates mouse events. These events are received in two different listeners, UIMouseMotionListener and UIMouseListener.

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent
      |
      +--UIInputEvent
        |
        +--UIMouseEvent

Constructors

UIMouseEvent

public UIMouseEvent(IUIComponent source, int id, long when, int modifiers,
        int x, int y, int clickCount, boolean popupTrigger);

Creates a UIMouseEvent object with the specified source IUIComponent , type, modifiers, coordinates, and click count.

Parameter | Description
source | The object where the event originated.
id | The event type.
when | The time that the event occurred.
modifiers | The modifiers down during event.
x | The x coordinate location of the mouse.
y | The y coordinate location of the mouse.
clickCount | The number of mouse clicks associated with the event.
popupTrigger | Set to true if this event is a pop-up menu trigger event.

Methods

getClickCount

public int getClickCount();

Retrieves the number of mouse button clicks associated with this event.

Return Value:

Returns the number of button clicks associated with the event.

getPoint

public synchronized Point getPoint();

Retrieves the (x,y) position of the event relative to the source component.

Return Value:

Returns the Point that describes the location of the event.

getX

public int getX();

Retrieves the x coordinate of the event relative to the source component.

Return Value:

Returns the x coordinate of the event.

getY

public int getY();

Retrieves the y coordinate of the event relative to the source component.

Return Value:

Returns the y coordinate of the event.

isPopupTrigger

public boolean isPopupTrigger();

Determines whether or not the mouse event is the pop-up menu trigger event for the platform.

Return Value:

Returns true if the event is the pop-up menu trigger event for the current platform.

paramString

public String paramString();

This method is used internally by the toString method.

Return Value:

Returns a formatted String object that assists with textual representation of the exception.

Fields

MOUSE_CLICKED
The mouse clicked event type.
MOUSE_DRAGGED
The mouse dragged event type.
MOUSE_ENTERED
The mouse entered event type.
MOUSE_EVENT_BASE
The base identifier for all UIMouseEvent events.
MOUSE_EXITED
The mouse exited event type.
MOUSE_MOVED
The mouse moved event type.
MOUSE_PRESSED
The mouse pressed event type.
MOUSE_RELEASED
The mouse released event type.


Class UIMouseMotionAdapter

public abstract class UIMouseMotionAdapter implements
            IUIMouseMotionListener
{
  // Methods
  public void mouseDragged(UIMouseEvent e);
  public void mouseMoved(UIMouseEvent e);
}

This abstract class functions as a MouseMotion Listener.

Methods

mouseDragged

public void mouseDragged(UIMouseEvent e);

Invoked when a mouse button is pressed on a component, and then dragged. Mouse drag events will continue to be delivered to the component where the first event originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

Return Value:

No return value.

Parameter | Description
e | The MOUSE_DRAGGED event that was posted.

mouseMoved

public void mouseMoved(UIMouseEvent e);

Invoked when the mouse button has been moved on a component (with no buttons pressed).

Return Value:

No return value.

Parameter | Description
e | The MOUSE_MOVED event that was posted.


Class UITextAdapter

public abstract class UITextAdapter implements IUITextListener
{
  // Methods
  public void textValueChanged(UITextEvent e);
}

This class is the listener adapter for receiving text events.

Methods

textValueChanged

public void textValueChanged(UITextEvent e);

Invoked when the value of the text has changed.

Return Value:

No return value.

Parameter | Description
e | The UITextEvent that was posted.


Class UITextEvent

public class UITextEvent extends UIEvent
{
  // Fields
  public static final int TEXT_VALUE_CHANGED;

  // Constructors
  public UITextEvent(IUIComponent source, int id);

  // Methods
  public String paramString();
}

This class represents a text event. Text events are generated by the text components when their values change.

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent
      |
      +--UITextEvent

Constructors

UITextEvent

public UITextEvent(IUIComponent source, int id);

Constructs a TextEvent object with the specified source and type.

Parameter | Description
source | The IUIComponent where the event originated.
id | The event type.

Methods

paramString

public String paramString();

This method is used internally by the toString method.

Return Value:

Returns a formatted String object that assists with textual representation of the exception.

Fields

TEXT_VALUE_CHANGED
The text value changed event.


Class UIWindowAdapter

public abstract class UIWindowAdapter implements
            IUIWindowListener
{
  // Methods
  public void windowActivated(UIWindowEvent e);
  public void windowClosed(UIWindowEvent e);
  public void windowClosing(UIWindowEvent e);
  public void windowDeactivated(UIWindowEvent e);
  public void windowDeiconified(UIWindowEvent e);
  public void windowIconified(UIWindowEvent e);
  public void windowOpened(UIWindowEvent e);
}

This class is the listener adapter for receiving UIComponent events. Component events are provided for notification purposes only.

Methods

windowActivated

public void windowActivated(UIWindowEvent e);

Invoked when a window is activated.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_ACTIVATED identifier.

windowClosed

public void windowClosed(UIWindowEvent e);

Invoked when a window has been closed.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_CLOSED identifier.

windowClosing

public void windowClosing(UIWindowEvent e);

Invoked when a window is in the process of being closed. The close operation can be overridden at this point.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_CLOSING identifier.

windowDeactivated

public void windowDeactivated(UIWindowEvent e);

Invoked when a window is de-activated.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_DEACTIVATED identifier.

windowDeiconified

public void windowDeiconified(UIWindowEvent e);

Invoked when a window is de-iconified.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_DEICONIFIED identifier.

windowIconified

public void windowIconified(UIWindowEvent e);

Invoked when a window is iconified.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_ICONIFIED identifier.

windowOpened

public void windowOpened(UIWindowEvent e);

Invoked when a window has been opened.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_OPENED identifier.


Class UIWindowEvent

public class UIWindowEvent extends UIEvent
{
  // Fields
  public static final int WINDOW_ACTIVATED;
  public static final int WINDOW_CLOSED;
  public static final int WINDOW_CLOSING;
  public static final int WINDOW_DEACTIVATED;
  public static final int WINDOW_DEICONIFIED;
  public static final int WINDOW_ICONIFIED;
  public static final int WINDOW_OPENED;

  // Constructors
  public UIWindowEvent(UIWindow source, int id);

  // Methods
  public UIWindow getWindow();
  public String paramString();
}

This class represents a window event and is generated for notification purposes when events changes occur to a top level window.

Also see com.ms.ui.IUIWindowListener

EventObject
  |
  +--UIBaseEvent
    |
    +--UIEvent
      |
      +--UIWindowEvent

Constructors

UIWindowEvent

public UIWindowEvent(UIWindow source, int id);

Creates a UIWindowEvent object with the specified source window and type.

Parameter | Description
source | The component where the event originated.
id The event type, which can be one of the following:
  • WINDOW_OPENED
  • WINDOW_CLOSING
  • WINDOW_CLOSED
  • WINDOW_ICONIFIED
  • WINDOW_DEICONIFIED
  • WINDOW_ACTIVATED
  • WINDOW_DEACTIVATED

Methods

getWindow

public UIWindow getWindow();

Retrieves the window where this event originated.

Return Value:

Returns the UIWindow object.

paramString

public String paramString();

Retrieves the event type of the UIWindowEvent object as a String.

Return Value:

Returns one of the following strings based on the event type (in parentheses):

  • "WINDOW_OPENED" (WINDOW_OPENED)
  • "WINDOW_CLOSING" (WINDOW_CLOSING)
  • "WINDOW_CLOSED" (WINDOW_CLOSED)
  • "WINDOW_ICONIFIED" (WINDOW_ICONIFIED)
  • "WINDOW_DEICONIFIED" (WINDOW_DEICONIFIED)
  • "WINDOW_ACTIVATED" (WINDOW_ACTIVATED)
  • "WINDOW_DEACTIVATED" (WINDOW_DEACTIVATED)

If the event is not one of these types, returns "unknown type".

Fields

WINDOW_ACTIVATED
The window activated event type.
WINDOW_CLOSED
The window closed event type. This event is delivered after the window has been closed as the result of a call to hide or destroy.
WINDOW_CLOSING
The window-closing event type. This event is delivered when the user selects "Quit" from the window's system menu. If the program does not explicitly hide or destroy the window as a result of this event, the window close operation will be cancelled.
WINDOW_DEACTIVATED
The window deactivated event type.
WINDOW_DEICONIFIED
The window de-iconified event type.
WINDOW_ICONIFIED
The window iconified event type.
WINDOW_OPENED
The window-opened event type. This event is delivered only the first time a window is made visible.


Interface IUIActionListener

public interface IUIActionListener extends IUIBaseEventListener
{
  // Methods
  public void actionPerformed(UIActionEvent e);
}

This listener interface receives action events.

EventListener
  |
  +--IUIBaseEventListener
    |
    +--IUIActionListener

Methods

actionPerformed

public void actionPerformed(UIActionEvent e);

Invoked when an action occurs.

Return Value:

No return value.

Parameter | Description
e | The ACTION_PERFORMED event that was posted.


Interface IUIAdjustmentListener

public interface IUIAdjustmentListener extends IUIBaseEventListener
{
  // Methods
  public void adjustmentValueChanged(UIAdjustmentEvent e);
}

This interface receives adjustment events.

EventListener
  |
  +--IUIBaseEventListener
    |
    +--IUIAdjustmentListener

Methods

adjustmentValueChanged

public void adjustmentValueChanged(UIAdjustmentEvent e);

Invoked when the value of the IUIScoll component has changed.

Return Value:

No return value.

Parameter | Description
e | The ADJUSTMENT_VALUE_CHANGED event that was posted.


Interface IUIBaseEventListener

public interface IUIBaseEventListener extends java.util.EventListener
{
}

This interface is a tagging interface that all com.ms.ui.event listener interfaces extend from.

EventListener
  |
  +--IUIBaseEventListener


Interface IUIContainerListener

public interface IUIContainerListener extends IUIBaseEventListener
{
  // Methods
  public void componentAdded(UIContainerEvent e);
  public void componentRemoved(UIContainerEvent e);
}

This listener interface receives container events. Container events are provided for notification purposes only.

EventListener
  |
  +--IUIBaseEventListener
    |
    +--IUIContainerListener

Methods

componentAdded

public void componentAdded(UIContainerEvent e);

Invoked when a component has been added to the container.

Return Value:

No return value.

Parameter | Description
e | The COMPONENT_ADDED event that was posted.

componentRemoved

public void componentRemoved(UIContainerEvent e);

Invoked when a component has been removed from the container.

Return Value:

No return value.

Parameter | Description
e | The COMPONENT_REMOVED event that was posted.


Interface IUIFocusListener

public interface IUIFocusListener extends IUIBaseEventListener
{
  // Methods
  public void focusGained(UIFocusEvent e);
  public void focusLost(UIFocusEvent e);
}

This listener interface defines methods that determine when an IUIComponent receives or loses keyboard focus.

EventListener
  |
  +--IUIBaseEventListener
    |
    +--IUIFocusListener

Methods

focusGained

public void focusGained(UIFocusEvent e);

Invoked when an IUIComponent gains the keyboard focus.

Return Value:

No return value.

Parameter | Description
e | The FOCUS_GAINED event that was posted.

focusLost

public void focusLost(UIFocusEvent e);

Invoked when an IUIComponent loses the keyboard focus.

Return Value:

No return value.

Parameter | Description
e | The FOCUS_LOST event that was posted.


Interface IUIItemListener

public interface IUIItemListener extends IUIBaseEventListener
{
  // Methods
  public void itemStateChanged(UIItemEvent e);
}

This interface receives item events.

EventListener
  |
  +--IUIBaseEventListener
    |
    +--IUIItemListener

Methods

itemStateChanged

public void itemStateChanged(UIItemEvent e);

Invoked when an item's state has been changed.

Return Value:

No return value.

Parameter | Description
e | The ITEM_STATE_CHANGED event that was posted.


Interface IUIKeyListener

public interface IUIKeyListener extends IUIBaseEventListener
{
  // Methods
  public void keyPressed(UIKeyEvent e);
  public void keyReleased(UIKeyEvent e);
  public void keyTyped(UIKeyEvent e);
}

This listener interface receives keyboard events.

EventListener
  |
  +--IUIBaseEventListener
    |
    +--IUIKeyListener

Methods

keyPressed

public void keyPressed(UIKeyEvent e);

Invoked when a key has been pressed.

Return Value:

No return value.

Parameter | Description
e | The KEY_PRESSED event that was posted.

keyReleased

public void keyReleased(UIKeyEvent e);

Invoked when a key has been released.

Return Value:

No return value.

Parameter | Description
e | The KEY_RELEASED event that was posted.

keyTyped

public void keyTyped(UIKeyEvent e);

Invoked when a key has been typed. This event occurs when a key press is followed by a key release.

Return Value:

No return value.

Parameter | Description
e | The KEY_TYPED event that was posted.


Interface IUIMouseListener

public interface IUIMouseListener extends IUIBaseEventListener
{
  // Methods
  public void mouseClicked(UIMouseEvent e);
  public void mouseEntered(UIMouseEvent e);
  public void mouseExited(UIMouseEvent e);
  public void mousePressed(UIMouseEvent e);
  public void mouseReleased(UIMouseEvent e);
}

This listener interface receives mouse events on a IUIComponent.

EventListener
  |
  +--IUIBaseEventListener
    |
    +--IUIMouseListener

Methods

mouseClicked

public void mouseClicked(UIMouseEvent e);

Invoked when the mouse has been clicked on an IUIComponent.

Return Value:

No return value.

Parameter | Description
e | The MOUSE_CLICKED mouse button event that was posted.

mouseEntered

public void mouseEntered(UIMouseEvent e);

Invoked when the mouse enters an IUIComponent.

Return Value:

No return value.

Parameter | Description
e | The MOUSE_ENTERED event that was posted.

mouseExited

public void mouseExited(UIMouseEvent e);

Invoked when the mouse exits an IUIComponent.

Return Value:

No return value.

Parameter | Description
e | The MOUSE_EXITED event that was posted.

mousePressed

public void mousePressed(UIMouseEvent e);

Invoked when a mouse button has been pressed on an IUIComponent.

Return Value:

No return value.

Parameter | Description
e | The MOUSE_PRESSED mouse button event that was posted.

mouseReleased

public void mouseReleased(UIMouseEvent e);

Invoked when a mouse button has been released on an IUIComponent.

Return Value:

No return value.

Parameter | Description
e | The MOUSE_RELEASED mouse button event that was posted.


Interface IUIMouseMotionListener

public interface IUIMouseMotionListener extends IUIBaseEventListener
{
  // Methods
  public void mouseDragged(UIMouseEvent e);
  public void mouseMoved(UIMouseEvent e);
}

This listener interface receives mouse motion events on a IUIComponent.

EventListener
  |
  +--IUIBaseEventListener
    |
    +--IUIMouseMotionListener

Methods

mouseDragged

public void mouseDragged(UIMouseEvent e);

Invoked when a mouse button is pressed on a component and then dragged. Mouse drag events will continue to be delivered to the component where the first event originated until the mouse button is released, regardless of whether the mouse position is within the bounds of the component.

Return Value:

No return value.

Parameter | Description
e | The MOUSE_DRAGGED event that was posted.

mouseMoved

public void mouseMoved(UIMouseEvent e);

Invoked when the mouse button has been moved on a component (with no buttons pressed down).

Return Value:

No return value.

Parameter | Description
e | The MOUSE_MOVED event that was posted.


Interface IUITextListener

public interface IUITextListener extends IUIBaseEventListener
{
  // Methods
  public void textValueChanged(UITextEvent e);
}

This listener interface receives adjustment events.

EventListener
  |
  +--IUIBaseEventListener
    |
    +--IUITextListener

Methods

textValueChanged

public void textValueChanged(UITextEvent e);

Invoked when the value of the text has changed.

Return Value:

No return value.

Parameter | Description
e | The TEXT_VALUE_CHANGED event that was posted.


Interface IUIWindowListener

public interface IUIWindowListener extends IUIBaseEventListener
{
  // Methods
  public void windowActivated(UIWindowEvent e);
  public void windowClosed(UIWindowEvent e);
  public void windowClosing(UIWindowEvent e);
  public void windowDeactivated(UIWindowEvent e);
  public void windowDeiconified(UIWindowEvent e);
  public void windowIconified(UIWindowEvent e);
  public void windowOpened(UIWindowEvent e);
}

This listener interface receives window events. Window events are provided for notification purposes only.

EventListener
  |
  +--IUIBaseEventListener
    |
    +--IUIWindowListener

Methods

windowActivated

public void windowActivated(UIWindowEvent e);

Invoked when a window is activated.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_ACTIVATED identifier.

windowClosed

public void windowClosed(UIWindowEvent e);

Invoked when a window has been closed.

Parameter | Description
e | A window event containing the WINDOW_CLOSED identifier.

windowClosing

public void windowClosing(UIWindowEvent e);

Invoked when a window is in the process of being closed. The close operation can be overridden at this point.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_CLOSING identifier.

windowDeactivated

public void windowDeactivated(UIWindowEvent e);

Invoked when a window is de-activated.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_DEACTIVATED identifier.

windowDeiconified

public void windowDeiconified(UIWindowEvent e);

Invoked when a window is de-iconified.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_DEICONIFIED identifier.

windowIconified

public void windowIconified(UIWindowEvent e);

Invoked when a window is iconified.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_ICONIFIED identifier.

windowOpened

public void windowOpened(UIWindowEvent e);

Invoked when a window has been opened.

Return Value:

No return value.

Parameter | Description
e | A window event containing the WINDOW_OPENED identifier.


About com.ms.ui.resource

This package allows Microsoft® Win32®-style resources to be accessed from within Java applets and applications.

Classes

Class DataBoundInputStream
This class enables primitive Java data types to be read from a stream in a portable way.
Class ResourceDecoder
This is an abstract class that reads resources from a resource file.
Class ResourceFormattingException
This class signals that the reading of a resource was incorrect.
Class UIDialogLayout
This class is a simple layout manager, which works with what the Microsoft® Win32® API calls dialog logical units (DLUs).
Class Win32ResourceDecoder
This class is used to utilize Microsoft® Win32® resource (.res) files.

Interfaces

Interface ResourceTypeListener
This interface is used by a class that examines resources in a resource bundle.

Hierarchy

Object
  |
  +--ResourceDecoder
     |
     +--Win32ResourceDecoder

FilterInputStream
  |
  +--DataBoundInputStream (DataInput)

Exception
  |
  +--ResourceFormattingException

UILayoutManager
  |
  +--UIDialogLayout

ResourceTypeListener


Class DataBoundInputStream

public class DataBoundInputStream extends FilterInputStream
             implements DataInput
{
  // Constructors
  public DataBoundInputStream(InputStream in);
  public DataBoundInputStream(InputStream in, boolean isBig);

  // Methods
  public void align();
  public final boolean getEndian();
  public int read(byte b[]) throws IOException;
  public int read(byte b[], int off, int len) throws IOException;
  public boolean readBoolean() throws IOException;
  public byte readByte() throws IOException;
  public char readChar() throws IOException;
  public double readDouble() throws IOException;
  public float readFloat() throws IOException;
  public void readFully(byte b[]) throws IOException;
  public void readFully(byte b[], int off, int len)
        throws IOException;
  public int readInt() throws IOException;
  public String readLine() throws IOException;
  public long readLong() throws IOException;
  public short readShort() throws IOException;
  public int readUnsignedByte() throws IOException;
  public int readUnsignedShort() throws IOException;
  public String readUTF() throws IOException;
  public final static String readUTF(DataInput in)
        throws IOException;
  public final void setEndian(boolean isBig);
  public int skipBytes(int n) throws IOException;
}

This class enables primitive Java data types to be read from a stream in a portable way. Primitive data types are well understood types with associated operations. For example, integers are considered primitive data types. This class is functionally exactly the same as java.io.DataInputStream except that

   (a) it balances short reads, so that it can DWORD align.

   (b) you can specify whether the file is big endian or little endian.

Also see java.io.DataOutputStream, java.io.DataBoundOutputStream

FilterInputStream
  |
  +--DataBoundInputStream

Constructors

DataBoundInputStream

public DataBoundInputStream(InputStream in);

Creates a DataBoundInputStream.

Parameter | Description
in | The input stream.

DataBoundInputStream

public DataBoundInputStream(InputStream in, boolean isBig);

Creates a DataBoundInputStream object, defining if it is big endian or not.

Parameter | Description
in | The input stream.
isBig | Set this parameter to true to indicate big endian format.

Methods

align

public void align();

Sets the file to be DWORD aligned.

Return Value:

No return value.

getEndian

public final boolean getEndian();

Determines if the file is to be read in big endian format.

Return Value:

Returns true if the file should be read in big endian format; otherwise, returns false.

read

public int read(byte b[]) throws IOException;

Reads data into an array of bytes. This method blocks input is available.

Return Value:

Returns the actual number of bytes read; -1 is returned when the end of the stream is reached.

Parameter | Description
b | The byte buffer that the data is read into.

Exceptions:

IOException if an I/O error has occurred.

read

public int read(byte b[], int off, int len) throws IOException;

Reads data into an array of bytes. This method blocks until some input is available.

Return Value:

Returns the actual number of bytes read; -1 is returned when the end of the stream is reached.

Parameter | Description
b | The byte buffer that the data is read into.
off | The starting offset of the data.
len | The maximum number of bytes read.

Exceptions:

IOException if an I/O error has occurred.

readBoolean

public boolean readBoolean() throws IOException;

Reads a boolean.

Return Value:

Returns the boolean that is read.

readByte

public byte readByte() throws IOException;

Reads an 8-bit byte.

Return Value:

Returns the 8-bit byte that is read.

readChar

public char readChar() throws IOException;

Reads a 16-bit character.

Return Value:

Returns the 16-bit character that is read.

readDouble

public double readDouble() throws IOException;

Reads a 64-bit double.

Return Value:

Returns the 64-bit double that is read.

readFloat

public float readFloat() throws IOException;

Reads a 32-bit float.

Return Value:

Returns the 32-bit float that is read.

readFully

public void readFully(byte b[]) throws IOException;

Reads bytes, blocking until all bytes are read.

Return Value:

No return value.

Parameter | Description
b | The byte buffer that the data is read into.

Exceptions:

IOException if an I/O error has occurred.

EOFException if EOF is reached before all bytes are read.

readFully

public void readFully(byte b[], int off, int len) throws IOException;

Reads bytes, blocking until all bytes are read.

Return Value:

No return value.

Parameter | Description
b | The buffer that the data is read into.
off | The starting offset of the data.
len | The maximum number of bytes read.

Exceptions:

IOException if an I/O error has occurred.

EOFException if EOF reached before all bytes are read.

readInt

public int readInt() throws IOException;

Reads a 32-bit integer.

Return Value:

Returns the 32-bit integer that is read.

readLine

public String readLine() throws IOException;

Reads in a line that has been terminated by a \n, \r, \r\n, or EOF.

Note This method does not properly convert bytes to characters. Since the release of JDK version 1.1, the preferred way to read lines of text is via the BufferedReader.readLine() method.

Return Value:

Returns a string copy of the line.

readLong

public long readLong() throws IOException;

Reads a 64-bit long.

Return Value:

Returns the 64-bit long that is read.

readShort

public short readShort() throws IOException;

Reads a 16-bit short.

Return Value:

Returns the 16-bit short that is read.

readUnsignedByte

public int readUnsignedByte() throws IOException;

Reads an unsigned 8-bit byte.

Return Value:

Returns the 8-bit byte that is read.

readUnsignedShort

public int readUnsignedShort() throws IOException;

Reads a 16-bit short.

Return Value:

Returns the 16-bit short that is read.

readUTF

public String readUTF() throws IOException;

Reads a UTF format string.

Return Value:

Returns the String.

readUTF

public final static String readUTF(DataInput in) throws IOException;

Reads a UTF format string.

Return Value:

Returns the String.

setEndian

public final void setEndian(boolean isBig);

Indicates whether the file is to be read in big endian format.

Return Value:

No return value.

Parameter | Description
isBig | Set this parameter to true to indicate big endian format.

skipBytes

public int skipBytes(int n) throws IOException;

Skips bytes, blocking until all bytes are skipped.

Return Value:

Returns the actual number of bytes skipped.

Parameter | Description
n | The number of bytes to be skipped.

Exceptions:

IOException if an I/O error has occurred.


Class ResourceDecoder

public abstract class ResourceDecoder
{
  // Constructors
  public ResourceDecoder();
  public ResourceDecoder(InputStream is);

  // Methods
  public abstract byte[] getBytes(int type, int strId)
        throws ResourceFormattingException ;
  public abstract byte[] getBytes(int type, String name)
        throws ResourceFormattingException ;
  public abstract UIDialog getDialog(int dlgId)
        throws ResourceFormattingException ;
  public abstract UIDialog getDialog(String dlgname)
        throws ResourceFormattingException ;
  public int getLocale();
  public abstract String getString(int strId)
        throws ResourceFormattingException ;
  public abstract void populateDialog(UIDialog dlg, int dlgId,
        int language) throws ResourceFormattingException ;
  public abstract void populateDialog(UIDialog dlg, String dlgname,
        int language) throws ResourceFormattingException ;
  public abstract void setLocale(int locale);
}

This is an abstract class that reads resources from a resource file. The format of the file is unspecified and is left to the classes deriving from this class.

Constructors

ResourceDecoder

public ResourceDecoder();

Creates an empty resource decoder.

ResourceDecoder

public ResourceDecoder(InputStream is);

Creates a resource decoder based on a byte input stream.

Parameter | Description
is | The InputStream object that the decoder is based on.

Methods

getBytes

public abstract byte[] getBytes(int type, int strId)
        throws ResourceFormattingException ;

Retrieves a byte block, of the resource type specified, with the given string identifier.

Parameter | Description
type | The resource type of the byte block.
strId | The string identifier of the byte block.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the resource identifier is not valid.

getBytes

public abstract byte[] getBytes(int type, String name)
        throws ResourceFormattingException ;

Retrieves a byte block, of the resource type specified, with the given name.

Return Value:

Returns the byte array.

Parameter | Description
type | The resource type of the byte block.
name | The resource name of the byte block.

getDialog

public abstract UIDialog getDialog(int dlgId)
        throws ResourceFormattingException ;

Retrieves a dialog box in the current locale with the specified dialog identifier.

Parameter | Description
dlgId | The identifier of the dialog resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the dialog identifier is not valid.

getDialog

public abstract UIDialog getDialog(String dlgname)
        throws ResourceFormattingException ;

Retrieves a dialog box in the current locale with the specified name.

Parameter | Description
dlgname | The name of the string resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the string resource name is not valid.

getLocale

public int getLocale();

Retrieves the current locale.

Return Value:

Returns the current locale.

getString

public abstract String getString(int strId)
        throws ResourceFormattingException ;

Retrieves a string resource, with the specified identifier, in the current locale.

Parameter | Description
strId | The identifier of the string resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the string identifier is not valid.

populateDialog

public abstract void populateDialog(UIDialog dlg, int dlgId,
        int language) throws ResourceFormattingException ;

Fills an existing dialog box with components from a dialog resource using the dialog resource identifier.

Parameter | Description
dlg | The dialog object to populate.
dlgId | The identifier of the dialog resource containing the components.
language | The language of the resources to use.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified dialog identifier is not valid.

populateDialog

public abstract void populateDialog(UIDialog dlg, String dlgname,
        int language) throws ResourceFormattingException ;

Fills an existing dialog box with components such as from a dialog resource using the dialog resource name.

Parameter | Description
dlg | The dialog object to populate.
dlgname | The name of the dialog resource containing the components.
language | The language to use.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified dialog name is not valid.

setLocale

public abstract void setLocale(int locale);

Sets the current locale.

Parameter | Description
locale | The locale to be set.


Class ResourceFormattingException

public class ResourceFormattingException extends Exception
{
  // Constructors
  public ResourceFormattingException(String msg);
}

This class signals that the reading of a resource was incorrect.

Exception
  |
  +--ResourceFormattingException

Constructors

ResourceFormattingException

public ResourceFormattingException(String msg);

Constructs a ResourceFormattingException exception with the specified detail message (a string that describes this particular exception).

Parameter | Description
msg | The detailed message.


Class UIDialogLayout

public class UIDialogLayout extends UILayoutManager
{
  // Constructors
  public UIDialogLayout(IUIContainer parent, int width, int height);
  public UIDialogLayout(IUIContainer parent, Dimension d);

  // Methods
  public void addLayoutComponent(String name, IUIComponent comp);
  public Dimension getDialogSize();
  public Dimension getMinimumSize(IUIContainer parent);
  public Dimension getPreferredSize(IUIContainer parent);
  public Rectangle getShape(IUIComponent comp);
  public boolean isHeightRelative(IUIContainer target);
  public boolean isWidthRelative(IUIContainer target);
  public void layout(IUIContainer parent, Rectangle bounds);
  public void removeLayoutComponent(IUIComponent comp);
  public void setShape(IUIComponent comp, int x, int y, int width,
        int height);
  public void setShape(IUIComponent comp, Rectangle rect);
}

This class is a simple layout manager, which works with what the Microsoft® Win32® API calls dialog logical units (DLUs). DLUs are resolution-independent coordinates, which work well for laying out controls on a dialog box. The mapping from DLUs to pixels is based on the font used in the dialog box. An x coordinate DLU is described as 1/4 (0.25) of the of the average character width of the font used in the dialog box. A y coordinate DLU is described as one-eighth (0.125) of the character height used in the dialog box.

Note The average character width is not the average of all characters — rather it is the average of all alpha characters both uppercase and lowercase. That is, it is the extent of the string "a...zA...Z" divided by 52.

This class allows you to associate a rectangle (x, y, width, height) with a component in a container. If called upon to layout the container, this layout manager will lay out based on the translation of dialog units to pixels.

UILayoutManager
  |
  +--UIDialogLayout

Constructors

UIDialogLayout

public UIDialogLayout(IUIContainer parent, int width, int height);

Sets the dimensions of the parent container, using the given width and height for the container and the average character width and height of the parent.

Caution The container that you are laying out with the UIDialogLayout manager must have its font set before this layout manager can be successfully created. If the font is not set for the container, a NullPointerException is thrown.

To set the font of the container, use the IUIComponent.setFont method.

Parameter | Description
parent | The container that has its dimensions set.
width | The width, in DLUs, of the dialog box.
height | The height, in DLUs, of the dialog box.

UIDialogLayout

public UIDialogLayout(IUIContainer parent, Dimension d);

Sets the dimensions of the parent container, using the width and height specified by the parameter d and the average character width and height of the parent.

Caution The container that you are laying out with the UIDialogLayout manager must have its font set before this layout manager can be successfully created. If the font is not set for the container, a NullPointerException is thrown.

To set the font of the container, use the IUIComponent.setFont method.

Parameter | Description
parent | The container to have its dimensions set.
d | The width and height, in DLUs, of the dialog box.

Methods

addLayoutComponent

public void addLayoutComponent(String name, IUIComponent comp);

Adds the specified component to the container. This method is not used by the dialog layout manager.

Return Value:

No return value.

Parameter | Description
name | The name of the new component.
comp | The component to be added.

getDialogSize

public Dimension getDialogSize();

Retrieves the dimensions of the parent container associated with this layout.

Return Value:

Returns the parent container dimensions. The Dimension.width and Dimension.height field values are measured in pixels.

getMinimumSize

public Dimension getMinimumSize(IUIContainer parent);

Determines the minimum size of the parent container, using this dialog layout.

Return Value:

Returns the minimum dimensions required to lay out the subcomponents of the specified container.

Parameter | Description
parent | The container in which to do the layout.

Remarks:

This method is called when a container (such as a window or frame) calls its layout method. Most applications do not call this method directly.

getPreferredSize

public Dimension getPreferredSize(IUIContainer parent);

Determines the preferred size of the parent container using this dialog layout.

Return Value:

Returns the preferred dimensions of the subcomponents that are laid out in the specified container.

Parameter | Description
parent | The container to do the layout in.

Remarks:

Most applications do not call this method directly. This method is called when a container (such as a window or frame) calls its preferredSize method.

getShape

public Rectangle getShape(IUIComponent comp);

Retrieves a rectangle that defines the position and shape of the given component.

Return Value:

Returns a rectangle. The x and y fields specify the position of the component (relative to the upper-left corner of the container), and the Rectangle.width and Rectangle.height specify the component width and height. All values are measured in DLUs.

Parameter | Description
comp | The component to be defined.

isHeightRelative

public boolean isHeightRelative(IUIContainer target);

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

Return Value:

Returns false.

Parameter | Description
target | The container to be laid out.

isWidthRelative

public boolean isWidthRelative(IUIContainer target);

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

Return Value:

Returns false.

Parameter | Description
target | The container to be laid out.

layout

public void layout(IUIContainer parent, Rectangle bounds);

Lays out the container argument by using this dialog layout.

Return Value:

No return value.

Parameter | Description
parent | The container in which to do the layout.
bounds | This parameter is not implemented for this layout manager.

Remarks:

Each component in the parent container is reshaped based on its size (in DLUs) and the average character width and height of the current font for the parent.

Most applications do not call this method directly. This method is called when a container (such as a window or frame) calls its layout method.

removeLayoutComponent

public void removeLayoutComponent(IUIComponent comp);

Removes the specified component from the container. This method is not used by the dialog layout manager.

Return Value:

No return value.

Parameter | Description
comp | The component to be removed.

setShape

public void setShape(IUIComponent comp, int x, int y, int width,
        int height);

Sets the position and shape of the specified component.

Return Value:

No return value.

Parameter | Description
comp | The component that has its position and shape set.
x | The x coordinate, in DLUs, of the upper-left corner of the component, relative to the upper-left corner of the parent container.
y | The y coordinate, in DLUs, of the upper-left corner of the component, relative to the upper-left corner of the parent container.
width | The width of the component (in DLUs).
height | The height of the component (in DLUs).

setShape

public void setShape(IUIComponent comp, Rectangle rect);

Sets the position and shape of the given component using values from the given rectangle.

Return Value:

No return value.

Parameter | Description
comp | The component that has its position and shape set.
rect | The x and y fields specify the position, in DLUs, of the upper-left corner of the component relative to the upper-left corner of the parent container. The Rectangle.width and Rectangle.height fields specify the width and height, in DLUs, of the component.


Class Win32ResourceDecoder

public class Win32ResourceDecoder extends ResourceDecoder
{
  // Fields
  public final static int RT_ACCELERATOR;
  public final static int RT_ANICURSOR;
  public final static int RT_ANIICON;
  public final static int RT_BITMAP;
  public final static int RT_CURSOR;
  public final static int RT_DIALOG;
  public final static int RT_DLGINCLUDE;
  public final static int RT_FONT;
  public final static int RT_FONTDIR;
  public final static int RT_GROUP_CURSOR;
  public final static int RT_GROUP_ICON;
  public final static int RT_ICON;
  public final static int RT_MENU;
  public final static int RT_MESSAGETABLE;
  public final static int RT_NAMEDTYPE;
  public final static int RT_NONE;
  public final static int RT_PLUGPLAY;
  public final static int RT_RCDATA;
  public final static int RT_STRING;
  public final static int RT_VERSION;
  public final static int RT_VXD;

  // Constructors
  public Win32ResourceDecoder();
  public Win32ResourceDecoder(String filename)
        throws FileNotFoundException;
  public Win32ResourceDecoder(InputStream is)
        throws FileNotFoundException;

  // Methods
  public void enumerateResources(ResourceTypeListener rtl)
        throws ResourceFormattingException;
  public synchronized void enumerateResources(
        ResourceTypeListener rtl, int lang, int type)
        throws ResourceFormattingException;
  public byte[] getBytes(int type, int id)
        throws ResourceFormattingException;
  public byte[] getBytes(int type, String name)
        throws ResourceFormattingException;
  public char[] getChars(int type, int id)
        throws ResourceFormattingException;
  public char[] getChars(int type, int id, int lang)
        throws ResourceFormattingException;
  public UIDialog getDialog(int dlgId)
        throws ResourceFormattingException;
  public UIDialog getDialog(String dlgname)
        throws ResourceFormattingException;
  public UIBand getMenu(int menuId)
        throws ResourceFormattingException;
  public UIBand getMenu(int menuId, int lang)
        throws ResourceFormattingException;
  public UIBand getMenu(String menuname,
        UIMenuList menuList) throws ResourceFormattingException;
  public UIBand getMenu(String menuname, UIMenuList menuList,
        int lang) throws ResourceFormattingException;
  public UIBand getMenu(String menuname)
        throws ResourceFormattingException;
  public String getString(int strId)
        throws ResourceFormattingException;
  public String getString(int strId, int lang)
        throws ResourceFormattingException;
  public void populateDialog(UIDialog dlg, int dlgId, int language)
        throws ResourceFormattingException;
  public void populateDialog(UIDialog dlg, int dlgId)
        throws ResourceFormattingException;
  public void populateDialog(UIDialog dlg, String dlgname,
        int language) throws ResourceFormattingException;
  public void populateDialog(UIDialog dlg, String dlgname)
        throws ResourceFormattingException;
  public UIBand populateMenu(int menuId,
        UIMenuList menuList) throws ResourceFormattingException;
  public UIBand populateMenu(int menuId, UIMenuList menuList,
        int lang) throws ResourceFormattingException;
  public void setLocale(int locale);
}

This class is used to utilize Microsoft® Win32® resource (.res) files. This class is provided to help developers maximize any investment they have already made in Win32 resources for Microsoft® Windows® applications by being able to use the same resources files in their Java applications and applets.

Resource files are particularly useful for localizing content, because the user interface (UI) elements or resources can be maintained in a separate file and localized apart from the source code. These resources are referenced either by name or resource identifier by this class and instantiated in the Java applet or application.

ResourceDecoder
  |
  +--Win32ResourceDecoder

Constructors

Win32ResourceDecoder

public Win32ResourceDecoder();

Creates an empty Win32 resource (.res) decoder.

Win32ResourceDecoder

public Win32ResourceDecoder(String filename) throws FileNotFoundException;

Creates a Win32 resource (.res) decoder based on the file specified.

Parameter | Description
filename | The file containing the resources.

Exceptions:

FileNotFoundException if the filename is invalid or the file is not found.

Win32ResourceDecoder

public Win32ResourceDecoder(InputStream is) throws FileNotFoundException;

Creates a Win32 resource (.res) decoder based on a byte input stream.

Parameter | Description
is | The InputStream object the decoder is based on.

Exceptions:

FileNotFoundException if the filename is invalid or the file is not found.

See Also: com.ms.ui.resource.ResourceDecoder

Methods

enumerateResources

public void enumerateResources(ResourceTypeListener rtl)
        throws ResourceFormattingException;

Enumerates all the resources in the file back to the application.

Return Value:

No return value.

Parameter | Description
rtl | The object supporting a ResourceTypeListener interface.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if there is no string buffer, or if the string buffer name is invalid.

enumerateResources

public synchronized void enumerateResources(ResourceTypeListener rtl,
        int lang, int type) throws ResourceFormattingException;

Enumerates all resources, conforming to the language, specified back to the application.

Return Value:

No return value.

Parameter | Description
rtl | The resource type listener.
lang | The language of resources to enumerate.
type | The type of resources to enumerate. Currently, this parameter is not used to enumerate resources.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if there is no string buffer, or the string buffer name is invalid.

getBytes

public byte[] getBytes(int type, int id) throws ResourceFormattingException;

Retrieves a byte block of the resource type specified, with the given identifier.

Return Value:

Returns the requested byte array.

Parameter | Description
type | The resource type of the byte block.
id | The string identifier of the byte block.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the resource identifier is invalid.

getBytes

public byte[] getBytes(int type, String name)
        throws ResourceFormattingException;

Retrieves a byte block, of the resource type specified, with the given name.

Return Value:

Returns the requested byte array.

Parameter | Description
type | The resource type of the byte block.
name | The resource name of the byte block.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the resource identifier is invalid.

getChars

public char[] getChars(int type, int id) throws ResourceFormattingException;

Retrieves a character array of the resource type specified with the given identifier. The RT_RCDATA resource format stores data in words, so use the getChars method when reading data in this format.

Return Value:

Returns the requested character array.

Parameter | Description
type | The resource type of the character block.
id | The identifier of the character block.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the resource identifier is invalid.

getChars

public char[] getChars(int type, int id, int lang)
        throws ResourceFormattingException;

Retrieves a character array of the resource type specified with the given identifier. The RT_RCDATA resource format stores data in words, so use the getChars method when reading data in this format.

Return Value:

Returns the requested character array.

Parameter | Description
type | The resource type of the character block.
id | The identifier of the character block.
lang | The language of the resource type. Currently, this parameter is not used to retrieve the character array.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the resource identifier is invalid.

getDialog

public UIDialog getDialog(int dlgId) throws ResourceFormattingException;

Retrieves a dialog box, in the current locale, with the specified dialog identifier.

Return Value:

Returns the dialog box requested.

Parameter | Description
dlgId | The identifier of the dialog resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified dialog identifier is not valid.

getDialog

public UIDialog getDialog(String dlgname)
        throws ResourceFormattingException;

Retrieves a dialog box, in the current locale, with the specified name.

Return Value:

Returns the dialog box requested.

Parameter | Description
dlgname | The name of the dialog resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified dialog name is not valid.

getMenu

public UIBand getMenu(int menuId) throws ResourceFormattingException;

Retrieves a menu, in the current locale, with the specified menu identifier.

Return Value:

Returns a UIBand menu object.

Parameter | Description
menuId | The menu identifier.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified menu identifier is not valid.

getMenu

public UIBand getMenu(int menuId, int lang)
        throws ResourceFormattingException;

Retrieves a menu with the specified menu identifier.

Return Value:

Returns a UIBand menu object.

Parameter | Description
menuId | The menu identifier.
lang | The language of the menu resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified menu identifier is not valid.

getMenu

public UIBand getMenu(String menuname, UIMenuList menuList)
        throws ResourceFormattingException;

Retrieves a filled menu, in the current locale, with the specified menu name.

Return Value:

Returns a UIBand menu object.

Parameter | Description
menuname | The name of the menu.
menuList | The list to fill the menu with.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified menu name is not valid.

getMenu

public UIBand getMenu(String menuname, UIMenuList menuList,
        int lang) throws ResourceFormattingException;

Retrieves a filled menu with the specified menu name.

Return Value:

Returns a UIBand menu object.

Parameter | Description
menuname | The name of the menu.
menuList | The list to populate the menu object with.
lang | The language of the resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified menu name is not valid.

getMenu

public UIBand getMenu(String menuname) throws ResourceFormattingException;

Retrieves a menu, in the current locale, with the specified menu name.

Return Value:

Returns a UIBand menu object.

Parameter | Description
menuname | The name of the menu.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified menu name is not valid.

getString

public String getString(int strId) throws ResourceFormattingException;

Retrieves a string resource, in the current locale, with the specified string identifier.

Return Value:

Returns the requested string resource.

Parameter | Description
strId | The identifier of the string resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified string identifier is not valid.

getString

public String getString(int strId, int lang)
        throws ResourceFormattingException;

Retrieves a string resource with the specified string identifier.

Return Value:

Returns the requested string resource.

Parameter | Description
strId | The identifier of the string resource.
lang | The language of the string resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified string identifier is not valid.

populateDialog

public void populateDialog(UIDialog dlg, int dlgId, int language)
        throws ResourceFormattingException;

Fills an existing dialog box with the specified identifier with the data and/or controls as specified in the resource. This is useful for classes that are derived from UIDialog.

Return Value:

No return value.

Parameter | Description
dlg | The dialog object to populate.
dlgId | The identifier of the dialog resource containing the components.
language | The language of the resources.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified dialog identifier is not valid.

populateDialog

public void populateDialog(UIDialog dlg, int dlgId)
        throws ResourceFormattingException;

Fills an existing dialog box, in the current locale, with the specified identifier with the data or controls, or both, as specified in the resource. This is useful for classes that are derived from UIDialog.

Return Value:

No return value.

Parameter | Description
dlg | The dialog object to populate.
dlgId | The identifier of the dialog resource containing the components.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified dialog identifier is not valid.

populateDialog

public void populateDialog(UIDialog dlg, String dlgname,
        int language) throws ResourceFormattingException;

Fills an existing dialog box with the specified name with the data or controls, or both, as specified in the resource. This is useful for classes that are derived from UIDialog.

Return Value:

No return value.

Parameter | Description
dlg | The dialog object to populate.
dlgname | The name of the dialog resource containing the components.
language | The language of the resources.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified dialog name is not valid.

populateDialog

public void populateDialog(UIDialog dlg, String dlgname)
        throws ResourceFormattingException;

Fills an existing dialog box, in the current locale, with the specified name with the data or controls, or both, as specified in the resource. This is useful for classes that are derived from UIDialog.

Return Value:

No return value.

Parameter | Description
dlg | The dialog object to populate.
dlgname | The name of the dialog resource containing the components.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified dialog name is not valid.

populateMenu

public UIBand populateMenu(int menuId, UIMenuList menuList)
        throws ResourceFormattingException;

Populates the specified menu.

Return Value:

Returns a populated UIBand menu object.

Parameter | Description
menuId | The menu identifier.
menuList | The list to fill the menu with.

populateMenu

public UIBand populateMenu(int menuId, UIMenuList menuList,
        int lang) throws ResourceFormattingException;

Retrieves a menu with the specified menu identifier.

Return Value:

Returns a populated UIBand menu object.

Parameter | Description
menuId | The menu identifier.
menuList | The list to fill the menu with.
lang | The language of the menu resource.

Exceptions:

com.ms.ui.resource.ResourceFormattingException if the specified menu identifier is not valid.

setLocale

public void setLocale(int locale);

Sets the current locale. Currently, this method accepts a system LCID value (not a java.util.Locale constant) for the Microsoft Win32 VM for Java.

Return Value:

No return value.

Parameter | Description
locale | The locale to be set.

See Also: java.util.Locale, java.util.Locale.getLCID, com.ms.fx.IFxSystemInterface.getSystemLCID

Fields

RT_ACCELERATOR
An accelerator (or keyboard shortcut, hotkey) table resource type.
RT_ANICURSOR
An animated cursor resource type.
RT_ANIICON
An animated icon resource type.
RT_BITMAP
A bitmap resource type.
RT_CURSOR
A hardware-dependent cursor resource type.
RT_DIALOG
A dialog resource type.
RT_DLGINCLUDE
RT_FONT
A font resource type.
RT_FONTDIR
A font directory resource type.
RT_GROUP_CURSOR
A hardware-independent cursor resource type.
RT_GROUP_ICON
A hardware-independent group icon resource type.
RT_ICON
A hardware-dependent icon resource type.
RT_MENU
A menu resource type.
RT_MESSAGETABLE
A message table entry resource type.
RT_NAMEDTYPE
RT_NONE
There is no specified resource type.
RT_PLUGPLAY
A Plug-and-Play resource type.
RT_RCDATA
A raw data resource type. Raw data resources permit the inclusion of binary data directly in the executable file.
RT_STRING
A string resource type.
RT_VERSION
A version stamp resource type.
RT_VXD
A virtual device driver resource type.


Interface ResourceTypeListener

public interface ResourceTypeListener
{
  // Methods
  public boolean examineBinaryData(byte data[], int locale);
  public boolean examineDialog(int id, byte d[], int locale);
  public boolean examineDialog(String id, byte d[], int locale);
  public boolean examineImage(byte b[], int imageType, int locale);
  public boolean examineMenu(Menu m, int locale);
  public boolean examineString(int id, String s, int locale);
}

This interface is used by a class that examines resources in a resource bundle.

Methods

examineBinaryData

public boolean examineBinaryData(byte data[], int locale);

Examines binary data.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
data | The data to examine.
locale | The locale of the resource.

examineDialog

public boolean examineDialog(int id, byte d[], int locale);

Examines a dialog resource.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
d | The resource identifier of the dialog.
d | The data to examine.
locale | The locale of the resource.

examineDialog

public boolean examineDialog(String id, byte d[], int locale);

Examines a dialog resource.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
id | The name of the dialog resource.
d | The dialog data.
locale | The locale of the resource.

examineImage

public boolean examineImage(byte b[], int imageType, int locale);

Examines an image resource.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
b | The binary image data.
imageType | The type of the image.
locale | The locale of the resource.

examineMenu

public boolean examineMenu(Menu m, int locale);

Examines a menu resource.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
m | The menu to examine.
locale | The locale of the resource.

examineString

public boolean examineString(int id, String s, int locale);

Examines a string resource.

Return Value:

Returns true if successful; otherwise, returns false.

Parameter | Description
id | The string identifier.
s | The string name.
locale | The locale of the resource.


About com.ms.util.cab

This package enables you to create and read compressed cabinet files.

Classes

Class CabCorruptException
Thrown when either the cabinet structure or the compressed data stored in the cabinet is corrupt.
Class CabCreator
This class creates cabinets.
Class CabDecoder
This class is used to decode a cabinet.
Class CabEnumerator
This class implements the Enumeration interface for cabinet files, allowing serial access to all of the items in the cabinet file.
Class CabException
This exception class handles the various non-input/output cabinet exceptions.
Class CabFileEntry
This class is used to represent file entries stored in the cabinet.
Class CabFolderEntry
This class implements objects that represent folders in a cabinet file.

Interfaces

Interface CabConstants
This interface contains the constants used in cabinet creation and extraction.
Interface CabDecoderInterface
This is the interface that must be passed as a parameter to the CabDecoder constructor.
Interface CabProgressInterface
This interface is used by both the CabCreator and CabDecoder classes to report progress when creating or decoding a cabinet file.

Hierarchy

Object
  |
  +--CabCreator
  |
  +--CabDecoder
  |
  +--CabEnumerator (Enumeration)
  |
  +--CabFileEntry
  |
  +--CabFolderEntry (CabConstants)

Exception
  |
  +--CabException
     |
     +--CabCorruptException

CabConstants
CabDecoderInterface
CabProgressInterface


Class CabCorruptException

public final class CabCorruptException extends CabException
{
}

Thrown when either the cabinet structure or the compressed data stored in the cabinet is corrupt.

Exception
  |
  +--CabException
    |
    +--CabCorruptException


Class CabCreator

public final class CabCreator
{
  // Constructors
  public CabCreator(CabProgressInterface new_progress_interface);

  // Methods
  public void abort() throws IOException;
  public void addStream(InputStream input,
        CabFileEntry cffile) throws CabException, IOException;
  public void complete() throws CabException, IOException;
  public void create(OutputStream output_stream) throws IOException;
  public void newFolder(CabFolderEntry folder_info)
        throws CabException, IOException;
  public void setSetID(int new_set_id);
}

This class creates cabinets. For more information about cabinets, see CabFileEntry, CabConstants, and CabProgressInterface.

Constructors

CabCreator

public CabCreator(CabProgressInterface new_progress_interface);

Initializes a CabCreator object.

Parameter | Description
new_progress_interface | An interface, through which progress reports are made.

Methods

abort

public void abort() throws IOException;

Aborts cabinet creation and closes the output_cabinet stream opened by the create method. If this method is called, it must be called after the create method and before the complete method. After this method has been called, this CabCreator object can still be used to create cabinets.

Return Value:

No return value.

Exceptions:

IOException if an input/output error occurred.

addStream

public void addStream(InputStream input, CabFileEntry cffile)
        throws CabException, IOException;

Adds a stream to the cabinet.

Return Value:

No return value.

Parameter | Description
input | The input stream associated with the file to be added.
cffile | A cabinet file entry. The name and date entries must be filled out at a minimum.

Exceptions:

com.ms.util.cab.CabException if an error (such as attempting to add a stream before starting a folder) has occurred.

IOException if an I/O error occurred.

complete

public void complete() throws CabException, IOException;

Completes the cabinet creation process.

Return Value:

No return value.

Exceptions:

com.ms.util.cab.CabException if an error (such as attempting to create an empty cabinet) has occurred.

IOException if an I/O error has occurred.

create

public void create(OutputStream output_stream) throws IOException;

Begins the creation of a new cabinet. Only one cabinet can be created at a time using the same CabCreator object. However, the same CabCreator object can be used repeatedly.

Return Value:

No return value.

Parameter | Description
output_stream | The output stream for the completed cabinet.

Exceptions:

IOException if an I/O error occurred.

newFolder

public void newFolder(CabFolderEntry folder_info) throws CabException,
        IOException;

Begins a new folder.

Return Value:

No return value.

Parameter | Description
folder_info | An initialized cabinet folder entry that indicates the type of compression designated for this folder.

Exceptions:

com.ms.util.cab.CabException if an error occurred (such as unknown compression type).

IOException if an I/O error occurred.

setSetID

public void setSetID(int new_set_id);

Establishes the Set ID of the cabinet being created. This method must be called after the create method and before the complete method. If this method is not called, the default Set ID is zero.

Return Value:

No return value.

Parameter | Description
new_set_id | The Set ID for the cabinet. Values range from 0 to 65535.


Class CabDecoder

public final class CabDecoder
{
  // Constructors
  public CabDecoder(InputStream new_input,
        CabDecoderInterface new_decoder_interface)
        throws CabException, IOException;

  // Methods
  public Enumeration entries();
  public Enumeration entries(boolean full);
  public void extract() throws CabException, IOException;
}

This class is used to decode a cabinet.

For more information about cabinet decoding, see CabDecoderInterface and CabFileEntry.

Constructors

CabDecoder

public CabDecoder(InputStream new_input,
        CabDecoderInterface new_decoder_interface) throws CabException,
        IOException;

Opens a cabinet for decoding.

Parameter | Description
new_decoder_interface | The interface used to extract files.
new_input | The input stream corresponding to the cabinet.

Exceptions:

com.ms.util.cab.CabException if the cabinet or its compressed data is corrupt.

IOException if an I/O error has occurred.

Methods

entries

public Enumeration entries();

Enumerates the files that are contained in the cabinet.

Return Value:

Returns an enumeration of CabFileEntry objects for this cabinet.

entries

public Enumeration entries(boolean full);

Enumerates the complete contents of the cabinet, including CabFolderEntry objects and CabFileEntry objects.

Return Value:

Returns an enumeration of objects in this cabinet. CabFolderEntry objects are returned at the beginning of each new folder. CabFileEntry objects are returned for each file.

Parameter | Description
full | Set true to enumerate all entries; set to false to enumerate just the CabFileEntry objects.

extract

public void extract() throws CabException, IOException;

Extracts files from the cabinet object. The openOutputStream method of the supplied CabDecoderInterface is called for each file stored in the cabinet.

Return Value:

No return value.

Exceptions:

com.ms.util.cab.CabException if the cabinet or its compressed data is corrupt.

IOException if an I/O error occurred.


Class CabEnumerator

public final class CabEnumerator implements Enumeration
{
  // Methods
  public boolean hasMoreElements();
  public Object nextElement();
}

This class implements the Enumeration interface for cabinet files, allowing serial access to all of the items in the cabinet file.

Methods

hasMoreElements

public boolean hasMoreElements();

Determines whether the cabinet file contains more files than those already enumerated.

Return Value:

Returns true if there are more elements in the cabinet file; otherwise, returns false.

nextElement

public Object nextElement();

Retrieves the next item in the cabinet file.

Return Value:

Returns the next element.


Class CabException

public class CabException extends Exception
{
}

This exception class handles the various non-input/output cabinet exceptions. The derived CabCorruptException class is thrown when either the cabinet structure or the compressed data stored in the cabinet is corrupt.

Exception
  |
  +--CabException


Class CabFileEntry

final public class CabFileEntry
{
  // Constructors
  public CabFileEntry();

  // Methods
  public Object getApplicationData();
  public Date getDate();
  public String getName();
  public long getSize();
  public boolean isArchive();
  public boolean isHidden();
  public boolean isReadOnly();
  public boolean isSystem();
  public void setApplicationData(Object object);
  public void setArchive(boolean set);
  public void setDate(Date new_date);
  public void setHidden(boolean set);
  public void setName(String new_filename);
  public void setReadOnly(boolean set);
  public void setSize(long new_file_size);
  public void setSystem(boolean set);
}

This class is used to represent file entries stored in the cabinet.

Constructors

CabFileEntry

public CabFileEntry();

Creates a new, blank cabinet file entry. To become a valid entry, the filename, date, and attributes must be set in order.

Methods

getApplicationData

public Object getApplicationData();

Retrieves the application data stored in this CabFileEntry object. Note that the application data is not recorded in the cabinet; the lifetime of this data is the lifetime of this CabFileEntry object.

Return Value:

Returns the application data.

getDate

public Date getDate();

Retrieves the modification date and time of this entry.

Return Value:

Returns the date of the entry.

getName

public String getName();

Retrieves the filename of this entry.

Return Value:

Returns the filename.

getSize

public long getSize();

Retrieves the file size of this entry.

Return Value:

Returns the file's size.

isArchive

public boolean isArchive();

Determines if this entry has the archive file attribute set.

Return Value:

Returns true if the archive file attribute is set; otherwise, returns false.

isHidden

public boolean isHidden();

Determines if this entry has the hidden file attribute set.

Return Value:

Returns true if the hidden file attribute is set; otherwise, returns false.

isReadOnly

public boolean isReadOnly();

Determines if this entry has the read-only file attribute set.

Return Value:

Returns true if the read-only file attribute is set; otherwise, returns false.

isSystem

public boolean isSystem();

Determines if this entry has the system file attribute set.

Return Value:

Returns true if the system file attribute is set; otherwise, returns false.

setApplicationData

public void setApplicationData(Object object);

Stores some application data in this CabFileEntry. Note that the application data is not recorded in the cabinet; the lifetime of this data is the lifetime of this CabFileEntry object.

Return Value:

No return value.

Parameter Description
object ??

setArchive

public void setArchive(boolean set);

Sets or clears the archive file attribute.

Return Value:

No return value.

Parameter | Description
set | The value that specifies whether to set or clear this attribute.

setDate

public void setDate(Date new_date);

Sets the file date and time of this entry.

Return Value:

No return value.

Parameter | Description
new_date | The date to be set.

setHidden

public void setHidden(boolean set);

Sets or clears the hidden file attribute.

Return Value:

No return value.

Parameter | Description
set | The value that specifies whether to set or clear the hidden-file attribute.

setName

public void setName(String new_filename);

Sets the filename of this entry.

Return Value:

No return value.

Parameter | Description
new_filename | The filename to apply to this entry.

setReadOnly

public void setReadOnly(boolean set);

Sets or clears the read-only file attribute.

Return Value:

No return value.

Parameter | Description
set | The value that specifies whether to set or clear this attribute.

setSize

public void setSize(long new_file_size);

Sets the file size of this entry. The file size must be less than or equal to Integer.MAX_VALUE.

Return Value:

No return value.

Parameter | Description
new_file_size | The file size to be set.

setSystem

public void setSystem(boolean set);

Sets or clears the system file attribute.

Return Value:

No return value.

Parameter | Description
set | The value that specifies whether to set or clear this attribute.


Class CabFolderEntry

public final class CabFolderEntry implements CabConstants
{
  // Constructors
  public CabFolderEntry();

  // Methods
  public String compressionToString();
  public int getCompressionMethod();
  public int getCompressionWindowSize();
  public void setCompression(int compression_method,
        int window_bits) throws CabException;
}

This class implements objects that represent folders in a cabinet file. CabFolderEntry items represent folders in the cabinet. A CabFolderEntry object must be passed to the newFolder method of the CabCreator class. CabFolderEntry objects can also be returned using the entries method of the CabDecoder class.

For more information, see the CabFileEntry, CabCreator, and CabDecoder classes.

Constructors

CabFolderEntry

public CabFolderEntry();

Initializes the new folder.

Methods

compressionToString

public String compressionToString();

Retrieves a string representation of the compression parameters containing the compression method and window bits (if applicable).

Return Value:

Returns a string containing compression parameters.

getCompressionMethod

public int getCompressionMethod();

Retrieves the compression method used in this folder.

Return Value:

Returns the method of compression.

getCompressionWindowSize

public int getCompressionWindowSize();

Retrieves the compression window size.

Return Value:

Returns the natural logarithm of the window history size used in compression.

setCompression

public void setCompression(int compression_method, int window_bits)
        throws CabException;

Sets the compression parameters to be used for this folder.

Return Value:

No return value.

Parameter | Description
compression_method | The compression method used, as defined in the CabConstants class.
window_bits | The History window size to use. For information about valid values, see the CabConstants class.

Exceptions:

com.ms.util.cab.CabException if one or more of the parameters are invalid.


Interface CabConstants

public interface CabConstants
{
  // Fields
  static final int CAB_BLOCK_SIZE;
  static final int CAB_PROGRESS_INPUT;
  static final int COMPRESSION_LZX;
  static final int COMPRESSION_MSZIP;
  static final int COMPRESSION_NONE;
  static final int COMPRESSION_QUANTUM;
  static final int RESERVED_CFDATA;
  static final int RESERVED_CFFOLDER;
  static final int RESERVED_CFHEADER;
}

This interface contains the constants used in cabinet creation and extraction. The COMPRESSION constants are used to select the compression type used in a new folder during in cabinet creation. The PROGRESS constants are used to indicate the type of progress message being sent to the progress method in CabProgressInterface. The RESERVED constants are used when decompressing cabinets.

Fields

CAB_BLOCK_SIZE
The size of input frames before compression.
CAB_PROGRESS_INPUT
When creating a cabinet, a progress report on a file being added.
COMPRESSION_LZX
LZX compression (selectable history window of 32K to 2048K).
COMPRESSION_MSZIP
MSZIP compression (32K history window).
COMPRESSION_NONE
Compression type indicating no compression.
COMPRESSION_QUANTUM
Quantum compression (not supported).
RESERVED_CFDATA
Indicates a CFDATA reserved area.
RESERVED_CFFOLDER
Indicates a CFFOLDER reserved area.
RESERVED_CFHEADER
Indicates a CFHEADER reserved area.


Interface CabDecoderInterface

public interface CabDecoderInterface extends CabProgressInterface
{
  // Methods
  boolean closeOutputStream(OutputStream stream,
        CabFileEntry entry, boolean success);
  InputStream openCabinet(String disk_name, String cabinet_name);
  OutputStream openOutputStream(CabFileEntry entry);
  boolean reservedAreaData(int reserve_type, byte[] reserved_data,
        int reserved_data_size, byte[] other_data,
        int other_data_size );
}

This is the interface that must be passed as a parameter to the CabDecoder constructor.

For more information about cabinet file decoding, see CabDecoderand CabFileEntry.

CabProgressInterface
  |
  +--CabDecoderInterface

Methods

closeOutputStream

boolean closeOutputStream(OutputStream stream, CabFileEntry entry,
        boolean success);

closeOutputStream is guaranteed to be called to close a stream opened using openOutputStream.

Return Value:

Returns true if processing should continue for files in this cabinet, or false if processing should end immediately. In the latter case, no more openOutputStream calls will be made.

Parameter | Description
stream | A handle on the file extracted from the cabinet file.
entry | Contains information about the file extracted from the cabinet file.
success | Determines whether the file was extracted successfully. If the value of this parameter is false, then all of the data written to this stream must be considered invalid.

openCabinet

InputStream openCabinet(String disk_name, String cabinet_name);

This method is used to open a next or previous cabinet in a set of spanned cabinets. Since spanned cabinets are currently not supported in this version of the cabinet file package, this method will never be called.

Return Value:

Returns null if the specified cabinet file is not available; otherwise an InputStream for the specified cabinet file is returned.

Parameter | Description
disk_name | The disk name of the desired cabinet file.
cabinet_name | The cabinet name of the desired cabinet file.

openOutputStream

OutputStream openOutputStream(CabFileEntry entry);

After the CabDecoder.extract method is called, the openStream method will be called for each file entry in the cabinet file.

Return Value:

Returns either an OutputStream object from which to extract the file, or null, indicating that the file should not be extracted.

Parameter | Description
entry | The CabFileEntry that will be extracted. The contents of this object are examined to determine whether it should be extracted.

reservedAreaData

boolean reservedAreaData(int reserve_type, byte[] reserved_data,
        int reserved_data_size, byte[] other_data, int other_data_size );

Called when the cabinet file contains reserved data. If the cabinet file does not contain any reserved data, then this method will never be called.

The reserve_type and data_size parameters indicate the type of reserved area (as defined in the CabConstants interface) and the size of the area. The data parameter will be null.

This method returns true to indicate that reserved areas of the specified type should be read, or false to indicate that they should be ignored. In the former case, reservedAreaData will be invoked each time the specified reserve area is seen with data containing the reserved data.

Additional reserved data area
Applications that use this method should return false for any reserved area types that they do not know how to handle.

Return Value:

Returns true if this type of reserved entry should be read and passed back for subsequent calls to this method, or false if no more calls should be made for this type of reserved data.

Parameter | Description
reserve_type | Type of reserved area as defined in the CabConstants interface.
reserved_data | The array containing the reserved data, or null if this is only a message indicating that the reserved area exists.
reserved_data_size | Size of the reserved area, or zero if size is not known
other_data | Valid only if a RESERVED_CFDATA type, in which case this array contains the data in the CFDATA frame
other_data_size | Valid only if a RESERVED_CFDATA reserve type, in which case this is the size of the data in other_data[]


Interface CabProgressInterface

public interface CabProgressInterface
{
  // Methods
  Object progress(int progress_type, long val1, long val2, Object[]
        progress_data);
}

This interface is used by both the CabCreator and CabDecoder classes to report progress when creating or decoding a cabinet file. Currently, the only progress message supported is CAB_PROGRESS_INPUT, which is sent by CabCreator when processing input streams. For this message, progress_data[0] is a CabFileEntry object that corresponds to the file being compressed, and progress_data[1] is the position of the compressor in the input stream of that file. The application should return null in response to this message.

Methods

progress

Object progress(int progress_type, long val1, long val2,
        Object[] progress_data);

Return Value:

Returns a return code specific to the type of progress message.

An application should return null for any progress messages it does not handle. Currently, null should be returned for all progress messages.

Parameter | Description
progress_type | The progress type as defined in the CabConstants interface.
val1 | The value of this parameter is specific to the progress message type.
val2 | The value of this parameter is specific to the progress message type.
progress_data | Progress data as defined by the progress type.


Application Foundation Classes

AFC

AFC Application Foundation Classes (JDK 1.0.2-compatible AFC) | Java Home
 | Java Home

Microsoft's Application Foundation Classes (AFC) are a comprehensive set of Java class libraries that provide user interface controls, graphics and effects classes, and the ability to create and extract cabinet (CAB) files. The release of AFC's JDK 1.0.2-compatible redistributable component gives developers a means to create and distribute AFC applets for a variety of popular JDK 1.0.2-compatible platforms.

AFC's UI controls give Java developers a rich set of UI elements from which they can quickly build flexible, modern, and powerful user interfaces for their applications, enhanced by the innovative graphics techniques exposed for the first time by the com.ms.fx graphics and effects classes. Developers can, through the com.ms.util.cab APIs, utilize Microsoft's CAB packaging and compression technology on any virtual machine.

Written in Java, AFC ensures that applications built using these classes run on the most popular platforms that support Java, insofar as it has been possible to achieve full compatibility. The AFC UI controls are defaulted to the Microsoft Windows UI, and are also are fully customizable to reflect the needs of application and applet designers. AFC supports Microsoft's Active Accessibility for Java, so any application developed using AFC is automatically accessibility-enabled (where Active Accessibility for Java services exist).

AFC comprises:

  • UI: A rich suite of UI controls, written in Java. UI controls will run in a number of popular browsers and are automatically accessibility-enabled.

  • Fx: A suite of classes for graphics and effects, written in Java. Fx classes will run in a number of popular browsers.

  • CAB: A suite of Java APIs for creating and extracting cabinet files on any virtual machine.

Known Issues for JDK 1.0.2-compatible AFC

  • Platforms and JDK 1.1 and 1.02 compatibility: The version of AFC's UI and Fx classes that ship with the Microsoft SDK for Java and Internet Explorer is fully JDK 1.1-compatible.

    The redistributable version of AFC provided here is fully JDK 1.0.2-compatible, and has been tested on popular JDK 1.0.2-compatible browsers on Win32 and other platforms. This redistributable component should be used for applets requiring distribution on Internet Explorer 3.0.2 and other popular non-JDK 1.1-compliant platforms.

    A license agreement provided with JDK 1.0.2-compatible AFC gives full licensing and redistribution details, and differences between the JDK 1.0.2 and 1.1-compatible versions of AFC affecting developers are described in accompanying documentation. Watch http://www.microsoft.com/java/afc for the latest information.

  • Platforms: JDK 1.0.2-compatible AFC will function effectively on Internet Explorer Version 3.0.2 and 4.01 and on Netscape Navigator 3.0.4 and 4.0.3 on Windows 95 and Windows NT 4.0.

    JDK 1.0.2-compatible AFC will also function on Navigator 3.0.4 and 4.0.3 on Solaris platforms.

    Severe painting and performance problems are exhibited when running JDK 1.0.2-compatible AFC on both Internet Explorer 3.0.2 and Netscape Navigator 3.0.4 and 4.0.3 for the Apple Macintosh as a result of difficulties intrinsic to the Macintosh VM. Microsoft is therefore not licensing JDK 1.0.2-compatible AFC for use on the Apple Macintosh at this time.

    The JDK 1.1-compatible version of AFC will be available with Internet Explorer 4.0 when Internet Explorer 4.0 is released for Apple Macintosh and Solaris platforms.

    Please note: Developers may notice variations in the quality of the JDK 1.0.2-compatible AFC implementation when running across VMs and browsers, resulting from compatibility issues and differences in VM implementations

  • Installation:
    Note: AFCSetup will automatically install JDK 1.0.2-compatible AFC on whichever browser is set as the default on your client machine. Please make sure you have set the browser in which you wish to run JDK 1.0.2-compatible AFC as default before proceeding with the installation.

    To install JDK 1.0.2-compatible AFC for Navigator 3.0.4 or 4.0.3 on Solaris:

    1. Copy AFC102.ZIP to an appropriate location on your computer (such as $HOME/classes). If you are unsure where this directory is, use the following to locate it:

      2. public static void main(String args [])
      {
      System.out.println( "java.home = " + System.getProperty( "java.home" ) );
      }
    2. Next, add this location to your CLASSPATH - for example: set CLASSPATH = $HOME/classes/afc102.zip:$CLASSPATH.

    AFC Detect: AFC Detect is a useful program that allows you to determine whether or not JDK 1.0.2-compatible AFC is installed on your client machine, and which will then install it in the correct location if it is not already present. AFC Detect is provided as a JDK 1.0.2-compatible AFC sample.

  • JDK 1.1 and 1.0.2 event models: You can use the JDK 1.1 event model in JDK 1.0.2-compatible AFC, provided you remain within AFC. Please note, however, that only events available under JDK 1.0.2 can be used.

  • Textures: It is not possible to do setColor(FxColor obj) on a UIComponent in JDK 1.0.2-compatible AFC. The workaround is to override update() and then call paint().

  • JDK Scrolling: This release may exhibit some scrolling problems when a scrollviewer is overlaid by a top level window.

  • Threading: JDK 1.0.2-compatible AFC classes have no inherent thread synchronization. Therefore, as with AWT 1.0.2, callers must be careful with threading.

  • AWT/UI interoperability: In this release, bi-directional interoperability between UI and AWT is provided, enabling AWT components to be used in AFC containers and vice versa.

    Please note: As AwtUI and UIAwt objects are intended only to provide a bridge between AWT and AFC, use of AwtUI and UIAwt should be confined to situations where a bridge is necessary and beyond this should be limited to prevent performance degradation and to permit the full benefits of AFC to be realized.

    AFC's API documentation and articles on     http://www.microsoft.com/java/ give further implementation details.

  • Class library changes: A list of class library changes between JDK 1.1-compatible AFC and JDK 1.0.2-compatible AFC is provided on http://www.microsoft.com/java/afc

  • Drag and Drop: Drag and drop does not function in JDK 1.0.2-compatible AFC. This functionality is restricted to JDK 1.1-compatible AFC.

  • Hot tracking has been disabled for this release.

  • FxStyledPen has a supported width of one pixel for this release.

  • UIEdit: Multiple font support and vertical writing are not available in this release. FxFormattedText provides multiple font and vertical writing support, but this functionality is not directly available as part of our UIEdit control.

  • UIResourceObject: UIResourceObject is very large (332K) in this release.

  • UIChoice: When using JDK 1.0.2-compatible AFC, top level windows can sometimes obscure any part of a pop-up menu that appears over them.

  • Border Layout: In this release of AFC, overridding getPreferredSize() in a Panel will not cause the panel to have that perferred size. The layout manager may shrink the panel to a smaller size.

      •


NOTICE SPECIFIC TO SOFTWARE AVAILABLE ON THIS WEBSITE Any software that is made available to download from this server ("Software") is the copyrighted work of Microsoft and/or its suppliers. Use of the Software is governed by the terms of the end user license agreement, if any, which accompanies or is included with the Software ("License Agreement"). An end user will be unable to install any Software that is accompanied by or includes a License Agreement, unless he or she first agrees to the License Agreement terms.

The Software is made available for downloading solely for use by end users according to the License Agreement. Any reproduction or redistribution of the Software not in accordance with the License Agreement is expressly prohibited by law, and may result in severe civil and criminal penalties. Violators will be prosecuted to the maximum extent possible.

WITHOUT LIMITING THE FOREGOING, COPYING OR REPRODUCTION OF THE SOFTWARE TO ANY OTHER SERVER OR LOCATION FOR FURTHER REPRODUCTION OR REDISTRIBUTION IS EXPRESSLY PROHIBITED.

THE SOFTWARE IS WARRANTED, IF AT ALL, ONLY ACCORDING TO THE TERMS OF THE LICENSE AGREEMENT. EXCEPT AS WARRANTED IN THE LICENSE AGREEMENT, MICROSOFT CORPORATION HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS WITH REGARD TO THE SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT.

RESTRICTED RIGHTS LEGEND. Any Software which is downloaded from this Server for or on behalf of the United States of America, its agencies and/or instrumentalities ("U.S. Government"), is provided with Restricted Rights. Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 or subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights at 48 CFR 52.227-19, as applicable. Manufacturer is Microsoft Corporation, One Microsoft Way, Redmond, WA 98052-6399.

NOTICE SPECIFIC TO DOCUMENTS AVAILABLE ON THIS WEBSITE

Permission to use Documents (such as white papers, press releases, datasheets and FAQs) from this server ("Server") is granted, provided that (1) the below copyright notice appears in all copies and that both the copyright notice and this permission notice appear, (2) use of such Documents from this Server is for informational and non-commercial or personal use only and will not be copied or posted on any network computer or broadcast in any media, and (3) no modifications of any Documents are made. Use for any other purpose is expressly prohibited by law, and may result in severe civil and criminal penalties. Violators will be prosecuted to the maximum extent possible.

Documents specified above do not include the design or layout of the microsoft.com website or any other Microsoft owned, operated, licensed or controlled site. Elements of Microsoft websites are protected by trade dress and other laws and may not be copied or imitated in whole or in part. No logo, graphic, sound or image from any Microsoft website may be copied or retransmitted unless expressly permitted by Microsoft.

MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS SERVER FOR ANY PURPOSE. ALL SUCH DOCUMENTS AND RELATED GRAPHICS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES

AND CONDITIONS WITH REGARD TO THIS INFORMATION, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF INFORMATION AVAILABLE FROM THIS SERVER.

THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS SERVER COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED HEREIN AT ANY TIME.

NOTICES REGARDING SOFTWARE, DOCUMENTS AND SERVICES AVAILABLE ON THIS WEBSITE.

IN NO EVENT SHALL MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF SOFTWARE, DOCUMENTS, PROVISION OF OR FAILURE TO PROVIDE SERVICES, OR INFORMATION AVAILABLE FROM THIS SERVER.

LINKS TO THIRD PARTY SITES

THE LINKS IN THIS AREA WILL LET YOU LEAVE MICROSOFT'S SITE. THE LINKED SITES ARE NOT UNDER THE CONTROL OF MICROSOFT AND MICROSOFT IS NOT RESPONSIBLE FOR THE CONTENTS OF ANY LINKED SITE OR ANY LINK CONTAINED IN A LINKED SITE, OR ANY CHANGES OR UPDATES TO SUCH SITES. MICROSOFT IS PROVIDING THESE LINKS TO YOU ONLY AS A CONVENIENCE, AND THE INCLUSION OF ANY LINK DOES NOT IMPLY ENDORSEMENT BY MICROSOFT OF THE SITE.

COPYRIGHT NOTICE. Copyright © 1998 Microsoft and/or its suppliers, One Microsoft Way, Redmond, Washington 98052-6399 U.S.A. All rights reserved.

TRADEMARKS. Microsoft, Windows, Windows NT, MSN, The Microsoft Network and/or other Microsoft products referenced herein are either trademarks or registered trademarks of Microsoft. Other product and company names mentioned herein may be the trademarks of their respective owners.

The names of companies, products, people, characters and/or data mentioned herein are fictitious and are in no way intended to represent any real individual, company, product or event, unless otherwise noted.

Any rights not expressly granted herein are reserved.