src/share/classes/java/awt/Toolkit.java

Print this page

        

*** 421,430 **** --- 421,431 ---- * Creates a peer for a component or container. This peer is windowless * and allows the Component and Container classes to be extended directly * to create windowless components that are defined entirely in java. * * @param target The Component to be created. + * @return the peer for the specified component */ protected LightweightPeer createComponent(Component target) { if (lightweightMarker == null) { lightweightMarker = new NullComponentPeer(); }
*** 1368,1377 **** --- 1369,1381 ---- * {@link java.awt.event.KeyEvent#VK_CAPS_LOCK VK_CAPS_LOCK}, * {@link java.awt.event.KeyEvent#VK_NUM_LOCK VK_NUM_LOCK}, * {@link java.awt.event.KeyEvent#VK_SCROLL_LOCK VK_SCROLL_LOCK}, and * {@link java.awt.event.KeyEvent#VK_KANA_LOCK VK_KANA_LOCK}. * + * @param keyCode the key code + * @return {@code true} if the given key is currently in its "on" state; + * otherwise {@code false} * @exception java.lang.IllegalArgumentException if <code>keyCode</code> * is not one of the valid key codes * @exception java.lang.UnsupportedOperationException if the host system doesn't * allow getting the state of this key programmatically, or if the keyboard * doesn't have this key
*** 1402,1411 **** --- 1406,1417 ---- * <p> * Depending on the platform, setting the state of a locking key may * involve event processing and therefore may not be immediately * observable through getLockingKeyState. * + * @param keyCode the key code + * @param on the state of the key * @exception java.lang.IllegalArgumentException if <code>keyCode</code> * is not one of the valid key codes * @exception java.lang.UnsupportedOperationException if the host system doesn't * allow setting the state of this key programmatically, or if the keyboard * doesn't have this key
*** 1427,1436 **** --- 1433,1445 ---- } /** * Give native peers the ability to query the native container * given a native component (eg the direct parent may be lightweight). + * + * @param c the component to fetch the container for + * @return the native container object for the component */ protected static Container getNativeContainer(Component c) { return c.getNativeContainer(); }
*** 1447,1456 **** --- 1456,1466 ---- * hotSpot values must be less than the Dimension returned by * <code>getBestCursorSize</code> * @param name a localized description of the cursor, for Java Accessibility use * @exception IndexOutOfBoundsException if the hotSpot values are outside * the bounds of the cursor + * @return the cursor created * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.2 */
*** 1673,1682 **** --- 1683,1697 ---- } /** * Gets a property with the specified key and default. * This method returns defaultValue if the property is not found. + * + * @param key the key + * @param defaultValue the default value + * @return the value of the property or the default value + * if the property was not found */ public static String getProperty(String key, String defaultValue) { // first try platform specific bundle if (platformResources != null) { try {
*** 1736,1745 **** --- 1751,1763 ---- /** * Creates the peer for a DragSourceContext. * Always throws InvalidDndOperationException if * GraphicsEnvironment.isHeadless() returns true. + * + * @param dge the {@code DragGestureEvent} + * @return the peer created * @see java.awt.GraphicsEnvironment#isHeadless */ public abstract DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException; /**
*** 1773,1782 **** --- 1791,1803 ---- * A desktop property is a uniquely named value for a resource that * is Toolkit global in nature. Usually it also is an abstract * representation for an underlying platform dependent desktop setting. * For more information on desktop properties supported by the AWT see * <a href="doc-files/DesktopProperties.html">AWT Desktop Properties</a>. + * + * @param propertyName the property name + * @return the value for the specified desktop property */ public final synchronized Object getDesktopProperty(String propertyName) { // This is a workaround for headless toolkits. It would be // better to override this method but it is declared final. // "this instanceof" syntax defeats polymorphism.
*** 1816,1825 **** --- 1837,1849 ---- } /** * Sets the named desktop property to the specified value and fires a * property change event to notify any listeners that the value has changed. + * + * @param name the property name + * @param newValue the new property value */ protected final void setDesktopProperty(String name, Object newValue) { // This is a workaround for headless toolkits. It would be // better to override this method but it is declared final. // "this instanceof" syntax defeats polymorphism.