From e10598eab697880e1a7e13eee6ad364d96d8a07d Mon Sep 17 00:00:00 2001 From: Sascha Brawer Date: Wed, 25 Jun 2003 15:01:09 +0000 Subject: Made abstract, reformatted, wrote JavaDoc. (tabForCoordinate, getTabBounds, getTabRunCount): Made abstract. --- javax/swing/plaf/TabbedPaneUI.java | 86 ++++++++++++++++++++++++++++++-------- 1 file changed, 68 insertions(+), 18 deletions(-) (limited to 'javax') diff --git a/javax/swing/plaf/TabbedPaneUI.java b/javax/swing/plaf/TabbedPaneUI.java index a9211c967..20c36c30c 100644 --- a/javax/swing/plaf/TabbedPaneUI.java +++ b/javax/swing/plaf/TabbedPaneUI.java @@ -1,5 +1,5 @@ /* TabbedPaneUI.java - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,24 +38,74 @@ exception statement from your version. */ package javax.swing.plaf; -import java.awt.*; -import javax.swing.*; +import java.awt.Rectangle; +import javax.swing.JTabbedPane; -public class TabbedPaneUI extends ComponentUI + +/** + * An abstract base class for delegates that implement the pluggable + * look and feel for a JTabbedPane. + * + * @see javax.swing.JTabbedPane + * + * @author Andrew Selkirk (aselkirk@sympatico.ca) + * @author Sascha Brawer (brawer@dandelis.ch) + */ +public abstract class TabbedPaneUI + extends ComponentUI { - public Rectangle getTabBounds(JTabbedPane pane, int index) - { - return null; - } - - public int getTabRunCount(JTabbedPane pane) - { - return 0; - } - - public int tabForCoordinate(JTabbedPane pane, int x, int y) - { - return 0; - } + /** + * Constructs a new TabbedPaneUI. + */ + public TabbedPaneUI() + { + } + + + /** + * Determines which tab lies at a given position. + * + * @param pane the JTabbedPane for which this + * delegate object provides the user interface. + * + * @param x the horizontal position, where zero is the left + * edge of pane. + * + * @param y the vertical position, where zero is the top + * edge of pane. + * + * @return the zero-based index of the tab, or -1 if no + * tab is at the specified position. + */ + public abstract int tabForCoordinate(JTabbedPane pane, + int x, int y); + + + /** + * Calculates the bounding box of a tab. + * + * @param pane the JTabbedPane for which this + * delegate object provides the user interface. + * + * @param index the index of the tab, which must be an integer + * in the range [0 .. pane.getTabCount() - 1]. + * + * @return the bounding box of the index-th tab, + * in the coordinate system of pane. + */ + public abstract Rectangle getTabBounds(JTabbedPane pane, int index); + + + /** + * Determines how many runs are used to display tabs. + * + * @param pane the JTabbedPane for which this + * delegate object provides the user interface. + * + * @return the number of tab runs. + * + * @see javax.swing.JTabbedPane#getTabRunCount() + */ + public abstract int getTabRunCount(JTabbedPane pane); } -- cgit v1.2.1