Package de.sciss.app

Examples of de.sciss.app.AbstractWindow


    private File queryFile()
    {
      final FileDialog    fDlg;
      final String      strFile, strDir;
      final AbstractWindow  w    = (AbstractWindow) getApplication().getComponent( Main.COMP_MAIN );
      final Frame        frame  = (w.getWindow() instanceof Frame) ? (Frame) w.getWindow() : null;
      final Preferences    prefs  = getApplication().getUserPrefs();

//System.err.println( "frame : "+frame );

      fDlg  = new FileDialog( frame, getResourceString( "fileDlgOpen" ), FileDialog.LOAD );
View Full Code Here


    public void mouseClicked( MouseEvent e )
    {
      Receiver    rcv;
      Rectangle2D    clipRect;
      ReceiverEditor  rcvEdit;
      AbstractWindow  rcvEditFrame;
      List      coll;
      PerformableEdit  edit;

      if( !doc.bird.attemptShared( Session.DOOR_RCV, 250 )) return;
      try {
        if( doc.getSelectedReceivers().isEmpty() ) {
          if( e.getClickCount() == 2 ) {  // double click creates new Receiver
            rcv = createReceiver( screenToVirtual( e.getPoint() ));
            if( rcv != null ) {
              coll = doc.getSelectedReceivers().getAll();
              coll.add( rcv );
              edit = new EditSetSessionObjects( this, doc.getMutableSelectedReceivers(), coll );
              doc.getUndoManager().addEdit( edit.perform() );
              clipRect = rcv.getBounds();
              updateSurfacePaneImage( clipRect );
              updateReceiverShapes();
              redrawImage();
              repaint( virtualToScreenClip( clipRect ));
            }
          }
         
        } else { // items have been selected
          if( e.getClickCount() == 2 && doc.getSelectedReceivers().size() == 1 ) {  // double click opens editor
            rcv    = (Receiver) doc.getSelectedReceivers().get( 0 );
            final Class clz = rcv.getDefaultEditor();
            final Constructor cons = clz.getConstructor( new Class[] { Session.class });
            rcvEdit = (ReceiverEditor) cons.newInstance( new Object[] { doc })// XXX deligate to SurfacePaneFrame
            rcvEdit.init( rcv );
            rcvEditFrame = rcvEdit.getView();
            rcvEditFrame.setVisible( true );
            rcvEditFrame.toFront();
            showCursorTab();
          }
        }
      }
      catch( InstantiationException e1 ) {
View Full Code Here

    winListener = new AbstractWindow.Adapter() {
//      public void windowGainedFocus( AbstractWindow.Event e )
      public void windowActivated( AbstractWindow.Event e )
      {
        final AbstractWindow w = e.getWindow();

        timer.stop();
       
        if( frames.contains( w )) {
          setFocusedWindow( w );
View Full Code Here

    if( !hiddenPalettes.isEmpty() ) {
      // in metal look-n-feel, seems that
      // setVisible might dispatch instanenously\
      // somehow setting focusedWindow to null (weird?!!!)
//      final AbstractWindow w = focusedWindow;
      AbstractWindow w;
      for( Iterator iter = hiddenPalettes.iterator(); iter.hasNext(); ) {
        w = (AbstractWindow) iter.next();
        if( DEBUG ) System.out.println( "setVisible( true ) : " + w.getClass().getName() );
        w.setVisible( true );
      }
      if( DEBUG ) System.out.println( "hiddenPalettes.clear" );
      hiddenPalettes.clear();
      //    focusedWindow.requestFocus();
      // trick to not have the originally focussed window loose its focus due to palettes showing up
View Full Code Here

    }
   
    private void hidePalettes()
  {
//      hidden = true;
    AbstractWindow w;

    if( !frames.isEmpty() ) {
      for( Iterator iter = frames.iterator(); iter.hasNext(); ) {
        w = (AbstractWindow) iter.next();
        if( isFocused( w )) return;
      }
    }
    if( !palettes.isEmpty() ) {
            for( Iterator iter = palettes.iterator(); iter.hasNext(); ) {
                w = (AbstractWindow) iter.next();
                if( isFocused( w )) return;
            }
        }

    for( Iterator iter = palettes.iterator(); iter.hasNext(); ) {
            w = (AbstractWindow) iter.next();
      if( w.isVisible() ) {
        if( DEBUG ) {
          System.out.println( "hiddenPalettes.add : " + w.getClass().getName() );
          System.out.println( "setVisible( false ) : " + w.getClass().getName() );
        }
        hiddenPalettes.add( w );
        w.setVisible( false );
            }
        }
   
//    // XXX fuer test
//    for( Iterator iter = hiddenPalettes.iterator(); iter.hasNext(); ) {
View Full Code Here

     *  If the window is already open, this
     *  method will bring it to the front.
     */
    public void actionPerformed( ActionEvent e )
    {
      AbstractWindow w = (AbstractWindow) getApplication().getComponent( component );
      if( w != null ) {
        w.setVisible( true );
        w.toFront();
      }
    }
View Full Code Here

// the next event cycle) and re-put it in the front\
// coz setAlwaysOnTop came "too late"
EventQueue.invokeLater( new Runnable() {
  public void run()
  {
    final AbstractWindow fw = FloatingPaletteHandler.getInstance().getFocussedWindow();
    if( fw != null ) fw.toFront();
  }
});
            } else {
              jif.setLayer( JLayeredPane.DEFAULT_LAYER );
            }
View Full Code Here

  private void instShowDialog( Dialog dlg )
  {
//    System.out.println( "instShowDialog" );
   
    final AbstractWindow  w;
    final List        wasOnTop  = new ArrayList();
    final boolean      modal    = dlg.isModal() && (fph != null);
    AbstractWindow      w2;
//boolean gaga = false;
   
    // temporarily disable alwaysOnTop
    if( !internalFrames && floating ) {
      for( Iterator iter = getWindows(); iter.hasNext(); ) {
        w2 = (AbstractWindow) iter.next();
        if( GUIUtil.isAlwaysOnTop( w2.getWindow() )) {
//gaga = true;
//break;
          wasOnTop.add( w2 );
          GUIUtil.setAlwaysOnTop( w2.getWindow(), false );
        }
      }
    }
    try {
      w = new AppWindow( dlg );
      w.init()// calls addWindow
//      ((AppWindow) w).gaga();
       
      // --- modal interruption ---
      if( modal ) fph.addModalDialog(); // this shit is necessary because java.awt.FileDialog doesn't fire windowActivated ...
//      if( gaga ) GUIUtil.setAlwaysOnTop( dlg, true );
      w.setVisible( true );
      if( modal ) fph.removeModalDialog();
     
  //    wh.removeWindow( w, null );
      w.dispose()// calls removeWindow

    } finally { // make sure to restore original state
      for( int i = 0; i < wasOnTop.size(); i++ ) {
        w2 = (AbstractWindow) wasOnTop.get( i );
//        System.out.println( "wasOnTop " + i + " : " + w2.getClass().getName() );
        GUIUtil.setAlwaysOnTop( w2.getWindow(), true );
      }
    }
  }
View Full Code Here

TOP

Related Classes of de.sciss.app.AbstractWindow

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.