AncestorEvent.java, [...]: New versions from classpath.
authorMichael Koch <konqueror@gmx.de>
Tue, 24 Jun 2003 20:17:27 +0000 (20:17 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Tue, 24 Jun 2003 20:17:27 +0000 (20:17 +0000)
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.

From-SVN: r68438

26 files changed:
libjava/ChangeLog
libjava/javax/swing/event/AncestorEvent.java
libjava/javax/swing/event/HyperlinkEvent.java
libjava/javax/swing/event/InternalFrameEvent.java
libjava/javax/swing/event/ListDataEvent.java
libjava/javax/swing/event/TableModelEvent.java
libjava/javax/swing/event/TreeWillExpandListener.java
libjava/javax/swing/plaf/ComponentUI.java
libjava/javax/swing/plaf/DesktopIconUI.java
libjava/javax/swing/plaf/DesktopPaneUI.java
libjava/javax/swing/plaf/DimensionUIResource.java
libjava/javax/swing/plaf/FileChooserUI.java
libjava/javax/swing/plaf/FontUIResource.java
libjava/javax/swing/plaf/IconUIResource.java
libjava/javax/swing/plaf/InputMapUIResource.java
libjava/javax/swing/plaf/InsetsUIResource.java
libjava/javax/swing/plaf/InternalFrameUI.java
libjava/javax/swing/plaf/LabelUI.java
libjava/javax/swing/plaf/ListUI.java
libjava/javax/swing/plaf/MenuBarUI.java
libjava/javax/swing/plaf/MenuItemUI.java
libjava/javax/swing/plaf/OptionPaneUI.java
libjava/javax/swing/plaf/PanelUI.java
libjava/javax/swing/plaf/ProgressBarUI.java
libjava/javax/swing/plaf/doc-files/ComponentUI-1.dia
libjava/javax/swing/plaf/doc-files/ComponentUI-1.png

index 90cd57f36b7eb6bf5b24a604ecd241cdbda88d1d..54f805114dc54b440c5e9909fa8de6951c0014f0 100644 (file)
@@ -1,3 +1,32 @@
+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.
+
 2003-06-24  Michael Koch  <konqueror@gmx.de>
 
        * java/nio/Buffer.java
index 0c86badc764b1763c9684a60df6217544bb154d0..7acc2881cdbd576ae2f1c8bcc36b8ba75cc84690 100644 (file)
@@ -43,99 +43,57 @@ import java.awt.Container;
 import javax.swing.JComponent;
 
 /**
- * Ancestor Event
  * @author Andrew Selkirk
  * @author Ronald Veldema
  */
-public class AncestorEvent extends AWTEvent {
-
-       //-------------------------------------------------------------
-       // Constants --------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * ANCESTOR_ADDED constant
-        */
-       public static int ANCESTOR_ADDED        = 0;
-       
-       /**
-        * ANCESTOR_MOVED constant
-        */
-       public static int ANCESTOR_MOVED        = 1;
-
-       /**
-        * ANCESTOR_REMOVED constant
-        */
-       public static int ANCESTOR_REMOVED      = 2;
-
-
-       //-------------------------------------------------------------
-       // Variables --------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Source component
-        */
-       private JComponent      sourceComponent = null;
-
-       /**
-        * Ancestor
-        */
-       private Container       ancestor                = null;
-       
-       /**
-        * Ancestor Parent
-        */
-       private Container       ancestorParent  = null;
-
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor AncestorEvent
-        * @param source Source component
-        * @param id ID
-        * @param ancestor ancestor
-        * @param ancestorParent parent ancestor
-        */
-       public AncestorEvent(JComponent source, int id, Container ancestor, 
-                                               Container ancestorParent) {
-               super(source, id);
-               this.sourceComponent = source;
-               this.ancestor           = ancestor;
-               this.ancestorParent     = ancestorParent;
-       } // AncestorEvent()
-
-
-       //-------------------------------------------------------------
-       // Methods ----------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Get ancestor
-        * @return ancestor
-        */
-       public Container getAncestor() {
-               return ancestor;
-       } // getAncestor()
-
-       /**
-        * Get ancestor parent
-        * @return ancestor parent
-        */
-       public Container getAncestorParent() {
-               return ancestorParent;
-       } // getAncestorParent()
-
-       /**
-        * Get component
-        * @return component
-        */
-       public JComponent getComponent() {
-               return sourceComponent;
-       } // getComponent()
-
-
-} // AncestorEvent
+public class AncestorEvent extends AWTEvent
+{
+  private static final serialVersionUID = 4799843792513591457L;
+  
+  public static int ANCESTOR_ADDED = 0;
+  public static int ANCESTOR_MOVED = 1;
+  public static int ANCESTOR_REMOVED = 2;
+
+  private JComponent sourceComponent;
+  private Container ancestor;
+  private Container ancestorParent;
+
+  /**
+   * @param source Source component
+   * @param id ID
+   * @param ancestor ancestor
+   * @param ancestorParent parent ancestor
+   */
+  public AncestorEvent(JComponent source, int id, Container ancestor,
+                      Container ancestorParent)
+  {
+    super(source, id);
+    this.sourceComponent = source;
+    this.ancestor = ancestor;
+    this.ancestorParent = ancestorParent;
+  }
+
+  /**
+   * Returns the ancestor of this event.
+   */
+  public Container getAncestor()
+  {
+    return ancestor;
+  }
+
+  /**
+   * Returns the ancester parent of this event.
+   */
+  public Container getAncestorParent()
+  {
+    return ancestorParent;
+  }
+
+  /**
+   * Returns the source of this event.
+   */
+  public JComponent getComponent()
+  {
+    return sourceComponent;
+  }
+}
index 26ccaa81c509de13f1c76ebce545e10d7c450bb8..a6bef2e679b57ecb9eb8a428c1f0b72bb640b644 100644 (file)
@@ -43,155 +43,117 @@ import java.util.EventObject;
 import javax.swing.text.Element;
 
 /**
- * HyperlinkEvent
  * @author Andrew Selkirk
  * @author Ronald Veldema
  */
 public class HyperlinkEvent extends EventObject
 {
-
-       //-------------------------------------------------------------
-       // Classes ----------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * EventType
-        */
-       public static final class EventType {
-
-               //-------------------------------------------------------------
-               // Variables --------------------------------------------------
-               //-------------------------------------------------------------
-
-               /**
-                * ENTERED
-                */
-               public static final EventType ENTERED = new EventType("ENTERED"); // TODO
-
-               /**
-                * EXITED
-                */
-               public static final EventType EXITED = new EventType("EXITED"); // TODO
-
-               /**
-                * ACTIVATED
-                */
-               public static final EventType ACTIVATED = new EventType("ACTIVATED"); // TODO
-
-               /**
-                * type
-                */
-               private String type;
-
-
-               //-------------------------------------------------------------
-               // Initialization ---------------------------------------------
-               //-------------------------------------------------------------
-
-               /**
-                * Constructor EventType
-                * @param type TODO
-                */
-               private EventType(String type) {
-                       this.type = type;
-               } // EventType()
-
-
-               //-------------------------------------------------------------
-               // Methods ----------------------------------------------------
-               //-------------------------------------------------------------
-
-               /**
-                * toString
-                * @returns String
-                */
-               public String toString() {
-                       return type; // TODO
-               } // toString()
-
-
-       } // EventType
-
-
-       //-------------------------------------------------------------
-       // Variables --------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * type
-        */
-       private EventType type;
-
-       /**
-        * url
-        */
-       private URL url;
-
-       /**
-        * description
-        */
-       private String description;
-
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor HyperlinkEvent
-        * @param source TODO
-        * @param type TODO
-        * @param url TODO
-        */
-       public HyperlinkEvent(Object source, EventType type, URL url) {
-               super(source);
-               this.type = type;
-               this.url = url;
-               this.description = null;
-       } // HyperlinkEvent()
-
-       /**
-        * Constructor HyperlinkEvent
-        * @param source TODO
-        * @param type TODO
-        * @param url TODO
-        * @param description TODO
-        */
-       public HyperlinkEvent(Object source, EventType type, URL url, String description) {
-               super(source);
-               this.type = type;
-               this.url = url;
-               this.description = null;
-       } // HyperlinkEvent()
-
-
-       //-------------------------------------------------------------
-       // Methods ----------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * getURL
-        * @returns URL
-        */
-       public URL getURL() {
-               return url;
-       } // getURL()
-
-       /**
-        * getEventType
-        * @returns EventType
-        */
-       public EventType getEventType() {
-               return type;
-       } // getEventType()
-
-       /**
-        * getDescription
-        * @returns String
-        */
-       public String getDescription() {
-               return description;
-       } // getDescription()
-
-
-} // HyperlinkEvent
+  public static final class EventType
+  {
+    public static final EventType ENTERED = new EventType("ENTERED"); // TODO
+    public static final EventType EXITED = new EventType("EXITED"); // TODO
+    public static final EventType ACTIVATED = new EventType("ACTIVATED"); // TODO
+    
+    private String type;
+
+    /**
+     * Creates a new Event type.
+     * 
+     * @param type String representing the event type.
+     */
+    private EventType(String type)
+    {
+      this.type = type;
+    }
+
+    /**
+     * Returns a <code>String</code> of this object.
+     */
+    public String toString()
+    {
+      return type;
+    }
+  }
+
+  private static final long serialVersionUID = -8168964465779154277L;
+  
+  private EventType type;
+  private URL url;
+  private String description;
+  private Element element;
+
+  /**
+   * Creates a new <code>HyperlinkEvent</code> with the given arguments.
+   * 
+   * @param source The object this link is associated to.
+   * @param type The type of event.
+   * @param url The URL this link pointing too.
+   */
+  public HyperlinkEvent(Object source, EventType type, URL url)
+  {
+    this (source, type, url, null, null);
+  }
+
+  /**
+   * Creates a new <code>HyperlinkEvent</code> with the given arguments.
+   * 
+   * @param source The object this link is associated to.
+   * @param type The type of event.
+   * @param url The URL this link pointing too.
+   * @param description The description for this link.
+   */
+  public HyperlinkEvent(Object source, EventType type, URL url, String description)
+  {
+    this (source, type, url, description, null);
+  }
+  
+  /**
+   * Creates a new <code>HyperlinkEvent</code> with the given arguments.
+   * 
+   * @param source The object this link is associated to.
+   * @param type The type of event.
+   * @param url The URL this link pointing too.
+   * @param description The description for this link.
+   * @param element The element in the document representing the anchor.
+   */
+  public HyperlinkEvent(Object source, EventType type, URL url, String description)
+  {
+    super(source);
+    this.type = type;
+    this.url = url;
+    this.description = description;
+    this.element = element;
+  }
+
+  /**
+   * Returns the element of the document repesenting this anchor.
+   */
+  public Element getSourceElement()
+  {
+    return element;
+  }
+  
+  /**
+   * Returns the URL of this event.
+   */
+  public URL getURL()
+  {
+    return url;
+  }
+
+  /**
+   * Returns the type of this event.
+   */
+  public EventType getEventType()
+  {
+    return type;
+  }
+
+  /**
+   * Returns the description of this event.
+   */
+  public String getDescription()
+  {
+    return description;
+  }
+}
index 345568b7b610649177d46858e1dde2108b2968a7..d802cd2608332750649b27293e9e1ee673e02370 100644 (file)
@@ -42,73 +42,73 @@ import java.awt.AWTEvent;
 import javax.swing.JInternalFrame;
 
 /**
- * InternalFrameEvent
  * @author Andrew Selkirk
  */
-public class InternalFrameEvent extends AWTEvent {
-
-       //-------------------------------------------------------------
-       // Constants --------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Internal frame activated event
-        */
-       public static   int     INTERNAL_FRAME_ACTIVATED        = 25554;
-
-       /**
-        * Internal frame closed event
-        */
-       public static   int     INTERNAL_FRAME_CLOSED           = 25551;
-
-       /**
-        * Internal frame closing event
-        */
-       public static   int     INTERNAL_FRAME_CLOSING          = 25550;
-
-       /**
-        * Internal frame deactivated event
-        */
-       public static   int     INTERNAL_FRAME_DEACTIVATED      = 25555;
-
-       /**
-        * Internal frame deiconifed event
-        */
-       public static   int     INTERNAL_FRAME_DEICONIFIED      = 25553;
-
-       /**
-        * Internal frame frame first event
-        */
-       public static   int     INTERNAL_FRAME_FIRST            = 25549;
-
-       /**
-        * Internal frame iconified event
-        */
-       public static   int     INTERNAL_FRAME_ICONIFIED        = 2552;
-
-       /**
-        * Internal frame last event
-        */
-       public static   int     INTERNAL_FRAME_LAST                     = 25555;
-
-       /**
-        * Internal frame opened event
-        */
-       public static   int     INTERNAL_FRAME_OPENED           = 25550;
-
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor InternalFrameEvent
-        * @param source JInternalFrame
-        * @param id Event ID
-        */
-       public InternalFrameEvent(JInternalFrame source, int id) {
-               super(source, id);
-       } // InternalFrameEvent()
-
-
-} // InternalFrameEvent
+public class InternalFrameEvent extends AWTEvent
+{
+  private static final serialVersionUID = 9195444901064686684L;
+
+  /**
+   * Internal frame activated event
+   */
+  public static int INTERNAL_FRAME_ACTIVATED = 25554;
+
+  /**
+   * Internal frame closed event
+   */
+  public static int INTERNAL_FRAME_CLOSED = 25551;
+
+  /**
+   * Internal frame closing event
+   */
+  public static int INTERNAL_FRAME_CLOSING = 25550;
+
+  /**
+   * Internal frame deactivated event
+   */
+  public static int INTERNAL_FRAME_DEACTIVATED = 25555;
+
+  /**
+   * Internal frame deiconifed event
+   */
+  public static int INTERNAL_FRAME_DEICONIFIED = 25553;
+
+  /**
+   * Internal frame frame first event
+   */
+  public static int INTERNAL_FRAME_FIRST = 25549;
+
+  /**
+   * Internal frame iconified event
+   */
+  public static int INTERNAL_FRAME_ICONIFIED = 2552;
+
+  /**
+   * Internal frame last event
+   */
+  public static int INTERNAL_FRAME_LAST = 25555;
+
+  /**
+   * Internal frame opened event
+   */
+  public static int INTERNAL_FRAME_OPENED = 25550;
+
+  /**
+   * Creates a <code>JInternalFrameEvent</code> object.
+   * 
+   * @param source The source of this event.
+   * @param id Then event ID of this event.
+   */
+  public InternalFrameEvent(JInternalFrame source, int id)
+  {
+    super(source, id);
+  }
+
+  /**
+   * Returns the <code>JInternalFrame</code> object stored in this event.
+   */
+  public JInternalFrame getInternalFrame()
+  {
+    return source;
+  }
+}
index 4c6e39f00a3dc80f9dce4377b33a8df52c1d4a6e..46f567a5e425e1d753dbba5e6c150517b9a0d301 100644 (file)
@@ -41,99 +41,58 @@ package javax.swing.event;
 import java.util.EventObject;
 
 /**
- * ListDataEvent
  * @author Andrew Selkirk
  * @author Ronald Veldema
  */
-public class ListDataEvent extends EventObject {
-
-       //-------------------------------------------------------------
-       // Constants --------------------------------------------------
-       //-------------------------------------------------------------
+public class ListDataEvent extends EventObject
+{
+  private static final serialVersionUID = -7131487416250401903L;
+  
+  public static int CONTENTS_CHANGED = 0;
+  public static int INTERVAL_ADDED = 1;
+  public static int INTERVAL_REMOVED = 2;
+
+  private int type = 0;
+  private int index0 = 0;
+  private int index1 = 0;
        
-       /**
-        * Contents changed
-        */
-       public static   int     CONTENTS_CHANGED        = 0;
-
-       /**
-        * Internal added
-        */
-       public static   int     INTERVAL_ADDED          = 1;
-
-       /**
-        * Interval removed
-        */
-       public static   int     INTERVAL_REMOVED        = 2;
-
-
-       //-------------------------------------------------------------
-       // Variables --------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * type
-        */
-       private                 int     type    = 0;
-       
-       /**
-        * index0
-        */
-       private                 int     index0  = 0;
+  /**
+   * Creates a <code>ListDataEvent</code> object.
+   * 
+   * @param source The source of the event.
+   * @param type The type of the event
+   * @param index0 Bottom of range
+   * @param index1 Top of range
+   */
+  public ListDataEvent(Object source, int type, int index0, int index1)
+  {
+    super(source);
+    this.type = type;
+    this.index0 = index0;
+    this.index1 = index1;
+  }
        
-       /**
-        * index1
-        */
-       private                 int     index1  = 0;
-
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-       
-       /**
-        * Constructor ListDataEvent
-        * @param source Source
-        * @param type Event type
-        * @param index0 Bottom of range
-        * @param index1 Top of range
-        */
-       public ListDataEvent(Object source, int type,
-                                                       int index0, int index1) {
-               super(source);
-               this.type       = type;
-               this.index0     = index0;
-               this.index1     = index1;
-       } // ListDataEvent()
-
-
-       //-------------------------------------------------------------
-       // Methods ----------------------------------------------------
-       //-------------------------------------------------------------
-       
-       /**
-        * getIndex0
-        * @returns index0
-        */
-       public int getIndex0() {
-               return index0;
-       } // getIndex0()
-
-       /**
-        * getIndex1
-        * @returns index1
-        */
-       public int getIndex1() {
-               return index1;
-       } // getIndex1()
-
-       /**
-        * Event type
-        * @returns Event type
-        */
-       public int getType() {
-               return type;
-       } // getType()
-
-
-} // ListDataEvent
+  /**
+   * Returns the bottom index.
+   */
+  public int getIndex0()
+  {
+    return index0;
+  }
+
+  /**
+   * Returns the top index.
+   */
+  public int getIndex1()
+  {
+    return index1;
+  }
+
+  /**
+   * Returns the type of this event.
+   */
+  public int getType()
+  {
+    return type;
+  }
+}
index c5989558099821a8871de5a0c137533a06227e7c..222d194c91e1f8372f2412cec554a10c7353bfdf 100644 (file)
@@ -42,163 +42,116 @@ import java.util.EventObject;
 import javax.swing.table.TableModel;
 
 /**
- * TableModelEvent
  * @author Andrew Selkirk
  */
-public class TableModelEvent extends EventObject {
-
-       //-------------------------------------------------------------
-       // Constants --------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * ALL_COLUMNS
-        */
-       public static   int     ALL_COLUMNS             = -1;
-
-       /**
-        * DELETE
-        */
-       public static   int     DELETE                  = -1;
-
-       /**
-        * HEADER_ROW
-        */
-       public static   int     HEADER_ROW              = -1;
-
-       /**
-        * INSERT
-        */
-       public static   int     INSERT                  = 1;
-
-       /**
-        * UPDATE
-        */
-       public static   int     UPDATE                  = 0;
-
-
-       //-------------------------------------------------------------
-       // Variables --------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * column
-        */
-       protected               int     column                  = 0;
-       
-       /**
-        * firstRow
-        */
-       protected               int firstRow            = 0;
-       
-       /**
-        * lastRow
-        */
-       protected               int     lastRow                 = 0;
-
-       /**
-        * type
-        */
-       protected               int     type                    = 0;
-
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor TableModelEvent
-        * @param source Source object
-        */
-       public TableModelEvent(TableModel source) {
-               this(source, 0, source.getRowCount(), ALL_COLUMNS, UPDATE);
-       } // TableModelEvent()
-
-       /**
-        * Constructor TableModelEvent
-        * @param source Source table model
-        * @param row Updated row
-        */
-       public TableModelEvent(TableModel source, int row) {
-               this(source, row, row, ALL_COLUMNS, UPDATE);
-       } // TableModelEvent()
-
-       /**
-        * Constructor TableModelEvent
-        * @param source Source table model
-        * @param firstRow First row of update
-        * @param lastRow Last row of update
-        */
-       public TableModelEvent(TableModel source, int firstRow,
-                                                       int lastRow) {
-               this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE);
-       } // TableModelEvent()
-
-       /**
-        * Constructor TableModelEvent
-        * @param source Source table model
-        * @param firstRow First row of update
-        * @param lastRow Last row of update
-        * @param column Affected column
-        */
-       public TableModelEvent(TableModel source, int firstRow,
-                                                       int lastRow, int column) {
-               this(source, firstRow, lastRow, column, UPDATE);
-       } // TableModelEvent()
-
-       /**
-        * Constructor TableModelEvent
-        * @param source Source table model
-        * @param firstRow First row of update
-        * @param lastRow Last row of update
-        * @param column Affected column
-        * @param type Type of change
-        */
-       public TableModelEvent(TableModel source, int firstRow,
-                                                       int lastRow, int column, int type) {
-               super(source);
-               this.firstRow   = firstRow;
-               this.lastRow    = lastRow;
-               this.column             = column;
-               this.type               = type;
-       } // TableModelEvent()
-
-
-       //-------------------------------------------------------------
-       // Methods ----------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * getColumn
-        * @returns column
-        */
-       public int getColumn() {
-               return column;
-       } // getColumn()
-
-       /**
-        * getFirstRow
-        * @returns row
-        */
-       public int getFirstRow() {
-               return firstRow;
-       } // getFirstRow()
-
-       /**
-        * getLastRow
-        * @returns row
-        */
-       public int getLastRow() {
-               return lastRow;
-       } // getLastRow()
-
-       /**
-        * Get type
-        * @returns Type of event
-        */
-       public int getType() {
-               return type;
-       } // getType()
-
-
-} // TableModelEvent
+public class TableModelEvent extends EventObject
+{
+  private static final serialVersionUID = -7037680193569691706L;
+  
+  public static int ALL_COLUMNS = -1;
+  public static int DELETE = -1;
+  public static int HEADER_ROW = -1;
+  public static int INSERT = 1;
+  public static int UPDATE = 0;
+
+  protected int column = 0;
+  protected int firstRow = 0;
+  protected int lastRow = 0;
+  protected int type = 0;
+
+  /**
+   * Creates a <code>TableModelEvent</code> event.
+   * 
+   * @param source The source object
+   */
+  public TableModelEvent(TableModel source)
+  {
+    this(source, 0, source.getRowCount(), ALL_COLUMNS, UPDATE);
+  }
+
+  /**
+   * Creates a <code>TableModelEvent</code> event.
+   * 
+   * @param source The source object
+   * @param row The updated row
+   */
+  public TableModelEvent(TableModel source, int row)
+  {
+    this(source, row, row, ALL_COLUMNS, UPDATE);
+  }
+
+  /**
+   * Creates a <code>TableModelEvent</code> event.
+   * 
+   * @param source The source object
+   * @param firstRow The first row of update
+   * @param lastRow The last row of update
+   */
+  public TableModelEvent(TableModel source, int firstRow, int lastRow)
+  {
+    this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE);
+  }
+
+  /**
+   * Creates a <code>TableModelEvent</code> event.
+   * 
+   * @param source The source object
+   * @param firstRow The first row of update
+   * @param lastRow The last row of update
+   * @param column The affected column
+   */
+  public TableModelEvent(TableModel source, int firstRow, int lastRow, int column)
+  {
+    this(source, firstRow, lastRow, column, UPDATE);
+  }
+
+  /**
+   * Creates a <code>TableModelEvent</code> event.
+   * 
+   * @param source The source object
+   * @param firstRow The first row of update
+   * @param lastRow The last row of update
+   * @param column The affected column
+   * @param type The type of change
+   */
+  public TableModelEvent(TableModel source, int firstRow, int lastRow, int column, int type)
+  {
+    super(source);
+    this.firstRow = firstRow;
+    this.lastRow = lastRow;
+    this.column = column;
+    this.type = type;
+  }
+
+  /**
+   * Returns the affected column of this event.
+   */
+  public int getColumn()
+  {
+    return column;
+  }
+
+  /**
+   * Returns the first affected row of this event.
+   */
+  public int getFirstRow()
+  {
+    return firstRow;
+  }
+
+  /**
+   * Returns the last affected row of this event.
+   */
+  public int getLastRow()
+  {
+    return lastRow;
+  }
+
+  /**
+   * Returns the type of change of this event.
+   */
+  public int getType()
+  {
+    return type;
+  }
+}
index e11416dbf1f0b45e5f7dab7a5489ba91f3efcfb3..c286fef80166a76760c1dad9a78983577eda6a41 100644 (file)
@@ -42,22 +42,23 @@ import java.util.EventListener;
 import javax.swing.tree.ExpandVetoException;
 
 /**
- * TreeWillExpandListener interface
  * @author Andrew Selkirk
  */
-public interface TreeWillExpandListener extends EventListener {
+public interface TreeWillExpandListener extends EventListener
+{
+  /**
+   * Invoked whenever a node in the tree is about to be collapsed.
+   * 
+   * @param event The tree expansion Event
+   */
+  public void treeWillCollapse(TreeExpansionEvent event)
+    throws ExpandVetoException;
 
-       /**
-        * Tree will collapse
-        * @param event Tree Expansion Event
-        */
-       public void treeWillCollapse(TreeExpansionEvent event);
-
-       /**
-        * Tree will expand
-        * @param event Tree Expansion Event
-        */
-       public void treeWillExpand(TreeExpansionEvent event);
-
-
-} // TreeWillExpandListener
+  /**
+   * Invoked whenever a node in the tree is about to be expanded.
+   * 
+   * @param event The tree expansion Event
+   */
+  public void treeWillExpand(TreeExpansionEvent event)
+    throws ExpandVetoException;
+}  
index dba15f71c4fdc896c0c37f01a529df2a485b8f83..00832789c1fc39d5a7d879bcb57420bdfe841af2 100644 (file)
@@ -1,5 +1,5 @@
 /* ComponentUI.java
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -38,89 +38,291 @@ exception statement from your version. */
 
 package javax.swing.plaf;
 
-import java.awt.*;
-import javax.swing.border.*;
-import javax.swing.*;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import javax.accessibility.Accessible;
+import javax.swing.JComponent;
 
-import javax.accessibility.*;
 
+/**
+ * The abstract base class for all delegates that provide the
+ * pluggable look and feel for Swing components. User applications
+ * should not need to access this class; it is internal to Swing
+ * and the look-and-feel implementations.
+ *
+ * <p><img src="ComponentUI-1.png" width="700" height="550"
+ * alt="[UML diagram illustrating the architecture for pluggable
+ * look and feels]" />
+ *
+ * <p>Components such as {@link javax.swing.JSlider} do not directly
+ * implement operations related to the look and feel of the user
+ * interface, such as painting or layout. Instead, they use a delegate
+ * object for all such tasks. In the case of <code>JSlider</code>, the
+ * user interface would be provided by some concrete subclass of
+ * {@link javax.swing.plaf.SliderUI}.
+ *
+ * <p>Soon after its creation, a <code>ComponentUI</code> will be sent
+ * an {@link #installUI} message. The <code>ComponentUI</code> will
+ * react by setting properties such as the border or the background
+ * color of the <code>JComponent</code> for which it provides its
+ * services. Soon before the end of its lifecycle, the
+ * <code>ComponentUI</code> will receive an {@link #uninstallUI}
+ * message, at which time the <code>ComponentUI</code> is expected to
+ * undo any changes.
+ *
+ * <p>Note that the <code>ui</code> of a <code>JComponent</code>
+ * changes whenever the user switches between look and feels.  For
+ * example, the <code>ui</code> property of a <code>JSlider</code>
+ * could change from an instance of <code>MetalSliderUI</code> to an
+ * instance of <code>FooSliderUI</code>. This switch can happen at any
+ * time, but it will always be performed from inside the Swing thread.
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
 public abstract class ComponentUI 
-    implements UIResource // ??
 {
-    boolean contains(JComponent c, int x, int y)
-    {
-       return c.inside(x,y);
-    }
+  /**
+   * Constructs a new UI delegate.
+   */
+  public ComponentUI()
+  {
+  }
+  
+  
+  /**
+   * Sets up the specified component so it conforms the the design
+   * guidelines of the implemented look and feel. When the look and
+   * feel changes, a <code>ComponentUI</code> delegate is created.
+   * The delegate object then receives an <code>installUI</code>
+   * message.
+   *
+   * <p>This method should perform the following tasks:
+   *
+   * <ul><li>Set visual properties such as borders, fonts, colors, or
+   * icons. However, no change should be performed for those
+   * properties whose values have been directly set by the client
+   * application. To allow the distinction, LookAndFeels are expected
+   * to use values that implement the {@link UIResource} marker
+   * interface, such as {@link BorderUIResource} or {@link
+   * ColorUIResource}.</li>
+   *
+   * <li>If necessary, install a {@link java.awt.LayoutManager}.</li>
+   *
+   * <li>Embed custom sub-components. For instance, the UI delegate
+   * for a {@link javax.swing.JSplitPane} might install a special
+   * component for the divider.</li>
+   *
+   * <li>Register event listeners.</li>
+   *
+   * <li>Set up properties related to keyborad navigation, such as
+   * mnemonics or focus traversal policies.</li></ul>
+   *
+   * @param c the component for which this delegate will provide
+   *        services.
+   *
+   * @see #uninstallUI
+   * @see javax.swing.JComponent#setUI
+   * @see javax.swing.JComponent#updateUI
+   */
+  public void installUI(JComponent c)
+  {
+    // The default implementation does not change any properties.
+  }
 
-    // this SHOULD thow an error:
-    public static ComponentUI createUI(JComponent c)
-    {
-       Exception e = new Exception("createUI from ComponentUI should never be called");
-       e.printStackTrace();
-       System.exit(1);
-       return null;
-    }
 
-    public Accessible getAccessibleChild(JComponent c, int i)
-    {
-       //Return the nth Accessible child of the object. 
-       return null;
-    }
+  /**
+   * Puts the specified component into the state it had before
+   * {@link #installUI} was called.
+   *
+   * @param c the component for which this delegate has provided
+   *        services.
+   *
+   * @see #installUI
+   * @see javax.swing.JComponent#setUI
+   * @see javax.swing.JComponent#updateUI
+   */
+  public void uninstallUI(JComponent c)
+  {
+    // The default implementation does not change any properties.
+  }
+  
+  
+  /**
+   * Paints the component according to the design guidelines
+   * of the look and feel. Most subclasses will want to override
+   * this method.
+   *
+   * @param g the graphics for painting.
+   *
+   * @param c the component for which this delegate performs
+   *          services.
+   */
+  public void paint(Graphics g, JComponent c)
+  {
+  }
   
-    public int getAccessibleChildrenCount(JComponent c)
-    {
-       //Returns the number of accessible children in the object. 
-       return 0;
-    }
   
-    public Dimension getMaximumSize(JComponent c)
+  /**
+   * Fills the specified component with its background color
+   * (unless the <code>opaque</code> property is <code>false</code>)
+   * before calling {@link #paint}.
+   *
+   * <p>It is unlikely that a subclass needs to override this method.
+   * The actual rendering should be performed by the {@link #paint}
+   * method.
+   *
+   * @param g the graphics for painting.
+   *
+   * @param c the component for which this delegate performs
+   *          services.
+   *
+   * @see #paint
+   * @see javax.swing.JComponent#paintComponent
+   */
+  public void update(Graphics g, JComponent c)
+  {
+    if (c.isOpaque())
     {
-       return getPreferredSize(c);
+      g.setColor(c.getBackground());
+      g.fillRect(0, 0, c.getWidth(), c.getHeight());
     }
+    paint(g, c);
+  }
+  
+  
+  /**
+   * Determines the preferred size of a component. The default
+   * implementation returns <code>null</code>, which means that
+   * <code>c</code>&#x2019;s layout manager should be asked to
+   * calculate the preferred size.
+   *
+   * @param c the component for which this delegate performs services.
+   *
+   * @return the preferred size, or <code>null</code> to indicate that
+   *         <code>c</code>&#x2019;s layout manager should be asked
+   *         for the preferred size.
+   */
+  public Dimension getPreferredSize(JComponent c)
+  {
+    return null;
+  }
+  
+  
+  /**
+   * Determines the minimum size of a component. The default
+   * implementation calls {@link #getPreferredSize}, but subclasses
+   * might want to override this.
+   *
+   * @param c the component for which this delegate performs services.
+   *
+   * @return the minimum size, or <code>null</code> to indicate that
+   *         <code>c</code>&#x2019;s layout manager should be asked
+   *         to calculate the minimum size.
+   */
+  public Dimension getMinimumSize(JComponent c)
+  {
+    return getPreferredSize(c);
+  }
 
-    public Dimension getMinimumSize(JComponent c)
-    {
-       return getPreferredSize(c);
-    }
 
-    public Dimension getPreferredSize(JComponent c)
-    {
-       return null;
-    }
+  /**
+   * Determines the maximum size of a component. The default
+   * implementation calls {@link #getPreferredSize}, but subclasses
+   * might want to override this.
+   *
+   * @param c the component for which this delegate performs services.
+   *
+   * @return the maximum size, or <code>null</code> to indicate that
+   *         <code>c</code>&#x2019;s layout manager should be asked
+   *         to calculate the maximum size.
+   */
+  public Dimension getMaximumSize(JComponent c)
+  {
+    return getPreferredSize(c);
+  }
 
-    public void installUI(JComponent c)
-    {
-       String id = c.getUIClassID() + ".border";
-
-       Border s = UIManager.getBorder( id );
-       
-       if (s != null)
-           {
-               c.setBorder( s );
-               //System.out.println("OK-INSTALL: " + this + ", ID=" + id + ",B="+s);
-           }
-       else
-           {
-               ///System.out.println("FAIL-INSTALL: " + this + ", " + id);
-           }   
-    }
 
-    public void paint(Graphics g, JComponent c)
-    {
-       //  System.out.println("UI-COMPONENT-> unimplemented paint: " + c + ", UI="+this);
-    }
+  /**
+   * Determines whether a click into the component at a specified
+   * location is considered as having hit the component. The default
+   * implementation checks whether the point falls into the
+   * component&#x2019;s bounding rectangle. Some subclasses might want
+   * to override this, for example in the case of a rounded button.
+   *
+   * @param c the component for which this delegate performs services.
+   *
+   * @param x the x coordinate of the point, relative to the local
+   *        coordinate system of the component. Zero would be be
+   *        component&#x2019;s left edge, irrespective of the location
+   *        inside its parent.
+   *
+   * @param y the y coordinate of the point, relative to the local
+   *        coordinate system of the component. Zero would be be
+   *        component&#x2019;s top edge, irrespective of the location
+   *        inside its parent.
+   */
+  public boolean contains(JComponent c, int x, int y)
+  {    
+    /* JComponent.contains calls the ui delegate for hit
+     * testing. Therefore, endless mutual recursion would result if we
+     * called c.contains(x, y) here.
+     *
+     * The previous Classpath implementation called the deprecated
+     * method java.awt.Component.inside. In the Sun implementation, it
+     * can be observed that inside, other than contains, does not call
+     * the ui delegate.  But that inside() behaves different to
+     * contains() clearly is in violation of the method contract, and
+     * it is not something that a good implementation should rely upon
+     * -- even if Classpath ends up being forced to replicate this
+     * apparent bug of the Sun implementation.
+     */
+    return (x >= 0) && (x < c.getWidth())
+      && (y >= 0) && (y < c.getHeight());
+  }
+  
+  
+  /**
+   * Creates a delegate object for the specified component.  Users
+   * should use the <code>createUI</code> method of a suitable
+   * subclass. The implementation of <code>ComponentUI</code>
+   * always throws an error.
+   *
+   * @param c the component for which a UI delegate is requested.
+   */
+  public static ComponentUI createUI(JComponent c)
+  {
+    throw new Error(
+      "javax.swing.plaf.ComponentUI does not implement createUI; call "
+      + "createUI on a subclass.");
+  }
+  
 
-    public void uninstallUI(JComponent c)
-    {  
-    }
+  /**
+   * Counts the number of accessible children in the component.  The
+   * default implementation delegates the inquiry to the {@link
+   * javax.accessibility.AccessibleContext} of <code>c</code>.
+   *
+   * @param c the component whose accessible children
+   *        are to be counted.
+   */
+  public int getAccessibleChildrenCount(JComponent c)
+  {
+    return c.getAccessibleContext().getAccessibleChildrenCount();
+  }
 
-    public void update(Graphics g, JComponent c) {
-        if (c.isOpaque()) {
-            g.setColor(c.getBackground());
-            g.fillRect(0, 0, c.getWidth(),c.getHeight());
-        }
-        paint(g, c);
-    }
-         
-}
 
+  /**
+   * Returns the specified accessible child of the component. The
+   * default implementation delegates the inquiry to the {@link
+   * javax.accessibility.AccessibleContext} of <code>c</code>.
+   *
+   * @param i the index of the accessible child, starting at zero.
+   *
+   * @param c the component whose <code>i</code>-th accessible child
+   *        is requested.
+   */
+  public Accessible getAccessibleChild(JComponent c, int i)
+  {
+    return c.getAccessibleContext().getAccessibleChild(i);
+  }
+}
index 880fa43915cf857c54f3eb7cca301f39de223f2c..0e6f63ad2cf85843934fc99d75282a9fec47e086 100644 (file)
@@ -1,5 +1,5 @@
 /* DesktopIconUI.java --
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -38,22 +38,19 @@ exception statement from your version. */
 package javax.swing.plaf;
 
 /**
- * DesktopIconUI
- * @author     Andrew Selkirk
- * @version    1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a desktop icon.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public abstract class DesktopIconUI extends ComponentUI {
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor DesktopIconUI
-        */
-       public DesktopIconUI() {
-               // TODO
-       } // DesktopIconUI()
-
-
-} // DesktopIconUI
+public abstract class DesktopIconUI
+  extends ComponentUI
+{
+  /**
+   * Constructs a new <code>DesktopIconUI</code>.
+   */
+  public DesktopIconUI()
+  {
+  }
+}
index 9cb278839fbdd7928eee419028fcc3ed0a82a089..61bad7232166d0f387b391b60057822a7e4791f5 100644 (file)
@@ -1,5 +1,5 @@
 /* DesktopPaneUI.java --
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -38,22 +38,22 @@ exception statement from your version. */
 package javax.swing.plaf;
 
 /**
- * DesktopPaneUI
- * @author     Andrew Selkirk
- * @version    1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JDesktopPane</code>.
+ *
+ * @see javax.swing.JDesktopPane
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public abstract class DesktopPaneUI extends ComponentUI {
+public abstract class DesktopPaneUI
+  extends ComponentUI
+{
+  /**
+   * Constructs a new <code>DesktopPaneUI</code>.
+   */
+  public DesktopPaneUI()
+  {
+  }
+}
 
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor DesktopPaneUI
-        */
-       public DesktopPaneUI() {
-               // TODO
-       } // DesktopPaneUI()
-
-
-} // DesktopPaneUI
index 52ea7a912f6933d7571fbae058325a208ccb83b6..3f64b30abf2cb95ba3a29ff94f9b43963eb6bd1b 100644 (file)
@@ -1,5 +1,5 @@
 /* DimensionUIResource.java
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -37,14 +37,32 @@ exception statement from your version. */
 
 
 package javax.swing.plaf;
+
 import java.awt.Dimension;
+
 /**
- * STUBBED
+ * A Dimension that is marked as <code>UIResource</code>, which
+ * indicates that it has been installed by a pluggable
+ * LookAndFeel. Such dimensions are replaced when the LookAndFeel
+ * changes.
+ *
+ * @see java.awt.Dimension
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public class DimensionUIResource extends Dimension implements UIResource
+public class DimensionUIResource
+  extends Dimension
+  implements UIResource
 {
-  public DimensionUIResource(int w, int h)
+  /**
+   * Constructs a new DimensionUIResource, given its width and height.
+   *
+   * @param width the width in pixels.
+   * @param height the height in pixels.
+   */
+  public DimensionUIResource(int width, int height)
   {
-    super(w, h);
+    super(width, height);
   }
-} // class DimensionUIResource
+}
index 00595eb7c66ab46cf4a76094b8fcda43fe69c224..193362ee60563234da4b62c22dbf41fec8dadd34 100644 (file)
@@ -1,5 +1,5 @@
 /* FileChooserUI.java --
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -37,75 +37,100 @@ exception statement from your version. */
 
 package javax.swing.plaf;
 
-// Imports
-import java.io.*;
-import javax.swing.*;
-import javax.swing.filechooser.*;
+import java.io.File;
+import javax.swing.JFileChooser;
 import javax.swing.filechooser.FileFilter;
+import javax.swing.filechooser.FileView;
 
 /**
- * FileChooserUI
- * @author     Andrew Selkirk
- * @version    1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JFileChooser</code>.
+ *
+ * @see javax.swing.JFileChooser
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public abstract class FileChooserUI extends ComponentUI {
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor FileChooserUI
-        */
-       public FileChooserUI() {
-               // TODO
-       } // FileChooserUI()
-
-
-       //-------------------------------------------------------------
-       // Methods ----------------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * getAcceptAllFileFilter
-        * @param chooser TODO
-        * @returns FileFilter
-        */
-       public abstract FileFilter getAcceptAllFileFilter(JFileChooser chooser);
-
-       /**
-        * getFileView
-        * @param chooser TODO
-        * @returns FileView
-        */
-       public abstract FileView getFileView(JFileChooser chooser);
-
-       /**
-        * getApproveButtonText
-        * @param chooser TODO
-        * @returns String
-        */
-       public abstract String getApproveButtonText(JFileChooser chooser);
-
-       /**
-        * getDialogTitle
-        * @param chooser TODO
-        * @returns String
-        */
-       public abstract String getDialogTitle(JFileChooser chooser);
-
-       /**
-        * rescanCurrentDirectory
-        * @param value0 TODO
-        */
-       public abstract void rescanCurrentDirectory(JFileChooser chooser);
-
-       /**
-        * ensureFileIsVisible
-        * @param chooser TODO
-        * @param file TODO
-        */
-       public abstract void ensureFileIsVisible(JFileChooser chooser, File file);
-
-
-} // FileChooserUI
+public abstract class FileChooserUI
+  extends ComponentUI
+{
+  /**
+   * Constructs a new <code>FileChooserUI</code>.
+   */
+  public FileChooserUI()
+  {
+  }
+
+  
+  /**
+   * Returns a <code>FileFilter</code> that accepts every file.  While
+   * the filtering itself is not specific to any look and feel, the
+   * text returned by <code>FileFilter.getDescription()</code> need
+   * not be the same across all look and feels.
+   *
+   * @param chooser the <code>JFileChooser</code> for which
+   *        a <code>FileFilter</code> is requested.
+   *
+   * @see javax.swing.JFileChooser#getAcceptAllFileFilter
+   * @see javax.swing.filechooser.FileFilter#getDescription
+   */
+  public abstract FileFilter getAcceptAllFileFilter(JFileChooser chooser);
+
+
+  /**
+   * Returns a view to a file, which is able to retrieve its name,
+   * icon, and other properties that are relevant for presenting
+   * the file to the user.
+   *
+   * @param chooser the <code>JFileChooser</code> for which
+   *        a <code>FileFilter</code> is requested.
+   */
+  public abstract FileView getFileView(JFileChooser chooser);
+
+
+  /**
+   * Determines which text is appropriate for the approve button
+   * according to the design guidelines of the implemented
+   * look and feel.
+   *
+   * @param chooser the <code>JFileChooser</code> whose
+   *        button text is requested.
+   *
+   * @see javax.swing.JFileChoose#getApproveButtonText
+   */
+  public abstract String getApproveButtonText(JFileChooser chooser);
+
+
+  /**
+   * Determines which text is appropriate for the title bar of a
+   * <code>JFileChooser</code> according to the design guidelines of
+   * the implemented look and feel.
+   *
+   * @param chooser the <code>JFileChooser</code> whose
+   *        dialog title is requested.
+   *
+   * @see javax.swing.JFileChoose#getDialogtitle
+   */
+  public abstract String getDialogTitle(JFileChooser chooser);
+
+
+  /**
+   * Refreshes the currently displayed directory.
+   *
+   * @param chooser the <code>JFileChooser</code> whose
+   *        dialog title needs re-scanning.
+   */
+  public abstract void rescanCurrentDirectory(JFileChooser chooser);
+
+
+  /**
+   * Ensures that a specified file is visible in the
+   * <code>JFileChooser</code>
+   *
+   * @param chooser the <code>JFileChooser</code> that
+   *        should display the file <code>file</code>.
+   *
+   * @param file the file that needs to be made visible.
+   */
+  public abstract void ensureFileIsVisible(JFileChooser chooser, File file);
+}
index e158ced74037668e8833d0b888dcfdbc672714a1..e906035711bb111a1687a09a873cb79a310596d0 100644 (file)
@@ -1,5 +1,5 @@
 /* FontUIResource.java
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -37,18 +37,65 @@ exception statement from your version. */
 
 
 package javax.swing.plaf;
+
 import java.awt.Font;
+
+
 /**
- * STUBBED
+ * A font that is marked as <code>UIResource</code>, which
+ * indicates that it has been installed by a pluggable
+ * LookAndFeel. Such dimensions are replaced when the LookAndFeel
+ * changes.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public class FontUIResource extends Font implements UIResource
+public class FontUIResource
+  extends Font
+  implements UIResource
 {
-  public FontUIResource(Font f)
-  {
-    super(f.getName(), f.getStyle(), f.getSize());
-  }
+  /**
+   * Constructs a new <code>FontUIResource</code> given
+   * the name, style and size of the font.
+   *
+   * @param name the name of the font. A number of
+   *        &#x201c;logical&#x201d; names are supported by any Java
+   *        implementation. These are
+   *        <code>&#x201c;Dialog&#x201d;</code>,
+   *        <code>&#x201c;DialogInput&#x201d;</code>,
+   *        <code>&#x201c;Monospaced&#x201d;</code>,
+   *        <code>&#x201c;Serif&#x201d;</code>, and
+   *        <code>&#x201c;SansSerif&#x201d;</code>.
+   *
+   * @param style the style of the font, for instance {@link
+   *        java.awt.Font#BOLD} or {@link java.awt.Font#PLAIN}.
+   *
+   * @param size the size of the font in typographic points, for
+   *        instance 10, 12 or 13. Designers of LookAndFeels should be
+   *        aware that some languages (like Japanese and Chinese) have
+   *        glyphs that are too complex to be legible at small point
+   *        sizes.
+   */
   public FontUIResource(String name, int style, int size)
   {
     super(name, style, size);
   }
-} // class FontUIResource
+
+
+  /**
+   * Constructs a new <code>FontUIResource</code> given
+   * an existing font.
+   *
+   * @param f the font that serves as a template.
+   */
+  public FontUIResource(Font f)
+  {
+    /* This implementation will get rid of many font properties,
+     * such as skewing, values of multiple master design axes,
+     * etc.,  unless they get encoded into the name.  It probably
+     * is not a problem for LookAndFeels because user interfaces
+     * are usually not very advanced with respect to typography.
+     */
+    super(f.getName(), f.getStyle(), f.getSize());
+  }
+}
index 2d948d7823dfcb9d3aa262c8d31249c75540711b..7097d8797907d04525d860419bb685b192f2c779 100644 (file)
@@ -1,5 +1,5 @@
 /* IconUIResource.java
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -37,29 +37,86 @@ exception statement from your version. */
 
 
 package javax.swing.plaf;
+
 import java.awt.Component;
 import java.awt.Graphics;
 import java.io.Serializable;
 import javax.swing.Icon;
+
+
 /**
- * STUBBED
+ * An icon that is marked as <code>UIResource</code>, which
+ * indicates that it has been installed by a pluggable
+ * LookAndFeel. Such icons are replaced when the LookAndFeel
+ * changes.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public class IconUIResource implements Icon, UIResource, Serializable
+public class IconUIResource
+  implements Icon, UIResource, Serializable
 {
+  /**
+   * Verified using the <code>serialver</code> tool of Sun JDK 1.4.1_01
+   * on GNU/Linux 2.4.18.
+   */
   static final long serialVersionUID = 3327049506004830542L;
 
+
+  /**
+   * The icon that is wrapped by this <code>IconUIResource</code>.
+   */
+  private Icon delegate;
+
+
+  /**
+   * Constructs a <code>IconUIResource</code> that wraps another
+   * icon. All messages are forwarded to the delegate icon.
+   *
+   * @param delegate the icon that is wrapped by this
+   *        <code>IconUIResource</code>.
+   */
   public IconUIResource(Icon delegate)
   {
+    this.delegate = delegate;
   }
+
+
+  /**
+   * Paints the icon by asking the delegate icon to paint itself.
+   *
+   * @param c the Component whose icon is being painted. Some icons
+   *        use this argument to retrieve properties like the
+   *        background color.
+   *
+   * @param g the graphics into which the icon will be painted.
+   *
+   * @param x the horizontal position of the icon.
+   *
+   * @param y the vertical position of the icon.
+   */
   public void paintIcon(Component c, Graphics g, int x, int y)
   {
+    delegate.paintIcon(c, g, x, y);
   }
+
+
+  /**
+   * Returns the width of the icon in pixels. The implementation
+   * determines and returns the width of the delegate icon.
+   */
   public int getIconWidth()
   {
-    return 0;
+    return delegate.getIconWidth();
   }
+
+
+  /**
+   * Returns the height of the icon in pixels. The implementation
+   * determines and returns the height of the delegate icon.
+   */
   public int getIconHeight()
   {
-    return 0;
+    return delegate.getIconHeight();
   }
-} // class IconUIResource
+}
index 4d6793bd0a89e11aca2a4010dfc8b3d47c57fc96..5bcc76da97321c56e223b9f2e61618fb86b38214 100644 (file)
@@ -1,5 +1,5 @@
 /* InputMapUIResource.java --
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -37,26 +37,27 @@ exception statement from your version. */
 
 package javax.swing.plaf;
 
-// Imports
-import javax.swing.*;
+import javax.swing.InputMap;
+
 
 /**
- * InputMapUIResource
- * @author     Andrew Selkirk
- * @version    1.0
+ * An <code>InputMap</code> that is marked as <code>UIResource</code>,
+ * which indicates that it has been installed by a pluggable
+ * LookAndFeel. Such dimensions are replaced when the LookAndFeel
+ * changes.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public class InputMapUIResource extends InputMap implements UIResource {
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor InputMapUIResource
-        */
-       public InputMapUIResource() {
-               // TODO
-       } // InputMapUIResource()
-
+public class InputMapUIResource
+  extends InputMap
+  implements UIResource
+{
+  /**
+   * Constructs a new <code>InputMapUIResource</code>.
+   */
+  public InputMapUIResource()
+  {
+  }
+}
 
-} // InputMapUIResource
index 7c989ab2ee0d61c547fdd0e40f2332551050e201..cdedc832f0aed34b52637f2ffec277c14dbba218 100644 (file)
@@ -1,5 +1,5 @@
 /* InsetsUIResource.java
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -37,14 +37,41 @@ exception statement from your version. */
 
 
 package javax.swing.plaf;
+
 import java.awt.Insets;
+import java.io.Serializable;
+
+
 /**
- * STUBBED
+ * An <code>Insets</code> that is marked as <code>UIResource</code>,
+ * which indicates that it has been installed by a pluggable
+ * LookAndFeel. Such insets are replaced when the LookAndFeel changes.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public class InsetsUIResource extends Insets implements UIResource
+public class InsetsUIResource
+  extends Insets
+  implements Cloneable, UIResource, Serializable
 {
+  /**
+   * Determined using the <code>serialver</code> tool
+   * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+   */
+  static final long serialVersionUID = 5622110143266315421L;
+
+
+  /**
+   * Constructs a new <code>InsetsUIResource</code> given the
+   * inset at each edge.
+   *
+   * @param top the inset at the top, in pixels.
+   * @param left the inset at the left, in pixels.
+   * @param bottom the inset at the bottom, in pixels.
+   * @param right the inset at the right, in pixels.
+   */
   public InsetsUIResource(int top, int left, int bottom, int right)
   {
     super(top, left, bottom, right);
   }
-} // class InsetsUIResource
+}
index 3019460c74a60fa2541228554f008bca030a9384..0e1ae59aed1988779eebc2f59aa0b25e7d46229d 100644 (file)
@@ -1,5 +1,5 @@
 /* InternalFrameUI.java --
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -37,23 +37,23 @@ exception statement from your version. */
 
 package javax.swing.plaf;
 
+
 /**
- * InternalFrameUI
- * @author     Andrew Selkirk
- * @version    1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JInternalFrame</code>.
+ *
+ * @see javax.swing.JInternalFrame
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public abstract class InternalFrameUI extends ComponentUI {
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor InternalFrameUI
-        */
-       public InternalFrameUI() {
-               // TODO
-       } // InternalFrameUI()
-
-
-} // InternalFrameUI
+public abstract class InternalFrameUI
+  extends ComponentUI
+{
+  /**
+   * Constructs a new <code>InternalFrameUI</code>.
+   */
+  public InternalFrameUI()
+  {
+  }
+}
index dc70ae284a88f5010c9a811ecb8750a965f0a5dd..3a5025e9508de3a826144a3d6f9b18988a57576c 100644 (file)
@@ -1,5 +1,5 @@
 /* LabelUI.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,22 @@ exception statement from your version. */
 
 package javax.swing.plaf;
 
-
-public class LabelUI extends ComponentUI
+/**
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JLabel</code>.
+ *
+ * @see javax.swing.JLabel
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class LabelUI
+  extends ComponentUI
 {
+  /**
+   * Constructs a new <code>LabelUI</code>.
+   */
+  public LabelUI()
+  {
+  }
 }
index be60eb4863b4b79bd8e70d719c3485c59f25a0a3..2e798b95a49a367e4351d7c88496c3e058420bef 100644 (file)
@@ -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);
 }
index 84c29d13ef5199c6391d27c4bdb335329f3177e6..a107a3e0304ae3773c5a31b346fcd88330f7baa0 100644 (file)
@@ -1,5 +1,5 @@
 /* MenuBarUI.java --
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -37,23 +37,23 @@ exception statement from your version. */
 
 package javax.swing.plaf;
 
+
 /**
- * MenuBarUI
- * @author     Andrew Selkirk
- * @version    1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JMenuBar</code>.
+ *
+ * @see javax.swing.JMenuBar
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public abstract class MenuBarUI extends ComponentUI {
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor MenuBarUI
-        */
-       public MenuBarUI() {
-               // TODO
-       } // MenuBarUI()
-
-
-} // MenuBarUI
+public abstract class MenuBarUI
+  extends ComponentUI
+{
+  /**
+   * Constructs a new <code>MenuBarUI</code>.
+   */
+  public MenuBarUI()
+  {
+  }
+}
index a9271219c8356015693f144a37dd81a474acb25e..3fa30a83b688119714622980eed9afae5a0596d7 100644 (file)
@@ -1,5 +1,5 @@
 /* MenuItemUI.java --
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -37,23 +37,23 @@ exception statement from your version. */
 
 package javax.swing.plaf;
 
+
 /**
- * MenuItemUI
- * @author     Andrew Selkirk
- * @version    1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JMenuItem</code>.
+ *
+ * @see javax.swing.JMenuItem
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public abstract class MenuItemUI extends ButtonUI {
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor MenuItemUI
-        */
-       public MenuItemUI() {
-               // TODO
-       } // MenuItemUI()
-
-
-} // MenuItemUI
+public abstract class MenuItemUI
+  extends ButtonUI
+{
+  /**
+   * Constructs a new <code>MenuItemUI</code>.
+   */
+  public MenuItemUI()
+  {
+  }
+}
index 94de794329294dab159e4d0eeb0861a577e0f349..e9ee57c164a23cc013c2abd326d8136d48667df5 100644 (file)
@@ -1,5 +1,5 @@
 /* OptionPaneUI.java
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -35,10 +35,41 @@ this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
-
 package javax.swing.plaf;
-import javax.accessibility.*;
 
-public class OptionPaneUI extends ComponentUI
+import javax.swing.JOptionPane;
+
+/**
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JOptionPane</code>.
+ *
+ * @see javax.swing.JOptionPane
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class OptionPaneUI
+  extends ComponentUI
 {
+  /**
+   * Gives keyboard input focus to the component that represents
+   * the default value.
+   *
+   * @param pane the <code>JOptionPane</code> for which this delegate
+   *        object provides the pluggable user interface.
+   */
+  public abstract void selectInitialValue(JOptionPane pane);
+
+
+  /**
+   * Determines whether the user has provided custom components
+   * for the options or the message.
+   *
+   * @param pane the <code>JOptionPane</code> for which this delegate
+   *        object provides the pluggable user interface.
+   *
+   * @return <code>true</code> if the user has supplied any custom
+   *         components; <code>false</code> if all components are
+   *         provided by Swing or a LookAndFeel.
+   */
+  public abstract boolean containsCustomComponents(JOptionPane pane);
 }
index 8a418342e8297dd5e6a720567d3b031ded73992f..7030925ecae6ae26ab817a798c4cfa4be942d933 100644 (file)
@@ -1,5 +1,5 @@
 /* PanelUI.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,21 @@ exception statement from your version. */
 
 package javax.swing.plaf;
 
-
-public class PanelUI extends ComponentUI
+/**
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JPanel</code>.
+ *
+ * @see javax.swing.JPanel
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class PanelUI
+  extends ComponentUI
 {
+  /**
+   * Constructs a new <code>PanelUI</code>.
+   */
+  public PanelUI()
+  {
+  }
 }
index c5f6466e7abd059bf3781337012a0188a268e061..7b60e0b05e4202f36f1f74ef8c2f76938a9e9cf2 100644 (file)
@@ -1,5 +1,5 @@
 /* ProgressBarUI.java --
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -37,23 +37,23 @@ exception statement from your version. */
 
 package javax.swing.plaf;
 
+
 /**
- * ProgressBarUI
- * @author     Andrew Selkirk
- * @version    1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JProgressBar</code>.
+ *
+ * @see javax.swing.JProgressBar
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
  */
-public abstract class ProgressBarUI extends ComponentUI {
-
-       //-------------------------------------------------------------
-       // Initialization ---------------------------------------------
-       //-------------------------------------------------------------
-
-       /**
-        * Constructor ProgressBarUI
-        */
-       public ProgressBarUI() {
-               // TODO
-       } // ProgressBarUI()
-
-
-} // ProgressBarUI
+public abstract class ProgressBarUI
+  extends ComponentUI
+{
+  /**
+   * Constructs a new <code>ProgressBarUI</code>.
+   */
+  public ProgressBarUI()
+  {
+  }
+}
index a78d97b90e68fbc3229f179fce8721ca07ca5f62..02bfbbe90f11fba4c63b0c6ec9e591c0f5824e18 100644 (file)
Binary files a/libjava/javax/swing/plaf/doc-files/ComponentUI-1.dia and b/libjava/javax/swing/plaf/doc-files/ComponentUI-1.dia differ
index da4a0fc8dc9c7a4ab1bf6360ea773f8faacaa8e8..def4cbc6c47a6201d1984d30ad36d37955ff4be1 100644 (file)
Binary files a/libjava/javax/swing/plaf/doc-files/ComponentUI-1.png and b/libjava/javax/swing/plaf/doc-files/ComponentUI-1.png differ