Tutorial

 

What is JBuilder?

 

JBuilder is a cross-platform environment for building Java applications. JBuilder Enterprise is used for the development of EJB, CORBA and database applications, with support for multiple platforms, application servers, and version control systems.

 

 

 

 

With the integration of VP-UML and JBuilder, you can synchronize your model in VP-UML and your code in JBuilder.

 

 

 

 

Before you can get the benefits from the integration between VP-UML and JBuilder, you need to install JBuilder and integrate them.

 

1.             It assumes that you have installed JBuilder on your system.

 

2.             Now start VP-UML for integration with JBuilder. Click the Tools menu on the menu bar. (See Figure 1)

Figure 1 VP-UML

 

3.             Click the IDE Integration menu item on the Tools menu.? A cascading menu appears. (See Figure 2)

Figure 2 Tools menu

 

4.             Click the JBuilder Integration? menu item on the cascading menu. The Visual Paradigm Integration dialog appears. (See Figure 3)

 

5.             Input the VP-UML and JBuilder Installation Directories in the dialog. (See Figure 3)

Figure 3 Visual Paradigm Integration dialog

 

6.             Click the Start Integrate button on the dialog. The Integration progress dialog appears. (See Figure 4)

Figure 4 Integration progress dialog

 

7.             When the integration is finished, the OK button on the Integration progress dialog will be activated. Click the OK button on the dialog.

 

8.             Click on the Yes button to start JBuilder.

 

 

 

 

When you want to generate or reverse your code, you need to start JBuilder first and then start VP-UML with a JBuilder project.

 

1.             After starting JBuilder, click File menu on the menu bar.

Figure 5 JBuilder

 

2.             Click the New menu item on the File menu. The New Project dialog appears. (See Figure 6)

Figure 6 File menu

 

3.             Type in the project name in the dialog and click the Finish button on the dialog. A new JBuilder project is created. (See Figure 7)

Figure 7 New Java Project dialog

 

4.             You can see the new project in the Package Explorer. (See Figure 8)

Figure 8 New JBuilder project

 

 

 

You can create a new VP-UML project with a JBuilder project in the Package Explorer in JBuilder.

 

1.             Right click a project in the Package Explorer in JBuilder. A popup menu appears. (See Figure 9)

Figure 9 Popup menu in Package Explorer in JBuilder

 

2.             Click the VP-UML Project menu item on the popup menu. A cascading menu appears. (See Figure 10)

Figure 10 VP-UML Project menu item

 

3.             Click the New VP-UML Project menu item on the cascading menu. VP-UML will be opened with a blank new VP-UML project created. (See Figure 11)

Figure 11 A blank new VP-UML project

 

You can perform visual modeling in VP-UML now. (See Figure 12)

Figure 12 Visual Modeling in VP-UML project created in JBuilder

 

 

 

 

With your existing java project(s), you can open VP-UML from JBuilder. VP-UML will start as another window. You can switch between them.

 

1.             Right click on a java project in the Package Explorer. A popup menu appears. (See Figure 14)

Figure 13 JBuilder

 

2.             Click on the Open VP-UML Project menu item in the popup menu. VP-UML flash screen appears. (See Figure 16) Or you can click on the Go to VP-UML button on the toolbar. (See Figure 15)

Figure 14 Open VP-UML Project menu item

 

Figure 15 Go to VP-UML button on the toolbar in JBuilder

 

3.             After VP-UML finished loading, VP-UML appears. (See Figure 1‑17 VP-UML)

Figure 16 VP-UML flash screen

 

4.             Now you can generate or reverse your code now.

Figure 17 VP-UML

 

 

 

You can use existing VP-UML project in JBuilder Integration. A copy of the imported VP-UML project will be created in the JBuilder Integration Project directory of the selected JBuilder project. The original and the imported VP-UML project are two separate copies and they are unlinked.

 

1.             Create a blank new VP-UML project (See Figure 18) and create a new textual analysis document in the project. (For more details about textual analysis, please see the Textual Analysis tutorial.)

Figure 18 New VP-UML project

 

2.             Input the problem statement in the document. (See Figure 19)

Figure 19 New textual analysis document

 

3.             Identify the candidate classes with the problem statement. (See Figure 20)

Figure 20 Identifying candidate classes in the problem statement

 

4.             Save the VP-UML project and start JBuilder.

 

5.             Right click a project in the Package Explorer in JBuilder. A popup menu appears. (See Figure 21)

Figure 21 Popup menu in Package Explorer in JBuilder

 

6.             Click the VP-UML Project menu item on the popup menu. A cascading menu appears. (See Figure 22)

Figure 22 VP-UML Project menu item

 

7.             Click the Import VP-UML Project menu item on the cascading menu. The Open dialog appears. (See Figure 23)

Figure 23 Open dialog for importing VP-UML project

 

8.             Double click the previous saved VP-UML project. The VP-UML project will be linked to the JBuilder project.

 

 

 

You can export the VP-UML project that is linked to the selected JBuilder project in JBuilder. The exported VP-UML project is unlinked with the VP-UML project inside the JBuilder Integration.

 

1.             Right click a project in the Package Explorer in JBuilder. A popup menu appears. (See Figure 24)

Figure 24 Popup menu in Package Explorer in JBuilder

 

2.             Click the VP-UML Project menu item on the popup menu. A cascading menu appears. (See Figure 25 VP-UML Project menu item)

Figure 25 VP-UML Project menu item

 

3.             Click the Export VP-UML Project menu item on the cascading menu. The Save As dialog appears. (See Figure 26)

Figure 26 Save As dialog for exporting VP-UML project

 

4.             Input the file name or select an existing VP-UML project file in the dialog.

 

5.             Click the Save button on the dialog. The VP-UML project will be saved to the selected destination.

 

 

 

 

You can generate/synchronize the model in VP-UML from your code in JBuilder. You can generate the model in VP-UML with different scope ? project, package and class.

 

public abstract class AbstractButton extends JComponent implements ItemSelectable, SwingConstants {

 

??? public static final String MODEL_CHANGED_PROPERTY = "model";

??? public static final String TEXT_CHANGED_PROPERTY = "text";

??? public static final String MNEMONIC_CHANGED_PROPERTY = "mnemonic";

??? .

??? .

??? .

}

 

 

Figure 27 Code reverse engineering

 

Method 1 ? Code Reverse with Package Explorer

1.             Right click on the desired project, package or class in the Package Explorer. A popup menu appears. (See Figure 29)

Figure 28 JBuilder

 

2.             Click on the Update VP-UML Project ?menu item on the popup menu. VP-UML will be opened. (See Figure 30)

Figure 29 Update VP-UML Model menu item

 

3.             A new project will be created and the model will be updated in VP-UML. Click on the Model Tree View tab in VP-UML. You can see the package and class models in the tree.

Figure 30 VP-UML

 

4.             Click on the Create Class Diagram button on the tool bar. A blank new class diagram appears.

Figure 31 Create Class Diagram menu item

 

5.             Drag the model in the Model Tree View to draw the class diagram. (See Figure 32)

Figure 32 Class Diagram

 

 

 

Method 2 ? Code Reverse with VP-UML Menu (for classes only)

You can also update the mode while editing a class in the JBuilder Editor.

 

1.             Open a Java file. (You can double click a Java file in the Package Explorer.) The VP-UML menu appears on the menu bar. (See Figure 34)

Figure 33 JBuilder

 

2.             Click on the VP-UML menu on the menu bar. (See Figure 34)

Figure 34 Update UML Model menu item

 

3.             Click on the Update In VP-UML menu item on the VP-UML menu. VP-UML will be opened. (See Figure 35)

Figure 35 VP-UML

 

4.             The model in VP-UML will be updated. (See Figure 36)

Figure 36 Model updated


You can select correspondent package or class in VP-UML from JBuilder.

 

Method 1 ? Select with Package Explorer

1.             Right Click on a package or a class in Package Explorer in JBuilder. A popup menu appears. (See Figure 38)

Figure 37 JBuilder

 

2.             Click on the Select in VP-UML Project menu item in the popup menu. VP-UML will be opened. (See Figure 39)

Figure 38 Select in VP-UML menu item

 

3.             Click the Model Tree View tab. You can see that the correspondent package or class is selected. (See Figure 39)

Figure 39 Correspondent package or class selected

 

 

 

Method 2 ? Select with VP-UML Menu

You can also select correspondent class in VP-UML from JBuilder while editing a class.

 

1.             Click on the VP-UML menu on the menu bar. (See Figure 41)

Figure 40 JBuilder

 

2.             Click on the Select In VP-UML menu item on the VP-UML menu. VP-UML will be opened. (See Figure 42)

Figure 41 Select in VP-UML menu item

 

3.             The model in VP-UML will be selected. (See Figure 42)

Figure 42 Model selected


You can generate code to JBuilder from the model in VP-UML. You can do some modeling in VP-UML before code generation and implementation. You may perform textual analysis to identify classes, draw class diagrams for implementation and so on.

public class ASwingComponent {

  int anAttribute = 0;

?????

  public void anOperation() {

    throw new UnsupportedOperationException();

  }

}

 
 

 


Figure 43 Code generation

 

1.             Before generating code, create a new project in JBuilder. Then open VP-UML from JBuilder. Then we draw some classes in a class diagram. (See Figure 44)

 

2.             After draw the class diagram, right click on the project, a package or a class in the Project Explorer or Model Tree View in VP-UML. A popup menu appears. (See Figure 45)

Figure 44 Class Diagram

 

3.             Click on the Update to JBuilder menu item on the popup menu. The code of the classes will be generated or synchronized in JBuilder. (See Figure 46)

Figure 45 Update to JBuilder menu item

 

4.             The code is generated in JBuilder. (See Figure 46)

 

Figure 46 Code generated

 

 


You can select correspondent package or class in JBuilder from VP-UML.

 

1.             Right click on a package or a class in Model Tree View/Project Explorer in VP-UML. A popup menu appears. (See Figure 48)

Figure 47 VP-UML

 

2.             Click on the Select in JBulider menu item in the popup menu. JBuilder will be opened. (See Figure 49)

Figure 48 Select in JBuilder menu item

 

3.             The correspondent package or class is selected. (See Figure 49)

Figure 49 Correspondent package or class selected

 

 

 

You can update the JBuilder Integration after updating VP-UML (Online Update/Local Update).

 

1.             After updating VP-UML, start the JBuilder. The Visual Paradigm for UML Project dialog appears. (See Figure 50)

Figure 50 JBuilder

 

2.             Click the Yes button. The Visual Paradigm Integration dialog appears. (See Figure 51)

Figure 51 Visual Paradigm Integration dialog in JBuilder

 

3.             Input the Visual Paradigm for UML Home Directory and the JBuilder Home Directory. Click the Start button. Another dialog appears. (See Figure 52)

Figure 52 Visual Paradigm Integration dialog in VP-UML

 

4.             The dialog shows the update progress of the JBuilder integration. Please wait until it is complete. (See Figure 53)

Figure 53 Visual Paradigm Integration progress dialog in VP-UML

 

5.             When the integration is complete, the OK button is activated. Click the OK button. Then the JBuilder will be opened automatically again. (See Figure 54)

Figure 54 Finish updating JBuilder integration

 

RESOURCES:
 
Download Tutorial:
   VP-UML JBuilder Integration Tutorial (2405 KB)
 
 

 

Software Maintenance VP-UML User's Guide