jdk/src/share/classes/sun/awt/HeadlessToolkit.java
author leonidr
Wed, 29 Aug 2012 19:53:35 +0400
changeset 13648 90effcfc064f
parent 11264 54f2f4c6bd30
child 23010 6dadb192ad81
permissions -rw-r--r--
7124375: [macosx] Focus isn't transfered as expected between components Reviewed-by: art, ant, serb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2809
diff changeset
     2
 * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2809
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2809
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2809
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2809
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2809
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.awt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.dnd.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.dnd.peer.DragSourceContextPeer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.awt.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.awt.im.InputMethodHighlight;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.awt.image.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.awt.datatransfer.Clipboard;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.awt.peer.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.beans.PropertyChangeListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.net.URL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.util.Properties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
public class HeadlessToolkit extends Toolkit
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    implements ComponentFactory, KeyboardFocusManagerPeerProvider {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
13648
90effcfc064f 7124375: [macosx] Focus isn't transfered as expected between components
leonidr
parents: 11264
diff changeset
    44
    private static final KeyboardFocusManagerPeer kfmPeer = new KeyboardFocusManagerPeer() {
90effcfc064f 7124375: [macosx] Focus isn't transfered as expected between components
leonidr
parents: 11264
diff changeset
    45
        public void setCurrentFocusedWindow(Window win) {}
90effcfc064f 7124375: [macosx] Focus isn't transfered as expected between components
leonidr
parents: 11264
diff changeset
    46
        public Window getCurrentFocusedWindow() { return null; }
90effcfc064f 7124375: [macosx] Focus isn't transfered as expected between components
leonidr
parents: 11264
diff changeset
    47
        public void setCurrentFocusOwner(Component comp) {}
90effcfc064f 7124375: [macosx] Focus isn't transfered as expected between components
leonidr
parents: 11264
diff changeset
    48
        public Component getCurrentFocusOwner() { return null; }
90effcfc064f 7124375: [macosx] Focus isn't transfered as expected between components
leonidr
parents: 11264
diff changeset
    49
        public void clearGlobalFocusOwner(Window activeWindow) {}
90effcfc064f 7124375: [macosx] Focus isn't transfered as expected between components
leonidr
parents: 11264
diff changeset
    50
    };
90effcfc064f 7124375: [macosx] Focus isn't transfered as expected between components
leonidr
parents: 11264
diff changeset
    51
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    private Toolkit tk;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    private ComponentFactory componentFactory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    public HeadlessToolkit(Toolkit tk) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        this.tk = tk;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        if (tk instanceof ComponentFactory) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
            componentFactory = (ComponentFactory)tk;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    public Toolkit getUnderlyingToolkit() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        return tk;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * Component peer objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    /* Lightweight implementation of Canvas and Panel */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    public CanvasPeer createCanvas(Canvas target) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        return (CanvasPeer)createComponent(target);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    public PanelPeer createPanel(Panel target) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        return (PanelPeer)createComponent(target);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * Component peer objects - unsupported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    public WindowPeer createWindow(Window target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    public FramePeer createFrame(Frame target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    public DialogPeer createDialog(Dialog target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    public ButtonPeer createButton(Button target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    public TextFieldPeer createTextField(TextField target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    public ChoicePeer createChoice(Choice target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    public LabelPeer createLabel(Label target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    public ListPeer createList(List target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    public CheckboxPeer createCheckbox(Checkbox target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    public ScrollbarPeer createScrollbar(Scrollbar target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    public ScrollPanePeer createScrollPane(ScrollPane target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    public TextAreaPeer createTextArea(TextArea target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    public FileDialogPeer createFileDialog(FileDialog target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    public MenuBarPeer createMenuBar(MenuBar target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    public MenuPeer createMenu(Menu target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    public PopupMenuPeer createPopupMenu(PopupMenu target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    public MenuItemPeer createMenuItem(MenuItem target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    public CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    public DragSourceContextPeer createDragSourceContextPeer(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        DragGestureEvent dge)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        throws InvalidDnDOperationException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        throw new InvalidDnDOperationException("Headless environment");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    public RobotPeer createRobot(Robot target, GraphicsDevice screen)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        throws AWTException, HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
13648
90effcfc064f 7124375: [macosx] Focus isn't transfered as expected between components
leonidr
parents: 11264
diff changeset
   185
    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() {
2809
b373581f6507 6833019: KeyboardFocusManager.getCurrentKeyboardFocusManager() throws unspecified HeadlessException
ant
parents: 2464
diff changeset
   186
        // See 6833019.
13648
90effcfc064f 7124375: [macosx] Focus isn't transfered as expected between components
leonidr
parents: 11264
diff changeset
   187
        return kfmPeer;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    public TrayIconPeer createTrayIcon(TrayIcon target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
      throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    public SystemTrayPeer createSystemTray(SystemTray target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
      throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    public boolean isTraySupported() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    public GlobalCursorManager getGlobalCursorManager()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * Headless toolkit - unsupported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    protected void loadSystemColors(int[] systemColors)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    public ColorModel getColorModel()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    public int getScreenResolution()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    public Map mapInputMethodHighlight(InputMethodHighlight highlight)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    public int getMenuShortcutKeyMask()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    public boolean getLockingKeyState(int keyCode)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        throws UnsupportedOperationException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    public void setLockingKeyState(int keyCode, boolean on)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        throws UnsupportedOperationException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    public Cursor createCustomCursor(Image cursor, Point hotSpot, String name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        throws IndexOutOfBoundsException, HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    public Dimension getBestCursorSize(int preferredWidth, int preferredHeight)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    public int getMaximumCursorColors()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    public <T extends DragGestureRecognizer> T
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        createDragGestureRecognizer(Class<T> abstractRecognizerClass,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
                                    DragSource ds, Component c,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
                                    int srcActions, DragGestureListener dgl)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    public int getScreenHeight()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    public int getScreenWidth()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    public Dimension getScreenSize()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    public Insets getScreenInsets(GraphicsConfiguration gc)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    public void setDynamicLayout(boolean dynamic)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
    protected boolean isDynamicLayoutSet()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    public boolean isDynamicLayoutActive()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    public Clipboard getSystemClipboard()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * Printing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
    public PrintJob getPrintJob(Frame frame, String jobtitle,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        JobAttributes jobAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
        PageAttributes pageAttributes) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        if (frame != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
            // Should never happen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
            throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
        }
8947
35ff89272f4f 7023011: Toolkit.getPrintJob(Frame,String,Properties) throws HE instead of specified NPE
dav
parents: 5506
diff changeset
   320
        throw new NullPointerException("frame must not be null");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
    public PrintJob getPrintJob(Frame frame, String doctitle, Properties props)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
        if (frame != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
            // Should never happen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
            throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
        }
8947
35ff89272f4f 7023011: Toolkit.getPrintJob(Frame,String,Properties) throws HE instead of specified NPE
dav
parents: 5506
diff changeset
   329
        throw new NullPointerException("frame must not be null");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * Headless toolkit - supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    public void sync() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
        // Do nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
    public void beep() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
        // Send alert character
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
        System.out.write(0x07);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     * Event Queue
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
    public EventQueue getSystemEventQueueImpl() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        return SunToolkit.getSystemEventQueueImplPP();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * Images.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
    public int checkImage(Image img, int w, int h, ImageObserver o) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
        return tk.checkImage(img, w, h, o);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    public boolean prepareImage(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
        Image img, int w, int h, ImageObserver o) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
        return tk.prepareImage(img, w, h, o);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
    public Image getImage(String filename) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
        return tk.getImage(filename);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    public Image getImage(URL url) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
        return tk.getImage(url);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    public Image createImage(String filename) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
        return tk.createImage(filename);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    public Image createImage(URL url) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
        return tk.createImage(url);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    public Image createImage(byte[] data, int offset, int length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
        return tk.createImage(data, offset, length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
    public Image createImage(ImageProducer producer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
        return tk.createImage(producer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    public Image createImage(byte[] imagedata) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
        return tk.createImage(imagedata);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * Fonts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     */
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 8947
diff changeset
   396
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
    public FontPeer getFontPeer(String name, int style) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
        if (componentFactory != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
            return componentFactory.getFontPeer(name, style);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 8947
diff changeset
   404
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
    public FontMetrics getFontMetrics(Font font) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
        return tk.getFontMetrics(font);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 8947
diff changeset
   409
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
    public String[] getFontList() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
        return tk.getFontList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * Desktop properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    public void addPropertyChangeListener(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
        PropertyChangeListener pcl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
        tk.addPropertyChangeListener(name, pcl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
    public void removePropertyChangeListener(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
        PropertyChangeListener pcl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
        tk.removePropertyChangeListener(name, pcl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * Modality
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
    public boolean isModalityTypeSupported(Dialog.ModalityType modalityType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType exclusionType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * Always on top
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    public boolean isAlwaysOnTopSupported() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * AWT Event listeners
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
    public void addAWTEventListener(AWTEventListener listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
        long eventMask) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
        tk.addAWTEventListener(listener, eventMask);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
    public void removeAWTEventListener(AWTEventListener listener) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
        tk.removeAWTEventListener(listener);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
    public AWTEventListener[] getAWTEventListeners() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
        return tk.getAWTEventListeners();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
1957
1da46e48ada5 6738181: api/java_awt/Toolkit/index.html#GetAWTEventListeners Fails with:empty array returned unexpectedly
dav
parents: 2
diff changeset
   463
    public AWTEventListener[] getAWTEventListeners(long eventMask) {
1da46e48ada5 6738181: api/java_awt/Toolkit/index.html#GetAWTEventListeners Fails with:empty array returned unexpectedly
dav
parents: 2
diff changeset
   464
        return tk.getAWTEventListeners(eventMask);
1da46e48ada5 6738181: api/java_awt/Toolkit/index.html#GetAWTEventListeners Fails with:empty array returned unexpectedly
dav
parents: 2
diff changeset
   465
    }
1da46e48ada5 6738181: api/java_awt/Toolkit/index.html#GetAWTEventListeners Fails with:empty array returned unexpectedly
dav
parents: 2
diff changeset
   466
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
    public boolean isDesktopSupported() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
    public DesktopPeer createDesktopPeer(Desktop target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
    throws HeadlessException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
    }
1962
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents: 1957
diff changeset
   475
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents: 1957
diff changeset
   476
    public boolean areExtraMouseButtonsEnabled() throws HeadlessException{
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents: 1957
diff changeset
   477
        throw new HeadlessException();
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents: 1957
diff changeset
   478
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
}