Manipulating beans

After you add beans to an applet, you will often want to align them, size them, or perform similar tasks. Before you can align or size your beans, however, you must learn to manipulate them. This section introduces you to the following tasks:

Selecting beans

To select a bean, click on it with mouse button 1.

When you select a bean, small, solid boxes called selection handles appear in the corners of the bean to assist you in manipulating that bean.

tgsbutt1.gif (382 bytes)

Note:
Beans that cannot be sized do not have selection handles. Instead, these beans change their background color when they are selected. Beans with this behavior include nonvisual beans and menu beans.

If other beans are selected when you select a bean, they will be deselected automatically. This is referred to as single selection. The name of the bean currently selected is displayed in the status area at the bottom of the Visual Composition Editor.

Selecting several beans

If several beans are selected, the last one selected has solid selection handles indicating that it is the anchor bean. The other selected beans have hollow selection handles.

../images/tjgsbuts.gif (678 bytes)

The anchor bean is important when performing operations such as bean sizing and alignment. The other selected beans set their position or size to the position or size of the anchor bean. You can change the anchor bean by holding the shift key and selecting the bean you want to be the anchor.

To select several beans, do one of the following:

When multiple beans are selected, the status area displays the number of beans selected (for example, 3 beans selected).

Deselecting beans

To deselect all the beans currently selected, click mouse button 1 on another bean or in an open area of the free-form surface.

To deselect one bean from a group of beans that have been selected, hold down the Ctrl key and click with mouse button 1 on the bean you want to deselect. If the bean you deselected was the anchor bean, the previously selected bean will become the anchor bean.

Moving beans

To move beans, follow these steps:

  1. Click and hold with the appropriate mouse button on the bean:
  2. Move the mouse pointer to the location at which  you want to position the bean and release the mouse button.

You can move several beans at once by first selecting all of the beans you want to move. You can then grab any selected bean (by clicking on it with mouse button 1) and drag all the selected beans to their new location.

Copying beans

After you add a bean, you can copy that bean instead of adding another one from the beans palette. Copying a bean is one method of adding multiple copies of the same bean. One obvious advantage to copying a bean is that you can make common modifications to one bean and simply duplicate it as often as needed. Copying a bean that has connections does not duplicate the connections.

To copy a bean, follow these steps:

  1. Hold down the Ctrl key and select with the appropriate mouse button on the bean you want to copy.
  2. Drag the mouse pointer to the position where you want the new bean and release the mouse button and the Ctrl key.

You can copy several beans at once by first selecting all the beans you want to copy. Then, hold the Ctrl key, grab any selected bean, and drag a copy of the beans to their new location.

Copying beans using the clipboard

To copy beans using the clipboard, follow these steps:

  1. Select the bean or beans you want to copy.
  2. From the Edit menu of the Visual Composition Editor, select Copy.
  3. Then, from the Edit menu, select Paste. The mouse pointer becomes a cross-hair.
  4. Move the mouse pointer to the location where you want to add the new bean or beans and click mouse button 1.

Deleting beans

To delete a bean, simply select it and press the Delete key, or select Delete from the bean's pop-up menu.

To delete several beans, multiple-select the beans you want to delete before performing the delete operation.

If you delete a bean that has connections to or from it, the bean and all of its connections are deleted. However, in this case, you are prompted to confirm whether you want to continue before the beans and connections are deleted. If you accidentally delete an item you wish to retain, simply select Undo from the Edit menu of the Visual Composition Editor.