8279798: Javadoc for BasicTabbedPaneUI is inconsistent

Reviewed-by: prr, psadhukhan
This commit is contained in:
Alexey Ivanov 2022-01-24 18:32:35 +00:00
parent acd98294c6
commit 0b5c54be67

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,21 +25,60 @@
package javax.swing.plaf.basic; package javax.swing.plaf.basic;
import sun.swing.SwingUtilities2; import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Hashtable;
import java.util.Vector;
import javax.swing.*; import javax.swing.Action;
import javax.swing.event.*; import javax.swing.ActionMap;
import javax.swing.plaf.*; import javax.swing.Icon;
import javax.swing.InputMap;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JViewport;
import javax.swing.KeyStroke;
import javax.swing.LookAndFeel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.ComponentInputMapUIResource;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.TabbedPaneUI;
import javax.swing.plaf.UIResource;
import javax.swing.text.View; import javax.swing.text.View;
import java.awt.*;
import java.awt.event.*;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;
import java.util.Vector;
import java.util.Hashtable;
import sun.swing.DefaultLookup; import sun.swing.DefaultLookup;
import sun.swing.SwingUtilities2;
import sun.swing.UIAction; import sun.swing.UIAction;
/** /**
@ -216,7 +255,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
public BasicTabbedPaneUI() {} public BasicTabbedPaneUI() {}
/** /**
* Create a UI. * Creates a UI.
* @param c a component * @param c a component
* @return a UI * @return a UI
*/ */
@ -386,7 +425,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
} }
/** /**
* Install the defaults. * Installs the defaults.
*/ */
protected void installDefaults() { protected void installDefaults() {
LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background",
@ -423,7 +462,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
} }
/** /**
* Uninstall the defaults. * Uninstalls the defaults.
*/ */
protected void uninstallDefaults() { protected void uninstallDefaults() {
highlight = null; highlight = null;
@ -438,7 +477,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
} }
/** /**
* Install the listeners. * Installs the listeners.
*/ */
protected void installListeners() { protected void installListeners() {
if ((propertyChangeListener = createPropertyChangeListener()) != null) { if ((propertyChangeListener = createPropertyChangeListener()) != null) {
@ -461,7 +500,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
} }
/** /**
* Uninstall the listeners. * Uninstalls the listeners.
*/ */
protected void uninstallListeners() { protected void uninstallListeners() {
if (mouseListener != null) { if (mouseListener != null) {
@ -1090,9 +1129,9 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
} }
/** /**
* Laysout a label. * Lays out a label.
* @param tabPlacement the tab placement * @param tabPlacement the tab placement
* @param metrics the font metric * @param metrics the font metrics
* @param tabIndex the tab index * @param tabIndex the tab index
* @param title the title * @param title the title
* @param icon the icon * @param icon the icon
@ -2144,7 +2183,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
// Tab Navigation methods // Tab Navigation methods
/** /**
* Navigate the selected tab. * Navigates the selected tab.
* @param direction the direction * @param direction the direction
*/ */
protected void navigateSelectedTab(int direction) { protected void navigateSelectedTab(int direction) {
@ -2226,7 +2265,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
} }
/** /**
* Select the next tab in the run. * Selects the next tab in the run.
* @param current the current tab * @param current the current tab
*/ */
protected void selectNextTabInRun(int current) { protected void selectNextTabInRun(int current) {
@ -2240,7 +2279,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
} }
/** /**
* Select the previous tab in the run. * Selects the previous tab in the run.
* @param current the current tab * @param current the current tab
*/ */
protected void selectPreviousTabInRun(int current) { protected void selectPreviousTabInRun(int current) {
@ -2254,7 +2293,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
} }
/** /**
* Select the next tab. * Selects the next tab.
* @param current the current tab * @param current the current tab
*/ */
protected void selectNextTab(int current) { protected void selectNextTab(int current) {
@ -2267,7 +2306,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
} }
/** /**
* Select the previous tab. * Selects the previous tab.
* @param current the current tab * @param current the current tab
*/ */
protected void selectPreviousTab(int current) { protected void selectPreviousTab(int current) {
@ -2772,7 +2811,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants {
* Returns the preferred tab area width. * Returns the preferred tab area width.
* @param tabPlacement the tab placement * @param tabPlacement the tab placement
* @param height the height * @param height the height
* @return the preferred tab area widty * @return the preferred tab area width
*/ */
protected int preferredTabAreaWidth(int tabPlacement, int height) { protected int preferredTabAreaWidth(int tabPlacement, int height) {
FontMetrics metrics = getFontMetrics(); FontMetrics metrics = getFontMetrics();