Logo
HomeDocumentationDownloadPublicationsContactEventsCommunityLinks

2. Wiring a first application

The roles of the ToggleControl composition pattern should be filled by concrete components before the application can work. Selecting a component to play a certain role is as simple as dragging that component on the desired role. The drag is refused when the component does not work like this role of the composition pattern expects. Now, drag the JButton component onto the Control role. If everything worked fine, it should look like the following screenshot:

When you accidently dragged the JButton component onto the Subject role, you'll notice that the drag is refused. Now, place the Juggler component onto the canvas and let him play the role of Subject. Both the roles of the composition pattern are now filled and code generation can now start. Press the J button in the toolbar or select Generate->Generate java code in the menu. Next, you'll see the options dialog where you can specify the class name and package for the newly generated component. You can leave this as is right now. While generating code, a dialog-box might pop up asking whether the proposed parameter translations are correct. Just press accept all, the default values will do. When the compilation has succeeded, the generated application should launch and you'll get a window with a button in it. When you press the button the Juggler component will start juggling and when you press again it stops and so on... Notice that even this simple example can not be made by current visual composition tools. This is because they lack a protocol in between the components. To be able to change for example the label that is displayed on the button, press the right mouse button on the JButton component on the canvas and select edit properties. All bean properties can then be altered. If you generate code again, you'll notice that the label has changed. The following screenshot shows how the generated application should look like:

<<    Getting Started With PacoSuite    >>
2003-02-19 15:01:44 - Wim Vanderperren

Latest build of the PacoSuite tool-suite can be found in the download section.

2003-02-19 15:01:19 - Wim Vanderperren

PacoSuite Website online.

SSELŠ2003-2004 visits: 55402