jdk/src/share/classes/sun/awt/HeadlessToolkit.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 1957 1da46e48ada5
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
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.im.spi.InputMethodDescriptor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.awt.image.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.awt.datatransfer.Clipboard;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.awt.peer.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.beans.PropertyChangeListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.lang.reflect.Constructor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.lang.reflect.InvocationTargetException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import java.net.URL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import java.util.Properties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import sun.awt.im.InputContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import sun.awt.image.ImageRepresentation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
public class HeadlessToolkit extends Toolkit
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    implements ComponentFactory, KeyboardFocusManagerPeerProvider {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    private Toolkit tk;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    private ComponentFactory componentFactory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    public HeadlessToolkit(Toolkit tk) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        this.tk = tk;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        if (tk instanceof ComponentFactory) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
            componentFactory = (ComponentFactory)tk;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    public Toolkit getUnderlyingToolkit() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        return tk;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * Component peer objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    /* Lightweight implementation of Canvas and Panel */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    public CanvasPeer createCanvas(Canvas target) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        return (CanvasPeer)createComponent(target);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    public PanelPeer createPanel(Panel target) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        return (PanelPeer)createComponent(target);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * Component peer objects - unsupported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    public WindowPeer createWindow(Window target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    public FramePeer createFrame(Frame target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    public DialogPeer createDialog(Dialog target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    public ButtonPeer createButton(Button target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    public TextFieldPeer createTextField(TextField target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    public ChoicePeer createChoice(Choice target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    public LabelPeer createLabel(Label target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    public ListPeer createList(List target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    public CheckboxPeer createCheckbox(Checkbox target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    public ScrollbarPeer createScrollbar(Scrollbar target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    public ScrollPanePeer createScrollPane(ScrollPane target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    public TextAreaPeer createTextArea(TextArea target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    public FileDialogPeer createFileDialog(FileDialog target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    public MenuBarPeer createMenuBar(MenuBar target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    public MenuPeer createMenu(Menu target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    public PopupMenuPeer createPopupMenu(PopupMenu target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    public MenuItemPeer createMenuItem(MenuItem target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    public CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    public DragSourceContextPeer createDragSourceContextPeer(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        DragGestureEvent dge)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        throws InvalidDnDOperationException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        throw new InvalidDnDOperationException("Headless environment");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    public RobotPeer createRobot(Robot target, GraphicsDevice screen)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        throws AWTException, HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    public  KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        KeyboardFocusManagerPeerImpl peer = new KeyboardFocusManagerPeerImpl(manager);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        return peer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    public TrayIconPeer createTrayIcon(TrayIcon target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
      throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    public SystemTrayPeer createSystemTray(SystemTray target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
      throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    public boolean isTraySupported() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    public GlobalCursorManager getGlobalCursorManager()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * Headless toolkit - unsupported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    protected void loadSystemColors(int[] systemColors)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    public ColorModel getColorModel()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    public int getScreenResolution()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    public Map mapInputMethodHighlight(InputMethodHighlight highlight)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    public int getMenuShortcutKeyMask()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    public boolean getLockingKeyState(int keyCode)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        throws UnsupportedOperationException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    public void setLockingKeyState(int keyCode, boolean on)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        throws UnsupportedOperationException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    public Cursor createCustomCursor(Image cursor, Point hotSpot, String name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        throws IndexOutOfBoundsException, HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    public Dimension getBestCursorSize(int preferredWidth, int preferredHeight)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    public int getMaximumCursorColors()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    public <T extends DragGestureRecognizer> T
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        createDragGestureRecognizer(Class<T> abstractRecognizerClass,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
                                    DragSource ds, Component c,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
                                    int srcActions, DragGestureListener dgl)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    public int getScreenHeight()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    public int getScreenWidth()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    public Dimension getScreenSize()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
    public Insets getScreenInsets(GraphicsConfiguration gc)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    public void setDynamicLayout(boolean dynamic)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
    protected boolean isDynamicLayoutSet()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
    public boolean isDynamicLayoutActive()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
    public Clipboard getSystemClipboard()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
        throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * Printing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    public PrintJob getPrintJob(Frame frame, String jobtitle,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
        JobAttributes jobAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
        PageAttributes pageAttributes) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
        if (frame != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
            // Should never happen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
            throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
        throw new IllegalArgumentException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
                "PrintJob not supported in a headless environment");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    public PrintJob getPrintJob(Frame frame, String doctitle, Properties props)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
        if (frame != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
            // Should never happen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
            throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
        throw new IllegalArgumentException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
                "PrintJob not supported in a headless environment");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * Headless toolkit - supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    public void sync() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
        // Do nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
    public void beep() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
        // Send alert character
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
        System.out.write(0x07);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * Event Queue
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
    public EventQueue getSystemEventQueueImpl() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        return SunToolkit.getSystemEventQueueImplPP();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * Images.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    public int checkImage(Image img, int w, int h, ImageObserver o) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        return tk.checkImage(img, w, h, o);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
    public boolean prepareImage(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
        Image img, int w, int h, ImageObserver o) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
        return tk.prepareImage(img, w, h, o);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
    public Image getImage(String filename) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
        return tk.getImage(filename);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
    public Image getImage(URL url) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
        return tk.getImage(url);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    public Image createImage(String filename) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
        return tk.createImage(filename);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
    public Image createImage(URL url) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
        return tk.createImage(url);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
    public Image createImage(byte[] data, int offset, int length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
        return tk.createImage(data, offset, length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    public Image createImage(ImageProducer producer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
        return tk.createImage(producer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
    public Image createImage(byte[] imagedata) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
        return tk.createImage(imagedata);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
    }
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
     * Fonts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
    public FontPeer getFontPeer(String name, int style) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
        if (componentFactory != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
            return componentFactory.getFontPeer(name, style);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
    public FontMetrics getFontMetrics(Font font) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
        return tk.getFontMetrics(font);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
    public String[] getFontList() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
        return tk.getFontList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * Desktop properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
    public void addPropertyChangeListener(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
        PropertyChangeListener pcl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
        tk.addPropertyChangeListener(name, pcl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    public void removePropertyChangeListener(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
        PropertyChangeListener pcl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
        tk.removePropertyChangeListener(name, pcl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * Modality
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
    public boolean isModalityTypeSupported(Dialog.ModalityType modalityType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
    public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType exclusionType) {
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
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * Always on top
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    public boolean isAlwaysOnTopSupported() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * AWT Event listeners
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
    public void addAWTEventListener(AWTEventListener listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
        long eventMask) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
        tk.addAWTEventListener(listener, eventMask);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
    public void removeAWTEventListener(AWTEventListener listener) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
        tk.removeAWTEventListener(listener);
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 AWTEventListener[] getAWTEventListeners() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
        return tk.getAWTEventListeners();
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 boolean isDesktopSupported() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
    public DesktopPeer createDesktopPeer(Desktop target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
    throws HeadlessException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
        throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
}