Visually composing beans means using the Visual Composition Editor to place and connect individual and composite beans in a graphical user interface (GUI). More specifically, visually developing a user interface bean includes:
When you edit the bean that represents the overall structure of your application (usually its main user interface view), you graphically build your application. By making connections between beans, you build your program's business logic.
A composite bean is a bean that contains other beans. The beans you add are referred to as embedded beans. You can embed primitive or composite beans into your composite bean.
You can add beans that appear on the beans palette, as well as beans that do not appear on the palette. Beans that do not appear on the palette may include composite beans you created, such as a panel with several buttons.
Note: | If you use a layout that allows a bean to completely cover another bean, the Beans List enables you to easily perform tasks on the covered components. |
To add a bean from the palette to the Visual Composition Editor surface, follow these steps:
Note: | If you specify a non-null layout for the container, the bean placement is affected by that layout manager. |
To add a bean from the palette to the beans list, follow these steps:
Note: | The layout you specified for the container affects the placement for the bean. To modify bean placement on the Visual Composition Editor from within the Beans List window, open the Properties for the bean and modify the Constraints. |
To add multiple instances of the same bean, enable Sticky by holding Ctrl while selecting the bean. Selecting a new bean or the Selection tool disables Sticky.
If the bean you want to add is not on the beans palette, you can add it with the Choose Bean tool from the beans palette.
You can add a bean as a class, a serialized bean, or a variable. When you add a bean as a class, the default constructor for the class is used when the program runs. This means that a real object is created, not a variable that points to a real object defined elsewhere. For more about serialized beans, see Object Serialization in VisualAge.
Before you try to add a serialized bean, make sure its serialization file (.ser) is somewhere in the classpath for your workspace.
To place a bean on the Visual Composition Editor:
The Name field is optional. If you leave it blank, VisualAge generates a default name based on the class.
To enable the OK push button, you must enter the fully qualified name, package, and class in the Class name field.
If you are dropping a bean that uses a graphic resource, place the graphic resource file in the directory where your program element is located. For example, if your program element is called MyProject.MyPackage.MyApp, place your graphic resource file in x:\..\ide\project_resources\MyProject\MyPackage\MyApp (where x is the drive where VisualAge is installed). If you have not exported your program element or created subdirectories in the project_resources directory, you may need to create the subdirectories manually.
To unload the mouse pointer at any time, from the beans
palette, click the
Selection tool.
If you undo an operation that you decide you had right in the first place, select Redo from the Edit pull-down menu. Redo restores the bean to the state before the last Undo, including any connections that were deleted.
Undo and Redo affect operations you perform on the free-form surface and beans palette in the Visual Composition Editor. They do not affect any of the functions in the File pull-down menu.
Use Undo to reverse any or all of the changes you made to the Reorder Connections list.
Saving a bean that you have constructed includes generating the source code. To save the bean and generate the source code:
Note: | Clicking the
![]() |
When you select
Run from the tool bar, VisualAge performs the following actions on
your visually composed bean:
Adding Beans in the Visual Composition Editor
Beans Palette
Free-Form Surface
Layout Managers in Visual Composition
Managing the Beans Palette
Moving Beans
Editing Bean Properties
Composing an Applet
Changing Bean Size and Position
Beans List
Choose Bean Window