CoCoViLa — Model-Based Software Development Platform

Creating packages with Class Editor


A CoCoViLa package consists of a package file in XML format (eg mypackage.xml), bitmaps for all visual classes of the packages (to be shown on the toolbar in the Scheme Editor), and Java classes associated with the visual classes. Example packages distributed with CoCoViLa are situated in the packages directory.

All files of type .java and .gif can be created in any convenient way, using some Java programming tool and a bitmap editor.

Creating a package

  1. Open the Class Editor.
  2. Use File -> Create Package to create a package. Enter the name and description of the package. You will be prompted with a dialog to choose where the newly created package will be saved. Typically, you should save it under a new directory in packages directory.
  3. Construct visual classes.

Constructing a visual class

  1. Draw an image (a shape) of the class, using the drawing tools of the Class Editor.
  2. Add ports to the image by clicking on the port tool button and then on the image, and specify interface variable bound to the port and its type in the port pop-up window.
  3. Add class fields (component fields that will be visible on the scheme when double-clicked on the image).
  4. Specify the bounding box that defines an area where the image will register mouse clicks in Scheme Editor. To do this, click on the bounding box button and then cover the image with the bounding box.
  5. Specify class properties and export the visual class by using commands File -> Export -> To Package. Choose the package you have created for this class.
  6. Note that right now, the Class Editor does not support drawing graphics for ports and fields. However the package format itself allows it, so graphics for open and closed ports and known and unknown fields can be given by directly editing the xml source of a package.

After that, there are still two things to do:

  1. Create and move source files of the classes to the package directory.
  2. Create bitmaps of the icons of classes and put them into the package directory.

Deleting and importing classes

  1. Delete a class: File -> Delete (This command requires a package name and a class name.)
  2. Import a class from a package: File -> Import
  3. To save the imported class use File -> Export -> To Package in the same way as for a new visual class.