Exemplo n.º 1
0
 /*
  * Handle events common to all views.
  * Returns false if no action was taken.
  */
 protected final void keyPressed(int keyCode) {
   if (modal != null) {
     if (modal.keyPressed(keyCode, this)) {
       if ((modal == menu) && (menu.execute())) {
         menuAction(menu.getAction());
       }
       modal = modal.parentModal;
     }
     this.repaint();
     System.out.println("repaint");
     return;
   }
   switch (keyCode) {
     case -7:
     case KEY_POUND:
       modal = menu;
       this.repaint();
       return;
     case -6:
     case KEY_STAR:
     case KEY_NUM0: // Convenience key when developing
       viewNavigator.ShowNext();
       return;
   }
   keyPressedView(keyCode); // Let the current view handle this keypress
 }
Exemplo n.º 2
0
 protected final void paint(Graphics g) {
   g.setFont(sysFont);
   if (modal != null) {
     modal.paint(g);
   } else {
     paintView(g);
     paintStatusBar(g);
   }
 }