Exemplo n.º 1
0
 public void showScreen(Panel panel, String title, String iconCls, String screenName) {
   String panelID = panel.getId();
   if (appTabPanel.hasItem(panelID)) {
     appTabPanel.scrollToTab(panel, true);
     appTabPanel.activate(panelID);
   } else {
     if (!panel.isRendered()) {
       panel.setTitle(title);
       if (iconCls == null) {
         iconCls = "plugins-nav-icon";
       }
       panel.setIconCls(iconCls);
     }
     appTabPanel.add(panel);
     appTabPanel.activate(panel.getId());
   }
   History.newItem(screenName);
 }
Exemplo n.º 2
0
 /**
  * Checks if the panel belongs to a active instruction if so, score + 1, remove the instruction
  * from the active list and return true Author Kaj
  *
  * @param panel the pressed panel
  * @return true if the pressed panel was a active instruction
  */
 public synchronized Instruction validateInstruction(Panel panel) {
   Instruction correctInstruction = null;
   for (Instruction instruction : activeInstructions) {
     if (instruction.getPanel().getId() == panel.getId()) {
       if (panel.getPanelType() == PanelTypeEnum.HorizontalSlider
           || panel.getPanelType() == PanelTypeEnum.VerticalSlider) {
         if (instruction.getPanel().getValue() != panel.getValue()) {
           return correctInstruction;
         }
       }
       score++;
       correctInstruction = instruction;
       // activeInstructions.remove(instruction);
       log.log(
           Level.INFO, "validating instruction ended, panel: {0} was correct", panel.getText());
       return correctInstruction;
     }
   }
   log.log(Level.INFO, "validating instruction ended, panel: {0} was incorrect", panel.getText());
   return correctInstruction;
 }