Exemplo n.º 1
0
 public Command myKeyEvent(KeyStroke stroke) {
   myGetKeyCommands();
   if (showTrailCommand != null && showTrailCommand.matches(stroke)) {
     final ChangeTracker tracker = new ChangeTracker(this);
     if (globallyVisible) {
       globalVisibility = !globalVisibility;
     } else {
       localVisibility = !localVisibility;
     }
     redraw();
     return tracker.getChangeCommand();
   }
   return null;
 }
Exemplo n.º 2
0
 public KeyCommand[] myGetKeyCommands() {
   if (commands == null) {
     if (trailKey != null) {
       showTrailCommand =
           new KeyCommand(menuCommand, trailKey, Decorator.getOutermost(this), this);
     }
     if (showTrailCommand != null && menuCommand.length() > 0) {
       commands = new KeyCommand[] {showTrailCommand};
     } else {
       commands = new KeyCommand[0];
     }
   }
   if (showTrailCommand != null) {
     showTrailCommand.setEnabled(getMap() != null);
   }
   return commands;
 }