In Visualizer and Diagrammer, two specific items are mandatory in
a graph (or diagram) which are nodes (including groups) and links
connecting nodes. Decorators can be used in a graph as an extra visual
pattern decorating nodes and links with more information.
The main items (units) used on the Visualizer can be described as following:
Item: Core item in the Visualizer and Diagrammer. Its
behavior and properties are used in Node and Link.
Node: Basic visual item that can be connected to other
nodes via Links;
Link: A visual entity connecting two nodes;
Group: A special node that have the ability to hold
dependant nodes and links inside;
Table: A special Group having columns and lanes (like
BPMN references) and organized in a cell based layout. Each cell can be
considered as a Group itself.
Decorator: A basic visual entity anchored to any Item.
All Entities (Node, Group, Table, link and decorator) implement
specific interfaces that are used to categorize them, thus we decouple
basic entities from core Visualizer processing and we let developers
replace these entities with their own :
ISprite : specifies a Node (Implemented by GenericSprite
and LightGenericSprite) and extends IItem interface. In
Diagrammer, IDiagramSprite is used instead (implemented by DiagramSprite).
It extends ISprite interface;
IGroup : specifies a group (Implemented by GenericGroup
and LightGenericGroup) and extends ISprite interface.
In Diagrammer, IDiagramGroup is used instead (implemented by DiagramGroup).
It extends IGroup interface;
ITable : specifies a table (Implemented by GenericTable)
and extends IGroup interface. In Diagrammer, IDiagramTable
is used instead. It extends ITable interface (implemented by DiagramTable);
ILink : specifies a Link (Implemented by GenericLink)
and extends IItem interface;
IDecorator : specifies a decorator attached to any IItem
instance (ISprite or ILink instance).
In order to let developers have full control on
what is rendered and how it behaves, we provide several
methodologies and tools. Each element inside a Visualizer or Diagrammer
can be modified and rendered differently using several properties (itemRendererClass
and itemRendererFunction). This can be considered as the first
and basic level of control which is common with all flex components. But
when dealing with graphs and diagrams, we need to have control on many
Custom highlight and selection effects (overriding default
User interaction constraints (drag, resize, zoom...);
Having access to renderer owner (e.g Node or Link Reference);
In general, renderers requires a data property to be exposed in order to
let them get fed with data. This is done by letting the item renderers
implement fr.kapit.visualizer.IRenderer or mx.core.IDataRenderer
Group, Table, Lane, Panel and Decorator renderers require specific
interfaces to be implemented in order to have the correct behavior (e.g
IGroupRenderer). The second level of control is based on renderes' interfaces implementation.
The more required interfaces you implement, the greater control you have.