| Method from sun.awt.windows.WToolkit Detail: |
public synchronized void addPropertyChangeListener(String name,
PropertyChangeListener pcl) {
if ( WDesktopProperties.isWindowsProperty(name)
|| name.startsWith(awtPrefix)
|| name.startsWith(dndPrefix))
{
// someone is interested in Windows-specific desktop properties
// we should initialize wprops
lazilyInitWProps();
}
super.addPropertyChangeListener(name, pcl);
}
|
public native void beep()
|
public ButtonPeer createButton(Button target) {
ButtonPeer peer = new WButtonPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public CanvasPeer createCanvas(Canvas target) {
CanvasPeer peer = new WCanvasPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public CheckboxPeer createCheckbox(Checkbox target) {
CheckboxPeer peer = new WCheckboxPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) {
CheckboxMenuItemPeer peer = new WCheckboxMenuItemPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public ChoicePeer createChoice(Choice target) {
ChoicePeer peer = new WChoicePeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public Cursor createCustomCursor(Image cursor,
Point hotSpot,
String name) throws IndexOutOfBoundsException {
return new WCustomCursor(cursor, hotSpot, name);
}
Returns a new custom cursor. |
public DesktopPeer createDesktopPeer(Desktop target) {
return new WDesktopPeer();
}
|
public DialogPeer createDialog(Dialog target) {
DialogPeer peer = new WDialogPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public T createDragGestureRecognizer(Class abstractRecognizerClass,
DragSource ds,
Component c,
int srcActions,
DragGestureListener dgl) {
if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl);
else
return null;
}
|
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
return WDragSourceContextPeer.createDragSourceContextPeer(dge);
}
create the peer for a DragSourceContext |
public WEmbeddedFramePeer createEmbeddedFrame(WEmbeddedFrame target) {
WEmbeddedFramePeer peer = new WEmbeddedFramePeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public FileDialogPeer createFileDialog(FileDialog target) {
FileDialogPeer peer = new WFileDialogPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public FramePeer createFrame(Frame target) {
FramePeer peer = new WFramePeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public LabelPeer createLabel(Label target) {
LabelPeer peer = new WLabelPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public ListPeer createList(List target) {
ListPeer peer = new WListPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public MenuPeer createMenu(Menu target) {
MenuPeer peer = new WMenuPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public MenuBarPeer createMenuBar(MenuBar target) {
MenuBarPeer peer = new WMenuBarPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public MenuItemPeer createMenuItem(MenuItem target) {
MenuItemPeer peer = new WMenuItemPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public PanelPeer createPanel(Panel target) {
PanelPeer peer = new WPanelPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public PopupMenuPeer createPopupMenu(PopupMenu target) {
PopupMenuPeer peer = new WPopupMenuPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public RobotPeer createRobot(Robot target,
GraphicsDevice screen) {
// (target is unused for now)
// Robot's don't need to go in the peer map since
// they're not Component's
return new WRobotPeer(screen);
}
|
public ScrollPanePeer createScrollPane(ScrollPane target) {
ScrollPanePeer peer = new WScrollPanePeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public ScrollbarPeer createScrollbar(Scrollbar target) {
ScrollbarPeer peer = new WScrollbarPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public SystemTrayPeer createSystemTray(SystemTray target) {
return new WSystemTrayPeer(target);
}
|
public TextAreaPeer createTextArea(TextArea target) {
TextAreaPeer peer = new WTextAreaPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public TextFieldPeer createTextField(TextField target) {
TextFieldPeer peer = new WTextFieldPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public TrayIconPeer createTrayIcon(TrayIcon target) {
WTrayIconPeer peer = new WTrayIconPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
WPageDialogPeer createWPageDialog(WPageDialog target) {
WPageDialogPeer peer = new WPageDialogPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
WPrintDialogPeer createWPrintDialog(WPrintDialog target) {
WPrintDialogPeer peer = new WPrintDialogPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public WindowPeer createWindow(Window target) {
WindowPeer peer = new WWindowPeer(target);
targetCreatedPeer(target, peer);
return peer;
}
|
public void disableBackgroundErase(Canvas canvas) {
WCanvasPeer peer = (WCanvasPeer)canvas.getPeer();
if (peer == null) {
throw new IllegalStateException("Canvas must have a valid peer");
}
peer.disableBackgroundErase();
}
|
public static void displayChanged() {
EventQueue.invokeLater(new Runnable() {
public void run() {
((Win32GraphicsEnvironment)GraphicsEnvironment
.getLocalGraphicsEnvironment())
.displayChanged();
}
});
}
|
public static native boolean embeddedDispose()
Disposes the Toolkit in an embedded environment. This method should
not be called on exit unless the Toolkit was constructed with
embeddedInit. |
public native void embeddedEventLoopIdleProcessing()
To be called after processing the event queue by users of the above
embeddedInit() function. The reason for this additional call is that
there are some operations performed during idle time in the AwtToolkit
event loop which should also be performed during idle time in any
other native event loop. Failure to do so could result in
deadlocks.
This method was added at the last minute of the jdk1.4 release
to work around a specific customer problem. As with the above
embedded*() class, this method is non-public and should not be
used by external applications.
See bug #4526587 for more information. |
public static native boolean embeddedInit()
Initializes the Toolkit for use in an embedded environment. |
public boolean enableInputMethodsForTextComponent() {
return true;
}
Returns whether enableInputMethods should be set to true for peered
TextComponent instances on this platform. |
public Dimension getBestCursorSize(int preferredWidth,
int preferredHeight) {
return new Dimension(WCustomCursor.getCursorWidth(),
WCustomCursor.getCursorHeight());
}
Returns the supported cursor size (Win32 only has one). |
public ColorModel getColorModel() {
return getStaticColorModel();
}
|
public Locale getDefaultKeyboardLocale() {
Locale locale = WInputMethod.getNativeLocale();
if (locale == null) {
return super.getDefaultKeyboardLocale();
} else {
return locale;
}
}
Returns the default keyboard locale of the underlying operating system |
protected synchronized RenderingHints getDesktopAAHints() {
if (wprops == null) {
return null;
} else {
return wprops.getDesktopAAHints();
}
}
|
public FontMetrics getFontMetrics(Font font) {
// REMIND: platform font flag should be removed post-merlin.
if (sun.font.FontManager.usePlatformFontMetrics()) {
return WFontMetrics.getFontMetrics(font);
}
return super.getFontMetrics(font);
}
|
public FontPeer getFontPeer(String name,
int style) {
FontPeer retval = null;
String lcName = name.toLowerCase();
if (null != cacheFontPeer) {
retval = (FontPeer)cacheFontPeer.get(lcName + style);
if (null != retval) {
return retval;
}
}
retval = new WFontPeer(name, style);
if (retval != null) {
if (null == cacheFontPeer) {
cacheFontPeer = new Hashtable(5, (float)0.9);
}
if (null != cacheFontPeer) {
cacheFontPeer.put(lcName + style, retval);
}
}
return retval;
}
|
public InputMethodDescriptor getInputMethodAdapterDescriptor() {
return new WInputMethodDescriptor();
}
Returns a new input method adapter descriptor for native input methods. |
public boolean getLockingKeyState(int key) {
if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
}
return getLockingKeyStateNative(key);
}
|
public native boolean getLockingKeyStateNative(int key)
|
public native int getMaximumCursorColors()
|
public PrintJob getPrintJob(Frame frame,
String doctitle,
Properties props) {
return getPrintJob(frame, doctitle, null, null);
}
|
public PrintJob getPrintJob(Frame frame,
String doctitle,
JobAttributes jobAttributes,
PageAttributes pageAttributes) {
if (GraphicsEnvironment.isHeadless()) {
throw new IllegalArgumentException();
}
PrintJob2D printJob = new PrintJob2D(frame, doctitle,
jobAttributes, pageAttributes);
if (printJob.printDialog() == false) {
printJob = null;
}
return printJob;
}
|
protected native int getScreenHeight()
|
public Insets getScreenInsets(GraphicsConfiguration gc) {
return getScreenInsets(((Win32GraphicsDevice) gc.getDevice()).getScreen());
}
|
protected native Insets getScreenInsets(int screen)
|
public int getScreenResolution() {
Win32GraphicsEnvironment ge = (Win32GraphicsEnvironment)
GraphicsEnvironment.getLocalGraphicsEnvironment();
return ge.getXResolution();
}
|
protected native int getScreenWidth()
|
static ColorModel getStaticColorModel() {
if (GraphicsEnvironment.isHeadless()) {
throw new IllegalArgumentException();
}
if (config == null) {
resetGC();
}
return config.getColorModel();
}
|
public Clipboard getSystemClipboard() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkSystemClipboardAccess();
}
synchronized (this) {
if (clipboard == null) {
clipboard = new WClipboard();
}
}
return clipboard;
}
|
public static WToolkit getWToolkit() {
WToolkit toolkit = (WToolkit)Toolkit.getDefaultToolkit();
return toolkit;
}
|
public void grab(Window w) {
if (w.getPeer() != null) {
((WWindowPeer)w.getPeer()).grab();
}
}
|
protected synchronized void initializeDesktopProperties() {
desktopProperties.put("DnD.Autoscroll.initialDelay", Integer.valueOf(50));
desktopProperties.put("DnD.Autoscroll.interval", Integer.valueOf(50));
try {
desktopProperties.put("Shell.shellFolderManager",
Class.forName("sun.awt.shell.Win32ShellFolderManager2"));
} catch (ClassNotFoundException ex) {
}
}
|
public boolean isDesktopSupported() {
return true;
}
|
public boolean isDynamicLayoutActive() {
return (isDynamicLayoutSet() && isDynamicLayoutSupported());
}
|
protected boolean isDynamicLayoutSet() {
return dynamicLayoutSetting;
}
|
protected native boolean isDynamicLayoutSupportedNative()
|
public boolean isFrameStateSupported(int state) {
switch (state) {
case Frame.NORMAL:
case Frame.ICONIFIED:
case Frame.MAXIMIZED_BOTH:
return true;
default:
return false;
}
}
Returns true if this frame state is supported. |
public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType exclusionType) {
return (exclusionType == null) ||
(exclusionType == Dialog.ModalExclusionType.NO_EXCLUDE) ||
(exclusionType == Dialog.ModalExclusionType.APPLICATION_EXCLUDE) ||
(exclusionType == Dialog.ModalExclusionType.TOOLKIT_EXCLUDE);
}
|
public boolean isModalityTypeSupported(Dialog.ModalityType modalityType) {
return (modalityType == null) ||
(modalityType == Dialog.ModalityType.MODELESS) ||
(modalityType == Dialog.ModalityType.DOCUMENT_MODAL) ||
(modalityType == Dialog.ModalityType.APPLICATION_MODAL) ||
(modalityType == Dialog.ModalityType.TOOLKIT_MODAL);
}
|
public boolean isTraySupported() {
return true;
}
|
protected Object lazilyLoadDesktopProperty(String name) {
if (name.startsWith(prefix)) {
String cursorName = name.substring(prefix.length(), name.length()) + postfix;
try {
return Cursor.getSystemCustomCursor(cursorName);
} catch (AWTException awte) {
throw new RuntimeException("cannot load system cursor: " + cursorName, awte);
}
}
if (name.equals("awt.dynamicLayoutSupported")) {
return Boolean.valueOf(isDynamicLayoutSupported());
}
if (WDesktopProperties.isWindowsProperty(name) ||
name.startsWith(awtPrefix) || name.startsWith(dndPrefix))
{
synchronized(this) {
lazilyInitWProps();
return desktopProperties.get(name);
}
}
return super.lazilyLoadDesktopProperty(name);
}
|
public static void loadLibraries() {
if (!loaded) {
java.security.AccessController.doPrivileged(
new sun.security.action.LoadLibraryAction("awt"));
loaded = true;
}
}
|
protected native void loadSystemColors(int[] systemColors)
|
static native ColorModel makeColorModel()
|
public Map mapInputMethodHighlight(InputMethodHighlight highlight) {
return WInputMethod.mapInputMethodHighlight(highlight);
}
Returns a style map for the input method highlight. |
static void paletteChanged() {
((Win32GraphicsEnvironment)GraphicsEnvironment
.getLocalGraphicsEnvironment())
.paletteChanged();
}
|
public static native void quitSecondaryEventLoop()
|
public static void resetGC() {
loadLibraries();
// Force Win32GE to load if it is not already loaded; this loads
// various other classes that are required for basic awt functionality
Win32GraphicsEnvironment.init();
initIDs();
// Print out which version of Windows is running
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Win version: " + getWindowsVersion());
}
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction()
{
public Object run() {
String browserProp = System.getProperty("browser");
if (browserProp != null && browserProp.equals("sun.plugin")) {
disableCustomPalette();
}
return null;
}
});
if (GraphicsEnvironment.isHeadless()) {
config = null;
} else {
config = (GraphicsEnvironment
.getLocalGraphicsEnvironment()
.getDefaultScreenDevice()
.getDefaultConfiguration());
}
}
|
public void run() {
boolean startPump = init();
if (startPump) {
ThreadGroup mainTG = (ThreadGroup)AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
ThreadGroup currentTG =
Thread.currentThread().getThreadGroup();
ThreadGroup parentTG = currentTG.getParent();
while (parentTG != null) {
currentTG = parentTG;
parentTG = currentTG.getParent();
}
return currentTG;
}
});
Runtime.getRuntime().addShutdownHook(
new Thread(mainTG, new Runnable() {
public void run() {
shutdown();
}
})
);
}
synchronized(this) {
notifyAll();
}
if (startPump) {
eventLoop(); // will Dispose Toolkit when shutdown hook executes
}
}
|
public void setDynamicLayout(boolean b) {
if (b == dynamicLayoutSetting) {
return;
}
dynamicLayoutSetting = b;
setDynamicLayoutNative(b);
}
|
protected native void setDynamicLayoutNative(boolean b)
|
public void setLockingKeyState(int key,
boolean on) {
if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
throw new IllegalArgumentException("invalid key for Toolkit.setLockingKeyState");
}
setLockingKeyStateNative(key, on);
}
|
public native void setLockingKeyStateNative(int key,
boolean on)
|
public static native void startSecondaryEventLoop()
|
public void sync() {
// flush the GDI/DD buffers
nativeSync();
// now flush the OGL pipeline (this is a no-op if OGL is not enabled)
OGLRenderQueue.sync();
}
|
public native boolean syncNativeQueue(long timeout)
|
public static final void targetDisposedPeer(Object target,
Object peer) {
SunToolkit.targetDisposedPeer(target, peer);
}
|
public static final Object targetToPeer(Object target) {
return SunToolkit.targetToPeer(target);
}
|
public void ungrab(Window w) {
if (w.getPeer() != null) {
((WWindowPeer)w.getPeer()).ungrab();
}
}
|
public boolean useBufferPerWindow() {
return true;
}
|