示例#1
0
  /**
   * The start() method is called when the page containing the applet first appears on the screen.
   * The AppletWizard's initial implementation of this method starts execution of the applet's
   * thread.
   */
  public void start() {
    super.start();
    if (m_screenField == null) { // This is the code that runs if this is an applet
      m_screenField = new AppletScreen();
      m_screenField.setTask(this);
      m_screenField.setScreenFieldView(m_screenField.setupScreenFieldView(true));
      // NOTE: When an Applet Screen passes no parent, the SApplet peer is not created, set it!
      m_screenField.init(null, null, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null);
      // x this.addRecordOwner(m_screenField);

      this.setupLookAndFeel(null);
      Container container = this.getBottomPane();
      while (container != null) {
        if (container.getParent() == null)
          container.setFocusTraversalPolicy(
              new MyFocusTraversalPolicy()); // Set the traversal policy for an applet
        container = container.getParent();
      }
    }

    BaseScreen.makeScreenFromParams(
        this, null, m_screenField, ScreenConstants.DONT_PUSH_TO_BROWSER, null);
  }
示例#2
0
  /**
   * If this task object was created from a class name, call init(xxx) for the task. You may want to
   * put logic in here that checks to make sure this object was not already inited. Typically, you
   * init a Task object and pass it to the job scheduler. The job scheduler will check to see if
   * this task is owned by an application... if not, initTask() is called.
   */
  public void initTask(App application, Map<String, Object> properties) {
    if (m_application != null) return; // No, already inited!
    m_application = (Application) application;
    if (properties != null) {
      if (m_properties != null) m_properties.putAll(properties);
      else m_properties = properties;
    }
    if (m_screenField == null) {
      FrameScreen frameScreen =
          new FrameScreen(null, null, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null);

      m_screenField = new AppletScreen();
      m_screenField.setTask(this);
      m_screenField.setScreenFieldView(m_screenField.setupScreenFieldView(true));
      // NOTE: When an Applet Screen passes no parent, the SApplet peer is not created, set it!
      m_screenField.init(null, frameScreen, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null);

      this.init(null);
      this.addRecordOwner(m_screenField);

      BaseScreen.makeScreenFromParams(this, null, m_screenField, 0, null);
    }
  }