Download Development of multimodal user interfaces by
Transcript
4.InterpiXML Development
HandVu gesture name
Message posted
Action
open
Command:Select
Selection
Lpalm
Command:Next
Next item
Lback
Command:Previous
Previous item
closed
Command:Close
Close
victory
Command:MiniMaxi
Minimization/
Maximization
sidepoint
Command:Reduce
Reduction
Figure 55: Gesture name - message posted - action associations
Because the close command is relatively destructive, it post only if it read (recognized)
three consecutive times. It's now to interfaces to receive these messages a react to them. During the
interfaces construction, each of them subscribe to receive HandVuEvent event. Then, all messages
posted on event bus will call the onEvent(Object e) of each interface. They only need now to react
correctly to each event received by this method. Here is a sample of this method :
public void onEvent(Object e) {
String type="",evt="",from="";
// If HandVuEvent
if(e instanceof HandVuEvent){
HandVuEvent hvEvent = (HandVuEvent)e;
type = hvEvent.getEventType();
evt = hvEvent.getEvent();
from="HandVu";
}
// Si la fenetre contient le focus
if(this.isFocused()){
// Si c'est une commande
if(type.compareTo("Command") == 0){
// Close
if(evt.compareTo("Close") == 0){
this.dispose();
}
// Next item
else if(this.getFocusOwner()!=null &
evt.compareTo("Next") == 0){
this.getFocusOwner().transferFocus();
}
...
}
}
}
Code 1: Interface reaction to event implementation
72