Beispiel #1
0
  protected AppWindow(Dialog wrap) {
    super();
    final Application app = AbstractApplication.getApplication();
    wh = (BasicWindowHandler) app.getWindowHandler();

    // wrap.addWindowFocusListener( new WindowFocusListener() {
    //	public void windowGainedFocus( WindowEvent e ) {
    //		System.out.println( "WINDOWFOCUSGAINED" );
    //	}
    //
    //	public void windowLostFocus( WindowEvent e ) {
    //		System.out.println( "WINDOWFOCUSLOST" );
    //	}
    // });
    // wrap.addWindowListener( new WindowAdapter() {
    //	public void windowOpened( WindowEvent e ) {
    //		System.out.println( "OPENED" );
    //	}
    //
    //	public void windowActivated( WindowEvent e ) {
    //		System.out.println( "ACTIVATED" );
    //	}
    //
    //	public void windowDeactivated( WindowEvent e ) {
    //		System.out.println( "DEACTIVATED" );
    //	}
    // });
    // wrap.addFocusListener( new FocusListener() {
    //	public void focusGained( FocusEvent e ) {
    //		System.out.println( "FOCUSGAINED" );
    //	}
    //
    //	public void focusLost( FocusEvent e ) {
    //		System.out.println( "FOCUSLOST" );
    //	}
    // });

    c = w = wrap;
    f = jf = null; // XXX
    jc = jif = null;
    d = jd = null;
    ownMenuBar = false;
    // WARNING: modal dialogs must not be permanent floating
    // because they would cause the floating palette handler
    // to hide and show them, re-creating a modal event queue
    // interruption!!
    //		permFloating		= !wh.usesInternalFrames() && wh.usesFloating();
    //		tempFloating		= false;
    //		tempFloating		= !wh.usesInternalFrames() && wh.usesFloating();
    //		floating			= false;
    // floating = tempFloating;
    tempFloating = false;
    floating = false;
    borrowMenuBar = false;
    ggTitle = null;

    //		if( floating ) GUIUtil.setAlwaysOnTop( wrap, true );
    //		initTempFloating();
    // lala=true;
  }
Beispiel #2
0
  public AppWindow(int flags) {
    super();
    final Application app = AbstractApplication.getApplication();
    final int type = flags & TYPES_MASK;
    wh = (BasicWindowHandler) app.getWindowHandler();

    switch (type) {
      case REGULAR:
      case SUPPORT:
        if (wh.usesInternalFrames()) {
          c = jc = jif = new JInternalFrame(null, true, true, true, true);
          w = f = jf = null;
          d = jd = null;
          wh.getDesktop().add(jif);
          ownMenuBar = type == REGULAR;

        } else {
          c = w = f = jf = new JFrame();
          jc = jif = null;
          d = jd = null;
          ownMenuBar = wh.usesScreenMenuBar() || (type == REGULAR);
        }
        //			floating			= false;
        tempFloating = (type == SUPPORT) && wh.usesFloating();
        floating = tempFloating;
        borrowMenuBar = false;
        ggTitle = null;
        break;

      case PALETTE:
        floating = wh.usesFloating();
        tempFloating = false;
        ownMenuBar = false;

        if (wh.usesInternalFrames()) {
          c = jc = jif = new JInternalFrame(null, true, true, true, true);
          w = f = jf = null;
          d = jd = null;
          borrowMenuBar = true;
          ggTitle = null;

          if (floating) jif.putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);
          wh.getDesktop()
              .add(jif, floating ? JLayeredPane.PALETTE_LAYER : JLayeredPane.DEFAULT_LAYER);

        } else {

          c = w = f = jf = new JFrame();
          jc = jif = null;
          d = jd = null;
          //				borrowMenuBar	= wh.usesScreenMenuBar();

          if (floating) {
            ggTitle = new AquaWindowBar(this, true);
            ggTitle.setAlwaysOnTop(true);
            borrowMenuBar = false;
            jf.setUndecorated(true);

            final Container cp = jf.getContentPane();

            //					cp.add( ggTitle, orient == HORIZONTAL ? BorderLayout.NORTH : BorderLayout.WEST );
            cp.add(ggTitle, BorderLayout.NORTH);

            //					if( resizable ) {
            //						final JPanel p = new JPanel( new BorderLayout() );
            //						p.add( new AquaResizeGadget(), BorderLayout.EAST );
            //						cp.add( p, BorderLayout.SOUTH );
            //					}
            //				} else {
            //					if( prefs.getBoolean( PrefsUtil.KEY_INTRUDINGSIZE, false )) {
            //						getContentPane().add( Box.createVerticalStrut( 16 ), BorderLayout.SOUTH );
            //					}
          } else {
            borrowMenuBar = wh.usesScreenMenuBar();
            ggTitle = null;
          }
        }
        break;

      default:
        throw new IllegalArgumentException("Unsupported window type : " + (flags & TYPES_MASK));
    }

    initTempFloating();
  }