コード例 #1
0
  /**
   * Finalizes this swing view.
   *
   * @exception NullPointerException if the configuration is null
   */
  public void finalizz() throws Exception, NullPointerException {

    Boolean resizable = (Boolean) getChildItem(UserInterface.RESIZABLE_FLAG);
    removeChildItem(UserInterface.RESIZABLE_FLAG);

    StatusBar statusBar = (StatusBar) getChildItem(UserInterface.STATUS_BAR);
    removeChildItem(UserInterface.STATUS_BAR);
    destroyComponent(statusBar);

    ContentsPanel contentsPanel = (ContentsPanel) getChildItem(UserInterface.CONTENTS_PANEL);
    removeChildItem(UserInterface.CONTENTS_PANEL);
    destroyComponent(contentsPanel);

    ToolBar toolBar = (ToolBar) getChildItem(UserInterface.TOOL_BAR);
    removeChildItem(UserInterface.TOOL_BAR);
    destroyComponent(toolBar);

    MenuBar menuBar = (MenuBar) getChildItem(UserInterface.MENU_BAR);
    removeChildItem(UserInterface.MENU_BAR);
    destroyComponent(menuBar);

    String icon = (String) getChildItem(UserInterface.ICON);
    removeChildItem(UserInterface.ICON);

    String title = (String) getChildItem(UserInterface.TITLE);
    removeChildItem(UserInterface.TITLE);

    /*??
            deconfigureInternalFrameBounds((java.awt.Rectangle) getChildItem(UserInterface.INTERNAL_FRAME_BOUNDS));
            removeChildItem(UserInterface.INTERNAL_FRAME_BOUNDS);
            destroyChildItem((java.awt.Rectangle) getChildItem(UserInterface.INTERNAL_FRAME_BOUNDS));

            deconfigureFrameBounds((java.awt.Rectangle) getChildItem(UserInterface.FRAME_BOUNDS));
            removeChildItem(UserInterface.FRAME_BOUNDS);
            destroyChildItem((java.awt.Rectangle) getChildItem(UserInterface.FRAME_BOUNDS));

            deconfigureDialogBounds((java.awt.Rectangle) getChildItem(UserInterface.DIALOG_BOUNDS));
            removeChildItem(UserInterface.DIALOG_BOUNDS);
            destroyChildItem((java.awt.Rectangle) getChildItem(UserInterface.DIALOG_BOUNDS));

            deconfigureWindowBounds((java.awt.Rectangle) getChildItem(UserInterface.WINDOW_BOUNDS));
            removeChildItem(UserInterface.WINDOW_BOUNDS);
            destroyChildItem((java.awt.Rectangle) getChildItem(UserInterface.WINDOW_BOUNDS));
    */

    Integer viewModelMode = (Integer) getChildItem(UserInterface.USER_INTERFACE_MODE);
    removeChildItem(UserInterface.USER_INTERFACE_MODE);

    super.finalizz();
  }
コード例 #2
0
  /**
   * Removes the child item from this item.
   *
   * @param n the name
   * @exception NullPointerException if the name is null
   */
  public void removeChildItem(String n) throws NullPointerException {

    if (n != null) {

      if (n.isEqualTo(UserInterface.TITLE)) {

        removeTitle((String) getChildItem(n));

      } else if (n.isEqualTo(UserInterface.ICON)) {

        removeIcon((String) getChildItem(n));

      } else if (n.isEqualTo(UserInterface.MENU_BAR)) {

        removeMenuBar((MenuBar) getChildItem(n));

      } else if (n.isEqualTo(UserInterface.TOOL_BAR)) {

        removeToolBar((ToolBar) getChildItem(n));

      } else if (n.isEqualTo(UserInterface.CONTENTS_PANEL)) {

        removeContentsPanel((ContentsPanel) getChildItem(n));

      } else if (n.isEqualTo(UserInterface.STATUS_BAR)) {

        removeStatusBar((StatusBar) getChildItem(n));

      } else if (n.isEqualTo(UserInterface.BOUNDS)) {

        // ??                    removeBounds((java.awt.Rectangle) getChildItem(n));
        java.lang.System.out.println("WARNING: Bounds not set. Replace java.awt.Rectangle");

      } else if (n.isEqualTo(UserInterface.RESIZABLE_FLAG)) {

        removeResizable((Boolean) getChildItem(n));
      }

    } else {

      throw new NullPointerException("Could not set item. The name is null.");
    }

    super.removeChildItem(n);
  }
コード例 #3
0
  /**
   * Initializes this swing view.
   *
   * @exception NullPointerException if the configuration is null
   */
  public void initialize() throws Exception, NullPointerException {

    super.initialize();

    javax.swing.UIManager.setLookAndFeel(getDefaultLookAndFeel());
    setChildItem(UserInterface.USER_INTERFACE_MODE, getDefaultUserInterfaceMode());
    /*??
            setChildItem(UserInterface.WINDOW_BOUNDS, configureWindowBounds(getDefaultWindowBounds()));
            setChildItem(UserInterface.DIALOG_BOUNDS, configureDialogBounds(getDefaultDialogBounds()));
            setChildItem(UserInterface.FRAME_BOUNDS, configureFrameBounds(getDefaultFrameBounds()));
            setChildItem(UserInterface.INTERNAL_FRAME_BOUNDS, configureInternalFrameBounds(getDefaultInternalFrameBounds()));
    */
    setChildItem(UserInterface.TITLE, getDefaultTitle());
    setChildItem(UserInterface.ICON, getDefaultIcon());
    setChildItem(UserInterface.MENU_BAR, createComponent(getDefaultMenuBar()));
    setChildItem(UserInterface.TOOL_BAR, createComponent(getDefaultToolBar()));
    setChildItem(UserInterface.CONTENTS_PANEL, createComponent(getDefaultContentsPanel()));
    setChildItem(UserInterface.STATUS_BAR, createComponent(getDefaultStatusBar()));
    setChildItem(UserInterface.RESIZABLE_FLAG, getDefaultResizableFlag());
  }