from WidgetCenter.WidgetCenter import * from GestureNotificationCenter.GestureNotificationCenter import * from GestureCenter.GestureCenter import * from GestureNotificationCenter.GestureNotificationCenter import * view1 = SRView((0, 0), (100, 100), "View1", None, (24, 34, 50), 1) view2 = SRView((10, 10), (50, 50), "View2", view1, (30, 30, 30), 1) view1.addSubView(view2) w_center = WidgetCenter() w_center.subscribeNewWidget(view1) g = GestureCenter() center = MoveNotificationCenter() g.newCoordonate(1, "down", 5, 200) notif = center.handleNotification() widget = w_center.examinNotif(notif) w_center.printWidgetList() notif.printInformation() widget.setNotif(notif)
#placer le fichier à la racine du dossier Home pour qu'il fonctionne from GestureCenter.GestureCenter import * from GestureNotificationCenter.GestureNotificationCenter import * # utilisation d'un Moves (surcouche aux MoveGraphe permettant l'interpretation des mouvements) g = GestureCenter() g.newCoordonate(1, "down", 10, 10) g.newCoordonate(2, "down", 10, 10) g.newCoordonate(3, "down", 10, 10) g.newCoordonate(3, "down", 20, 10) #print g.getCurrentNode().getValue() g.newCoordonate(1, "down", 12, 12) #print g.getCurrentNode().getValue() g.newCoordonate(1, "down", 17, 18) g.newCoordonate(1, "down", 19, 21) #print g.getCoordonate() #print g.getCurrentNode().getValue() g.newCoordonate(1, "up") #print g.getCurrentNode().getValue() # Singleton MoveNotificationCenter : utilisation center = MoveNotificationCenter() center.handleNotification() center.handleNotification() center.handleNotification() center.handleNotification() center.handleNotification()