View Javadoc

1   /*
2      Copyright 2002-2007 Martin van den Bemt
3   
4      Licensed under the Apache License, Version 2.0 (the "License");
5      you may not use this file except in compliance with the License.
6      You may obtain a copy of the License at
7   
8          http://www.apache.org/licenses/LICENSE-2.0
9   
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15  */
16  package org.xulux.guilayer.swing.util;
17  
18  import java.awt.Toolkit;
19  
20  import org.xulux.gui.XuluxToolkit;
21  import org.xulux.gui.utils.XuluxEventQueue;
22  
23  /**
24   * The swing toolkit...
25   *
26   * @author <a href="mailto:martin@mvdb.net">Martin van den Bemt</a>
27   * @version $Id: SwingToolkit.java,v 1.1 2005/12/18 12:58:22 mvdb Exp $
28   */
29  public class SwingToolkit extends XuluxToolkit {
30  
31      /**
32       * Is the toolkit initialized
33       */
34      private static boolean initialized = false;
35  
36      /**
37       *
38       */
39      public SwingToolkit() {
40      }
41  
42      /**
43       * @see org.xulux.nyx.gui.XuluxToolkit#beep()
44       */
45      public void beep() {
46          Toolkit.getDefaultToolkit().beep();
47      }
48  
49      /**
50       * @see org.xulux.nyx.gui.XuluxToolkit#initialize()
51       */
52      public void initialize() {
53          if (initialized) {
54              return;
55          }
56          // initialize the eventqueue..
57          new XuluxEventQueue();
58          initialized = true;
59      }
60  
61      /**
62       * @see org.xulux.nyx.gui.XuluxToolkit#destroy()
63       */
64      public void destroy() {
65          // clear the xulux eventqueue instance.
66          XuluxEventQueue.clearInstance();
67          initialized = false;
68      }
69  
70  }