Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mrserb/jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
mrserb committed Jan 8, 2024
2 parents b8174df + c84df4d commit e0b8e09
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 137 deletions.
4 changes: 2 additions & 2 deletions src/java.desktop/share/classes/java/awt/dnd/Autoscroll.java
Expand Up @@ -65,8 +65,8 @@ public interface Autoscroll {
/**
* notify the {@code Component} to autoscroll.
*
* @param cursorLocn A {@code Point} indicating the location of the
* cursor that triggered this operation
* @param cursorLocn A {@code Point} indicating the location of the cursor
* that triggered this operation
*/
public void autoscroll(Point cursorLocn);
}
24 changes: 11 additions & 13 deletions src/java.desktop/share/classes/java/awt/dnd/DragGestureEvent.java
Expand Up @@ -78,14 +78,13 @@ public class DragGestureEvent extends EventObject {
* that comprise the gesture({@code evs} parameter).
*
* @param dgr The {@code DragGestureRecognizer} firing this event
* @param act The user's preferred action. For information on
* allowable values, see the class description for
* {@link DragGestureEvent}.
* @param act The user's preferred action. For information on allowable
* values, see the class description for {@link DragGestureEvent}.
* @param ori The origin of the drag
* @param evs The {@code List} of events that comprise the gesture
* @throws IllegalArgumentException if any parameter equals {@code null}
* @throws IllegalArgumentException if the act parameter does not
* comply with the values given in the class description for
* @throws IllegalArgumentException if the act parameter does not comply
* with the values given in the class description for
* {@link DragGestureEvent}
* @see java.awt.dnd.DnDConstants
*/
Expand Down Expand Up @@ -200,17 +199,16 @@ public InputEvent getTriggerEvent() {
* If a {@code null Transferable} is specified {@code NullPointerException}
* will be thrown.
*
* @param dragCursor The initial {@code Cursor} for this drag
* operation or {@code null} for the default cursor handling; see <a
* @param dragCursor The initial {@code Cursor} for this drag operation or
* {@code null} for the default cursor handling; see <a
* href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
* for more details on the cursor handling mechanism during drag and
* drop
* @param transferable The {@code Transferable} representing the
* source data for this drag operation
* @throws InvalidDnDOperationException if the Drag and Drop system
* is unable to initiate a drag operation, or if the user attempts
* to start a drag while an existing drag operation is still
* executing
* @param transferable The {@code Transferable} representing the source
* data for this drag operation
* @throws InvalidDnDOperationException if the Drag and Drop system is
* unable to initiate a drag operation, or if the user attempts to
* start a drag while an existing drag operation is still executing
* @throws NullPointerException if the {@code Transferable} is {@code null}
* @since 1.4
*/
Expand Down
Expand Up @@ -49,8 +49,8 @@ public interface DragGestureListener extends EventListener {
* appropriate, {@link DragGestureEvent#startDrag startDrag()} method on the
* {@code DragGestureEvent} has to be invoked.
*
* @param dge the {@code DragGestureEvent} describing the gesture
* that has just occurred
* @param dge the {@code DragGestureEvent} describing the gesture that has
* just occurred
* @see java.awt.dnd.DragGestureRecognizer
* @see java.awt.dnd.DragGestureEvent
*/
Expand Down
Expand Up @@ -124,11 +124,10 @@ protected DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureL
* drag initiating gestures, and the action(s) supported for this Drag and
* Drop operation.
*
* @param ds the {@code DragSource} this
* {@code DragGestureRecognizer} will use to process the Drag and
* Drop operation
* @param c the {@code Component} this {@code DragGestureRecognizer}
* should "observe" the event stream to, in order to detect a drag
* @param ds the {@code DragSource} this {@code DragGestureRecognizer} will
* use to process the Drag and Drop operation
* @param c the {@code Component} this {@code DragGestureRecognizer} should
* "observe" the event stream to, in order to detect a drag
* initiating gesture. If this value is {@code null}, the
* {@code DragGestureRecognizer} is not associated with any
* {@code Component}.
Expand All @@ -146,11 +145,10 @@ protected DragGestureRecognizer(DragSource ds, Component c, int sa) {
* {@code Component} this {@code DragGestureRecognizer} should "observe" for
* drag initiating gestures.
*
* @param ds the {@code DragSource} this
* {@code DragGestureRecognizer} will use to process the Drag and
* Drop operation
* @param c the {@code Component} this {@code DragGestureRecognizer}
* should "observe" the event stream to, in order to detect a drag
* @param ds the {@code DragSource} this {@code DragGestureRecognizer} will
* use to process the Drag and Drop operation
* @param c the {@code Component} this {@code DragGestureRecognizer} should
* "observe" the event stream to, in order to detect a drag
* initiating gesture. If this value is {@code null}, the
* {@code DragGestureRecognizer} is not associated with any
* {@code Component}.
Expand All @@ -164,9 +162,8 @@ protected DragGestureRecognizer(DragSource ds, Component c) {
* Construct a new {@code DragGestureRecognizer} given the
* {@code DragSource} to be used in this Drag and Drop operation.
*
* @param ds the {@code DragSource} this
* {@code DragGestureRecognizer} will use to process the Drag and
* Drop operation
* @param ds the {@code DragSource} this {@code DragGestureRecognizer} will
* use to process the Drag and Drop operation
* @throws IllegalArgumentException if ds is {@code null}
*/
protected DragGestureRecognizer(DragSource ds) {
Expand Down Expand Up @@ -332,9 +329,8 @@ protected synchronized void appendEvent(InputEvent awtie) {
*
* @param s the {@code ObjectOutputStream} to write
* @throws IOException if an I/O error occurs
* @serialData The default serializable fields, in alphabetical
* order, followed by either a {@code DragGestureListener}, or
* {@code null}
* @serialData The default serializable fields, in alphabetical order,
* followed by either a {@code DragGestureListener}, or {@code null}
* @since 1.4
*/
@Serial
Expand All @@ -352,8 +348,8 @@ private void writeObject(ObjectOutputStream s) throws IOException {
* using the next object in the stream.
*
* @param s the {@code ObjectInputStream} to read
* @throws ClassNotFoundException if the class of a serialized
* object could not be found
* @throws ClassNotFoundException if the class of a serialized object could
* not be found
* @throws IOException if an I/O error occurs
* @since 1.4
*/
Expand Down
72 changes: 32 additions & 40 deletions src/java.desktop/share/classes/java/awt/dnd/DragSource.java
Expand Up @@ -107,7 +107,6 @@ public class DragSource implements Serializable {
/*
* load a system default cursor
*/

private static Cursor load(String name) {
if (GraphicsEnvironment.isHeadless()) {
return null;
Expand All @@ -122,7 +121,6 @@ private static Cursor load(String name) {
}
}


/**
* The default {@code Cursor} to use with a copy operation indicating that a
* drop is currently allowed. {@code null} if
Expand Down Expand Up @@ -197,8 +195,8 @@ private static Cursor load(String name) {
* platform.
*
* @return the platform DragSource
* @throws HeadlessException if GraphicsEnvironment.isHeadless()
* returns true
* @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
* returns {@code true}
* @see java.awt.GraphicsEnvironment#isHeadless
*/
public static DragSource getDefaultDragSource() {
Expand Down Expand Up @@ -232,8 +230,8 @@ public static boolean isDragImageSupported() {
/**
* Creates a new {@code DragSource}.
*
* @throws HeadlessException if GraphicsEnvironment.isHeadless()
* returns true
* @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
* returns {@code true}
* @see java.awt.GraphicsEnvironment#isHeadless
*/
public DragSource() throws HeadlessException {
Expand All @@ -249,22 +247,21 @@ public DragSource() throws HeadlessException {
* instant of the trigger, the {@code Transferable} subject data of the
* drag, the {@code DragSourceListener}, and the {@code FlavorMap}.
*
* @param trigger the {@code DragGestureEvent} that initiated the
* drag
* @param dragCursor the initial {@code Cursor} for this drag
* operation or {@code null} for the default cursor handling; see <a
* @param trigger the {@code DragGestureEvent} that initiated the drag
* @param dragCursor the initial {@code Cursor} for this drag operation or
* {@code null} for the default cursor handling; see <a
* href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
* for more details on the cursor handling mechanism during drag and
* drop
* @param dragImage the image to drag or {@code null}
* @param imageOffset the offset of the {@code Image} origin from
* the hotspot of the {@code Cursor} at the instant of the trigger
* @param imageOffset the offset of the {@code Image} origin from the
* hotspot of the {@code Cursor} at the instant of the trigger
* @param transferable the subject data of the drag
* @param dsl the {@code DragSourceListener}
* @param flavorMap the {@code FlavorMap} to use, or {@code null}
* @throws java.awt.dnd.InvalidDnDOperationException if the Drag and
* Drop system is unable to initiate a drag operation, or if the
* user attempts to start a drag while an existing drag operation is
* @throws java.awt.dnd.InvalidDnDOperationException if the Drag and Drop
* system is unable to initiate a drag operation, or if the user
* attempts to start a drag while an existing drag operation is
* still executing
*/
public void startDrag(DragGestureEvent trigger,
Expand Down Expand Up @@ -301,19 +298,18 @@ public void startDrag(DragGestureEvent trigger,
* the initial {@code Cursor} to use, the {@code Transferable} subject data
* of the drag, the {@code DragSourceListener}, and the {@code FlavorMap}.
*
* @param trigger the {@code DragGestureEvent} that initiated the
* drag
* @param dragCursor the initial {@code Cursor} for this drag
* operation or {@code null} for the default cursor handling; see <a
* @param trigger the {@code DragGestureEvent} that initiated the drag
* @param dragCursor the initial {@code Cursor} for this drag operation or
* {@code null} for the default cursor handling; see <a
* href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
* for more details on the cursor handling mechanism during drag and
* drop
* @param transferable the subject data of the drag
* @param dsl the {@code DragSourceListener}
* @param flavorMap the {@code FlavorMap} to use or {@code null}
* @throws java.awt.dnd.InvalidDnDOperationException if the Drag and
* Drop system is unable to initiate a drag operation, or if the
* user attempts to start a drag while an existing drag operation is
* @throws java.awt.dnd.InvalidDnDOperationException if the Drag and Drop
* system is unable to initiate a drag operation, or if the user
* attempts to start a drag while an existing drag operation is
* still executing
*/
public void startDrag(DragGestureEvent trigger,
Expand Down Expand Up @@ -342,9 +338,9 @@ public void startDrag(DragGestureEvent trigger,
* hotspot of the {@code Cursor} at the instant of the trigger
* @param transferable the subject data of the drag
* @param dsl the {@code DragSourceListener}
* @throws java.awt.dnd.InvalidDnDOperationException if the Drag and
* Drop system is unable to initiate a drag operation, or if the
* user attempts to start a drag while an existing drag operation is
* @throws java.awt.dnd.InvalidDnDOperationException if the Drag and Drop
* system is unable to initiate a drag operation, or if the user
* attempts to start a drag while an existing drag operation is
* still executing
*/
public void startDrag(DragGestureEvent trigger,
Expand All @@ -362,16 +358,16 @@ public void startDrag(DragGestureEvent trigger,
* of the drag, and the {@code DragSourceListener}.
*
* @param trigger the {@code DragGestureEvent} that initiated the drag
* @param dragCursor the initial {@code Cursor} for this drag
* operation or {@code null} for the default cursor handling; see <a
* @param dragCursor the initial {@code Cursor} for this drag operation or
* {@code null} for the default cursor handling; see <a
* href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
* class for more details on the cursor handling mechanism during
* drag and drop
* @param transferable the subject data of the drag
* @param dsl the {@code DragSourceListener}
* @throws java.awt.dnd.InvalidDnDOperationException if the Drag and
* Drop system is unable to initiate a drag operation, or if the
* user attempts to start a drag while an existing drag operation is
* @throws java.awt.dnd.InvalidDnDOperationException if the Drag and Drop
* system is unable to initiate a drag operation, or if the user
* attempts to start a drag while an existing drag operation is
* still executing
*/
public void startDrag(DragGestureEvent trigger,
Expand Down Expand Up @@ -403,8 +399,8 @@ public void startDrag(DragGestureEvent trigger,
* class for more details on the cursor handling mechanism during
* drag and drop
* @param dragImage The {@code Image} to drag or {@code null}
* @param imageOffset The offset of the {@code Image} origin from
* the hotspot of the cursor at the instant of the trigger
* @param imageOffset The offset of the {@code Image} origin from the
* hotspot of the cursor at the instant of the trigger
* @param t The subject data of the drag
* @param dsl The {@code DragSourceListener}
* @return the {@code DragSourceContext}
Expand Down Expand Up @@ -437,9 +433,7 @@ protected DragSourceContext createDragSourceContext(DragGestureEvent dgl,
*
* @return the {@code FlavorMap} for this {@code DragSource}
*/
public FlavorMap getFlavorMap() {
return flavorMap;
}
public FlavorMap getFlavorMap() { return flavorMap; }

/**
* Creates a new {@code DragGestureRecognizer} that implements the specified
Expand All @@ -465,7 +459,6 @@ public FlavorMap getFlavorMap() {
return Toolkit.getDefaultToolkit().createDragGestureRecognizer(recognizerAbstractClass, this, c, actions, dgl);
}


/**
* Creates a new {@code DragGestureRecognizer} that implements the default
* abstract subclass of {@code DragGestureRecognizer} for this
Expand Down Expand Up @@ -580,7 +573,7 @@ public void removeDragSourceMotionListener(DragSourceMotionListener dsml) {
}

/**
* Gets all of the {@code DragSourceMotionListener}s registered with this
* Gets all of the {@code DragSourceMotionListener}s registered with this
* {@code DragSource}.
*
* @return all of this {@code DragSource}'s
Expand All @@ -605,9 +598,8 @@ public DragSourceMotionListener[] getDragSourceMotionListeners() {
* should specify an interface that descends from
* {@code java.util.EventListener}
* @return an array of all objects registered as
* <code><em>Foo</em>Listener</code>s on this
* {@code DragSource}, or an empty array if no such listeners have
* been added
* <code><em>Foo</em>Listener</code>s on this {@code DragSource}, or
* an empty array if no such listeners have been added
* @throws ClassCastException if {@code listenerType} doesn't specify a
* class or interface that implements
* {@code java.util.EventListener}
Expand Down
22 changes: 11 additions & 11 deletions src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java
Expand Up @@ -153,8 +153,8 @@ public class DragSourceContext
* If {@code DragSourceListener} is {@code null} no exception is thrown.
*
* @param trigger the triggering event
* @param dragCursor the initial {@code Cursor} for this drag
* operation or {@code null} for the default cursor handling; see <a
* @param dragCursor the initial {@code Cursor} for this drag operation or
* {@code null} for the default cursor handling; see <a
* href="DragSourceContext.html#defaultCursor">class level
* documentation</a> for more details on the cursor handling
* mechanism during drag and drop
Expand Down Expand Up @@ -268,7 +268,7 @@ public int getSourceActions() {

/**
* Sets the custom cursor for this drag operation to the specified
* {@code Cursor}. If the specified {@code Cursor} is {@code null}, the
* {@code Cursor}. If the specified {@code Cursor} is {@code null}, the
* default drag cursor behavior is activated for this drag operation,
* otherwise it is deactivated.
*
Expand Down Expand Up @@ -314,11 +314,11 @@ public synchronized void addDragSourceListener(DragSourceListener dsl) throws To
}

/**
* Removes the specified {@code DragSourceListener} from this
* Removes the specified {@code DragSourceListener} from this
* {@code DragSourceContext}.
*
* @param dsl the {@code DragSourceListener} to remove; note that
* while {@code null} is not prohibited, it is not acceptable as a
* @param dsl the {@code DragSourceListener} to remove; note that while
* {@code null} is not prohibited, it is not acceptable as a
* parameter
*/
public synchronized void removeDragSourceListener(DragSourceListener dsl) {
Expand Down Expand Up @@ -517,10 +517,10 @@ private void setCursorImpl(Cursor c) {
*
* @param s the {@code ObjectOutputStream} to write
* @throws IOException if an I/O error occurs
* @serialData The default serializable fields, in alphabetical
* order, followed by either a {@code Transferable} instance, or
* @serialData The default serializable fields, in alphabetical order,
* followed by either a {@code Transferable} instance, or
* {@code null}, followed by either a {@code DragSourceListener}
* instance, or {@code null}.
* instance, or {@code null}
* @since 1.4
*/
@Serial
Expand All @@ -543,8 +543,8 @@ private void writeObject(ObjectOutputStream s) throws IOException {
* supports no {@code DataFlavor}s.
*
* @param s the {@code ObjectInputStream} to read
* @throws ClassNotFoundException if the class of a serialized
* object could not be found
* @throws ClassNotFoundException if the class of a serialized object could
* not be found
* @throws IOException if an I/O error occurs
* @since 1.4
*/
Expand Down

0 comments on commit e0b8e09

Please sign in to comment.