From 03e958a5a9bfe536fdaa7975a5f05b4e2f8e98b3 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Fri, 14 Mar 2014 18:14:41 +0400 Subject: [PATCH] 8036103: Cleanup of java.awt and java.awt.peer packages Reviewed-by: bagiras, pchelko --- .../share/classes/java/awt/PointerInfo.java | 43 +++++++++---------- .../java/awt/peer/CheckboxMenuItemPeer.java | 12 +++--- .../classes/java/awt/peer/CheckboxPeer.java | 11 ++--- .../classes/java/awt/peer/ComponentPeer.java | 6 +-- .../classes/java/awt/peer/TextAreaPeer.java | 4 +- 5 files changed, 37 insertions(+), 39 deletions(-) diff --git a/jdk/src/share/classes/java/awt/PointerInfo.java b/jdk/src/share/classes/java/awt/PointerInfo.java index 9418d3d134f..9b51d6ead36 100644 --- a/jdk/src/share/classes/java/awt/PointerInfo.java +++ b/jdk/src/share/classes/java/awt/PointerInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,62 +23,59 @@ * questions. */ + package java.awt; /** * A class that describes the pointer position. - * It provides the GraphicsDevice where the - * pointer is and the Point that represents - * the coordinates of the pointer. + * It provides the {@code GraphicsDevice} where the pointer is and + * the {@code Point} that represents the coordinates of the pointer. *

* Instances of this class should be obtained via * {@link MouseInfo#getPointerInfo}. - * The PointerInfo instance is not updated dynamically - * as the mouse moves. To get the updated location, you must call + * The {@code PointerInfo} instance is not updated dynamically as the mouse + * moves. To get the updated location, you must call * {@link MouseInfo#getPointerInfo} again. * * @see MouseInfo#getPointerInfo - * @author Roman Poborchiy - * @since 1.5 + * @author Roman Poborchiy + * @since 1.5 */ - public class PointerInfo { - private GraphicsDevice device; - private Point location; + private final GraphicsDevice device; + private final Point location; /** * Package-private constructor to prevent instantiation. */ - PointerInfo(GraphicsDevice device, Point location) { + PointerInfo(final GraphicsDevice device, final Point location) { this.device = device; this.location = location; } /** - * Returns the GraphicsDevice where the mouse pointer - * was at the moment this PointerInfo was created. + * Returns the {@code GraphicsDevice} where the mouse pointer was at the + * moment this {@code PointerInfo} was created. * - * @return GraphicsDevice corresponding to the pointer - * @since 1.5 + * @return {@code GraphicsDevice} corresponding to the pointer + * @since 1.5 */ public GraphicsDevice getDevice() { return device; } /** - * Returns the Point that represents the coordinates - * of the pointer on the screen. See {@link MouseInfo#getPointerInfo} - * for more information about coordinate calculation for multiscreen - * systems. + * Returns the {@code Point} that represents the coordinates of the pointer + * on the screen. See {@link MouseInfo#getPointerInfo} for more information + * about coordinate calculation for multiscreen systems. * + * @return coordinates of mouse pointer * @see MouseInfo * @see MouseInfo#getPointerInfo - * @return coordinates of mouse pointer - * @since 1.5 + * @since 1.5 */ public Point getLocation() { return location; } - } diff --git a/jdk/src/share/classes/java/awt/peer/CheckboxMenuItemPeer.java b/jdk/src/share/classes/java/awt/peer/CheckboxMenuItemPeer.java index 5741b21c8ce..f9535131b21 100644 --- a/jdk/src/share/classes/java/awt/peer/CheckboxMenuItemPeer.java +++ b/jdk/src/share/classes/java/awt/peer/CheckboxMenuItemPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,12 +38,12 @@ import java.awt.CheckboxMenuItem; public interface CheckboxMenuItemPeer extends MenuItemPeer { /** - * Sets the state of the checkbox to be checked ({@code true}) or - * unchecked ({@code false}). + * Sets the state of the checkbox to be checked {@code true} or + * unchecked {@code false}. * - * @param t the state to set on the checkbox + * @param state the state to set on the checkbox * - * @see CheckboxMenuItemPeer#setState(boolean) + * @see CheckboxMenuItem#setState(boolean) */ - void setState(boolean t); + void setState(boolean state); } diff --git a/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java b/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java index 567d29e0e27..dc0b85f50c2 100644 --- a/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java +++ b/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,8 @@ */ package java.awt.peer; -import java.awt.*; +import java.awt.Checkbox; +import java.awt.CheckboxGroup; /** * The peer interface for {@link Checkbox}. @@ -38,8 +39,8 @@ import java.awt.*; public interface CheckboxPeer extends ComponentPeer { /** - * Sets the state of the checkbox to be checked ({@code true}) or - * unchecked ({@code false}). + * Sets the state of the checkbox to be checked {@code true} or + * unchecked {@code false}. * * @param state the state to set on the checkbox * @@ -60,7 +61,7 @@ public interface CheckboxPeer extends ComponentPeer { void setCheckboxGroup(CheckboxGroup g); /** - * Sets the label that should be displayed on the ckeckbox. A value of + * Sets the label that should be displayed on the checkbox. A value of * {@code null} means that no label should be displayed. * * @param label the label to be displayed on the checkbox, or diff --git a/jdk/src/share/classes/java/awt/peer/ComponentPeer.java b/jdk/src/share/classes/java/awt/peer/ComponentPeer.java index 8f0366711e5..5fcc90f8d75 100644 --- a/jdk/src/share/classes/java/awt/peer/ComponentPeer.java +++ b/jdk/src/share/classes/java/awt/peer/ComponentPeer.java @@ -27,11 +27,11 @@ package java.awt.peer; import java.awt.*; import java.awt.event.PaintEvent; -import java.awt.image.ImageProducer; -import java.awt.image.ImageObserver; import java.awt.image.ColorModel; +import java.awt.image.ImageObserver; +import java.awt.image.ImageProducer; import java.awt.image.VolatileImage; -import java.awt.GraphicsConfiguration; + import sun.awt.CausedFocusEvent; import sun.java2d.pipe.Region; diff --git a/jdk/src/share/classes/java/awt/peer/TextAreaPeer.java b/jdk/src/share/classes/java/awt/peer/TextAreaPeer.java index 2aa68ed090e..e173cf58b18 100644 --- a/jdk/src/share/classes/java/awt/peer/TextAreaPeer.java +++ b/jdk/src/share/classes/java/awt/peer/TextAreaPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ public interface TextAreaPeer extends TextComponentPeer { void insert(String text, int pos); /** - * Replaces a range of text by the specified string + * Replaces a range of text by the specified string. * * @param text the replacement string * @param start the begin of the range to replace