8.4 AIVA Plug-in
8.4.1 Action listeners
Implementation of action listeners, mainly mouse/mousewheel listeners was a bit complicated, because these events had to be redirected between two frameworks – SWT (used by RCP, ComAV) and AWT/Swing (used by JGraphX). This brought several problems, however most of them were solved. The only problem that remains unfixed is touch control. More than one so- lution was tested but without satisfying results.
Listing 8.7: Editor - create the whole AIVA workspace
p u b l i c c l a s s E d i t o r e x t e n d s E d i t o r P a r t {
p u b l i c s t a t i c f i n a l S t r i n g ID = ” c z . z c u . k i v . comav . v i s u a l i z a t i o n s ←- . a i v a . e d i t o r ”;
. . .
// Other a t t r i b u t e s and methods
. . .
/∗ ∗
∗ T h i s method c r e a t e s a l l main components and p l a c e s them i n ←- t h e e d i t o r a r e a
∗/
@ O v e r r i d e
p u b l i c v o i d c r e a t e P a r t C o n t r o l ( C o m p o s i t e p a r e n t ) { . . .
// Graph component and SWT l i s t e n e r
f i n a l m x G r a p h C o m p o n e n t g r a p h C o m p o n e n t = g r a p h . ←- g e t G r a p h C o m p o n e n t ( ) ; S w t E v e n t L i s t e n e r s w t l i s t e n e r = new S w t E v e n t L i s t e n e r ( ←- g r a p h C o m p o n e n t , s w t A w t G r a p h C o m p o n e n t ) ; s w t A w t G r a p h C o m p o n e n t . a d d M o u s e W h e e l L i s t e n e r ( s w t l i s t e n e r ) ; . . . // Add S w i n g L i s t e n e r A i v a G r a p h M o u s e L i s t e n e r g r a p h M o u s e L i s t e n e r = new A i v a G r a p h M o u s e L i s t e n e r ( graph , s w t A w t G r a p h C o m p o n e n t , ←- g e t E d i t o r S i t e ( ) . g e t S h e l l ( ) ) ; i f ( g r a p h M o u s e L i s t e n e r != n u l l) g r a p h . g e t G r a p h C o m p o n e n t ( ) . g e t G r a p h C o n t r o l ( ) . ←- a d d M o u s e L i s t e n e r ( g r a p h M o u s e L i s t e n e r ) ; } }
Listing 8.7 shows that two different listeners have to be registered in or- der to manage both mouse and mousewheel events. Both these listeners require the reference on Swing graph component and on its SWT container. These references are required to ensure the stability of the application – to synchronize threads, when working in two different graphical frameworks. The shorter listener is used to manage mousewheel event and is listed in Listing 8.8. Most of the code in methodmouseScrolled() is used for synchro-
nization purposes.
Listing 8.8: SwtEventListener - manages SWT mouse wheel event
p u b l i c c l a s s S w t E v e n t L i s t e n e r i m p l e m e n t s M o u s e W h e e l L i s t e n e r {
p r i v a t e m x G r a p h C o m p o n e n t g r a p h C o m p o n e n t ;
p r i v a t e C o m p o s i t e c o m p o s i t e ;
p u b l i c S w t E v e n t L i s t e n e r ( m x G r a p h C o m p o n e n t g r a p h C o m p o n e n t , ←- C o m p o s i t e c o m p o s i t e ) {
t h i s. g r a p h C o m p o n e n t = g r a p h C o m p o n e n t ; t h i s. c o m p o s i t e = c o m p o s i t e ; } @ O v e r r i d e p u b l i c v o i d m o u s e S c r o l l e d ( M o u s e E v e n t e ) { f i n a l i n t c o u n t = e . c o u n t ; E v e n t Q u e u e . i n v o k e L a t e r (new R u n n a b l e ( ) { p u b l i c v o i d run ( ) { i f ( c o m p o s i t e . i s D i s p o s e d ( ) == f a l s e && c o m p o s i t e . ←- g e t D i s p l a y ( ) . i s D i s p o s e d ( ) == f a l s e) { c o m p o s i t e . g e t D i s p l a y ( ) . s y n c E x e c (new R u n n a b l e ( ) { p u b l i c v o i d run ( ) { i f ( count < 0 ) { g r a p h C o m p o n e n t . z o o m I n ( ) ; } e l s e { g r a p h C o m p o n e n t . z o o m O u t ( ) ; } } } ) ; } } } ) ; } }
Evaluation of the Proposed
Approach
The goal of this Chapter is to evaluate our new visualization approach called AIVA, which was described in Chapters 6 and 8. As a new approach it should be evaluated if the claimed advantages of this approach are true. The strongest and most important claims are that AIVA solves problems of overly complex component diagrams (Research challenges in Section 6.1) and that it should boost the learning process using interaction (defined as one of the goals of this thesis in Introduction). Both these claims were mostly defined against UML, thus comparison evaluation should prove which approach provides better results.
Complexity of diagrams was studied in a case study, that had clearly defined research questions and evaluation criteria. It compared diagrams made in a UML tool and in AIVA from several points of view, concluding which one of them provides a less complex diagram. This case study is thoroughly described in Section 9.2. This case study was already reviewed and published in one of our papers [60] and the content of Section 9.2 is almost identical. The impact of interactivity on learning process is hard to measure. There- fore, we simplified our question and asked if interactivity will help users to find their answers faster. Such simplification lead to the implication that if user can find his answers faster he should also learn faster. A user study that monitored performance of several participants would evaluate such question. This study measured user performance in a set of several key tasks, analyzed results and provided discussion about findigs. The tasks measured were the elementary ones that are used the most frequently – more complex tasks are composed of them. All details about this user study are provided in Section 9.3 for the sake of replicability. This user study was also already reviewed and published in one of our papers [61] and the content of Section 9.3 is
almost identical.
9.1
Overview of Used Tools and Technologies
This Section covers the description of tools and technologies that were used in the following studies.