Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/bdexx/macosx/OggCartonX.java


1   
2   /*
3    * Copyright 2003 by Bdexx.com, Inc. 
4    * This program is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU General Public License
6    * as published by the Free Software Foundation; either version 2
7    * of the License, or (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You can view a copy of the GNU General Public License on the
15   * Web at http://www.gnu.org/copyleft/gpl.html, or 
16   * write to the Free Software Foundation, Inc., 
17   * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18   */ 
19  
20  
21  /* This is a hack so the normal Mac top-of-screen menu works for OggCarton.
22   * Ugly, but effective.
23   * Needs to be updated to conform to the new ApplicationListener interface
24   * in Apple's 1.4.x release.
25   */
26   
27  package com.bdexx.macosx;
28  import java.awt.*;
29  import java.awt.event.*;
30  import com.apple.mrj.*;
31  import javax.swing.*;
32  public class OggCartonX
33      implements  OSXInterface,
34      MRJAboutHandler,
35      MRJQuitHandler,
36      MRJPrefsHandler {
37  
38     
39    
40      CartonInterface carton;  
41      public OggCartonX(){
42    ;
43      }
44      public void setCarton(CartonInterface carton) {
45    this.carton = carton;
46          Toolkit.getDefaultToolkit();
47    /* Tell Mac OS X to call us for the top of screen menu events */
48          MRJApplicationUtils.registerAboutHandler(this);
49          MRJApplicationUtils.registerQuitHandler(this);
50          MRJApplicationUtils.registerPrefsHandler(this);
51          
52      }
53  
54      /* Menu "About" was selected */
55      public void handleAbout() {
56    carton.showAbout();
57      }
58      /* Menu "Preferences" was selected */
59      public void handlePrefs(){
60          carton.showConfig();
61      }
62      /* Menu "Quit" was selected */
63  
64      public void handleQuit() {  
65    carton.windowClosing(null);
66      }
67  
68  
69    
70  
71  }