How To Make A Figure

Every new diagram type that would appear in the Editor pane will need a property panel associated with it in the Details pane, and make sure that it is correctly displayed in the Navigation pane as well. To do this, the visual elements have to be created and the meta-model has to be changed to accomidate the new diagram type. The best way the accomplish your goal is to find an implemented figure type with similar features to the one you want to create, and use some of it's source code files as templates for the ones you need to create. For instance, if Class type is implemented, and you want to make an Interface type, you could take FigClass.java, copy it into the same directory, and rename it FigInterface.java, and them make the code modifications in that file as appropriate. Also, a new icon for the toolbar will need to made for your new figure.

For the sake of this example, let's call our new figure Interface, and let's say that this figure will be part of the Class diagram. All figures are either a node or an edge. Interface will be a node.


The figure you want to create.

Ingredients

Files you will need to create:

  • uci.uml.visual.FigInterface
  • uci.uml.Foundation.Core.Interface

Files you will need to modify:

  • uci.uml.visual.UMLClassDiagram
  • uci.uml.visual.ClassDiagramGraphModel
  • uci.uml.visual.ClassDiagramRenderer

Directions

FigInterface

Notice that the Class figure is similar to the one we want to create. So it would be a time-saver to make a copy of FigClass.java, rename it FigInterface.java, and then make the appropriate modificaitons.

Interface

You will not want to make any changes to the meta-model unless there is no other way.

UMLClassDiagram

This will be one of the last steps:

Create the Icon:

You will need to make an icon, in .gif format, 18 X 19 pixels, with the transparent background color set to white. Place this file in the uci.Images directory (it must be named Interface.gif). This icon will automatically be used in the toolbar and in the Navigation pane.

Modify the file:

  • Create a new action called _actionInterface
  • Make the appropriate modifications in the method initToolBar()

ClassDiagramGraphModel

Methods to modify:

  • getPorts()
  • getInEdges()
  • canAddNode()
  • connect()

ClassDiagramRenderer

Methods to modify:

  • getFigNodeFor()

Results

The final result should look like the below. Note that the toolbar and the tree in the Navigation pane are using the same icon.

 

Contact

Please send comments and questions to: Jason Robbins


Back to Argo/UML Release Page

Back to Argo/UML Home