Warning: This class is NOT a general graph class, and it should NOT be used as it. This class is particularly dedicated to fast drawing of the graph and is internally arranged to be fast for this task only. It implements graph solely to be easily susceptible to be used as a sink and source for graph events. Some of the common methods of the Graph interface are not functional and will throw an exception if used (as documented in their respective JavaDoc).
The purpose of the graphic graph is to represent a graph with some often used graphic attributes (like position, label, etc.) stored as fields in the nodes and edges and most of the style stored in styles pertaining to a style sheet that tries to imitate the way CSS works. For example, the GraphicNode class defines a label, a position (x,y,z) and a style that is taken from the style sheet.
The style sheet is uploaded on the graph using an attribute correspondingly named "ui.stylesheet" or "ui.stylesheet" (the second one is better). It can be a string that contains the whole style sheet, or an URL of the form :
url(name)
The graphic graph does not completely duplicate a graph, it only store things that are useful for drawing it. Although it implements "Graph", some methods are not implemented and will throw a runtime exception. These methods are mostly utility methods like write(), read(), and naturally display().
The graphic graph has the ability to store attributes like any other graph element, however the attributes stored by the graphic graph are restricted. There is a filter on the attribute adding methods that let pass only:
The implementation of this graph relies on the StyleGroupSet class and this is indeed its way to store its elements (grouped by style and Z level).
In addition to this, it provides, as all graphs do, the relational information for edges.
TODO : this graph cannot handle modification inside event listener methods !!
|
|
|
|
|
|
|
|
|
|
|
|