diff options
author | Michael Koch <konqueror@gmx.de> | 2003-06-24 20:17:27 +0000 |
---|---|---|
committer | Michael Koch <konqueror@gmx.de> | 2003-06-24 20:17:27 +0000 |
commit | 428e542390f5d5bd1e6c6037b75a095be83e9bb3 (patch) | |
tree | 8d80296e8b413cdaf683251d6bff73920ddd04ee /libjava/javax/swing/plaf/ListUI.java | |
parent | c44a40f4df3f1f6272508c062d3ef305e0e11aaa (diff) |
2003-06-24 Michael Koch <konqueror@gmx.de>
* javax/swing/event/AncestorEvent.java,
javax/swing/event/HyperlinkEvent.java,
javax/swing/event/InternalFrameEvent.java,
javax/swing/event/ListDataEvent.java,
javax/swing/event/TableModelEvent.java,
javax/swing/event/TreeWillExpandListener.java,
javax/swing/plaf/ComponentUI.java,
javax/swing/plaf/DesktopIconUI.java,
javax/swing/plaf/DesktopPaneUI.java,
javax/swing/plaf/DimensionUIResource.java,
javax/swing/plaf/FileChooserUI.java,
javax/swing/plaf/FontUIResource.java,
javax/swing/plaf/IconUIResource.java,
javax/swing/plaf/InputMapUIResource.java,
javax/swing/plaf/InsetsUIResource.java,
javax/swing/plaf/InternalFrameUI.java,
javax/swing/plaf/LabelUI.java,
javax/swing/plaf/ListUI.java,
javax/swing/plaf/MenuBarUI.java,
javax/swing/plaf/MenuItemUI.java,
javax/swing/plaf/OptionPaneUI.java,
javax/swing/plaf/PanelUI.java,
javax/swing/plaf/ProgressBarUI.java,
javax/swing/plaf/doc-files/ComponentUI-1.dia,
javax/swing/plaf/doc-files/ComponentUI-1.png:
New versions from classpath.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@68438 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/javax/swing/plaf/ListUI.java')
-rw-r--r-- | libjava/javax/swing/plaf/ListUI.java | 74 |
1 files changed, 72 insertions, 2 deletions
diff --git a/libjava/javax/swing/plaf/ListUI.java b/libjava/javax/swing/plaf/ListUI.java index be60eb4863b..2e798b95a49 100644 --- a/libjava/javax/swing/plaf/ListUI.java +++ b/libjava/javax/swing/plaf/ListUI.java @@ -1,5 +1,5 @@ /* ListUI.java - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,7 +38,77 @@ exception statement from your version. */ package javax.swing.plaf; +import java.awt.Point; +import java.awt.Rectangle; +import javax.swing.JList; -public class ListUI extends ComponentUI + +/** + * An abstract base class for delegates that implement the pluggable + * look and feel for a <code>JList</code>. + * + * @author Sascha Brawer (brawer@dandelis.ch) + */ +public abstract class ListUI + extends ComponentUI { + /** + * Constructs a new <code>ListUI</code>. + */ + public ListUI() + { + } + + + /** + * Determines the cell index which is the closest to the specified + * location. The find out whether the returned cell actually + * contains the location, the caller should also use {@link + * #getCellBounds}. + * + * @param list the <code>JList</code> for which this delegate object + * provides the pluggable user interface. + * + * @param location a point in the <code>JList</code> coordinate + * system. + * + * @return the index of the closest cell, or -1 if the list model + * is empty. + */ + public abstract int locationToIndex(JList index, Point location); + + + /** + * Determines the location of the specified cell. + * + * @param list the <code>JList</code> for which this delegate object + * provides the pluggable user interface. + * + * @param index the zero-based index of the cell whose location shall be + * determined. + * + * @return the position of the top left corner of the cell in the + * <code>JList</code> coordinate system, or <code>null</code> + * if <code>cell</code> does not designate a valid cell. + */ + public abstract Point indexToLocation(JList list, int index); + + + /** + * Determines the bounding box of the rectangle spanned by + * two list indices. + * + * @param list the <code>JList</code> for which this delegate object + * provides the pluggable user interface. + * + * @param index1 the zero-based index of the first cell. + * + * @param index2 the zero-based index of the second cell. + * + * @return the spanned rectangle, or <code>null</code> if either + * <code>index1</code> or <code>index2</code> does not + * designate a valid cell. + */ + public abstract Rectangle getCellBounds(JList list, + int index1, int index2); } |