Modelling and editing package for simple higraphs based upon JGraph and its example editor GraphEd.
The objective is to develop in Java a representation of algebraic higraphs and their visualisation which:
Konstantinos Tourlas and Daniele Turi (pair programming)
Work carried out under UK-EPSRC grant GR/N12480/01 (principal investigator: Stuart Anderson).
Tools used:
The architecture of our higraph editor refines that of GraphEd, the main elements of which are a {@link com.jgraph.JGraph} component together with its associated model, as shown:
The model maintains a representation of a single graph, in a way which is partly independent of its visualisation, or view. Multiple views of the same model may be constructed, even simultaneously, and are managed by the JGraph component. As a minimum, the model contains uniform representations of the graph's main elements, its vertices and edges, in terms of entities called cells. (Models further contain cells representing ports, which are an additional concept specific to the modelling of graphs in JGraph.)
The views themselves may differ from each other in a number of geometric aspects, such as whether graph vertices are drawn as, say, circles or rectangles. Only those geometric aspects which are common across all possible views, such as the size or colours of vertices, may be (optionally) kept in the model as attribute maps. Thus, as a minimum, model consists of a set of cells, each of which may be optionally associated with an attribute map.
Additionally, the structure of a model becomes hierarchical, in the form of trees of cells (rather than just sets of cells), whenever it is necessary to represent the (typically temporary) grouping together of cells, be they edges or vertices. Such grouping operations are often convenient for moving whole collections of cells in the graph's view. A decision in the design of JGraph has been to provide direct support for such grouping operations in the model by enabling the configuration of cells to form tree structures. Thus, for instance, a root cell is taken to represent the grouping of its children cells which may, in turn, be groups in their own right. It is worth noting that permanent views are only associated with those cells which are leaves in the model.
Despite the sophistication of their structure, and of the mechanisms in place to support them, JGraph models were found inadequate for modelling the containment of blobs in higraphs, on a number of counts:
Partly in response to these problems, as well as for the more general reasons outlined in the paper On the geometric modelling of visual languages, we have augmented the architecture of GraphEd with the notion of a validator, which in this application we call the geometric model, or higraph geometry:
In summary, this {@link uk.ac.ed.inf.higraph.HigraphGeometry} validator fully controls access to an underlying {@link com.jgraph.JGraph} model, which it validates against the requirement that the certain higraph-specific constraints always hold. More specifically, the role of the higraph geometry is twofold:
The central place occupied by our {@link uk.ac.ed.inf.higraph.EmbeddableContainmentTree} dedicated to modelling blob containment is illustrated in the following diagram.
While, in GraphEd the insertion of new cells is done directly into the JGraph model
Insertion of a new blob is carried out using a new algorithm which implements the ideas in the paper On the geometric modelling of visual languages.