SE401:Group19:Feature:Highlight connections

From Marks Wiki
Revision as of 05:21, 3 November 2008 by Mark (Sọ̀rọ̀ | contribs) (2 revision(s))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

◄ Back

Description

When a user is dealing with a complicated function block network, there should be a way to provide the user with good feedback on the users' actions to reduce complexity. This implementation was done to provide visual feedback by highlighting all the connections going out of the selected function block. This allowed the user to clearly visualize which elements (function block and connections) the user is currently dealing with.

Development

Implementation

The new boolean connected is introduced to define the state of the connection where the state is true/false when the connected function block is selected/not selected. This boolean is set to true by going through a loop of all of the elements inside the panel checking if the connection of the destination function block or source function block of the XML is selected or not. This action is taken whenever the mouse is pressed inside the panel, thus the boolean is set to false if the status mentioned above is false. Once the boolean is set, when the connections are drawn in the class GraphEdge, it checks the boolean which defines its colour.