Package de.sciss.app

Examples of de.sciss.app.Application


    final String[]    fntNames;
//    HelpGlassPane.setHelp( lta, "MainLogPane" );  // EEE
//    HelpGlassPane.setHelp( pb, "MainProgressBar" );  // EEE
        final JScrollPane  ggScroll= new JScrollPane( lta, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                       JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
        final Application  app    = AbstractApplication.getApplication();
       
    logStream    = lta.getLogStream();
    System.setOut( logStream );
    System.setErr( logStream );
    b.add( pb );
        if( app.getUserPrefs().getBoolean( PrefsUtil.KEY_INTRUDINGSIZE, false )) {
        b.add( Box.createHorizontalStrut( 16 )); // RigidArea( new Dimension( 16, 16 )));
        }
    cp.add( ggScroll, BorderLayout.CENTER );
    cp.add( b, BorderLayout.SOUTH );
    AbstractWindowHandler.setDeepFont( cp );

    fntNames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
    if( contains( fntNames, "Monaco" )) {              // Mac OS
      fntMonoSpaced = new Font( "Monaco", Font.PLAIN, 9 );    // looks bigger than it is
    } else if( contains( fntNames, "Lucida Sans Unicode" )) {    // Windows XP
      fntMonoSpaced = new Font( "Lucida Sans Unicode", Font.PLAIN, 9 );
    } else {
      fntMonoSpaced = new Font( "Monospaced", Font.PLAIN, 10 );
    }
    lta.setFont( fntMonoSpaced );

    // ---- listeners ----

    this.addListener( new AbstractWindow.Adapter() {
      public void windowClosing( AbstractWindow.Event e ) {
        root.quit();
      }
    });
   
    setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
   
    init();
    updateTitle();
    app.addComponent( Main.COMP_MAIN, this );
    setVisible( true );
  }
View Full Code Here


   *  after a sessions name changed (clear/load/save as session)
   */
  public void updateTitle()
  {
    final String    name  = doc.getName();    // 2022 20DF 2299 2605 2666
    final Application  app    = AbstractApplication.getApplication();
    final String    title   = app.getResourceString( "frameMain" ) + (doc.isDirty() ? " - \u2022" : " - " ) +
      name == null ? app.getResourceString( "frameUntitled" ) : name;
    setTitle( title );
    setDirty( doc.isDirty() );
  }
View Full Code Here

  // context options map
  private static final String  KEY_PRODC  = "prodc";

  public VectorRaiseMultiply()
  {
    final Application  app = AbstractApplication.getApplication();
   
    msgPane      = new JPanel( new SpringLayout() );
   
    ggRaise      = new PrefCheckBox( app.getResourceString( "vectorRaise" ));
    ggRaiseVal    = new PrefNumberField();
    ggRaiseVal.setSpace( NumberSpace.genericDoubleSpace );
    ggRaiseVal.setNumber( new Double( 1.0 ));
    ggMultiply    = new PrefCheckBox( app.getResourceString( "vectorMultiply" ));
    ggMultiplyVal  = new PrefNumberField();
    ggMultiplyVal.setSpace( NumberSpace.genericDoubleSpace );
    ggMultiplyVal.setNumber( new Double( 1.0 ));

    msgPane.add( ggRaise );
View Full Code Here

        // nothing to do
      }
    });
   
    final Container    cp    = getContentPane();
    final Application  app    = AbstractApplication.getApplication();
    final JScrollPane  scroll;
    final Box      box    = Box.createHorizontalBox();

    setTitle( app.getResourceString( "frameJatha" ));

    prompt      = new JTextArea( app.getResourceString( "jathaDiddlerIntro" ), 4, 0 ); //, 16, 40
// key location ignored ;-(
//    prompt.getInputMap().put( KeyStroke.getKeyStrokeForEvent( new KeyEvent(
//      this, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, KeyEvent.VK_ENTER,
//      KeyEvent.CHAR_UNDEFINED, KeyEvent.KEY_LOCATION_NUMPAD )), "eval" );
    prompt.getInputMap().put( KeyStroke.getKeyStroke( KeyEvent.VK_ENTER, KeyEvent.SHIFT_MASK ), "eval" );
    prompt.getActionMap().put( "eval", new actionEvalClass() );
//    prompt.setFont( app.getWindowHandler().getDefaultFont() );
    prompt.setTabSize( 4 );
    prompt.setLineWrap( false );
    prompt.setCaretPosition( prompt.getText().length() );
    scroll      = new JScrollPane( prompt );
   
    ggPrintInput  = new JCheckBox( app.getResourceString( "jathaDiddlerInput" ));
    ggPrintResult  = new JCheckBox( app.getResourceString( "jathaDiddlerResult" ));
    ggPrintResult.setSelected( true );
    box.add( ggPrintInput );
    box.add( ggPrintResult );
    if( app.getUserPrefs().getBoolean( PrefsUtil.KEY_INTRUDINGSIZE, false )) {
      box.add( Box.createVerticalStrut( 16 ));
        }

    cp.add( scroll, BorderLayout.CENTER );
    cp.add( box, BorderLayout.SOUTH );
View Full Code Here

   */
    public HelpFrame()
    {
        super();
       
    final Application  app  = AbstractApplication.getApplication();
    final WindowHandler wh  = app.getWindowHandler();
   
    win  = wh.createWindow( AbstractWindow.SUPPORT );
   
    Container              cp    = win.getContentPane();
        Box                  buttonPanel;
    final JButton            ggClose;
        JScrollPane              ggScroll;
   
    plainTitle  = GUIUtil.getResourceString( "frameHelp" );
   
    win.setTitle( plainTitle );
   
        // ---------- HTML schoko ----------
        htmlPane    = new JEditorPane();
        htmlPane.setEditable( false );
        htmlPane.addHyperlinkListener( this );
        htmlPane.setPreferredSize( new Dimension( 320, 320 ));
        htmlPane.setAutoscrolls( true );
//      htmlPane.setContentType( "text/html" );
        htmlPane.addPropertyChangeListener( this );
//    HelpGlassPane.setHelp( htmlPane, "HelpHTMLPane" );
        ggScroll    = new JScrollPane( htmlPane );
    ggVScroll  = ggScroll.getVerticalScrollBar();
       
        // ---------- generic gadgets ----------

        buttonPanel = Box.createHorizontalBox(); // new JPanel( new FlowLayout( FlowLayout.RIGHT, 4, 4 ));
    ggEdit    = new JButton( GUIUtil.getResourceString( "buttonJEdit" ));
    buttonPanel.add( ggEdit );
    buttonPanel.add( Box.createHorizontalGlue() );
    ggEdit.addActionListener( new ActionListener() {
      public void actionPerformed( ActionEvent e )
      {
        if( historyIndex < 0 ) return;
     
        try {
          final File      f  = net.roydesign.mac.MRJAdapter.findApplication( "JESP" )// try to open with jEdit
          final HistoryEntry  he  = (HistoryEntry) history.get( historyIndex );
          if( f != null ) {
            final String[] cmdArray = { "open", "-a", f.getAbsolutePath(), new File( new URI( he.url.toString() )).getAbsolutePath() };
            java.lang.Runtime.getRuntime().exec( cmdArray );
          }
        }
        catch( IOException e1 ) {
          GUIUtil.displayError( win.getWindow(), e1, ggEdit.getText() );
        }
        catch( IllegalArgumentException e1 ) {
          GUIUtil.displayError( win.getWindow(), e1, ggEdit.getText() );
        }
        catch( URISyntaxException e1 ) {
          GUIUtil.displayError( win.getWindow(), e1, ggEdit.getText() );
        }
      }
    });
        ggBack      = new JButton( GUIUtil.getResourceString( "buttonBack" ));
        ggBack.setEnabled( false );
        buttonPanel.add( ggBack );
        ggBack.addActionListener( new ActionListener() {
      public void actionPerformed( ActionEvent newEvent )
      {
        if( historyIndex > 0 ) {
          try {
            try {
              historyIndex--;
              loadURL();
            }
            catch( IOException e2 ) {   // try to load previous file
              historyIndex++;
              loadURL();
              throw e2;
            }
          }
          catch( IOException e3 ) {
            GUIUtil.displayError( win.getWindow(), e3, ggBack.getText() );
          }
        }
            }
    });
        ggOpenInBrowser  = new JButton( GUIUtil.getResourceString( "helpOpenBrowser" ));
        ggOpenInBrowser.setEnabled( false );
//    HelpGlassPane.setHelp( ggOpenInBrowser, "HelpOpenInBrowser" );
        buttonPanel.add( ggOpenInBrowser );
        ggOpenInBrowser.addActionListener( new ActionListener() {
      public void actionPerformed( ActionEvent newEvent )
      {
                openInBrowser();
           
    });
        ggClose  = new JButton( GUIUtil.getResourceString( "buttonClose" ));
        buttonPanel.add( ggClose );
        ggClose.addActionListener( new ActionListener() {
      public void actionPerformed( ActionEvent newEvent )
      {
                dispose();
     
    });

    win.addListener( new AbstractWindow.Adapter() {
      public void windowClosing( AbstractWindow.Event e )
      {
        dispose();
      }
    });

    buttonPanel.add( new HelpButton( "HelpHTMLPane" ));
    buttonPanel.add( Box.createHorizontalStrut( 16 ))// XXX check intruding size

        cp.add( ggScroll, BorderLayout.CENTER );
        cp.add( buttonPanel, BorderLayout.SOUTH );
//    GUIUtil.setDeepFont( cp, fnt );

    AbstractWindowHandler.setDeepFont( win.getContentPane(), null );

    ggScroll.setPreferredSize( new Dimension( 512, 512 ))// XXX
    win.pack();
   
//    win.setDefaultCloseOperation( WindowConstants.DISPOSE_ON_CLOSE );
    win.setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
    win.init();
    app.addComponent( COMP_HELP, this );
    }
View Full Code Here

  protected Timer              tempFloatingTimer;

  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() ) {
View Full Code Here

     }
 
  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" );
//  }
View Full Code Here

    super( PALETTE );
    setResizable( false );
   
        final Container    cp  = getContentPane();
    final JPanel    gp  = GUIUtil.createGradientPanel();
    final Application  app  = AbstractApplication.getApplication();

    setTitle( app.getResourceString( "paletteTransport" ));

    tb      = new TransportToolBar( doc );
    tb.setOpaque( false );
    gp.add( tb );
    cp.add( gp );

    init();
    app.addComponent( Main.COMP_TRANSPORT, this );
  }
View Full Code Here

    setTitle( title );
   
    this.root   = root;
    this.doc  = doc;
   
    final Application  app  = AbstractApplication.getApplication();
   
    rsmpItems  = new StringItem[] {
      new StringItem( NearestNeighbour.class.getName(),
              app.getResourceString( "pluginResamplingNearest" )),
      new StringItem( LinearInterpolation.class.getName(),
              app.getResourceString( "pluginResamplingLinear" )),
      new StringItem( BandLimitedResampling.class.getName(),
              app.getResourceString( "pluginResamplingBandlimited" ))
    };
   
    String className  = getClass().getName();
    classPrefs      = app.getUserPrefs().node( PrefsUtil.NODE_SHARED ).node(
                className.substring( className.lastIndexOf( '.' ) + 1 ));
               
    // --- GUI creation ---
   
    Container cp = getContentPane();
View Full Code Here

   (escape) is attached to the close button.
   */
  protected JComponent createBottomPanel( int flags )
  {
    JPanel        bottomPanel;
    final Application  app = AbstractApplication.getApplication();

    actionClose    = new actionCloseClassapp.getResourceString( "buttonClose" ));
    actionCancel  = new actionCancelClass( app.getResourceString( "buttonCancel" ));
    actionRender  = new actionRenderClass( app.getResourceString( "buttonRender" ));
   
    bottomPanel    = new JPanel();
    bottomPanel.setLayout( new BorderLayout() );
    ggClose      = new JButton( actionClose );
    GUIUtil.createKeyAction( ggClose, KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0 ));
View Full Code Here

TOP

Related Classes of de.sciss.app.Application

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.