src/share/classes/sun/awt/HeadlessToolkit.java

Print this page
rev 9830 : 8039642: Fix raw and unchecked warnings in sun.awt.*
Reviewed-by: darcy, prr


  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.awt;
  27 
  28 import java.awt.*;
  29 import java.awt.dnd.*;
  30 import java.awt.dnd.peer.DragSourceContextPeer;
  31 import java.awt.event.*;

  32 import java.awt.im.InputMethodHighlight;
  33 import java.awt.image.*;
  34 import java.awt.datatransfer.Clipboard;
  35 import java.awt.peer.*;
  36 import java.beans.PropertyChangeListener;
  37 import java.net.URL;
  38 import java.util.Map;
  39 import java.util.Properties;
  40 
  41 public class HeadlessToolkit extends Toolkit
  42     implements ComponentFactory, KeyboardFocusManagerPeerProvider {
  43 
  44     private static final KeyboardFocusManagerPeer kfmPeer = new KeyboardFocusManagerPeer() {
  45         public void setCurrentFocusedWindow(Window win) {}
  46         public Window getCurrentFocusedWindow() { return null; }
  47         public void setCurrentFocusOwner(Component comp) {}
  48         public Component getCurrentFocusOwner() { return null; }
  49         public void clearGlobalFocusOwner(Window activeWindow) {}
  50     };
  51 


 207     }
 208 
 209     /*
 210      * Headless toolkit - unsupported.
 211      */
 212     protected void loadSystemColors(int[] systemColors)
 213         throws HeadlessException {
 214         throw new HeadlessException();
 215     }
 216 
 217     public ColorModel getColorModel()
 218         throws HeadlessException {
 219         throw new HeadlessException();
 220     }
 221 
 222     public int getScreenResolution()
 223         throws HeadlessException {
 224         throw new HeadlessException();
 225     }
 226 
 227     public Map mapInputMethodHighlight(InputMethodHighlight highlight)
 228         throws HeadlessException {
 229         throw new HeadlessException();
 230     }
 231 
 232     public int getMenuShortcutKeyMask()
 233         throws HeadlessException {
 234         throw new HeadlessException();
 235     }
 236 
 237     public boolean getLockingKeyState(int keyCode)
 238         throws UnsupportedOperationException {
 239         throw new HeadlessException();
 240     }
 241 
 242     public void setLockingKeyState(int keyCode, boolean on)
 243         throws UnsupportedOperationException {
 244         throw new HeadlessException();
 245     }
 246 
 247     public Cursor createCustomCursor(Image cursor, Point hotSpot, String name)




  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.awt;
  27 
  28 import java.awt.*;
  29 import java.awt.dnd.*;
  30 import java.awt.dnd.peer.DragSourceContextPeer;
  31 import java.awt.event.*;
  32 import java.awt.font.TextAttribute;
  33 import java.awt.im.InputMethodHighlight;
  34 import java.awt.image.*;
  35 import java.awt.datatransfer.Clipboard;
  36 import java.awt.peer.*;
  37 import java.beans.PropertyChangeListener;
  38 import java.net.URL;
  39 import java.util.Map;
  40 import java.util.Properties;
  41 
  42 public class HeadlessToolkit extends Toolkit
  43     implements ComponentFactory, KeyboardFocusManagerPeerProvider {
  44 
  45     private static final KeyboardFocusManagerPeer kfmPeer = new KeyboardFocusManagerPeer() {
  46         public void setCurrentFocusedWindow(Window win) {}
  47         public Window getCurrentFocusedWindow() { return null; }
  48         public void setCurrentFocusOwner(Component comp) {}
  49         public Component getCurrentFocusOwner() { return null; }
  50         public void clearGlobalFocusOwner(Window activeWindow) {}
  51     };
  52 


 208     }
 209 
 210     /*
 211      * Headless toolkit - unsupported.
 212      */
 213     protected void loadSystemColors(int[] systemColors)
 214         throws HeadlessException {
 215         throw new HeadlessException();
 216     }
 217 
 218     public ColorModel getColorModel()
 219         throws HeadlessException {
 220         throw new HeadlessException();
 221     }
 222 
 223     public int getScreenResolution()
 224         throws HeadlessException {
 225         throw new HeadlessException();
 226     }
 227 
 228     public Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight)
 229         throws HeadlessException {
 230         throw new HeadlessException();
 231     }
 232 
 233     public int getMenuShortcutKeyMask()
 234         throws HeadlessException {
 235         throw new HeadlessException();
 236     }
 237 
 238     public boolean getLockingKeyState(int keyCode)
 239         throws UnsupportedOperationException {
 240         throw new HeadlessException();
 241     }
 242 
 243     public void setLockingKeyState(int keyCode, boolean on)
 244         throws UnsupportedOperationException {
 245         throw new HeadlessException();
 246     }
 247 
 248     public Cursor createCustomCursor(Image cursor, Point hotSpot, String name)