8077094: Fix missing doclint warnings in the javax.swing.plaf package

Reviewed-by: serb
This commit is contained in:
Joe Darcy 2015-04-08 10:50:50 -07:00
parent 0b17b713ec
commit 2bc44815c5
11 changed files with 278 additions and 15 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2015, 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
@ -37,6 +37,9 @@ import javax.swing.ActionMap;
*/
@SuppressWarnings("serial") // Superclass is not serializable across versions
public class ActionMapUIResource extends ActionMap implements UIResource {
/**
* Constructs an {@code ActionMapUIResource}.
*/
public ActionMapUIResource() {
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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,7 +38,7 @@ import javax.swing.Icon;
import javax.swing.plaf.UIResource;
/*
/**
* A Border wrapper class which implements UIResource. UI
* classes which set border properties should use this class
* to wrap any borders specified as defaults.
@ -67,6 +67,10 @@ public class BorderUIResource implements Border, UIResource, Serializable
static Border raisedBevel;
static Border blackLine;
/**
* Returns a etched border UI resource.
* @return a etched border UI resource
*/
public static Border getEtchedBorderUIResource() {
if (etched == null) {
etched = new EtchedBorderUIResource();
@ -74,6 +78,10 @@ public class BorderUIResource implements Border, UIResource, Serializable
return etched;
}
/**
* Returns a lowered bevel border UI resource.
* @return a lowered bevel border UI resource
*/
public static Border getLoweredBevelBorderUIResource() {
if (loweredBevel == null) {
loweredBevel = new BevelBorderUIResource(BevelBorder.LOWERED);
@ -81,6 +89,10 @@ public class BorderUIResource implements Border, UIResource, Serializable
return loweredBevel;
}
/**
* Returns a raised bevel border UI resource.
* @return a raised bevel border UI resource
*/
public static Border getRaisedBevelBorderUIResource() {
if (raisedBevel == null) {
raisedBevel = new BevelBorderUIResource(BevelBorder.RAISED);
@ -88,6 +100,10 @@ public class BorderUIResource implements Border, UIResource, Serializable
return raisedBevel;
}
/**
* Returns a black line border UI resource.
* @return a black line border UI resource
*/
public static Border getBlackLineBorderUIResource() {
if (blackLine == null) {
blackLine = new LineBorderUIResource(Color.black);
@ -122,7 +138,15 @@ public class BorderUIResource implements Border, UIResource, Serializable
return delegate.isBorderOpaque();
}
/**
* A compound border UI resource.
*/
public static class CompoundBorderUIResource extends CompoundBorder implements UIResource {
/**
* Constructs a {@code CompoundBorderUIResource}.
* @param outsideBorder the outside border
* @param insideBorder the inside border
*/
@ConstructorProperties({"outsideBorder", "insideBorder"})
public CompoundBorderUIResource(Border outsideBorder, Border insideBorder) {
super(outsideBorder, insideBorder);
@ -130,23 +154,49 @@ public class BorderUIResource implements Border, UIResource, Serializable
}
/**
* An empty border UI resource.
*/
public static class EmptyBorderUIResource extends EmptyBorder implements UIResource {
/**
* Constructs a {@code EmptyBorderUIResource}.
* @param top the top inset of the border
* @param left the left inset of the border
* @param bottom the bottom inset of the border
* @param right the right inset of the border
*/
public EmptyBorderUIResource(int top, int left, int bottom, int right) {
super(top, left, bottom, right);
}
/**
* Constructs a {@code EmptyBorderUIResource}.
* @param insets the insets of the border
*/
@ConstructorProperties({"borderInsets"})
public EmptyBorderUIResource(Insets insets) {
super(insets);
}
}
/**
* A line border UI resource.
*/
public static class LineBorderUIResource extends LineBorder implements UIResource {
/**
* Constructs a {@code LineBorderUIResource}.
* @param color the color for the border
*/
public LineBorderUIResource(Color color) {
super(color);
}
/**
* Constructs a {@code LineBorderUIResource}.
* @param color the color for the border
* @param thickness the thickness of the border
*/
@ConstructorProperties({"lineColor", "thickness"})
public LineBorderUIResource(Color color, int thickness) {
super(color, thickness);
@ -154,16 +204,37 @@ public class BorderUIResource implements Border, UIResource, Serializable
}
/**
* A bevel border UI resource.
*/
public static class BevelBorderUIResource extends BevelBorder implements UIResource {
/**
* Constructs a {@code BevelBorderUIResource}.
* @param bevelType the type of bevel for the border
*/
public BevelBorderUIResource(int bevelType) {
super(bevelType);
}
/**
* Constructs a {@code BevelBorderUIResource}.
* @param bevelType the type of bevel for the border
* @param highlight the color to use for the bevel highlight
* @param shadow the color to use for the bevel shadow
*/
public BevelBorderUIResource(int bevelType, Color highlight, Color shadow) {
super(bevelType, highlight, shadow);
}
/**
* Constructs a {@code BevelBorderUIResource}.
* @param bevelType the type of bevel for the border
* @param highlightOuter the color to use for the bevel outer highlight
* @param highlightInner the color to use for the bevel inner highlight
* @param shadowOuter the color to use for the bevel outer shadow
* @param shadowInner the color to use for the bevel inner shadow
*/
@ConstructorProperties({"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"})
public BevelBorderUIResource(int bevelType,
Color highlightOuter, Color highlightInner,
@ -172,57 +243,124 @@ public class BorderUIResource implements Border, UIResource, Serializable
}
}
/**
* An etched border UI resource.
*/
public static class EtchedBorderUIResource extends EtchedBorder implements UIResource {
/**
* Constructs an {@code EtchedBorderUIResource}.
*/
public EtchedBorderUIResource() {
super();
}
/**
* Constructs an {@code EtchedBorderUIResource}.
* @param etchType the type of etch to be drawn by the border
*/
public EtchedBorderUIResource(int etchType) {
super(etchType);
}
/**
* Constructs an {@code EtchedBorderUIResource}.
* @param highlight the color to use for the etched highlight
* @param shadow the color to use for the etched shadow
*/
public EtchedBorderUIResource(Color highlight, Color shadow) {
super(highlight, shadow);
}
/**
* Constructs an {@code EtchedBorderUIResource}.
* @param etchType the type of etch to be drawn by the border
* @param highlight the color to use for the etched highlight
* @param shadow the color to use for the etched shadow
*/
@ConstructorProperties({"etchType", "highlightColor", "shadowColor"})
public EtchedBorderUIResource(int etchType, Color highlight, Color shadow) {
super(etchType, highlight, shadow);
}
}
/**
* A matte border UI resource.
*/
public static class MatteBorderUIResource extends MatteBorder implements UIResource {
/**
* Constructs a {@code MatteBorderUIResource}.
* @param top the top inset of the border
* @param left the left inset of the border
* @param bottom the bottom inset of the border
* @param right the right inset of the border
* @param color the color rendered for the border
*/
public MatteBorderUIResource(int top, int left, int bottom, int right,
Color color) {
super(top, left, bottom, right, color);
}
/**
* Constructs a {@code MatteBorderUIResource}.
* @param top the top inset of the border
* @param left the left inset of the border
* @param bottom the bottom inset of the border
* @param right the right inset of the border
* @param tileIcon the icon to be used for tiling the border
*/
public MatteBorderUIResource(int top, int left, int bottom, int right,
Icon tileIcon) {
super(top, left, bottom, right, tileIcon);
}
/**
* Constructs a {@code MatteBorderUIResource}.
* @param tileIcon the icon to be used for tiling the border
*/
public MatteBorderUIResource(Icon tileIcon) {
super(tileIcon);
}
}
/**
* A titled border UI resource.
*/
public static class TitledBorderUIResource extends TitledBorder implements UIResource {
/**
* Constructs a {@code TitledBorderUIResource}.
* @param title the title the border should display
*/
public TitledBorderUIResource(String title) {
super(title);
}
/**
* Constructs a {@code TitledBorderUIResource}.
* @param border the border
*/
public TitledBorderUIResource(Border border) {
super(border);
}
/**
* Constructs a {@code TitledBorderUIResource}.
* @param border the border
* @param title the title the border should display
*/
public TitledBorderUIResource(Border border, String title) {
super(border, title);
}
/**
* Constructs a {@code TitledBorderUIResource}.
* @param border the border
* @param title the title the border should display
* @param titleJustification the justification fro the title
* @param titlePosition the position for the title
*/
public TitledBorderUIResource(Border border,
String title,
int titleJustification,
@ -230,6 +368,14 @@ public class BorderUIResource implements Border, UIResource, Serializable
super(border, title, titleJustification, titlePosition);
}
/**
* Constructs a {@code TitledBorderUIResource}.
* @param border the border
* @param title the title the border should display
* @param titleJustification the justification fro the title
* @param titlePosition the position for the title
* @param titleFont the font for rendering the title
*/
public TitledBorderUIResource(Border border,
String title,
int titleJustification,
@ -238,6 +384,15 @@ public class BorderUIResource implements Border, UIResource, Serializable
super(border, title, titleJustification, titlePosition, titleFont);
}
/**
* Constructs a {@code TitledBorderUIResource}.
* @param border the border
* @param title the title the border should display
* @param titleJustification the justification fro the title
* @param titlePosition the position for the title
* @param titleFont the font for rendering the title
* @param titleColor the color of the title
*/
@ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"})
public TitledBorderUIResource(Border border,
String title,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
@ -28,7 +28,7 @@ package javax.swing.plaf;
import java.awt.Color;
import java.beans.ConstructorProperties;
/*
/**
* A subclass of Color that implements UIResource. UI
* classes that create colors should use this class.
* <p>
@ -48,19 +48,39 @@ import java.beans.ConstructorProperties;
@SuppressWarnings("serial") // Same-version serialization only
public class ColorUIResource extends Color implements UIResource
{
/**
* Constructs a {@code ColorUIResource}.
* @param r the red component
* @param g the green component
* @param b the blue component
*/
@ConstructorProperties({"red", "green", "blue"})
public ColorUIResource(int r, int g, int b) {
super(r, g, b);
}
/**
* Constructs a {@code ColorUIResource}.
* @param rgb the combined RGB components
*/
public ColorUIResource(int rgb) {
super(rgb);
}
/**
* Constructs a {@code ColorUIResource}.
* @param r the red component
* @param g the green component
* @param b the blue component
*/
public ColorUIResource(float r, float g, float b) {
super(r, g, b);
}
/**
* Constructs a {@code ColorUIResource}.
* @param c the color
*/
public ColorUIResource(Color c) {
super(c.getRGB(), (c.getRGB() & 0xFF000000) != 0xFF000000);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2015, 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,6 +38,10 @@ import javax.swing.JComponent;
*/
@SuppressWarnings("serial") // Superclass is not serializable across versions
public class ComponentInputMapUIResource extends ComponentInputMap implements UIResource {
/**
* Constructs a {@code ComponentInputMapUIResource}.
* @param component a non-null JComponent
*/
public ComponentInputMapUIResource(JComponent component) {
super(component);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
@ -29,7 +29,7 @@ import java.awt.Dimension;
import javax.swing.plaf.UIResource;
/*
/**
* A subclass of <code>Dimension</code> that implements
* <code>UIResource</code>. UI classes that use
* <code>Dimension</code> values for default properties
@ -51,6 +51,11 @@ import javax.swing.plaf.UIResource;
@SuppressWarnings("serial") // Same-version serialization only
public class DimensionUIResource extends Dimension implements UIResource
{
/**
* Constructs a {@code DimensionUIResource}.
* @param width the width
* @param height the height
*/
public DimensionUIResource(int width, int height) {
super(width, height);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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,13 +38,42 @@ import java.io.File;
public abstract class FileChooserUI extends ComponentUI
{
/**
* Returns an accept-all file filter.
* @param fc the file chooser
* @return an accept-all file filter
*/
public abstract FileFilter getAcceptAllFileFilter(JFileChooser fc);
/**
* Returns a file view.
* @param fc the file chooser
* @return a file view
*/
public abstract FileView getFileView(JFileChooser fc);
/**
* Returns approve button text.
* @param fc the file chooser
* @return approve button text.
*/
public abstract String getApproveButtonText(JFileChooser fc);
/**
* Returns the dialog title.
* @param fc the file chooser
* @return the dialog title.
*/
public abstract String getDialogTitle(JFileChooser fc);
/**
* Rescan the current directory.
* @param fc the file chooser
*/
public abstract void rescanCurrentDirectory(JFileChooser fc);
/**
* Ensure the file in question is visible.
* @param fc the file chooser
* @param f the file
*/
public abstract void ensureFileIsVisible(JFileChooser fc, File f);
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
@ -50,10 +50,20 @@ import javax.swing.plaf.UIResource;
@SuppressWarnings("serial") // Same-version serialization only
public class FontUIResource extends Font implements UIResource
{
/**
* Constructs a {@code FontUIResource}.
* @param name the font name
* @param style the style constant for the font
* @param size the point size of the font
*/
public FontUIResource(String name, int style, int size) {
super(name, style, size);
}
/**
* Constructs a {@code FontUIResource}.
* @param font the font
*/
public FontUIResource(Font font) {
super(font);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2015, 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
@ -37,6 +37,9 @@ import javax.swing.InputMap;
*/
@SuppressWarnings("serial") // Same-version serialization only
public class InputMapUIResource extends InputMap implements UIResource {
/**
* Constructs an {@code InputMapUIResource}.
*/
public InputMapUIResource() {
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
@ -29,7 +29,7 @@ import java.awt.Insets;
import javax.swing.plaf.UIResource;
/*
/**
* A subclass of Insets that implements UIResource. UI
* classes that use Insets values for default properties
* should use this class.
@ -50,6 +50,13 @@ import javax.swing.plaf.UIResource;
@SuppressWarnings("serial") // Same-version serialization only
public class InsetsUIResource extends Insets implements UIResource
{
/**
* Constructs an {@code InsetsUIResource}.
* @param top the inset from the top
* @param left the inset from the left
* @param bottom the inset from the bottom
* @param right the inset from the right
*/
public InsetsUIResource(int top, int left, int bottom, int right) {
super(top, left, bottom, right);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2015, 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
@ -730,6 +730,15 @@ public class LayerUI<V extends Component>
* This method is to be overridden instead of {@code JLayer.imageUpdate}.
* <p>
* <b>Note:</b> This method is usually called <b>not</b> on the Event Dispatching Thread.
*
* @param img the image being observed
* @param infoflags see imageUpdate for information
* @param x the x coordinate
* @param y the y coordinate
* @param w the width
* @param h the height
* @param l a {@code JLayer} component
* @return false if the infoflags indicate that the image is completely loaded; true otherwise
*/
public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h, JLayer<? extends V> l) {
return l.imageUpdate(img, infoflags, x, y, w, h);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
@ -35,7 +35,25 @@ import javax.swing.JTabbedPane;
* @author Amy Fowler
*/
public abstract class TabbedPaneUI extends ComponentUI {
/**
* Returns the tab for the coordinate.
* @param pane the pane
* @param x the x coordinate
* @param y the y coordinate
* @return the tab for the coordinate
*/
public abstract int tabForCoordinate(JTabbedPane pane, int x, int y);
/**
* Returns the rectangle for the tab bounds.
* @param pane the pane
* @param index the index
* @return the rectangle for the tab bounds
*/
public abstract Rectangle getTabBounds(JTabbedPane pane, int index);
/**
* Returns the tab run count.
* @param pane the pane
* @return the tab run count
*/
public abstract int getTabRunCount(JTabbedPane pane);
}