Package ch.tatool.core.display.swing.container

Examples of ch.tatool.core.display.swing.container.RegionsContainer


    if (backgroundColor != null) {
      origColor = display.getBackgroundColor();
      display.setBackgroundColor(backgroundColor);
    }
   
    RegionsContainer regionsContainer = ContainerUtils.getRegionsContainer();
    // add all defined content panels
    for (Region region : contents.keySet()) {
      JPanel panel = contents.get(region);
      regionsContainer.setRegionContent(region, panel, false);
    }
       
    // setup the timer (if applicable)
    if (displayDuration > 0) {
      timeoutHandler = new DefaultTimeoutHandler();
      timeoutHandler.setDefaultTimerDuration(displayDuration);
    }
       
    // check whether the user is allowed to finish by hitting a button
    if (finishOnInput) {
      // action panel
      ActionPanelListener myListener = new ActionPanelListener() {
        public void actionTriggered(ActionPanel source, Object actionValue) {
          if (getFinishExecutionLock()) {
            doCleanup();
            finishExecution();
          }
        }
      };
      KeyActionPanel actionPanel = new KeyActionPanel();
      actionPanel.addKey(KeyEvent.VK_SPACE, "", null);
      actionPanel.addActionPanelListener(myListener);
      actionPanel.enableActionPanel();
    }
   
    // display the information
    regionsContainer.setAllContentVisibility(true);
   
    // start the timer (if applicable)
    if (timeoutHandler != null) {
      timeoutHandler.startTimeout(getExecutionContext());
    }
View Full Code Here


      getDisplay(getExecutionContext()).setBackgroundColor(origColor);
      origColor = null;
    }
   
    // remove added panels
    RegionsContainer regionsContainer = ContainerUtils.getRegionsContainer();
    for (Region region : contents.keySet()) {
      regionsContainer.removeRegionContent(region);
    }
  }
View Full Code Here

  /** Called at element start. */
  @Override
  protected void startExecutionAWT() {
    // setup the RegionsContainer
    RegionsContainer regionsContainer = ContainerUtils.getRegionsContainer();
    SwingExecutionDisplay display = ExecutionDisplayUtils.getDisplay(getExecutionContext());
    ContainerUtils.showRegionsContainer(display);
    regionsContainer.setRegionVisibility(Region.NORTH, false);
   
    // only continue if there are instructions to display
    if (getInstructionCount() < 1) {
      getFinishExecutionLock();
      return;
View Full Code Here

    setupInstruction(0);
  }

  /** Sets up the next instruction panel. */
  private void setupInstruction(int index) {
    RegionsContainer regionsContainer = ContainerUtils.getRegionsContainer();
    JPanel instructionPanel = getInstruction(index);
    regionsContainer.removeRegionContent(Region.CENTER);
    regionsContainer.setRegionContent(Region.CENTER, instructionPanel);
    regionsContainer.removeRegionContent(Region.SOUTH);
    setupActionPanelKeys(index);
    regionsContainer.setRegionContent(Region.SOUTH, actionPanel);
    regionsContainer.setRegionContentVisibility(Region.SOUTH, true);
    regionsContainer.setRegionContentVisibility(Region.CENTER, true);
    actionPanel.enableActionPanel();
    currentIndex = index;
  }
View Full Code Here

   */
  @Override
  protected void cancelExecutionAWT() {
    // disable actions
    actionPanel.disableActionPanel();
    RegionsContainer regionsContainer = ContainerUtils.getRegionsContainer();
    regionsContainer.removeRegionContent(Region.CENTER);
    regionsContainer.removeRegionContent(Region.SOUTH);
  }
View Full Code Here

    if (backgroundColor != null) {
      origColor = display.getBackgroundColor();
      display.setBackgroundColor(backgroundColor);
    }
   
    RegionsContainer regionsContainer = ContainerUtils.getRegionsContainer();
    // add all defined content panels
    for (Region region : contents.keySet()) {
      JPanel panel = contents.get(region);
      regionsContainer.setRegionContent(region, panel, false);
    }
       
    // setup the timer (if applicable)
    if (displayDuration > 0) {
      timeoutHandler = new DefaultTimeoutHandler();
      timeoutHandler.setDefaultTimerDuration(displayDuration);
    }
       
    // check whether the user is allowed to finish by hitting a button
    if (finishOnInput) {
      // action panel
      ActionPanelListener myListener = new ActionPanelListener() {
        public void actionTriggered(ActionPanel source, Object actionValue) {
          if (getFinishExecutionLock()) {
            doCleanup();
            finishExecution();
          }
        }
      };
      KeyActionPanel actionPanel = new KeyActionPanel();
      actionPanel.addKey(KeyEvent.VK_SPACE, "", null);
      actionPanel.addActionPanelListener(myListener);
      actionPanel.enableActionPanel();
      regionsContainer.setRegionContent(Region.SOUTH, actionPanel, false);
    }
   
    // display the information
    regionsContainer.setAllContentVisibility(true);
   
    // start the timer (if applicable)
    if (timeoutHandler != null) {
      timeoutHandler.startTimeout(getExecutionContext());
    }
View Full Code Here

      getDisplay(getExecutionContext()).setBackgroundColor(origColor);
      origColor = null;
    }
   
    // remove added panels
    RegionsContainer regionsContainer = ContainerUtils.getRegionsContainer();
    for (Region region : contents.keySet()) {
      regionsContainer.removeRegionContent(region);
    }
  }
View Full Code Here

 
  /** Adds a text display content to the center region. */
  public void setDisplayTest(String text) {
    CenteredTextPanel panel = new CenteredTextPanel();
    panel.setText(text);
    RegionsContainer regionsContainer = ContainerUtils.getRegionsContainer();
    regionsContainer.setRegionContent(Region.CENTER, panel);
  }
View Full Code Here

   * Cleanup after element execution
   */
  @Override
  protected void cancelExecutionAWT() {
    // disable actions
    RegionsContainer regionsContainer = ContainerUtils.getRegionsContainer();
    regionsContainer.removeRegionContent(Region.CENTER);
    regionsContainer.removeRegionContent(Region.SOUTH);
    if (timeoutHandler != null) {
      timeoutHandler.cancelTimeout();
    }
    if (inputActionPanel != null) {
      inputActionPanel.disableActionPanel();
View Full Code Here

  @Override
  protected void startExecutionAWT() {
    actionPanel.setRatingLabel("How confident are you in your decision?");
   
    // setup the ExecutionDisplay
    RegionsContainer regionsContainer = ContainerUtils.getRegionsContainer();
    regionsContainer.setRegionContent(Region.CENTER, actionPanel);
   
    // display and enable the action panel
    SwingExecutionDisplay display = getDisplay(getExecutionContext());
    ContainerUtils.showRegionsContainer(display);
   
View Full Code Here

TOP

Related Classes of ch.tatool.core.display.swing.container.RegionsContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.