Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Class Editor user manual
Create Package or import existing class from package
When application is started for the first time user must import class or create a package. Later on application saves last state and previous selection will be loaded.
User can load class or template through “Import” option. Preview is available.
Following import options are available:
- clear - drawing Area cleared, imported class is positioned top-left corner, ClassProperties set to newly imported class' properties;
- don’t clear - shapes from new import added to already existing. If there were no ClassProperties (e.g new class), after import ClassProperties still will be empty;
- cancel – import is aborted.
Application supports multiple tabs. Each tab is independent and can use different packages or different instances of the same package.
User can choose different view modes, toggle grid, ports’ and fields’ graphics and choose between open or closed port graphics.
A CoCoViLa package consists of a package description in XML format (e.g., mypackage.xml), bitmaps for all visual classes of the package (to be shown on the tool bar in the Scheme Editor), and Java classes associated with the visual classes. Class Editor has tools to create (top menu File->Create Package) and edit (top menu File->Edit Package) packages.
Class is a group of shapes, ports etc. Each class has class properties.
To open Class properties dialog:
- double click bounding box;
- select Class Properties option from bounding box right-mouse-click Menu;
- select bounding box and click Properties button on top Toolbar;
- select from top Menu Edit-> Class Properties option
Class Name is mandatory. No changes will be saved unless class name is filled.
Class icon field can be filled in manually, or user can select a file from list. Icon preview is available.
Class Fields Simple mode:
- Field name;
- Field type;
- Field value;
Please note that there’s no inbuilt validation for type-value correspondence. It is up to user to control, that types and values are correct.
Class Fields Advanced mode:
- Field name;
- Field type;
- Field value;
- Nature (Normal, Input, Goal);
- Known (known graphics);
- Default (default graphics);
Field graphics (known or default)
When checkbox is selected package and template selection dialogs pop up. In case of success field graphics added to drawing area. x, y coordinates can be adjusted. To apply other changes user should edit graphics template.
Class field graphic can only be deleted from Class Properties dialog (unlike other shapes that can be deleted by eraser tool or by using option “Delete” from right-mouse-click menu). Class field graphics can’t be cloned or rotated. Class field name and type are saved to java file as specification variables, like port’s name and type. User has to make sure that port and field names are valid and not duplicated.
Only one bounding box is allowed per drawing area and bounding box is connected to class.
Bounding box menu options :
- Delete – only deletes BB graphic shape, no changes are made to Class;
- Class Properties and View Code - have same functionality as top menu options;
- Order - is disabled since bounding box is always on top.
New component type - template. Templates are grouped shapes that can be reused as port graphic, part of class graphics etc.
Default port graphics
These graphics are stored in application and not saved to xml.
<port multi="false" name="a2" portConnection="" strict="false" type="float" x="93" y="27"/>
Port name and type are saved to java file as specification variables.
Custom port graphics
Right mouse click menu has options to set custom graphics both for open and closed port, as well as restore default graphics. Select package:
Preview Dialog with list of templates only Select one:
Custom port graphics are centered to original port. Port size is set to template’s bounding box size. Ports can’t be resized by user.
XML code example for custom port graphics:
<port multi="false" name="a1" portConnection="" strict="false" type="int" x="33" y="27"> <open> <graphics> <bounds height="30" width="30" x="-15" y="-15"/> <rect colour="-10066177" filled="true" fixed="false" height="30" linetype="0.0" stroke="1.0" transparency="255" width="30" x="-15" y="-15"/> <rect colour="-16777216" filled="false" fixed="false" height="30" linetype="0.0" stroke="1.0" transparency="255" width="30" x="-15" y="-15"/> </graphics> </open> </port>
To open Port properties dialog:
- double click selected port;
- select Properties option from right-mouse-click Menu;
- select port and click Properties button on top Toolbar.
All port properties are editable. Port name must be unique per Class. To clone port select Clone option from right-mouse-click Menu.
All port properties are copied from parent port except for name, which has to be unique per Class.