31.05.2013 Views

think-cell technical report TC2003/01 A GUI-based Interaction ...

think-cell technical report TC2003/01 A GUI-based Interaction ...

think-cell technical report TC2003/01 A GUI-based Interaction ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.1 Program Architecture IMPLEMENTATION<br />

levels. The union set of all UI objects is then returned.<br />

Figure 40 gives an idea of how user interaction propagates through the system<br />

and finally generates appropriate on-screen feedback. When the framework inter-<br />

cepts a mouse event message, such as ButtonDown, the message gets forwarded to<br />

the responsible document window and its UI objects. Each UI object has to make<br />

a decision if it is concerned by that mouse action, depending on the current mouse<br />

pointer location and possibly other UI objects concurrently capturing the mouse.<br />

If appropriate, the UI object puts its respective visual elements into another state<br />

– say, highlight – to reflect its responsiveness. Moreover, the UI object that was hit<br />

calls its own OnClick() method that finally applies the intended changes to the data<br />

model. Meanwhile, the visual element has notified the framework of the invalidation<br />

of the screen region where a change in the UI occurred.<br />

Depending on the effect that the mouse interaction had on the underlying data<br />

model, the smart grid, its shapes and its UI objects may explicitly be called to<br />

update themselves. The propagation of UpdateShapes() and UpdateUI() messages<br />

are not reflected in the sequence diagram; they take similar paths as the CreateUI()<br />

message in figure 39. At some point in time, there will be a Paint() message<br />

generated from the framework, which causes the visual elements to update their<br />

texture mapping with regard to current document and screen coordinates, and<br />

finally reflects the internal state on the screen.<br />

User<br />

Mouse event<br />

visual feedback<br />

... ButtonDown()<br />

... Paint()<br />

:CPPTDocWnd<br />

ButtonDown()<br />

Paint()<br />

:CUIObject<br />

Highlight()<br />

Paint()<br />

:CVisualElement<br />

OnClick()<br />

SetDirtyRect(...) ...<br />

Modify()<br />

BuildScreenPoints()<br />

TextureMapping(...)<br />

Figure 40: Processing of user input and generation of visual feedback<br />

75<br />

...<br />

:CFeature

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!