diff --git a/src/share/classes/java/awt/peer/ButtonPeer.java b/src/share/classes/java/awt/peer/ButtonPeer.java
index 5b6f43b1d3318110d3858732b8a34efe33071595..8b2190060a536ab48faf29f467fa05d38ab4355b 100644
--- a/src/share/classes/java/awt/peer/ButtonPeer.java
+++ b/src/share/classes/java/awt/peer/ButtonPeer.java
@@ -25,7 +25,11 @@
package java.awt.peer;
+import java.awt.Button;
+
/**
+ * The peer interface for {@link Button}.
+ *
* The peer interfaces are intended only for use in porting
* the AWT. They are not intended for use by application
* developers, and developers should not implement peers
@@ -33,5 +37,14 @@ package java.awt.peer;
* instances.
*/
public interface ButtonPeer extends ComponentPeer {
+
+ /**
+ * Sets the label that is displayed on the button. Can be {@code null}
+ * when the button should not display a label.
+ *
+ * @param label the label string to set
+ *
+ * @see Button#setLabel
+ */
void setLabel(String label);
}
diff --git a/src/share/classes/java/awt/peer/CanvasPeer.java b/src/share/classes/java/awt/peer/CanvasPeer.java
index 020a931a77e294b82eefe8ac49a757908b383282..bbf6a111086352b8d1d725639de7a91aebd776ec 100644
--- a/src/share/classes/java/awt/peer/CanvasPeer.java
+++ b/src/share/classes/java/awt/peer/CanvasPeer.java
@@ -24,7 +24,11 @@
*/
package java.awt.peer;
+import java.awt.Canvas;
+
/**
+ * The peer interface for {@link Canvas}.
+ *
* The peer interfaces are intended only for use in porting
* the AWT. They are not intended for use by application
* developers, and developers should not implement peers
diff --git a/src/share/classes/java/awt/peer/CheckboxMenuItemPeer.java b/src/share/classes/java/awt/peer/CheckboxMenuItemPeer.java
index d7e5a60de3f539a563389c947073d54ba6bf12bc..34b9f85c3210dad98bca8d59ab4936c22d0670eb 100644
--- a/src/share/classes/java/awt/peer/CheckboxMenuItemPeer.java
+++ b/src/share/classes/java/awt/peer/CheckboxMenuItemPeer.java
@@ -24,7 +24,11 @@
*/
package java.awt.peer;
+import java.awt.CheckboxMenuItem;
+
/**
+ * The peer interface for {@link CheckboxMenuItem}.
+ *
* The peer interfaces are intended only for use in porting
* the AWT. They are not intended for use by application
* developers, and developers should not implement peers
@@ -32,5 +36,14 @@ package java.awt.peer;
* instances.
*/
public interface CheckboxMenuItemPeer extends MenuItemPeer {
+
+ /**
+ * Sets the state of the checkbox to be checked ({@code true}) or
+ * unchecked ({@code false}).
+ *
+ * @param t the state to set on the checkbox
+ *
+ * @see CheckboxMenuItemPeer#setState(boolean)
+ */
void setState(boolean t);
}
diff --git a/src/share/classes/java/awt/peer/CheckboxPeer.java b/src/share/classes/java/awt/peer/CheckboxPeer.java
index 64ecf3a91af8b85ea3a4520bd58dce99cae0693d..f2126e20f31e57797b20c9840ea973519b05c9a0 100644
--- a/src/share/classes/java/awt/peer/CheckboxPeer.java
+++ b/src/share/classes/java/awt/peer/CheckboxPeer.java
@@ -27,6 +27,8 @@ package java.awt.peer;
import java.awt.*;
/**
+ * The peer interface for {@link Checkbox}.
+ *
* The peer interfaces are intended only for use in porting
* the AWT. They are not intended for use by application
* developers, and developers should not implement peers
@@ -34,7 +36,36 @@ import java.awt.*;
* instances.
*/
public interface CheckboxPeer extends ComponentPeer {
+
+ /**
+ * Sets the state of the checkbox to be checked ({@code true}) or
+ * unchecked ({@code false}).
+ *
+ * @param t the state to set on the checkbox
+ *
+ * @see Checkbox#setState(boolean)
+ */
void setState(boolean state);
+
+ /**
+ * Sets the checkbox group for this checkbox. Checkboxes in one checkbox
+ * group can only be selected exclusively (like radio buttons). A value
+ * of {@code null} removes this checkbox from any checkbox group.
+ *
+ * @param g the checkbox group to set, or {@code null} when this
+ * checkbox should not be placed in any group
+ *
+ * @see Checkbox#setCheckboxGroup(CheckboxGroup)
+ */
void setCheckboxGroup(CheckboxGroup g);
+
+ /**
+ * Sets the label that should be displayed on the ckeckbox. A value of
+ * {@code null} means that no label should be displayed.
+ *
+ * @param label the label to be displayed on the checkbox, or
+ * {@code null} when no label should be displayed.
+ */
void setLabel(String label);
+
}
diff --git a/src/share/classes/java/awt/peer/ChoicePeer.java b/src/share/classes/java/awt/peer/ChoicePeer.java
index 7343ff3db914025353b6f70a63b13c4aed8d7a70..7efebdae3fd98479209735adf7a3f5165d9c3926 100644
--- a/src/share/classes/java/awt/peer/ChoicePeer.java
+++ b/src/share/classes/java/awt/peer/ChoicePeer.java
@@ -24,7 +24,11 @@
*/
package java.awt.peer;
+import java.awt.Choice;
+
/**
+ * The peer interface for {@link Choice}.
+ *
* The peer interfaces are intended only for use in porting
* the AWT. They are not intended for use by application
* developers, and developers should not implement peers
@@ -32,9 +36,41 @@ package java.awt.peer;
* instances.
*/
public interface ChoicePeer extends ComponentPeer {
+
+ /**
+ * Adds an item with the string {@code item} to the combo box list
+ * at index {@code index}.
+ *
+ * @param item the label to be added to the list
+ * @param index the index where to add the item
+ *
+ * @see Choice#add(String)
+ */
void add(String item, int index);
+
+ /**
+ * Removes the item at index {@code index} from the combo box list.
+ *
+ * @param index the index where to remove the item
+ *
+ * @see Choice#remove(int)
+ */
void remove(int index);
+
+ /**
+ * Removes all items from the combo box list.
+ *
+ * @see Choice#removeAll()
+ */
void removeAll();
+
+ /**
+ * Selects the item at index {@code index}.
+ *
+ * @param index the index which should be selected
+ *
+ * @see Choice#select(int)
+ */
void select(int index);
}
diff --git a/src/share/classes/java/awt/peer/ComponentPeer.java b/src/share/classes/java/awt/peer/ComponentPeer.java
index 79f4eb8a96437194efbbd9aaf57a0d0b7c855510..e71ab27f7ac7dfe0a48fe80eb15b2d99c3f0b459 100644
--- a/src/share/classes/java/awt/peer/ComponentPeer.java
+++ b/src/share/classes/java/awt/peer/ComponentPeer.java
@@ -37,6 +37,12 @@ import sun.java2d.pipe.Region;
/**
+ * The peer interface for {@link Component}. This is the top level peer
+ * interface for widgets and defines the bulk of methods for AWT component
+ * peers. Most component peers have to implement this interface (via one
+ * of the subinterfaces), except menu components, which implement
+ * {@link MenuComponentPeer}.
+ *
* The peer interfaces are intended only for use in porting
* the AWT. They are not intended for use by application
* developers, and developers should not implement peers
@@ -44,62 +50,474 @@ import sun.java2d.pipe.Region;
* instances.
*/
public interface ComponentPeer {
- public static final int SET_LOCATION = 1,
- SET_SIZE = 2,
- SET_BOUNDS = 3,
- SET_CLIENT_SIZE = 4,
- RESET_OPERATION = 5,
- NO_EMBEDDED_CHECK = (1 << 14),
- DEFAULT_OPERATION = SET_BOUNDS;
+
+ /**
+ * Operation for {@link #setBounds(int, int, int, int, int)}, indicating
+ * a change in the component location only.
+ *
+ * @see #setBounds(int, int, int, int, int)
+ */
+ public static final int SET_LOCATION = 1;
+
+ /**
+ * Operation for {@link #setBounds(int, int, int, int, int)}, indicating
+ * a change in the component size only.
+ *
+ * @see #setBounds(int, int, int, int, int)
+ */
+ public static final int SET_SIZE = 2;
+
+ /**
+ * Operation for {@link #setBounds(int, int, int, int, int)}, indicating
+ * a change in the component size and location.
+ *
+ * @see #setBounds(int, int, int, int, int)
+ */
+ public static final int SET_BOUNDS = 3;
+
+ /**
+ * Operation for {@link #setBounds(int, int, int, int, int)}, indicating
+ * a change in the component client size. This is used for setting
+ * the 'inside' size of windows, without the border insets.
+ *
+ * @see #setBounds(int, int, int, int, int)
+ */
+ public static final int SET_CLIENT_SIZE = 4;
+
+ /**
+ * Resets the setBounds() operation to DEFAULT_OPERATION. This is not
+ * passed into {@link #setBounds(int, int, int, int, int)}.
+ *
+ * TODO: This is only used internally and should probably be moved outside
+ * the peer interface.
+ *
+ * @see Component#setBoundsOp
+ */
+ public static final int RESET_OPERATION = 5;
+
+ /**
+ * A flag that is used to suppress checks for embedded frames.
+ *
+ * TODO: This is only used internally and should probably be moved outside
+ * the peer interface.
+ */
+ public static final int NO_EMBEDDED_CHECK = (1 << 14);
+
+ /**
+ * The default operation, which is to set size and location.
+ *
+ * TODO: This is only used internally and should probably be moved outside
+ * the peer interface.
+ *
+ * @see Component#setBoundsOp
+ */
+ public static final int DEFAULT_OPERATION = SET_BOUNDS;
+
+ /**
+ * Determines if a component has been obscured, i.e. by an overlapping
+ * window or similar. This is used by JViewport for optimizing performance.
+ * This doesn't have to be implemented, when
+ * {@link #canDetermineObscurity()} returns {@code false}.
+ *
+ * @return {@code true} when the component has been obscured,
+ * {@code false} otherwise
+ *
+ * @see #canDetermineObscurity()
+ * @see javax.swing.JViewport#needsRepaintAfterBlit
+ */
boolean isObscured();
+
+ /**
+ * Returns {@code true} when the peer can determine if a component
+ * has been obscured, {@code false} false otherwise.
+ *
+ * @return {@code true} when the peer can determine if a component
+ * has been obscured, {@code false} false otherwise
+ *
+ * @see #isObscured()
+ * @see javax.swing.JViewport#needsRepaintAfterBlit
+ */
boolean canDetermineObscurity();
- void setVisible(boolean b);
- void setEnabled(boolean b);
- void paint(Graphics g);
- void print(Graphics g);
- void setBounds(int x, int y, int width, int height, int op);
- void handleEvent(AWTEvent e);
- void coalescePaintEvent(PaintEvent e);
- Point getLocationOnScreen();
- Dimension getPreferredSize();
- Dimension getMinimumSize();
- ColorModel getColorModel();
- Toolkit getToolkit();
- Graphics getGraphics();
- FontMetrics getFontMetrics(Font font);
- void dispose();
- void setForeground(Color c);
- void setBackground(Color c);
- void setFont(Font f);
- void updateCursorImmediately();
- boolean requestFocus(Component lightweightChild,
- boolean temporary,
- boolean focusedWindowChangeAllowed,
- long time, CausedFocusEvent.Cause cause);
- boolean isFocusable();
-
- Image createImage(ImageProducer producer);
- Image createImage(int width, int height);
- VolatileImage createVolatileImage(int width, int height);
- boolean prepareImage(Image img, int w, int h, ImageObserver o);
- int checkImage(Image img, int w, int h, ImageObserver o);
+
+ /**
+ * Makes a component visible or invisible.
+ *
+ * @param v {@code true} to make a component visible,
+ * {@code false} to make it invisible
+ *
+ * @see Component#setVisible(boolean)
+ */
+ void setVisible(boolean v);
+
+ /**
+ * Enables or disables a component. Disabled components are usually grayed
+ * out and cannot be activated.
+ *
+ * @param e {@code true} to enable the component, {@code false}
+ * to disable it
+ *
+ * @see Component#setEnabled(boolean)
+ */
+ void setEnabled(boolean e);
+
+ /**
+ * Paints the component to the specified graphics context. This is called
+ * by {@link Component#paintAll(Graphics)} to paint the component.
+ *
+ * @param g the graphics context to paint to
+ *
+ * @see Component#paintAll(Graphics)
+ */
+ void paint(Graphics g);
+
+ /**
+ * Prints the component to the specified graphics context. This is called
+ * by {@link Component#printAll(Graphics)} to print the component.
+ *
+ * @param g the graphics context to print to
+ *
+ * @see Component#printAll(Graphics)
+ */
+ void print(Graphics g);
+
+ /**
+ * Sets the location or size or both of the component. The location is
+ * specified relative to the component's parent. The {@code op}
+ * parameter specifies which properties change. If it is
+ * {@link #SET_LOCATION}, then only the location changes (and the size
+ * parameters can be ignored). If {@code op} is {@link #SET_SIZE},
+ * then only the size changes (and the location can be ignored). If
+ * {@code op} is {@link #SET_BOUNDS}, then both change. There is a
+ * special value {@link #SET_CLIENT_SIZE}, which is used only for
+ * window-like components to set the size of the client (i.e. the 'inner'
+ * size, without the insets of the window borders).
+ *
+ * @param x the X location of the component
+ * @param y the Y location of the component
+ * @param width the width of the component
+ * @param height the height of the component
+ * @param op the operation flag
+ *
+ * @see #SET_BOUNDS
+ * @see #SET_LOCATION
+ * @see #SET_SIZE
+ * @see #SET_CLIENT_SIZE
+ */
+ void setBounds(int x, int y, int width, int height, int op);
+
+ /**
+ * Called to let the component peer handle events.
+ *
+ * @param e the AWT event to handle
+ *
+ * @see Component#dispatchEvent(AWTEvent)
+ */
+ void handleEvent(AWTEvent e);
+
+ /**
+ * Called to coalesce paint events.
+ *
+ * @param e the paint event to consider to coalesce
+ *
+ * @see EventQueue#coalescePaintEvent
+ */
+ void coalescePaintEvent(PaintEvent e);
+
+ /**
+ * Determines the location of the component on the screen.
+ *
+ * @return the location of the component on the screen
+ *
+ * @see Component#getLocationOnScreen()
+ */
+ Point getLocationOnScreen();
+
+ /**
+ * Determines the preferred size of the component.
+ *
+ * @return the preferred size of the component
+ *
+ * @see Component#getPreferredSize()
+ */
+ Dimension getPreferredSize();
+
+ /**
+ * Determines the minimum size of the component.
+ *
+ * @return the minimum size of the component
+ *
+ * @see Component#getMinimumSize()
+ */
+ Dimension getMinimumSize();
+
+ /**
+ * Returns the color model used by the component.
+ *
+ * @return the color model used by the component
+ *
+ * @see Component#getColorModel()
+ */
+ ColorModel getColorModel();
+
+ /**
+ * Returns the toolkit that is responsible for the component.
+ *
+ * @return the toolkit that is responsible for the component
+ *
+ * @see Component#getToolkit()
+ */
+ Toolkit getToolkit();
+
+ /**
+ * Returns a graphics object to paint on the component.
+ *
+ * @return a graphics object to paint on the component
+ *
+ * @see Component#getGraphics()
+ */
+ // TODO: Maybe change this to force Graphics2D, since many things will
+ // break with plain Graphics nowadays.
+ Graphics getGraphics();
+
+ /**
+ * Returns a font metrics object to determine the metrics properties of
+ * the specified font.
+ *
+ * @param font the font to determine the metrics for
+ *
+ * @return a font metrics object to determine the metrics properties of
+ * the specified font
+ *
+ * @see Component#getFontMetrics(Font)
+ */
+ FontMetrics getFontMetrics(Font font);
+
+ /**
+ * Disposes all resources held by the component peer. This is called
+ * when the component has been disconnected from the component hierarchy
+ * and is about to be garbage collected.
+ *
+ * @see Component#removeNotify()
+ */
+ void dispose();
+
+ /**
+ * Sets the foreground color of this component.
+ *
+ * @param c the foreground color to set
+ *
+ * @see Component#setForeground(Color)
+ */
+ void setForeground(Color c);
+
+ /**
+ * Sets the background color of this component.
+ *
+ * @param c the background color to set
+ *
+ * @see Component#setBackground(Color)
+ */
+ void setBackground(Color c);
+
+ /**
+ * Sets the font of this component.
+ *
+ * @param f the font of this component
+ *
+ * @see Component#setFont(Font)
+ */
+ void setFont(Font f);
+
+ /**
+ * Updates the cursor of the component.
+ *
+ * @see Component#updateCursorImmediately
+ */
+ void updateCursorImmediately();
+
+ /**
+ * Requests focus on this component.
+ *
+ * @param lightweightChild the actual lightweight child that requests the
+ * focus
+ * @param temporary {@code true} if the focus change is temporary,
+ * {@code false} otherwise
+ * @param focusedWindowChangeAllowed {@code true} if changing the
+ * focus of the containing window is allowed or not
+ * @param time the time of the focus change request
+ * @param cause the cause of the focus change request
+ *
+ * @return {@code true} if the focus change is guaranteed to be
+ * granted, {@code false} otherwise
+ */
+ boolean requestFocus(Component lightweightChild, boolean temporary,
+ boolean focusedWindowChangeAllowed, long time,
+ CausedFocusEvent.Cause cause);
+
+ /**
+ * Returns {@code true} when the component takes part in the focus
+ * traversal, {@code false} otherwise.
+ *
+ * @return {@code true} when the component takes part in the focus
+ * traversal, {@code false} otherwise
+ */
+ boolean isFocusable();
+
+ /**
+ * Creates an image using the specified image producer.
+ *
+ * @param producer the image producer from which the image pixels will be
+ * produced
+ *
+ * @return the created image
+ *
+ * @see Component#createImage(ImageProducer)
+ */
+ Image createImage(ImageProducer producer);
+
+ /**
+ * Creates an empty image with the specified width and height. This is
+ * generally used as a non-accelerated backbuffer for drawing onto the
+ * component (e.g. by Swing).
+ *
+ * @param width the width of the image
+ * @param height the height of the image
+ *
+ * @return the created image
+ *
+ * @see Component#createImage(int, int)
+ */
+ // TODO: Maybe make that return a BufferedImage, because some stuff will
+ // break if a different kind of image is returned.
+ Image createImage(int width, int height);
+
+ /**
+ * Creates an empty volatile image with the specified width and height.
+ * This is generally used as an accelerated backbuffer for drawing onto
+ * the component (e.g. by Swing).
+ *
+ * @param width the width of the image
+ * @param height the height of the image
+ *
+ * @return the created volatile image
+ *
+ * @see Component#createVolatileImage(int, int)
+ */
+ // TODO: Include capabilities here and fix Component#createVolatileImage
+ VolatileImage createVolatileImage(int width, int height);
+
+ /**
+ * Prepare the specified image for rendering on this component. This should
+ * start loading the image (if not already loaded) and create an
+ * appropriate screen representation.
+ *
+ * @param img the image to prepare
+ * @param w the width of the screen representation
+ * @param h the height of the screen representation
+ * @param o an image observer to observe the progress
+ *
+ * @return {@code true} if the image is already fully prepared,
+ * {@code false} otherwise
+ *
+ * @see Component#prepareImage(Image, int, int, ImageObserver)
+ */
+ boolean prepareImage(Image img, int w, int h, ImageObserver o);
+
+ /**
+ * Determines the status of the construction of the screen representaion
+ * of the specified image.
+ *
+ * @param img the image to check
+ * @param w the target width
+ * @param h the target height
+ * @param o the image observer to notify
+ *
+ * @return the status as bitwise ORed ImageObserver flags
+ *
+ * @see Component#checkImage(Image, int, int, ImageObserver)
+ */
+ int checkImage(Image img, int w, int h, ImageObserver o);
+
+ /**
+ * Returns the graphics configuration that corresponds to this component.
+ *
+ * @return the graphics configuration that corresponds to this component
+ *
+ * @see Component#getGraphicsConfiguration()
+ */
GraphicsConfiguration getGraphicsConfiguration();
- boolean handlesWheelScrolling();
- void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException;
+
+ /**
+ * Determines if the component handles wheel scrolling itself. Otherwise
+ * it is delegated to the component's parent.
+ *
+ * @return {@code true} if the component handles wheel scrolling,
+ * {@code false} otherwise
+ *
+ * @see Component#dispatchEventImpl(AWTEvent)
+ */
+ boolean handlesWheelScrolling();
+
+ /**
+ * Create {@code numBuffers} flipping buffers with the specified
+ * buffer capabilities.
+ *
+ * @param numBuffers the number of buffers to create
+ * @param caps the buffer capabilities
+ *
+ * @throws AWTException if flip buffering is not supported
+ *
+ * @see Component.FlipBufferStrategy#createBuffers
+ */
+ void createBuffers(int numBuffers, BufferCapabilities caps)
+ throws AWTException;
+
+ /**
+ * Returns the back buffer as image.
+ *
+ * @return the back buffer as image
+ *
+ * @see Component.FlipBufferStrategy#getBackBuffer
+ */
Image getBackBuffer();
+
+ /**
+ * Move the back buffer to the front buffer.
+ *
+ * @param x1 the area to be flipped, upper left X coordinate
+ * @param y1 the area to be flipped, upper left Y coordinate
+ * @param x2 the area to be flipped, lower right X coordinate
+ * @param y2 the area to be flipped, lower right Y coordinate
+ * @param flipAction the flip action to perform
+ *
+ * @see Component.FlipBufferStrategy#flip
+ */
void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction);
+
+ /**
+ * Destroys all created buffers.
+ *
+ * @see Component.FlipBufferStrategy#destroyBuffers
+ */
void destroyBuffers();
/**
- * Reparents this peer to the new parent referenced by newContainer
peer
- * Implementation depends on toolkit and container.
+ * Reparents this peer to the new parent referenced by
+ * {@code newContainer} peer. Implementation depends on toolkit and
+ * container.
+ *
* @param newContainer peer of the new parent container
+ *
* @since 1.5
*/
void reparent(ContainerPeer newContainer);
+
/**
- * Returns whether this peer supports reparenting to another parent withour destroying the peer
+ * Returns whether this peer supports reparenting to another parent without
+ * destroying the peer.
+ *
* @return true if appropriate reparent is supported, false otherwise
+ *
* @since 1.5
*/
boolean isReparentSupported();
@@ -108,12 +526,16 @@ public interface ComponentPeer {
* Used by lightweight implementations to tell a ComponentPeer to layout
* its sub-elements. For instance, a lightweight Checkbox needs to layout
* the box, as well as the text label.
+ *
+ * @see Component#validate()
*/
- void layout();
+ void layout();
/**
* Applies the shape to the native component window.
* @since 1.7
+ *
+ * @see Component#applyCompoundShape
*/
void applyShape(Region shape);
diff --git a/src/share/classes/java/awt/peer/ContainerPeer.java b/src/share/classes/java/awt/peer/ContainerPeer.java
index cda790a60480e6250c154403f1f195121e764e1a..092a54f2a24b9d5ed372be212c386dd115e6cea3 100644
--- a/src/share/classes/java/awt/peer/ContainerPeer.java
+++ b/src/share/classes/java/awt/peer/ContainerPeer.java
@@ -27,6 +27,9 @@ package java.awt.peer;
import java.awt.*;
/**
+ * The peer interface for {@link Container}. This is the parent interface
+ * for all container like widgets.
+ *
* The peer interfaces are intended only for use in porting
* the AWT. They are not intended for use by application
* developers, and developers should not implement peers
@@ -34,21 +37,59 @@ import java.awt.*;
* instances.
*/
public interface ContainerPeer extends ComponentPeer {
+
+ /**
+ * Returns the insets of this container. Insets usually is the space that
+ * is occupied by things like borders.
+ *
+ * @return the insets of this container
+ */
Insets getInsets();
+
+ /**
+ * Notifies the peer that validation of the component tree is about to
+ * begin.
+ *
+ * @see Container#validate()
+ */
void beginValidate();
+
+ /**
+ * Notifies the peer that validation of the component tree is finished.
+ *
+ * @see Container#validate()
+ */
void endValidate();
+
+ /**
+ * Notifies the peer that layout is about to begin. This is called
+ * before the container itself and its children are laid out.
+ *
+ * @see Container#validateTree()
+ */
void beginLayout();
+
+ /**
+ * Notifies the peer that layout is finished. This is called after the
+ * container and its children have been laid out.
+ *
+ * @see Container#validateTree()
+ */
void endLayout();
/**
- * Restacks native windows - children of this native window - according to Java container order
+ * Restacks native windows - children of this native window - according to
+ * Java container order.
+ *
* @since 1.5
*/
void restack();
/**
- * Indicates availabiltity of restacking operation in this container.
+ * Indicates availability of restacking operation in this container.
+ *
* @return Returns true if restack is supported, false otherwise
+ *
* @since 1.5
*/
boolean isRestackSupported();
diff --git a/src/share/classes/java/awt/peer/DesktopPeer.java b/src/share/classes/java/awt/peer/DesktopPeer.java
index e0e5ad2ad62bf3556a667e526099199c04ebeab4..1b2d1bdb87b73a1f56cefb202e3d98c5886ea6f9 100644
--- a/src/share/classes/java/awt/peer/DesktopPeer.java
+++ b/src/share/classes/java/awt/peer/DesktopPeer.java
@@ -32,7 +32,7 @@ import java.net.URI;
import java.awt.Desktop.Action;
/**
- * The DesktopPeer
interface provides methods for the operation
+ * The {@code DesktopPeer} interface provides methods for the operation
* of open, edit, print, browse and mail with the given URL or file, by
* launching the associated application.
*
@@ -40,14 +40,15 @@ import java.awt.Desktop.Action;
*
*/
public interface DesktopPeer {
+
/**
* Returns whether the given action is supported on the current platform.
* @param action the action type to be tested if it's supported on the
* current platform.
- * @return true
if the given action is supported on
- * the current platform; false
otherwise.
+ * @return {@code true} if the given action is supported on
+ * the current platform; {@code false} otherwise.
*/
- public boolean isSupported(Action action);
+ boolean isSupported(Action action);
/**
* Launches the associated application to open the given file. The
@@ -58,7 +59,7 @@ public interface DesktopPeer {
* @throws IOException If the given file has no associated application,
* or the associated application fails to be launched.
*/
- public void open(File file) throws IOException;
+ void open(File file) throws IOException;
/**
* Launches the associated editor and opens the given file for editing. The
@@ -69,7 +70,7 @@ public interface DesktopPeer {
* @throws IOException If the given file has no associated editor, or
* the associated application fails to be launched.
*/
- public void edit(File file) throws IOException;
+ void edit(File file) throws IOException;
/**
* Prints the given file with the native desktop printing facility, using
@@ -79,7 +80,7 @@ public interface DesktopPeer {
* @throws IOException If the given file has no associated application
* that can be used to print it.
*/
- public void print(File file) throws IOException;
+ void print(File file) throws IOException;
/**
* Launches the mail composing window of the user default mail client,
@@ -93,7 +94,7 @@ public interface DesktopPeer {
* @throws IOException If the user default mail client is not found,
* or it fails to be launched.
*/
- public void mail(URI mailtoURL) throws IOException;
+ void mail(URI mailtoURL) throws IOException;
/**
* Launches the user default browser to display the given URI.
@@ -102,5 +103,5 @@ public interface DesktopPeer {
* @throws IOException If the user default browser is not found,
* or it fails to be launched.
*/
- public void browse(URI url) throws IOException;
+ void browse(URI url) throws IOException;
}
diff --git a/src/share/classes/java/awt/peer/DialogPeer.java b/src/share/classes/java/awt/peer/DialogPeer.java
index 7c08206d4f495c8a4b3979160a6168202eea8c72..27ac26ffff027757524767226a0bd3ef6b462d14 100644
--- a/src/share/classes/java/awt/peer/DialogPeer.java
+++ b/src/share/classes/java/awt/peer/DialogPeer.java
@@ -28,6 +28,9 @@ package java.awt.peer;
import java.awt.*;
/**
+ * The peer interface for {@link Dialog}. This adds a couple of dialog specific
+ * features to the {@link WindowPeer} interface.
+ *
* The peer interfaces are intended only for use in porting
* the AWT. They are not intended for use by application
* developers, and developers should not implement peers
@@ -35,7 +38,33 @@ import java.awt.*;
* instances.
*/
public interface DialogPeer extends WindowPeer {
+
+ /**
+ * Sets the title on the dialog window.
+ *
+ * @param title the title to set
+ *
+ * @see Dialog#setTitle(String)
+ */
void setTitle(String title);
+
+ /**
+ * Sets if the dialog should be resizable or not.
+ *
+ * @param resizeable {@code true} when the dialog should be resizable,
+ * {@code false} if not
+ *
+ * @see Dialog#setResizable(boolean)
+ */
void setResizable(boolean resizeable);
+
+ /**
+ * Block the specified windows. This is used for modal dialogs.
+ *
+ * @param windows the windows to block
+ *
+ * @see Dialog#modalShow()
+ * @see Dialog#blockWindows()
+ */
void blockWindows(java.util.List