Microsoft HomeProductsSearchSupportShopWrite Usspacer.gif Microsoft Home
AFC Samples
 In this topic

*Description

*Sources

 

AFC Samples   PreviousAFC SamplesNext
    Previous AFC
Samples
Next

 


Viewers Sample Applet

This SDK for Java sample demonstrates the most common AFC viewers.

Description

All the viewers that compose this sample are contained in a UITabViewer, which is in turn contained in a UIGroup control.

The first viewer displayed is a UISplitViewer. Use the mouse to select and drag the gray splitter bars dividing the blocks of color, altering their dimensions and creating your own Mondrian-style painting. The UISplitViewer tab panel also demonstrates Microsoft drag-and-drop support. Colors from the color grid on the right can be dragged (click, hold mouse button, and then move the mouse) and dropped (release mouse button) onto one of the panes of the split panel on the left. This functionality is provided by the classes in the com.ms.object and com.ms.object.dragdrop packages. Currently, it is necessary to have an AWT component implement the DragHandler interface (and be addNotify'd) so that the drag session is registered for com.ms.ui components. This will be improved for future releases.

The UISplitViewer sample also demonstrates a com.ms.ui component hosting an AWT component, and an AWT component hosting a com.ms.ui component. The main panel is a com.ms.ui.UIPanel, while the panel that contains the color grid is a java.awt.Panel. The individual color squares are com.ms.ui.UIPanel components.

The next viewer displayed is a UIColumnViewer that shows three columns. The first column contains a UITree control, and the next two contain UIText controls. The columns can be moved, resized and reordered. The UITree expands when the plus signs are clicked, and collapses when the minus signs are clicked. Upon expansion, the ScrollViewer that contains the tree automatically adds horizontal and vertical scroll bars.

The UIMarquee tab displays two UIMarquees that have been easily extended to perform custom operations. The first shows scrolling and changing statics moving vertically. The second shows an animated graphic being moved down the page and to the right.

The final viewer displayed is a UITabViewer with complex navigation through nested tabs and tab viewers. Navigate through the tabs to discover the final image.

Sources

This sample applet consists of the following sources:
SDKSample.java
SDKConsts.java
SDKCtrlPnl.java
SDKImages.java
SDKCallbacks.java
SDKInsetPanel.java
TabViewerPanel.java
SplitViewerPanel.java
ColumnViewerPanel.java
MarqueePanel.java

Top