-
Notifications
You must be signed in to change notification settings - Fork 0
Module
A module is basically an immutable state-machine that provides interaction Siigna and visual feedback based on incoming Events. In other words the modules are the part of Siigna that provides event-based functionality while drawing graphical representations on the View.
The utilizes three mechanisms to handle the event-flow and the graphical feedback: The EventHandler, the EventParser and the ModuleInterface.
- In depth article: States.
- In depth article: EventHandler.
GENERAL NOTE: after the Menu forwards to a module with the triggering event (MouseDown), other events (like MouseUp) may be registered while the ForwardTo mechanism is running. These events can trigger Goto events in the module, unless ruled out by case matches.
- Read more: StateMap.
- Read more: StateMachine.
- In depth article: EventParser.
- In depth article: ModuleInterface.
A module can exist without ways to paint it's contents. But if the modules wants to show graphical feedback all you have to do is to override the paint method like so:
override def paint(g : Graphics, t : TransformationMatrix) : Unit
The Graphics object can be used to draw shapes and the TransformationMatrix can transform them to fit the screen as is.
Modules can call another module to get its functionality. This means that commonly used operations does not have to be implemented seperately in each individual module that needs this operations, but the individual models can all forward to the same module to get the operation. A good example of this that the base modules have a Point module, that is used for setting a point, then returning its coordinates. Several modules forward to this point module, Eg. polyline, rectangle, and text.. basically all modules that needs one or more point coordinates as part of their functionality. Actually the Point module has the ability to call the Angle Gizmo module if the user wish to get a point that lies in a specific angle relative to another point. See an illustration of the Polyline-Point-AngleGizmo calling logic here: polyline module calling structure.
- Home - Overview of Siigna
- About - Why we made Siigna
-
Siigna main - The "heart" of Siigna
- Architecture
- Action - Remote and local changes
- Event - How Siigna communicates
- Shape - The figures and geometry
-
Siigna module - The "brain" of Siigna
- Module - How a module is defined
- License - It's open source!
- Contact - Get in touch