From ec403df959893ee586941b2a3e7dcdf74eb465a7 Mon Sep 17 00:00:00 2001 From: mkoch Date: Fri, 27 Jun 2003 12:41:52 +0000 Subject: 2003-06-27 Michael Koch * javax/swing/JWindow.java, 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/plaf/PopupMenuUI.java, javax/swing/plaf/SplitPaneUI.java, javax/swing/plaf/TabbedPaneUI.java, javax/swing/plaf/TextUI.java, javax/swing/plaf/TreeUI.java, javax/swing/plaf/basic/BasicTextUI.java, javax/swing/plaf/basic/BasicTreeUI.java: New versions from classpath. * javax/swing/Popup.java, javax/swing/PopupFactory.jav: New source files from classpath. * javax/swing/plaf/doc-files/TreeUI-1.png: New binary files from classpath. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68568 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/javax/swing/plaf/basic/BasicTreeUI.java | 197 +++++++++++++++++++++++- 1 file changed, 194 insertions(+), 3 deletions(-) (limited to 'libjava/javax/swing/plaf/basic/BasicTreeUI.java') diff --git a/libjava/javax/swing/plaf/basic/BasicTreeUI.java b/libjava/javax/swing/plaf/basic/BasicTreeUI.java index 17ba4b56e61..d9af1010ba7 100644 --- a/libjava/javax/swing/plaf/basic/BasicTreeUI.java +++ b/libjava/javax/swing/plaf/basic/BasicTreeUI.java @@ -1,5 +1,5 @@ /* BasicTreeUI.java - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,8 +38,199 @@ exception statement from your version. */ package javax.swing.plaf.basic; -import javax.swing.plaf.*; +import java.awt.Rectangle; +import javax.swing.JTree; +import javax.swing.plaf.TreeUI; +import javax.swing.tree.TreePath; -public class BasicTreeUI extends TreeUI + +/** + * A delegate providing the user interface for JTree + * according to the Basic look and feel. The current implementation + * of GNU Classpath does really work; it is just a stub that allows + * compiling the code. + * + * @see javax.swing.JTree + * + * @author Sascha Brawer (brawer@dandelis.ch) + */ +public class BasicTreeUI + extends TreeUI { + /** + * Determines the geometric extent of the label that is + * drawn for a path. + * + * @param tree the JTree for which this delegate + * object provides the user interface. + * + * @param path the path whose label extent is requested. + * + * @return a rectangle enclosing the label, or null + * if path contains invalid nodes. + */ + public Rectangle getPathBounds(JTree tree, TreePath path) + { + return null; // FIXME: not implemented + } + + + /** + * Creates a TreePath for the specified row. + * + * @param tree the JTree for which this delegate + * object provides the user interface. + * + * @param row the index of the row, which should be a number + * in the range [0, getRowCount(tree) - 1]. + * + * @return a TreePath for the specified row, or + * null if row is outside + * the valid range. + */ + public TreePath getPathForRow(JTree tree, int row) + { + return null; // FIXME: not implemented + } + + + /** + * Determines in which row a TreePath is currently + * being displayed. + * + * @param tree the JTree for which this delegate + * object provides the user interface. + * + * @param path the path for which the caller wants to know + * in which row it is being displayed. + * + * @return a number in the range [0, getRowCount(tree) + * - 1] if the path is currently on display; + * -1 if the path is not shown to the + * user. + */ + public int getRowForPath(JTree tree, TreePath path) + { + return -1; // FIXME: not implemented + } + + + /** + * Counts how many rows are currently displayed. + * + * @param tree the JTree for which this delegate + * object provides the user interface. + * + * @return the number of visible rows. + */ + public int getRowCount(JTree tree) + { + return 0; // FIXME: not implemented + } + + + /** + * Finds the path that is closest to the specified position. + * + *