886N/A/*
3909N/A * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
886N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
886N/A *
886N/A * This code is free software; you can redistribute it and/or modify it
886N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
886N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
886N/A *
886N/A * This code is distributed in the hope that it will be useful, but WITHOUT
886N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
886N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
886N/A * version 2 for more details (a copy is included in the LICENSE file that
886N/A * accompanied this code).
886N/A *
886N/A * You should have received a copy of the GNU General Public License version
886N/A * 2 along with this work; if not, write to the Free Software Foundation,
886N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
886N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
886N/A */
886N/A
886N/Apackage sun.awt;
886N/A
886N/Aimport java.awt.*;
4639N/Aimport java.awt.KeyboardFocusManager;
5255N/Aimport java.awt.DefaultKeyboardFocusManager;
5222N/Aimport java.awt.event.InputEvent;
5255N/Aimport java.awt.event.KeyEvent;
1045N/Aimport java.awt.geom.Point2D;
1045N/A
886N/Aimport sun.misc.Unsafe;
1338N/Aimport java.awt.peer.ComponentPeer;
886N/A
5704N/Aimport java.lang.reflect.InvocationTargetException;
3787N/Aimport java.security.AccessControlContext;
3787N/A
4787N/Aimport java.io.File;
5255N/Aimport java.util.Vector;
4787N/A
1058N/A/**
1058N/A * The AWTAccessor utility class.
886N/A * The main purpose of this class is to enable accessing
886N/A * private and package-private fields of classes from
886N/A * different classes/packages. See sun.misc.SharedSecretes
886N/A * for another example.
886N/A */
886N/Apublic final class AWTAccessor {
1045N/A
886N/A private static final Unsafe unsafe = Unsafe.getUnsafe();
886N/A
1045N/A /*
1045N/A * We don't need any objects of this class.
886N/A * It's rather a collection of static methods
886N/A * and interfaces.
886N/A */
886N/A private AWTAccessor() {
886N/A }
886N/A
1045N/A /*
1045N/A * An interface of accessor for the java.awt.Component class.
886N/A */
886N/A public interface ComponentAccessor {
1045N/A /*
1045N/A * Sets whether the native background erase for a component
1045N/A * has been disabled via SunToolkit.disableBackgroundErase().
1045N/A */
1045N/A void setBackgroundEraseDisabled(Component comp, boolean disabled);
1045N/A /*
1045N/A * Indicates whether the native background erase for a
1045N/A * component has been disabled via
1045N/A * SunToolkit.disableBackgroundErase().
1045N/A */
1045N/A boolean getBackgroundEraseDisabled(Component comp);
1045N/A /*
1045N/A *
1045N/A * Gets the bounds of this component in the form of a
1045N/A * <code>Rectangle</code> object. The bounds specify this
1045N/A * component's width, height, and location relative to
1045N/A * its parent.
1045N/A */
1045N/A Rectangle getBounds(Component comp);
1045N/A /*
886N/A * Sets the shape of a lw component to cut out from hw components.
1045N/A *
1045N/A * See 6797587, 6776743, 6768307, and 6768332 for details
886N/A */
886N/A void setMixingCutoutShape(Component comp, Shape shape);
1053N/A
1053N/A /**
1053N/A * Sets GraphicsConfiguration value for the component.
1053N/A */
1053N/A void setGraphicsConfiguration(Component comp, GraphicsConfiguration gc);
1058N/A /*
1058N/A * Requests focus to the component.
1058N/A */
1058N/A boolean requestFocus(Component comp, CausedFocusEvent.Cause cause);
1058N/A /*
1058N/A * Determines if the component can gain focus.
1058N/A */
1058N/A boolean canBeFocusOwner(Component comp);
1066N/A
1066N/A /**
1066N/A * Returns whether the component is visible without invoking
1066N/A * any client code.
1066N/A */
1976N/A boolean isVisible(Component comp);
1338N/A
1338N/A /**
1338N/A * Sets the RequestFocusController.
1338N/A */
1338N/A void setRequestFocusController(RequestFocusController requestController);
1338N/A
1338N/A /**
1338N/A * Returns the appContext of the component.
1338N/A */
1338N/A AppContext getAppContext(Component comp);
1338N/A
1338N/A /**
1338N/A * Sets the appContext of the component.
1338N/A */
1338N/A void setAppContext(Component comp, AppContext appContext);
1976N/A
1976N/A /**
1976N/A * Returns the parent of the component.
1976N/A */
1976N/A Container getParent(Component comp);
1976N/A
1976N/A /**
1976N/A * Sets the parent of the component to the specified parent.
1976N/A */
1976N/A void setParent(Component comp, Container parent);
1976N/A
1976N/A /**
1976N/A * Resizes the component to the specified width and height.
1976N/A */
1976N/A void setSize(Component comp, int width, int height);
1976N/A
1976N/A /**
1976N/A * Returns the location of the component.
1976N/A */
1976N/A Point getLocation(Component comp);
1976N/A
1976N/A /**
1976N/A * Moves the component to the new location.
1976N/A */
1976N/A void setLocation(Component comp, int x, int y);
1976N/A
1976N/A /**
1976N/A * Determines whether this component is enabled.
1976N/A */
1976N/A boolean isEnabled(Component comp);
1976N/A
1976N/A /**
1976N/A * Determines whether this component is displayable.
1976N/A */
1976N/A boolean isDisplayable(Component comp);
1976N/A
1976N/A /**
1976N/A * Gets the cursor set in the component.
1976N/A */
1976N/A Cursor getCursor(Component comp);
1976N/A
1976N/A /**
1976N/A * Returns the peer of the component.
1976N/A */
1976N/A ComponentPeer getPeer(Component comp);
1976N/A
1976N/A /**
1976N/A * Sets the peer of the component to the specified peer.
1976N/A */
1976N/A void setPeer(Component comp, ComponentPeer peer);
1976N/A
1976N/A /**
1976N/A * Determines whether this component is lightweight.
1976N/A */
1976N/A boolean isLightweight(Component comp);
1976N/A
1976N/A /**
1976N/A * Returns whether or not paint messages received from
1976N/A * the operating system should be ignored.
1976N/A */
1976N/A boolean getIgnoreRepaint(Component comp);
1976N/A
1976N/A /**
1976N/A * Returns the width of the component.
1976N/A */
1976N/A int getWidth(Component comp);
1976N/A
1976N/A /**
1976N/A * Returns the height of the component.
1976N/A */
1976N/A int getHeight(Component comp);
1976N/A
1976N/A /**
1976N/A * Returns the x coordinate of the component.
1976N/A */
1976N/A int getX(Component comp);
1976N/A
1976N/A /**
1976N/A * Returns the y coordinate of the component.
1976N/A */
1976N/A int getY(Component comp);
1976N/A
1976N/A /**
1976N/A * Gets the foreground color of this component.
1976N/A */
1976N/A Color getForeground(Component comp);
1976N/A
1976N/A /**
1976N/A * Gets the background color of this component.
1976N/A */
1976N/A Color getBackground(Component comp);
1976N/A
1976N/A /**
1976N/A * Sets the background of this component to the specified color.
1976N/A */
1976N/A void setBackground(Component comp, Color background);
1976N/A
1976N/A /**
1976N/A * Gets the font of the component.
1976N/A */
1976N/A Font getFont(Component comp);
1976N/A
1976N/A /**
1976N/A * Processes events occurring on this component.
1976N/A */
1976N/A void processEvent(Component comp, AWTEvent e);
3787N/A
3787N/A
3787N/A /*
3787N/A * Returns the acc this component was constructed with.
3787N/A */
3787N/A AccessControlContext getAccessControlContext(Component comp);
3787N/A
886N/A }
886N/A
1045N/A /*
3075N/A * An interface of accessor for the java.awt.Container class.
3075N/A */
3075N/A public interface ContainerAccessor {
3075N/A /**
3075N/A * Validates the container unconditionally.
3075N/A */
3075N/A void validateUnconditionally(Container cont);
3075N/A }
3075N/A
3075N/A /*
1045N/A * An interface of accessor for java.awt.Window class.
1045N/A */
1045N/A public interface WindowAccessor {
1045N/A /*
1045N/A * Get opacity level of the given window.
1045N/A */
1045N/A float getOpacity(Window window);
1045N/A /*
1045N/A * Set opacity level to the given window.
1045N/A */
1045N/A void setOpacity(Window window, float opacity);
1045N/A /*
1045N/A * Get a shape assigned to the given window.
1045N/A */
1045N/A Shape getShape(Window window);
1045N/A /*
1045N/A * Set a shape to the given window.
1045N/A */
1045N/A void setShape(Window window, Shape shape);
1045N/A /*
1045N/A * Set the opaque preoperty to the given window.
1045N/A */
1045N/A void setOpaque(Window window, boolean isOpaque);
1045N/A /*
1045N/A * Update the image of a non-opaque (translucent) window.
1045N/A */
1222N/A void updateWindow(Window window);
1066N/A
1066N/A /** Get the size of the security warning.
1066N/A */
1066N/A Dimension getSecurityWarningSize(Window w);
1066N/A
1066N/A /**
1066N/A * Set the size of the security warning.
1066N/A */
1066N/A void setSecurityWarningSize(Window w, int width, int height);
1066N/A
1066N/A /** Set the position of the security warning.
1066N/A */
1066N/A void setSecurityWarningPosition(Window w, Point2D point,
1066N/A float alignmentX, float alignmentY);
1066N/A
1066N/A /** Request to recalculate the new position of the security warning for
1066N/A * the given window size/location as reported by the native system.
1066N/A */
1066N/A Point2D calculateSecurityWarningPosition(Window window,
1066N/A double x, double y, double w, double h);
1338N/A
1338N/A /** Sets the synchronous status of focus requests on lightweight
1338N/A * components in the specified window to the specified value.
1338N/A */
1338N/A void setLWRequestStatus(Window changed, boolean status);
1976N/A
1976N/A /**
1976N/A * Indicates whether this window should receive focus on subsequently
1976N/A * being shown, or being moved to the front.
1976N/A */
1976N/A boolean isAutoRequestFocus(Window w);
1976N/A
1976N/A /**
1976N/A * Indicates whether the specified window is an utility window for TrayIcon.
1976N/A */
1976N/A boolean isTrayIconWindow(Window w);
1976N/A
1976N/A /**
1976N/A * Marks the specified window as an utility window for TrayIcon.
1976N/A */
1976N/A void setTrayIconWindow(Window w, boolean isTrayIconWindow);
1045N/A }
1045N/A
5255N/A /**
1045N/A * An accessor for the AWTEvent class.
1045N/A */
1045N/A public interface AWTEventAccessor {
1338N/A /**
1338N/A * Marks the event as posted.
1045N/A */
1338N/A void setPosted(AWTEvent ev);
2860N/A
2860N/A /**
2860N/A * Sets the flag on this AWTEvent indicating that it was
2860N/A * generated by the system.
2860N/A */
2860N/A void setSystemGenerated(AWTEvent ev);
2860N/A
2860N/A /**
2860N/A * Indicates whether this AWTEvent was generated by the system.
2860N/A */
2860N/A boolean isSystemGenerated(AWTEvent ev);
3787N/A
5255N/A /**
3787N/A * Returns the acc this event was constructed with.
3787N/A */
3787N/A AccessControlContext getAccessControlContext(AWTEvent ev);
3787N/A
5255N/A /**
5255N/A * Returns binary data associated with this event;
5255N/A */
5255N/A byte[] getBData(AWTEvent ev);
5255N/A
5255N/A /**
5255N/A * Associates binary data with this event;
5255N/A */
5255N/A void setBData(AWTEvent ev, byte[] bdata);
1045N/A }
1045N/A
2859N/A public interface InputEventAccessor {
2859N/A /*
2859N/A * Accessor for InputEvent.getButtonDownMasks()
2859N/A */
2859N/A int[] getButtonDownMasks();
2859N/A }
2859N/A
1045N/A /*
1047N/A * An accessor for the java.awt.Frame class.
1047N/A */
1047N/A public interface FrameAccessor {
1047N/A /*
1047N/A * Sets the state of this frame.
1047N/A */
1047N/A void setExtendedState(Frame frame, int state);
1047N/A /*
1047N/A * Gets the state of this frame.
1047N/A */
1047N/A int getExtendedState(Frame frame);
3073N/A /*
3073N/A * Gets the maximized bounds of this frame.
3073N/A */
3073N/A Rectangle getMaximizedBounds(Frame frame);
1047N/A }
1047N/A
5255N/A /**
1059N/A * An interface of accessor for the java.awt.KeyboardFocusManager class.
1058N/A */
1058N/A public interface KeyboardFocusManagerAccessor {
5255N/A /**
1058N/A * Indicates whether the native implementation should
1058N/A * proceed with a pending focus request for the heavyweight.
1058N/A */
1058N/A int shouldNativelyFocusHeavyweight(Component heavyweight,
1058N/A Component descendant,
1058N/A boolean temporary,
1058N/A boolean focusedWindowChangeAllowed,
1058N/A long time,
1058N/A CausedFocusEvent.Cause cause);
5255N/A /**
1058N/A * Delivers focus for the lightweight descendant of the heavyweight
1058N/A * synchronously.
1058N/A */
1058N/A boolean processSynchronousLightweightTransfer(Component heavyweight,
1058N/A Component descendant,
1058N/A boolean temporary,
1058N/A boolean focusedWindowChangeAllowed,
1058N/A long time);
5255N/A /**
1058N/A * Removes the last focus request for the heavyweight from the queue.
1058N/A */
1058N/A void removeLastFocusRequest(Component heavyweight);
2765N/A
5255N/A /**
2765N/A * Sets the most recent focus owner in the window.
2765N/A */
2765N/A void setMostRecentFocusOwner(Window window, Component component);
4639N/A
5255N/A /**
4639N/A * Returns current KFM of the specified AppContext.
4639N/A */
4639N/A KeyboardFocusManager getCurrentKeyboardFocusManager(AppContext ctx);
5255N/A
5255N/A /**
5255N/A * Return the current focus cycle root
5255N/A */
5255N/A Container getCurrentFocusCycleRoot();
1058N/A }
1058N/A
5255N/A /**
1338N/A * An accessor for the MenuComponent class.
1338N/A */
1338N/A public interface MenuComponentAccessor {
1338N/A /**
1338N/A * Returns the appContext of the menu component.
1338N/A */
1338N/A AppContext getAppContext(MenuComponent menuComp);
1338N/A
1338N/A /**
1338N/A * Sets the appContext of the menu component.
1338N/A */
1338N/A void setAppContext(MenuComponent menuComp, AppContext appContext);
1338N/A
1338N/A /**
1338N/A * Returns the menu container of the menu component
1338N/A */
1338N/A MenuContainer getParent(MenuComponent menuComp);
5255N/A
5255N/A /**
5255N/A * Gets the font used for this menu component.
5255N/A */
5255N/A Font getFont_NoClientCode(MenuComponent menuComp);
1338N/A }
1338N/A
5255N/A /**
1338N/A * An accessor for the EventQueue class
1338N/A */
1338N/A public interface EventQueueAccessor {
5255N/A /**
1338N/A * Gets the event dispatch thread.
1338N/A */
1338N/A Thread getDispatchThread(EventQueue eventQueue);
5255N/A
5255N/A /**
1970N/A * Checks if the current thread is EDT for the given EQ.
1970N/A */
1970N/A public boolean isDispatchThreadImpl(EventQueue eventQueue);
5255N/A
5255N/A /**
5255N/A * Removes any pending events for the specified source object.
5255N/A */
5255N/A void removeSourceEvents(EventQueue eventQueue, Object source, boolean removeAllEvents);
5255N/A
5255N/A /**
5255N/A * Returns whether an event is pending on any of the separate Queues.
5255N/A */
5255N/A boolean noEvents(EventQueue eventQueue);
5255N/A
5255N/A /**
5255N/A * Called from PostEventQueue.postEvent to notify that a new event
5255N/A * appeared.
5255N/A */
5255N/A void wakeup(EventQueue eventQueue, boolean isShutdown);
5704N/A
5704N/A /**
5704N/A * Static in EventQueue
5704N/A */
5704N/A void invokeAndWait(Object source, Runnable r)
5704N/A throws InterruptedException, InvocationTargetException;
1338N/A }
1338N/A
1338N/A /*
1338N/A * An accessor for the PopupMenu class
1338N/A */
1338N/A public interface PopupMenuAccessor {
1338N/A /*
1338N/A * Returns whether the popup menu is attached to a tray
1338N/A */
1338N/A boolean isTrayIconPopup(PopupMenu popupMenu);
1338N/A }
1338N/A
2153N/A /*
2153N/A * An accessor for the FileDialog class
2153N/A */
2153N/A public interface FileDialogAccessor {
2153N/A /*
2153N/A * Sets the files the user selects
2153N/A */
4787N/A void setFiles(FileDialog fileDialog, File files[]);
2153N/A
2153N/A /*
2153N/A * Sets the file the user selects
2153N/A */
2153N/A void setFile(FileDialog fileDialog, String file);
2153N/A
2153N/A /*
2153N/A * Sets the directory the user selects
2153N/A */
2153N/A void setDirectory(FileDialog fileDialog, String directory);
2153N/A
2153N/A /*
2153N/A * Returns whether the file dialog allows the multiple file selection.
2153N/A */
2153N/A boolean isMultipleMode(FileDialog fileDialog);
2153N/A }
1338N/A
5255N/A /**
5255N/A * An accessor for the ScrollPaneAdjustable class.
5255N/A */
5255N/A public interface ScrollPaneAdjustableAccessor {
5255N/A /**
5255N/A * Sets the value of this scrollbar to the specified value.
5255N/A */
5255N/A void setTypedValue(final ScrollPaneAdjustable adj, final int v,
5255N/A final int type);
5255N/A }
5255N/A
5255N/A /**
5255N/A * An accessor for the CheckboxMenuItem class
5255N/A */
5255N/A public interface CheckboxMenuItemAccessor {
5255N/A /**
5255N/A * Returns whether menu item is checked
5255N/A */
5255N/A boolean getState(CheckboxMenuItem cmi);
5255N/A }
5255N/A
5255N/A /**
5255N/A * An accessor for the Cursor class
5255N/A */
5255N/A public interface CursorAccessor {
5255N/A /**
5255N/A * Returns pData of the Cursor class
5255N/A */
5255N/A long getPData(Cursor cursor);
5255N/A
5255N/A /**
5255N/A * Sets pData to the Cursor class
5255N/A */
5255N/A void setPData(Cursor cursor, long pData);
5255N/A
5255N/A /**
5255N/A * Return type of the Cursor class
5255N/A */
5255N/A int getType(Cursor cursor);
5255N/A }
5255N/A
5255N/A /**
5255N/A * An accessor for the MenuBar class
5255N/A */
5255N/A public interface MenuBarAccessor {
5255N/A /**
5255N/A * Returns help menu
5255N/A */
5255N/A Menu getHelpMenu(MenuBar menuBar);
5255N/A
5255N/A /**
5255N/A * Returns menus
5255N/A */
5255N/A Vector getMenus(MenuBar menuBar);
5255N/A }
5255N/A
5255N/A /**
5255N/A * An accessor for the MenuItem class
5255N/A */
5255N/A public interface MenuItemAccessor {
5255N/A /**
5255N/A * Returns whether menu item is enabled
5255N/A */
5255N/A boolean isEnabled(MenuItem item);
5255N/A
5255N/A /**
5255N/A * Gets the command name of the action event that is fired
5255N/A * by this menu item.
5255N/A */
5255N/A String getActionCommandImpl(MenuItem item);
5255N/A
5255N/A /**
5255N/A * Returns true if the item and all its ancestors are
5255N/A * enabled, false otherwise
5255N/A */
5255N/A boolean isItemEnabled(MenuItem item);
5255N/A
5255N/A /**
5255N/A * Returns label
5255N/A */
5255N/A String getLabel(MenuItem item);
5255N/A
5255N/A /**
5255N/A * Returns shortcut
5255N/A */
5255N/A MenuShortcut getShortcut(MenuItem item);
5255N/A }
5255N/A
5255N/A /**
5255N/A * An accessor for the Menu class
5255N/A */
5255N/A public interface MenuAccessor {
5255N/A /**
5255N/A * Returns vector of the items that are part of the Menu
5255N/A */
5255N/A Vector getItems(Menu menu);
5255N/A }
5255N/A
5255N/A /**
5255N/A * An accessor for the KeyEvent class
5255N/A */
5255N/A public interface KeyEventAccessor {
5255N/A /**
5255N/A * Sets rawCode field for KeyEvent
5255N/A */
5255N/A void setRawCode(KeyEvent ev, long rawCode);
5255N/A
5255N/A /**
5255N/A * Sets primaryLevelUnicode field for KeyEvent
5255N/A */
5255N/A void setPrimaryLevelUnicode(KeyEvent ev, long primaryLevelUnicode);
5255N/A
5255N/A /**
5255N/A * Sets extendedKeyCode field for KeyEvent
5255N/A */
5255N/A void setExtendedKeyCode(KeyEvent ev, long extendedKeyCode);
5255N/A }
5255N/A
5255N/A /**
5255N/A * An accessor for the ClientPropertyKey class
5255N/A */
5255N/A public interface ClientPropertyKeyAccessor {
5255N/A /**
5255N/A * Retrieves JComponent_TRANSFER_HANDLER enum object
5255N/A */
5255N/A Object getJComponent_TRANSFER_HANDLER();
5255N/A }
5255N/A
5255N/A /**
5255N/A * An accessor for the SystemTray class
5255N/A */
5255N/A public interface SystemTrayAccessor {
5255N/A /**
5255N/A * Support for reporting bound property changes for Object properties.
5255N/A */
5255N/A void firePropertyChange(SystemTray tray, String propertyName, Object oldValue, Object newValue);
5255N/A }
5255N/A
5255N/A /**
5255N/A * An accessor for the TrayIcon class
5255N/A */
5255N/A public interface TrayIconAccessor {
5255N/A void addNotify(TrayIcon trayIcon) throws AWTException;
5255N/A void removeNotify(TrayIcon trayIcon);
5255N/A }
5255N/A
5255N/A /**
5255N/A * An accessor for the DefaultKeyboardFocusManager class
5255N/A */
5255N/A public interface DefaultKeyboardFocusManagerAccessor {
5255N/A public void consumeNextKeyTyped(DefaultKeyboardFocusManager dkfm, KeyEvent e);
5255N/A }
5255N/A
1338N/A /*
5574N/A * An accessor for the SequencedEventAccessor class
5574N/A */
5574N/A public interface SequencedEventAccessor {
5574N/A /*
5574N/A * Returns the nested event.
5574N/A */
5574N/A AWTEvent getNested(AWTEvent sequencedEvent);
5574N/A
5574N/A /*
5574N/A * Returns true if the event is an instances of SequencedEvent.
5574N/A */
5574N/A boolean isSequencedEvent(AWTEvent event);
5574N/A }
5574N/A
5574N/A /*
3075N/A * Accessor instances are initialized in the static initializers of
3075N/A * corresponding AWT classes by using setters defined below.
886N/A */
886N/A private static ComponentAccessor componentAccessor;
3075N/A private static ContainerAccessor containerAccessor;
1045N/A private static WindowAccessor windowAccessor;
1045N/A private static AWTEventAccessor awtEventAccessor;
2859N/A private static InputEventAccessor inputEventAccessor;
1047N/A private static FrameAccessor frameAccessor;
1058N/A private static KeyboardFocusManagerAccessor kfmAccessor;
1338N/A private static MenuComponentAccessor menuComponentAccessor;
1338N/A private static EventQueueAccessor eventQueueAccessor;
1338N/A private static PopupMenuAccessor popupMenuAccessor;
2153N/A private static FileDialogAccessor fileDialogAccessor;
5255N/A private static ScrollPaneAdjustableAccessor scrollPaneAdjustableAccessor;
5255N/A private static CheckboxMenuItemAccessor checkboxMenuItemAccessor;
5255N/A private static CursorAccessor cursorAccessor;
5255N/A private static MenuBarAccessor menuBarAccessor;
5255N/A private static MenuItemAccessor menuItemAccessor;
5255N/A private static MenuAccessor menuAccessor;
5255N/A private static KeyEventAccessor keyEventAccessor;
5255N/A private static ClientPropertyKeyAccessor clientPropertyKeyAccessor;
5255N/A private static SystemTrayAccessor systemTrayAccessor;
5255N/A private static TrayIconAccessor trayIconAccessor;
5255N/A private static DefaultKeyboardFocusManagerAccessor defaultKeyboardFocusManagerAccessor;
5574N/A private static SequencedEventAccessor sequencedEventAccessor;
2153N/A
2153N/A /*
1045N/A * Set an accessor object for the java.awt.Component class.
886N/A */
886N/A public static void setComponentAccessor(ComponentAccessor ca) {
886N/A componentAccessor = ca;
886N/A }
886N/A
1045N/A /*
3075N/A * Retrieve the accessor object for the java.awt.Component class.
886N/A */
886N/A public static ComponentAccessor getComponentAccessor() {
886N/A if (componentAccessor == null) {
886N/A unsafe.ensureClassInitialized(Component.class);
886N/A }
886N/A
886N/A return componentAccessor;
886N/A }
1045N/A
1045N/A /*
3075N/A * Set an accessor object for the java.awt.Container class.
3075N/A */
3075N/A public static void setContainerAccessor(ContainerAccessor ca) {
3075N/A containerAccessor = ca;
3075N/A }
3075N/A
3075N/A /*
3075N/A * Retrieve the accessor object for the java.awt.Container class.
3075N/A */
3075N/A public static ContainerAccessor getContainerAccessor() {
3075N/A if (containerAccessor == null) {
3075N/A unsafe.ensureClassInitialized(Container.class);
3075N/A }
3075N/A
3075N/A return containerAccessor;
3075N/A }
3075N/A
3075N/A /*
1045N/A * Set an accessor object for the java.awt.Window class.
1045N/A */
1045N/A public static void setWindowAccessor(WindowAccessor wa) {
1045N/A windowAccessor = wa;
1045N/A }
1045N/A
1045N/A /*
1045N/A * Retrieve the accessor object for the java.awt.Window class.
1045N/A */
1045N/A public static WindowAccessor getWindowAccessor() {
1045N/A if (windowAccessor == null) {
1045N/A unsafe.ensureClassInitialized(Window.class);
1045N/A }
1045N/A return windowAccessor;
1045N/A }
1045N/A
1045N/A /*
1045N/A * Set an accessor object for the java.awt.AWTEvent class.
1045N/A */
1045N/A public static void setAWTEventAccessor(AWTEventAccessor aea) {
1045N/A awtEventAccessor = aea;
1045N/A }
1045N/A
1045N/A /*
1045N/A * Retrieve the accessor object for the java.awt.AWTEvent class.
1045N/A */
1045N/A public static AWTEventAccessor getAWTEventAccessor() {
1338N/A if (awtEventAccessor == null) {
1338N/A unsafe.ensureClassInitialized(AWTEvent.class);
1338N/A }
1045N/A return awtEventAccessor;
1045N/A }
1047N/A
1047N/A /*
2859N/A * Set an accessor object for the java.awt.event.InputEvent class.
2859N/A */
2859N/A public static void setInputEventAccessor(InputEventAccessor iea) {
2859N/A inputEventAccessor = iea;
2859N/A }
2859N/A
2859N/A /*
2859N/A * Retrieve the accessor object for the java.awt.event.InputEvent class.
2859N/A */
2859N/A public static InputEventAccessor getInputEventAccessor() {
2859N/A if (inputEventAccessor == null) {
2859N/A unsafe.ensureClassInitialized(InputEvent.class);
2859N/A }
2859N/A return inputEventAccessor;
2859N/A }
2859N/A
2859N/A /*
1047N/A * Set an accessor object for the java.awt.Frame class.
1047N/A */
1047N/A public static void setFrameAccessor(FrameAccessor fa) {
1047N/A frameAccessor = fa;
1047N/A }
1047N/A
1047N/A /*
1047N/A * Retrieve the accessor object for the java.awt.Frame class.
1047N/A */
1047N/A public static FrameAccessor getFrameAccessor() {
1047N/A if (frameAccessor == null) {
1047N/A unsafe.ensureClassInitialized(Frame.class);
1047N/A }
1047N/A return frameAccessor;
1047N/A }
1058N/A
1058N/A /*
1058N/A * Set an accessor object for the java.awt.KeyboardFocusManager class.
1058N/A */
1058N/A public static void setKeyboardFocusManagerAccessor(KeyboardFocusManagerAccessor kfma) {
1058N/A kfmAccessor = kfma;
1058N/A }
1058N/A
1058N/A /*
1058N/A * Retrieve the accessor object for the java.awt.KeyboardFocusManager class.
1058N/A */
1058N/A public static KeyboardFocusManagerAccessor getKeyboardFocusManagerAccessor() {
1058N/A if (kfmAccessor == null) {
1058N/A unsafe.ensureClassInitialized(KeyboardFocusManager.class);
1058N/A }
1058N/A return kfmAccessor;
1058N/A }
1338N/A
1338N/A /*
1338N/A * Set an accessor object for the java.awt.MenuComponent class.
1338N/A */
1338N/A public static void setMenuComponentAccessor(MenuComponentAccessor mca) {
1338N/A menuComponentAccessor = mca;
1338N/A }
1338N/A
1338N/A /*
1338N/A * Retrieve the accessor object for the java.awt.MenuComponent class.
1338N/A */
1338N/A public static MenuComponentAccessor getMenuComponentAccessor() {
1338N/A if (menuComponentAccessor == null) {
1338N/A unsafe.ensureClassInitialized(MenuComponent.class);
1338N/A }
1338N/A return menuComponentAccessor;
1338N/A }
1338N/A
1338N/A /*
1338N/A * Set an accessor object for the java.awt.EventQueue class.
1338N/A */
1338N/A public static void setEventQueueAccessor(EventQueueAccessor eqa) {
1338N/A eventQueueAccessor = eqa;
1338N/A }
1338N/A
1338N/A /*
1338N/A * Retrieve the accessor object for the java.awt.EventQueue class.
1338N/A */
1338N/A public static EventQueueAccessor getEventQueueAccessor() {
1338N/A if (eventQueueAccessor == null) {
1338N/A unsafe.ensureClassInitialized(EventQueue.class);
1338N/A }
1338N/A return eventQueueAccessor;
1338N/A }
1338N/A
1338N/A /*
1338N/A * Set an accessor object for the java.awt.PopupMenu class.
1338N/A */
1338N/A public static void setPopupMenuAccessor(PopupMenuAccessor pma) {
1338N/A popupMenuAccessor = pma;
1338N/A }
1338N/A
1338N/A /*
1338N/A * Retrieve the accessor object for the java.awt.PopupMenu class.
1338N/A */
1338N/A public static PopupMenuAccessor getPopupMenuAccessor() {
1338N/A if (popupMenuAccessor == null) {
1338N/A unsafe.ensureClassInitialized(PopupMenu.class);
1338N/A }
1338N/A return popupMenuAccessor;
1338N/A }
2153N/A
2153N/A /*
2153N/A * Set an accessor object for the java.awt.FileDialog class.
2153N/A */
2153N/A public static void setFileDialogAccessor(FileDialogAccessor fda) {
2153N/A fileDialogAccessor = fda;
2153N/A }
2153N/A
2153N/A /*
2153N/A * Retrieve the accessor object for the java.awt.FileDialog class.
2153N/A */
2153N/A public static FileDialogAccessor getFileDialogAccessor() {
2153N/A if (fileDialogAccessor == null) {
2153N/A unsafe.ensureClassInitialized(FileDialog.class);
2153N/A }
2153N/A return fileDialogAccessor;
2153N/A }
2153N/A
5255N/A /**
5255N/A * Set an accessor object for the java.awt.ScrollPaneAdjustable class.
5255N/A */
5255N/A public static void setScrollPaneAdjustableAccessor(ScrollPaneAdjustableAccessor adj) {
5255N/A scrollPaneAdjustableAccessor = adj;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Retrieve the accessor object for the java.awt.ScrollPaneAdjustable
5255N/A * class.
5255N/A */
5255N/A public static ScrollPaneAdjustableAccessor getScrollPaneAdjustableAccessor() {
5255N/A if (scrollPaneAdjustableAccessor == null) {
5255N/A unsafe.ensureClassInitialized(ScrollPaneAdjustable.class);
5255N/A }
5255N/A return scrollPaneAdjustableAccessor;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Set an accessor object for the java.awt.CheckboxMenuItem class.
5255N/A */
5255N/A public static void setCheckboxMenuItemAccessor(CheckboxMenuItemAccessor cmia) {
5255N/A checkboxMenuItemAccessor = cmia;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Retrieve the accessor object for the java.awt.CheckboxMenuItem class.
5255N/A */
5255N/A public static CheckboxMenuItemAccessor getCheckboxMenuItemAccessor() {
5255N/A if (checkboxMenuItemAccessor == null) {
5255N/A unsafe.ensureClassInitialized(CheckboxMenuItemAccessor.class);
5255N/A }
5255N/A return checkboxMenuItemAccessor;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Set an accessor object for the java.awt.Cursor class.
5255N/A */
5255N/A public static void setCursorAccessor(CursorAccessor ca) {
5255N/A cursorAccessor = ca;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Retrieve the accessor object for the java.awt.Cursor class.
5255N/A */
5255N/A public static CursorAccessor getCursorAccessor() {
5255N/A if (cursorAccessor == null) {
5255N/A unsafe.ensureClassInitialized(CursorAccessor.class);
5255N/A }
5255N/A return cursorAccessor;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Set an accessor object for the java.awt.MenuBar class.
5255N/A */
5255N/A public static void setMenuBarAccessor(MenuBarAccessor mba) {
5255N/A menuBarAccessor = mba;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Retrieve the accessor object for the java.awt.MenuBar class.
5255N/A */
5255N/A public static MenuBarAccessor getMenuBarAccessor() {
5255N/A if (menuBarAccessor == null) {
5255N/A unsafe.ensureClassInitialized(MenuBarAccessor.class);
5255N/A }
5255N/A return menuBarAccessor;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Set an accessor object for the java.awt.MenuItem class.
5255N/A */
5255N/A public static void setMenuItemAccessor(MenuItemAccessor mia) {
5255N/A menuItemAccessor = mia;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Retrieve the accessor object for the java.awt.MenuItem class.
5255N/A */
5255N/A public static MenuItemAccessor getMenuItemAccessor() {
5255N/A if (menuItemAccessor == null) {
5255N/A unsafe.ensureClassInitialized(MenuItemAccessor.class);
5255N/A }
5255N/A return menuItemAccessor;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Set an accessor object for the java.awt.Menu class.
5255N/A */
5255N/A public static void setMenuAccessor(MenuAccessor ma) {
5255N/A menuAccessor = ma;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Retrieve the accessor object for the java.awt.Menu class.
5255N/A */
5255N/A public static MenuAccessor getMenuAccessor() {
5255N/A if (menuAccessor == null) {
5255N/A unsafe.ensureClassInitialized(MenuAccessor.class);
5255N/A }
5255N/A return menuAccessor;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Set an accessor object for the java.awt.event.KeyEvent class.
5255N/A */
5255N/A public static void setKeyEventAccessor(KeyEventAccessor kea) {
5255N/A keyEventAccessor = kea;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Retrieve the accessor object for the java.awt.event.KeyEvent class.
5255N/A */
5255N/A public static KeyEventAccessor getKeyEventAccessor() {
5255N/A if (keyEventAccessor == null) {
5255N/A unsafe.ensureClassInitialized(KeyEventAccessor.class);
5255N/A }
5255N/A return keyEventAccessor;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Set an accessor object for the javax.swing.ClientPropertyKey class.
5255N/A */
5255N/A public static void setClientPropertyKeyAccessor(ClientPropertyKeyAccessor cpka) {
5255N/A clientPropertyKeyAccessor = cpka;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Retrieve the accessor object for the javax.swing.ClientPropertyKey class.
5255N/A */
5255N/A public static ClientPropertyKeyAccessor getClientPropertyKeyAccessor() {
5255N/A if (clientPropertyKeyAccessor == null) {
5255N/A unsafe.ensureClassInitialized(ClientPropertyKeyAccessor.class);
5255N/A }
5255N/A return clientPropertyKeyAccessor;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Set an accessor object for the java.awt.SystemTray class.
5255N/A */
5255N/A public static void setSystemTrayAccessor(SystemTrayAccessor sta) {
5255N/A systemTrayAccessor = sta;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Retrieve the accessor object for the java.awt.SystemTray class.
5255N/A */
5255N/A public static SystemTrayAccessor getSystemTrayAccessor() {
5255N/A if (systemTrayAccessor == null) {
5255N/A unsafe.ensureClassInitialized(SystemTrayAccessor.class);
5255N/A }
5255N/A return systemTrayAccessor;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Set an accessor object for the java.awt.TrayIcon class.
5255N/A */
5255N/A public static void setTrayIconAccessor(TrayIconAccessor tia) {
5255N/A trayIconAccessor = tia;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Retrieve the accessor object for the java.awt.TrayIcon class.
5255N/A */
5255N/A public static TrayIconAccessor getTrayIconAccessor() {
5255N/A if (trayIconAccessor == null) {
5255N/A unsafe.ensureClassInitialized(TrayIconAccessor.class);
5255N/A }
5255N/A return trayIconAccessor;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Set an accessor object for the java.awt.DefaultKeyboardFocusManager class.
5255N/A */
5255N/A public static void setDefaultKeyboardFocusManagerAccessor(DefaultKeyboardFocusManagerAccessor dkfma) {
5255N/A defaultKeyboardFocusManagerAccessor = dkfma;
5255N/A }
5255N/A
5255N/A /**
5255N/A * Retrieve the accessor object for the java.awt.DefaultKeyboardFocusManager class.
5255N/A */
5255N/A public static DefaultKeyboardFocusManagerAccessor getDefaultKeyboardFocusManagerAccessor() {
5255N/A if (defaultKeyboardFocusManagerAccessor == null) {
5255N/A unsafe.ensureClassInitialized(DefaultKeyboardFocusManagerAccessor.class);
5255N/A }
5255N/A return defaultKeyboardFocusManagerAccessor;
5255N/A }
5255N/A
5574N/A /*
5574N/A * Set an accessor object for the java.awt.SequencedEvent class.
5574N/A */
5574N/A public static void setSequencedEventAccessor(SequencedEventAccessor sea) {
5574N/A sequencedEventAccessor = sea;
5574N/A }
5574N/A
5574N/A /*
5574N/A * Get the accessor object for the java.awt.SequencedEvent class.
5574N/A */
5574N/A public static SequencedEventAccessor getSequencedEventAccessor() {
5574N/A // The class is not public. So we can't ensure it's initialized.
5574N/A // Null returned value means it's not initialized
5574N/A // (so not a single instance of the event has been created).
5574N/A return sequencedEventAccessor;
5574N/A }
886N/A}