Top
Interstage Studio User's Guide
FUJITSU Software

7.3.6 Editing a Java Form

Editing a Java Form

To edit a Java Form, the Java Form Designer can be used to perform the following operations:

Screen configuration of the Java Form Designer

The Java Form Designer screens are made up of the following five windows, editors, and views. Use these screens to edit Java Forms:

Note

If the Java editor has been used to open a Java Form, sections of the source displayed with a different background color cannot be edited. The source in these sections invokes screen (Bean) information or event processing. Modification is also prohibited for "// Graphical Editor Form" at the beginning and for the part enclosed within "//@@Form Design Information start" and "//@@Form Design Information end". Once these parts are edited, they cannot be opened by the Graphical Editor.

7.3.6.1 Setting a Bean

Use a mouse to perform operations such as laying out a new Bean, modifying the size, shifting, and copying.

7.3.6.2 Laying out a Bean

The layout manager is provided as a method of laying out a Bean using a Java application. When the layout manager is used, the layout will be corrected automatically according to the modifications made to the screen size but will be subject to the constraints of the screen formats supported by the layout manager.

From the viewpoint of screen extendibility, handling modifications made to the screen size is desirable, so using the layout manager in the screen design of Java applications is recommended.

Layout characteristics

Point

If Bean drawings overlap, a Heavyweight will be drawn over a Lightweight. In addition, if the drawings overlap among components, they will be determined according to the order in which the components were added to a container. The order in which they were added is their order on the component tree. If the layout manager specification is other than "none", there will be no overlapping among drawings within the same component.

7.3.6.3 Referencing or Setting Bean Properties

Bean properties can be classified into the following types:

List of Standard Properties

Standard Properties are typical properties of a Java Form or Bean. The list of Standard Properties is as follows:

Property

beanName

layout

bounds

border

constraints

addIndex

visible

background

foreground

font

AWTName

toolTipText

attention

Note

The bounds property displays the values of the width and height of the client area of a window, but the values of the width and height of the window itself will be displayed if [Edit as Execution Image] has been selected.

Original Properties

Original Properties are displayed based on information that has been specified in the BeanInfo information provided by various Beans.

If a Original Properties is a read-only property, a write-only property, or an invisible property, it will not be displayed.

In addition, some properties will not be displayed if [Show expert property] has not been selected in the properties of the Environment Setup options.

Note

For projects in which the Peculiar Property name begins with an asterisk (*), the initial value of [Value] cannot be changed.

Information in the properties sheet

The properties sheet of the properties window is used to reference or set properties. The following information will be displayed in the properties sheet:

Functions of the properties sheet

The buttons in the properties window have the following functions:

Point

The Java Form Designer has a function for editing the main properties of a Bean on a form, which is referred to as the spot edit function. To use the spot function, from the Java Form Designer menu bar, go to [Settings] > [Options] > [Form] tab and then select [Enable spot editing].

When you click on the Bean being selected or when you press the [Ctrl+E] keys simultaneously, the spot edit status will result, and a label indicating that spot editing is in progress will be displayed in the upper part of the Bean.

To end the spot edit, press the [Enter] key, or for a spot edit that allows multiple line input, press the [Ctrl+Enter] keys.

7.3.6.4 Creating Bean Relationships

The Java Form Designer allows Bean Relationships to be created in an interactive format in Java Forms, applets, and Java programs and allows these Bean Relationships to be visualized.

Creating Bean Relationships

[Bean Relationships Wizard] can be launched using the method shown below. When you follow the instructions of the Wizard to set a source Bean event and a target Bean method or property, a Bean Relationships source will be created in the description of the event processing of the specified Bean.

Editing Bean Relationships

When you edit the values that have been specified in [Bean Relationships Wizard] and click [Create], the Bean Relationship source will be updated in the description of the event processing that corresponds to the Visualized Bean Relationships (directional lines).

To start the Wizard:

Deleting Bean Relationships

Bean Relationships can be deleted by right-clicking the Visualized Bean Relationships (directional lines) of the Java Form and clicking [Delete] from the context menu.

Point

Deleting Bean Relationships can also be performed from the Bean Relationships confirmation screen.

Displaying Bean Relationships

To confirm Bean Relationships, select [Tools] > [Check Bean Relationships] from the Java Form Designer menu bar and launch the [Check Bean Relationships] screen.

The [Check Bean Relationships] screen displays a list of all the Bean Relationships and allows the creation, edit, and deletion of Bean Relationships.

Analyzing Bean Relationships

Bean Relationships are analyzed automatically, but it is also possible to perform optional analysis by selecting [Edit] > [Re-analyze Bean Relationships] from the Java Form Designer menu bar.

7.3.6.5 Defining a Menu

Menu definition

If pull-down menus are to be used, select [Tools] > [Menus] from the Java Form Designer menu bar and launch menu definition. In menu definition, define the configuration of the menus and information such as the character strings to be displayed in the menus.

Menu definition

Menu objects that have been defined in Java Forms will become the class fields of the Java Forms. There is usually no need to use these fields to operate menus directly, but objects can be operated via class fields in order to perform special processing.

An example of operating a menu object is shown below.

Example

If an "APPLY" attention occurs, a "cancel" menu object is masked.

public boolean processAttention_APPLY() {
  cancel.setEnabled(false);
  return true;
}

Attentions

Attentions are used to define the actions for menu operations. Attentions are the names given to describe the general operations of both the screens and menus. They are used to define the operation of menus, buttons, or keys.

Note

It is essential for an action event to have been defined in order for an attention to be caused, so this is no different from an ordinary action event. Therefore, as attentions may require more time and effort, their use is not recommended.

7.3.6.6 Defining an Exclusive Selection Group

An exclusive selection group is a function that groups exclusive selection type Beans (radio buttons) and automatically sets the selection status. Only one Bean in a single exclusive selection group will have a status of selected; the other Beans will be set with an unselected status.

Method of defining an exclusive selection group

  1. Displaying the setup dialog box of the exclusive selection group
    Select [Tools] > [Button Groups] from the Java Form Designer menu bar and start defining the exclusive selection group.

  2. Creating a new exclusive selection group
    Click [Add JFButtonGroup(JBK)], [Add CheckboxGroup(AWT)], or [Add ButtonGroup(Swing)] to create a new selection group.

  3. Setting group members
    Select a created group name that from the [Groups] list and then click [Edit Member]. The [Exclusive Selection Members] screen will be displayed. Set the group members in this screen.

Note

Default exclusive selection groups (group names: __cdDefaultJFButtonGroup, __cdDefaultCheckboxGroup, and __cdDefaultButtonGroup) have been defined in advance. If an exclusive selection type Bean has been pasted onto a Java Form, it will be automatically added to the default exclusive selection groups. The default exclusive selection groups cannot be deleted.

Direct operation of exclusive selection groups

To perform special processing, objects can be operated using class fields.

[Class field name]
Name specified by "group object name" when a group has been added using the exclusive selection group definition dialog box

[Class field type]

Type of exclusive selection group that has been created

Class field type of exclusive selection group object

Group for AWT

java.awt.CheckboxGroup

Group for Swing

javax.swing.ButtonGroup

Example

If an "APPLY" attention occurs, red will be set as the background color of the object that has been exclusively selected in the "select" exclusive selection group for AWT.

public boolean processAttention_APPLY() {
  select.getSelectedCheckbox().setBackground(java.awt.Color.red);
  return true;
}