< prev index next >

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

Print this page


   1 /*
   2  * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  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.datatransfer.Clipboard;
  30 import java.awt.dnd.DragGestureListener;
  31 import java.awt.dnd.DragGestureRecognizer;
  32 import java.awt.dnd.DragSource;
  33 import java.awt.event.AWTEventListener;

  34 import java.awt.font.TextAttribute;
  35 import java.awt.im.InputMethodHighlight;
  36 import java.awt.image.ColorModel;
  37 import java.awt.image.ImageObserver;
  38 import java.awt.image.ImageProducer;
  39 import java.awt.peer.FontPeer;
  40 import java.awt.peer.KeyboardFocusManagerPeer;
  41 import java.awt.peer.SystemTrayPeer;
  42 import java.awt.peer.TrayIconPeer;
  43 import java.beans.PropertyChangeListener;
  44 import java.net.URL;
  45 import java.util.Map;
  46 import java.util.Properties;
  47 
  48 public final class HeadlessToolkit extends Toolkit
  49     implements ComponentFactory, KeyboardFocusManagerPeerProvider {
  50 
  51     private static final KeyboardFocusManagerPeer kfmPeer = new KeyboardFocusManagerPeer() {
  52         @Override
  53         public void setCurrentFocusedWindow(Window win) {}


 111 
 112     @Override
 113     public ColorModel getColorModel()
 114         throws HeadlessException {
 115         throw new HeadlessException();
 116     }
 117 
 118     @Override
 119     public int getScreenResolution()
 120         throws HeadlessException {
 121         throw new HeadlessException();
 122     }
 123 
 124     @Override
 125     public Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight)
 126         throws HeadlessException {
 127         throw new HeadlessException();
 128     }
 129 
 130     @Override

 131     public int getMenuShortcutKeyMask()
 132         throws HeadlessException {
 133         throw new HeadlessException();
 134     }
 135 
 136     @Override






 137     public boolean getLockingKeyState(int keyCode)
 138         throws UnsupportedOperationException {
 139         throw new HeadlessException();
 140     }
 141 
 142     @Override
 143     public void setLockingKeyState(int keyCode, boolean on)
 144         throws UnsupportedOperationException {
 145         throw new HeadlessException();
 146     }
 147 
 148     @Override
 149     public Cursor createCustomCursor(Image cursor, Point hotSpot, String name)
 150         throws IndexOutOfBoundsException, HeadlessException {
 151         throw new HeadlessException();
 152     }
 153 
 154     @Override
 155     public Dimension getBestCursorSize(int preferredWidth, int preferredHeight)
 156         throws HeadlessException {


   1 /*
   2  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  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.datatransfer.Clipboard;
  30 import java.awt.dnd.DragGestureListener;
  31 import java.awt.dnd.DragGestureRecognizer;
  32 import java.awt.dnd.DragSource;
  33 import java.awt.event.AWTEventListener;
  34 import java.awt.event.InputEvent;
  35 import java.awt.font.TextAttribute;
  36 import java.awt.im.InputMethodHighlight;
  37 import java.awt.image.ColorModel;
  38 import java.awt.image.ImageObserver;
  39 import java.awt.image.ImageProducer;
  40 import java.awt.peer.FontPeer;
  41 import java.awt.peer.KeyboardFocusManagerPeer;
  42 import java.awt.peer.SystemTrayPeer;
  43 import java.awt.peer.TrayIconPeer;
  44 import java.beans.PropertyChangeListener;
  45 import java.net.URL;
  46 import java.util.Map;
  47 import java.util.Properties;
  48 
  49 public final class HeadlessToolkit extends Toolkit
  50     implements ComponentFactory, KeyboardFocusManagerPeerProvider {
  51 
  52     private static final KeyboardFocusManagerPeer kfmPeer = new KeyboardFocusManagerPeer() {
  53         @Override
  54         public void setCurrentFocusedWindow(Window win) {}


 112 
 113     @Override
 114     public ColorModel getColorModel()
 115         throws HeadlessException {
 116         throw new HeadlessException();
 117     }
 118 
 119     @Override
 120     public int getScreenResolution()
 121         throws HeadlessException {
 122         throw new HeadlessException();
 123     }
 124 
 125     @Override
 126     public Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight)
 127         throws HeadlessException {
 128         throw new HeadlessException();
 129     }
 130 
 131     @Override
 132     @Deprecated(since = "10")
 133     public int getMenuShortcutKeyMask()
 134         throws HeadlessException {
 135         throw new HeadlessException();
 136     }
 137 
 138     @Override
 139     public int getMenuShortcutKeyMaskEx()
 140         throws HeadlessException {
 141         throw new HeadlessException();
 142     }
 143 
 144     @Override
 145     public boolean getLockingKeyState(int keyCode)
 146         throws UnsupportedOperationException {
 147         throw new HeadlessException();
 148     }
 149 
 150     @Override
 151     public void setLockingKeyState(int keyCode, boolean on)
 152         throws UnsupportedOperationException {
 153         throw new HeadlessException();
 154     }
 155 
 156     @Override
 157     public Cursor createCustomCursor(Image cursor, Point hotSpot, String name)
 158         throws IndexOutOfBoundsException, HeadlessException {
 159         throw new HeadlessException();
 160     }
 161 
 162     @Override
 163     public Dimension getBestCursorSize(int preferredWidth, int preferredHeight)
 164         throws HeadlessException {


< prev index next >