Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.2386.2.66 diff -u -3 -p -u -r1.2386.2.66 ChangeLog --- ChangeLog 24 Jan 2005 01:59:54 -0000 1.2386.2.66 +++ ChangeLog 25 Jan 2005 10:16:48 -0000 @@ -1,3 +1,43 @@ +2005-01-24 Michael Koch + + * javax/swing/JScrollPane.java + (ScrollBar): Made class protected. + * javax/swing/JSpinner.java + (JSpinner): Added @since tag. + (listenerList): Removed. + * javax/swing/JTable.java + (setValueAt): New method. + (getColumn): Likewise. + * javax/swing/JWindow.java + (rootPaneCheckingEnabled): Renamed from checking. + +2005-01-24 Michael Koch + + * javax/swing/plaf/basic/BasicTextUI.java + (RootView.modelToView): Made it public and return a java.awt.Shape. + Handle null subview. + (uninstall): Set textComponent to null when its not possible used + anymore. + * javax/swing/text/View.java + (setParent): Use better argument name. + (getContainer): Get parent via getParent(). + (getViewFactory): Likewise. + (getAttributes): Get element via getElement(). + (getStartOffset): Likewise. + (getEndOffset): Likewise. + (getResizeWeight): New method. + (getMaximumSpan): Likewise. + (getMinimumSpan): Likewise. + (setSize): Likewise. + (getGraphics): Likewise. + +2005-01-24 Graydon Hoare + Michael Koch + + * javax/swing/LayoutFocusTraversalPolicy.java, + javax/swing/SortingFocusTraversalPolicy.java: + New classes. + 2005-01-23 Sven de Marothy * gnu/java/awt/peer/gtk/GtkComponentPeer.java: Index: javax/swing/JScrollPane.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JScrollPane.java,v retrieving revision 1.12.2.2 diff -u -3 -p -u -r1.12.2.2 JScrollPane.java --- javax/swing/JScrollPane.java 15 Jan 2005 17:02:20 -0000 1.12.2.2 +++ javax/swing/JScrollPane.java 25 Jan 2005 10:16:52 -0000 @@ -1,5 +1,5 @@ /* JScrollPane.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -624,7 +624,7 @@ public class JScrollPane super.setUI(ui); } - class ScrollBar + protected class ScrollBar extends JScrollBar implements UIResource { @@ -660,8 +660,5 @@ public class JScrollPane direction); } } - - } - } Index: javax/swing/JSpinner.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JSpinner.java,v retrieving revision 1.6.2.2 diff -u -3 -p -u -r1.6.2.2 JSpinner.java --- javax/swing/JSpinner.java 15 Jan 2005 17:02:20 -0000 1.6.2.2 +++ javax/swing/JSpinner.java 25 Jan 2005 10:16:52 -0000 @@ -1,5 +1,5 @@ /* JSpinner.java -- - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -59,7 +59,8 @@ import javax.swing.plaf.SpinnerUI; * way to manipulate the value. * * @author Ka-Hing Cheung - * @version 1.0 + * + * @since 1.4 */ public class JSpinner extends JComponent { @@ -286,9 +287,6 @@ public class JSpinner extends JComponent private JComponent editor; /** DOCUMENT ME! */ - private EventListenerList listenerList = new EventListenerList(); - - /** DOCUMENT ME! */ private ChangeListener listener = new ChangeListener() { public void stateChanged(ChangeEvent evt) Index: javax/swing/JTable.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JTable.java,v retrieving revision 1.9.2.5 diff -u -3 -p -u -r1.9.2.5 JTable.java --- javax/swing/JTable.java 21 Jan 2005 02:16:36 -0000 1.9.2.5 +++ javax/swing/JTable.java 25 Jan 2005 10:16:53 -0000 @@ -1864,4 +1864,14 @@ public class JTable extends JComponent { return dataModel.getValueAt(row, convertColumnIndexToModel(column)); } + + public void setValueAt(Object value, int row, int column) + { + dataModel.setValueAt(value, row, convertColumnIndexToModel(column)); + } + + public TableColumn getColumn(Object identifier) + { + return columnModel.getColumn(columnModel.getColumnIndex(identifier)); + } } Index: javax/swing/JWindow.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JWindow.java,v retrieving revision 1.11.2.2 diff -u -3 -p -u -r1.11.2.2 JWindow.java --- javax/swing/JWindow.java 16 Jan 2005 15:15:13 -0000 1.11.2.2 +++ javax/swing/JWindow.java 25 Jan 2005 10:16:53 -0000 @@ -1,5 +1,5 @@ /* JWindow.java -- - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -62,9 +62,8 @@ public class JWindow extends Window impl { private static final long serialVersionUID = 5420698392125238833L; - private boolean checking; - protected JRootPane rootPane; + protected boolean rootPaneCheckingEnabled; protected AccessibleContext accessibleContext; public JWindow() @@ -176,12 +175,12 @@ public class JWindow extends Window impl protected boolean isRootPaneCheckingEnabled() { - return checking; + return rootPaneCheckingEnabled; } protected void setRootPaneCheckingEnabled(boolean enabled) { - checking = enabled; + rootPaneCheckingEnabled = enabled; } public void update(Graphics g) Index: javax/swing/plaf/basic/BasicTextUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTextUI.java,v retrieving revision 1.10.2.3 diff -u -3 -p -u -r1.10.2.3 BasicTextUI.java --- javax/swing/plaf/basic/BasicTextUI.java 16 Jan 2005 02:14:49 -0000 1.10.2.3 +++ javax/swing/plaf/basic/BasicTextUI.java 25 Jan 2005 10:16:53 -0000 @@ -1,5 +1,5 @@ -/* BasicTextUI.java - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +/* BasicTextUI.java -- + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -104,6 +104,8 @@ public abstract class BasicTextUI extend super(null); } + // View methods. + public ViewFactory getViewFactory() { // FIXME: Handle EditorKit somehow. @@ -140,9 +142,12 @@ public abstract class BasicTextUI extend view.paint(g, s); } - protected Rectangle modelToView(int position, Shape a, Position.Bias bias) + public Shape modelToView(int position, Shape a, Position.Bias bias) throws BadLocationException { + if (view == null) + return null; + return ((PlainView) view).modelToView(position, a, bias).getBounds(); } } @@ -327,11 +332,12 @@ public abstract class BasicTextUI extend rootView.setView(null); textComponent.removePropertyChangeListener(updateHandler); - textComponent = null; uninstallDefaults(); uninstallListeners(); uninstallKeyboardActions(); + + textComponent = null; } protected void uninstallDefaults() @@ -442,13 +448,13 @@ public abstract class BasicTextUI extend public View create(Element elem) { - // subclasses have to implement this to get this functionality + // Subclasses have to implement this to get this functionality. return null; } public View create(Element elem, int p0, int p1) { - // subclasses have to implement this to get this functionality + // Subclasses have to implement this to get this functionality. return null; } Index: javax/swing/text/View.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/text/View.java,v retrieving revision 1.6.2.2 diff -u -3 -p -u -r1.6.2.2 View.java --- javax/swing/text/View.java 15 Jan 2005 17:02:21 -0000 1.6.2.2 +++ javax/swing/text/View.java 25 Jan 2005 10:16:53 -0000 @@ -1,5 +1,5 @@ /* View.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,6 +35,7 @@ this exception to your version of the li obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package javax.swing.text; import java.awt.Container; @@ -69,9 +70,9 @@ public abstract class View implements Sw public abstract void paint(Graphics g, Shape s); - public void setParent(View a) + public void setParent(View parent) { - parent = a; + this.parent = parent; } public View getParent() @@ -87,6 +88,7 @@ public abstract class View implements Sw public Container getContainer() { + View parent = getParent(); return parent != null ? parent.getContainer() : null; } @@ -101,6 +103,32 @@ public abstract class View implements Sw } public abstract float getPreferredSpan(int axis); + + public int getResizeWeight(int axis) + { + return 0; + } + + public float getMaximumSpan(int axis) + { + if (getResizeWeight(axis) <= 0) + return getPreferredSpan(axis); + + return Integer.MAX_VALUE; + } + + public float getMinimumSpan(int axis) + { + if (getResizeWeight(axis) <= 0) + return getPreferredSpan(axis); + + return Integer.MAX_VALUE; + } + + public void setSize(float width, float height) + { + // The default implementation does nothing. + } public float getAlignment(int axis) { @@ -109,7 +137,7 @@ public abstract class View implements Sw public AttributeSet getAttributes() { - return elt.getAttributes(); + return getElement().getAttributes(); } public boolean isVisible() @@ -129,6 +157,7 @@ public abstract class View implements Sw public ViewFactory getViewFactory() { + View parent = getParent(); return parent != null ? parent.getViewFactory() : null; } @@ -167,12 +196,12 @@ public abstract class View implements Sw public int getStartOffset() { - return elt.getStartOffset(); + return getElement().getStartOffset(); } public int getEndOffset() { - return elt.getEndOffset(); + return getElement().getEndOffset(); } public Shape getChildAllocation(int index, Shape a) @@ -205,5 +234,13 @@ public abstract class View implements Sw return null; } + + /** + * @since 1.3 + */ + public Graphics getGraphics() + { + return getContainer().getGraphics(); + } }