JDiagram implements the Model-View-Controller (MVC) architectural pattern. The MVC design pattern as applied to JDiagram separates the diagram data (model) from its representation to the user (view) and controlling it by the user (controller).
The Diagram class represents the diagram data model and provides operations to process the data. It exposes properties and methods for adding new diagram elements, finding and accessing existing elements, or removing them.
The DiagramView class presents the relevant data from the Diagram class by drawing on the screen using the Java Graphics2D API. When the diagram is changed, the view automatically redraws the affected part of the image to reflect the changes. Multiple views can display the same diagram. Perform the setDiagram method of the DiagramView class to specify the diagram displayed by the view. Each view can have a different zoom level and scroll position.
Controllers responding to user interactions are represented by Behavior objects. The Behavior property of DiagramView and respective enumeration let you switch between different controllers, specifying how GUI actions should be interpreted to manipulate the diagram elements, or scroll / zoom the view itself.