Visual OCL

TU-Berlin | Faculty IV | Institute ISTI | Research group TFS

Model Driven Architecture - the controller with GEF

small logo
section: < previous | next >
| |
chapter: << previous | next >>

Edit policies

The EditPolicys that are installed in EditParts are to be find in the package vocleditor.edit.policy”. Each EditPolicy represents a functionality of the EditParts.

Indeed: VOCLDiagrammXYLayoutEditPolicy, VOCLExpressionXYLayoutEdiPolicy, PredicatContainerXYLayoutEditPolicy, NavExpContainerXYLayoutEdiPolicy, LetExpXYLayoutEditPolicy, IfExpXYLayoutEdiPolicy, VOCLConstraintXYLayoutEditPolicy, BoolExpXYLayoutEdiPolicy exercise ContainerRole. They implement the insert instructions and/or create instructions, which are executed on the EditPart. Moreover, they administrate the graphical layout of ChildEditParts within the ParentEditPart.

ClassifierComponentEditPolicy, ExpressionComponentEditPolicy ConstraintComponentEditPolicy, AssociationRoleEditPolicy are responsible for the deletion of EditParts. They implement the delete command.

ClassifierRoleEditPolicy exercises the NodeRole. It is linked certainly the GraphicalEditPart with the AssociationEditPart, and implements the connect-, reconnect- commands.

AssociationRoleEndPointEditPolicy and AssociationRoleSelectionEditPolicy are responsible for selecting of AssociationEditPart (connection).

Each EditPart has a basic figure, which is implemented with Draw2D-Plugin. You find it in the package “vocleditor.figure”. NodeFigures, like ClassifierRoleFigure and SetClassifierRoleFigure, have Anchors. These two figures are linked with a connection. Connections are provided with a ManhattenLayout. ContainerEditPart have a figure as a rectangle with the Borderlayout. A characteristic is, that figures like IfExpFigure, LetExtFigure and BoolExpFigure provide one or two adjustable bars (sash). The sash is implemented in the class (SashFigure.java). Shifting is specified over VOCLBorderLayout.

Commands:

Commands come either from the CreationPallette or from the ContextMenu. Commands, which come from the CreationPalette, are initialized in the appropriate EditPolicy, and executed in the CommandCtack. They see a possible scenario down.

Commands, which come from the ContextMenu, are registered over appropriate of an action in the ContextMenueProvider and in the VOCLEditor. For the example: VOCLExpNegateCommand is registered over VOCLExpNegateAction.

All commands are implemented with a dialogue, in which a needs values can be set. The dialogues are developed with the Jigloo-Plugin.


  section: < previous | next >
| |
chapter: << previous | next >>
©2005 TFS