DroidDiagram implements the Model-View-Controller (MVC) architectural pattern. The MVC design pattern as applied to DroidDiagram 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 android.graphics 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.
The DiagramView class also integrates the Controller part of the MVC, represented mostly by the view's Behavior attributes enabled through the setBehavior method. The Behavior enumeration specifies how GUI actions should be interpreted to manipulate the data.