Commit bbe53f03 by Michael Koch Committed by Michael Koch

AncestorEvent.java, [...]: New versions from classpath.

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
parent 7aff2f28
2003-06-24 Michael Koch <konqueror@gmx.de> 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 * java/nio/Buffer.java
(cap): Made package-private. (cap): Made package-private.
(pos): Likewise. (pos): Likewise.
......
...@@ -43,99 +43,57 @@ import java.awt.Container; ...@@ -43,99 +43,57 @@ import java.awt.Container;
import javax.swing.JComponent; import javax.swing.JComponent;
/** /**
* Ancestor Event
* @author Andrew Selkirk * @author Andrew Selkirk
* @author Ronald Veldema * @author Ronald Veldema
*/ */
public class AncestorEvent extends AWTEvent { public class AncestorEvent extends AWTEvent
{
private static final serialVersionUID = 4799843792513591457L;
//-------------------------------------------------------------
// Constants --------------------------------------------------
//-------------------------------------------------------------
/**
* ANCESTOR_ADDED constant
*/
public static int ANCESTOR_ADDED = 0; public static int ANCESTOR_ADDED = 0;
/**
* ANCESTOR_MOVED constant
*/
public static int ANCESTOR_MOVED = 1; public static int ANCESTOR_MOVED = 1;
/**
* ANCESTOR_REMOVED constant
*/
public static int ANCESTOR_REMOVED = 2; public static int ANCESTOR_REMOVED = 2;
private JComponent sourceComponent;
//------------------------------------------------------------- private Container ancestor;
// Variables -------------------------------------------------- private Container ancestorParent;
//-------------------------------------------------------------
/**
* 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 source Source component
* @param id ID * @param id ID
* @param ancestor ancestor * @param ancestor ancestor
* @param ancestorParent parent ancestor * @param ancestorParent parent ancestor
*/ */
public AncestorEvent(JComponent source, int id, Container ancestor, public AncestorEvent(JComponent source, int id, Container ancestor,
Container ancestorParent) { Container ancestorParent)
{
super(source, id); super(source, id);
this.sourceComponent = source; this.sourceComponent = source;
this.ancestor = ancestor; this.ancestor = ancestor;
this.ancestorParent = ancestorParent; this.ancestorParent = ancestorParent;
} // AncestorEvent() }
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/** /**
* Get ancestor * Returns the ancestor of this event.
* @return ancestor
*/ */
public Container getAncestor() { public Container getAncestor()
{
return ancestor; return ancestor;
} // getAncestor() }
/** /**
* Get ancestor parent * Returns the ancester parent of this event.
* @return ancestor parent
*/ */
public Container getAncestorParent() { public Container getAncestorParent()
{
return ancestorParent; return ancestorParent;
} // getAncestorParent() }
/** /**
* Get component * Returns the source of this event.
* @return component
*/ */
public JComponent getComponent() { public JComponent getComponent()
{
return sourceComponent; return sourceComponent;
} // getComponent() }
}
} // AncestorEvent
...@@ -43,155 +43,117 @@ import java.util.EventObject; ...@@ -43,155 +43,117 @@ import java.util.EventObject;
import javax.swing.text.Element; import javax.swing.text.Element;
/** /**
* HyperlinkEvent
* @author Andrew Selkirk * @author Andrew Selkirk
* @author Ronald Veldema * @author Ronald Veldema
*/ */
public class HyperlinkEvent extends EventObject public class HyperlinkEvent extends EventObject
{ {
public static final class EventType
//------------------------------------------------------------- {
// Classes ----------------------------------------------------
//-------------------------------------------------------------
/**
* EventType
*/
public static final class EventType {
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
/**
* ENTERED
*/
public static final EventType ENTERED = new EventType("ENTERED"); // TODO public static final EventType ENTERED = new EventType("ENTERED"); // TODO
/**
* EXITED
*/
public static final EventType EXITED = new EventType("EXITED"); // TODO public static final EventType EXITED = new EventType("EXITED"); // TODO
/**
* ACTIVATED
*/
public static final EventType ACTIVATED = new EventType("ACTIVATED"); // TODO public static final EventType ACTIVATED = new EventType("ACTIVATED"); // TODO
/**
* type
*/
private String type; private String type;
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor EventType * Creates a new Event type.
* @param type TODO *
* @param type String representing the event type.
*/ */
private EventType(String type) { private EventType(String type)
{
this.type = type; this.type = type;
} // EventType() }
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/** /**
* toString * Returns a <code>String</code> of this object.
* @returns String
*/ */
public String toString() { public String toString()
return type; // TODO {
} // toString() return type;
}
}
} // EventType
//------------------------------------------------------------- private static final long serialVersionUID = -8168964465779154277L;
// Variables --------------------------------------------------
//-------------------------------------------------------------
/**
* type
*/
private EventType type; private EventType type;
/**
* url
*/
private URL url; private URL url;
private String description;
private Element element;
/** /**
* description * 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.
*/ */
private String description; public HyperlinkEvent(Object source, EventType type, URL url)
{
this (source, type, url, null, null);
}
/**
//------------------------------------------------------------- * Creates a new <code>HyperlinkEvent</code> with the given arguments.
// Initialization --------------------------------------------- *
//------------------------------------------------------------- * @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);
}
/** /**
* Constructor HyperlinkEvent * Creates a new <code>HyperlinkEvent</code> with the given arguments.
* @param source TODO *
* @param type TODO * @param source The object this link is associated to.
* @param url TODO * @param type The type of event.
*/ * @param url The URL this link pointing too.
public HyperlinkEvent(Object source, EventType type, URL url) { * @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); super(source);
this.type = type; this.type = type;
this.url = url; this.url = url;
this.description = null; this.description = description;
} // HyperlinkEvent() this.element = element;
}
/** /**
* Constructor HyperlinkEvent * Returns the element of the document repesenting this anchor.
* @param source TODO
* @param type TODO
* @param url TODO
* @param description TODO
*/ */
public HyperlinkEvent(Object source, EventType type, URL url, String description) { public Element getSourceElement()
super(source); {
this.type = type; return element;
this.url = url; }
this.description = null;
} // HyperlinkEvent()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/** /**
* getURL * Returns the URL of this event.
* @returns URL
*/ */
public URL getURL() { public URL getURL()
{
return url; return url;
} // getURL() }
/** /**
* getEventType * Returns the type of this event.
* @returns EventType
*/ */
public EventType getEventType() { public EventType getEventType()
{
return type; return type;
} // getEventType() }
/** /**
* getDescription * Returns the description of this event.
* @returns String
*/ */
public String getDescription() { public String getDescription()
{
return description; return description;
} // getDescription() }
}
} // HyperlinkEvent
...@@ -42,14 +42,11 @@ import java.awt.AWTEvent; ...@@ -42,14 +42,11 @@ import java.awt.AWTEvent;
import javax.swing.JInternalFrame; import javax.swing.JInternalFrame;
/** /**
* InternalFrameEvent
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public class InternalFrameEvent extends AWTEvent { public class InternalFrameEvent extends AWTEvent
{
//------------------------------------------------------------- private static final serialVersionUID = 9195444901064686684L;
// Constants --------------------------------------------------
//-------------------------------------------------------------
/** /**
* Internal frame activated event * Internal frame activated event
...@@ -96,19 +93,22 @@ public class InternalFrameEvent extends AWTEvent { ...@@ -96,19 +93,22 @@ public class InternalFrameEvent extends AWTEvent {
*/ */
public static int INTERNAL_FRAME_OPENED = 25550; public static int INTERNAL_FRAME_OPENED = 25550;
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor InternalFrameEvent * Creates a <code>JInternalFrameEvent</code> object.
* @param source JInternalFrame *
* @param id Event ID * @param source The source of this event.
* @param id Then event ID of this event.
*/ */
public InternalFrameEvent(JInternalFrame source, int id) { public InternalFrameEvent(JInternalFrame source, int id)
{
super(source, id); super(source, id);
} // InternalFrameEvent() }
/**
} // InternalFrameEvent * Returns the <code>JInternalFrame</code> object stored in this event.
*/
public JInternalFrame getInternalFrame()
{
return source;
}
}
...@@ -41,99 +41,58 @@ package javax.swing.event; ...@@ -41,99 +41,58 @@ package javax.swing.event;
import java.util.EventObject; import java.util.EventObject;
/** /**
* ListDataEvent
* @author Andrew Selkirk * @author Andrew Selkirk
* @author Ronald Veldema * @author Ronald Veldema
*/ */
public class ListDataEvent extends EventObject { public class ListDataEvent extends EventObject
{
private static final serialVersionUID = -7131487416250401903L;
//-------------------------------------------------------------
// Constants --------------------------------------------------
//-------------------------------------------------------------
/**
* Contents changed
*/
public static int CONTENTS_CHANGED = 0; public static int CONTENTS_CHANGED = 0;
/**
* Internal added
*/
public static int INTERVAL_ADDED = 1; public static int INTERVAL_ADDED = 1;
/**
* Interval removed
*/
public static int INTERVAL_REMOVED = 2; public static int INTERVAL_REMOVED = 2;
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
/**
* type
*/
private int type = 0; private int type = 0;
/**
* index0
*/
private int index0 = 0; private int index0 = 0;
/**
* index1
*/
private int index1 = 0; private int index1 = 0;
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor ListDataEvent * Creates a <code>ListDataEvent</code> object.
* @param source Source *
* @param type Event type * @param source The source of the event.
* @param type The type of the event
* @param index0 Bottom of range * @param index0 Bottom of range
* @param index1 Top of range * @param index1 Top of range
*/ */
public ListDataEvent(Object source, int type, public ListDataEvent(Object source, int type, int index0, int index1)
int index0, int index1) { {
super(source); super(source);
this.type = type; this.type = type;
this.index0 = index0; this.index0 = index0;
this.index1 = index1; this.index1 = index1;
} // ListDataEvent() }
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/** /**
* getIndex0 * Returns the bottom index.
* @returns index0
*/ */
public int getIndex0() { public int getIndex0()
{
return index0; return index0;
} // getIndex0() }
/** /**
* getIndex1 * Returns the top index.
* @returns index1
*/ */
public int getIndex1() { public int getIndex1()
{
return index1; return index1;
} // getIndex1() }
/** /**
* Event type * Returns the type of this event.
* @returns Event type
*/ */
public int getType() { public int getType()
{
return type; return type;
} // getType() }
}
} // ListDataEvent
...@@ -42,163 +42,116 @@ import java.util.EventObject; ...@@ -42,163 +42,116 @@ import java.util.EventObject;
import javax.swing.table.TableModel; import javax.swing.table.TableModel;
/** /**
* TableModelEvent
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public class TableModelEvent extends EventObject { public class TableModelEvent extends EventObject
{
private static final serialVersionUID = -7037680193569691706L;
//-------------------------------------------------------------
// Constants --------------------------------------------------
//-------------------------------------------------------------
/**
* ALL_COLUMNS
*/
public static int ALL_COLUMNS = -1; public static int ALL_COLUMNS = -1;
/**
* DELETE
*/
public static int DELETE = -1; public static int DELETE = -1;
/**
* HEADER_ROW
*/
public static int HEADER_ROW = -1; public static int HEADER_ROW = -1;
/**
* INSERT
*/
public static int INSERT = 1; public static int INSERT = 1;
/**
* UPDATE
*/
public static int UPDATE = 0; public static int UPDATE = 0;
//-------------------------------------------------------------
// Variables --------------------------------------------------
//-------------------------------------------------------------
/**
* column
*/
protected int column = 0; protected int column = 0;
/**
* firstRow
*/
protected int firstRow = 0; protected int firstRow = 0;
/**
* lastRow
*/
protected int lastRow = 0; protected int lastRow = 0;
/**
* type
*/
protected int type = 0; protected int type = 0;
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor TableModelEvent * Creates a <code>TableModelEvent</code> event.
* @param source Source object *
* @param source The source object
*/ */
public TableModelEvent(TableModel source) { public TableModelEvent(TableModel source)
{
this(source, 0, source.getRowCount(), ALL_COLUMNS, UPDATE); this(source, 0, source.getRowCount(), ALL_COLUMNS, UPDATE);
} // TableModelEvent() }
/** /**
* Constructor TableModelEvent * Creates a <code>TableModelEvent</code> event.
* @param source Source table model *
* @param row Updated row * @param source The source object
* @param row The updated row
*/ */
public TableModelEvent(TableModel source, int row) { public TableModelEvent(TableModel source, int row)
{
this(source, row, row, ALL_COLUMNS, UPDATE); this(source, row, row, ALL_COLUMNS, UPDATE);
} // TableModelEvent() }
/** /**
* Constructor TableModelEvent * Creates a <code>TableModelEvent</code> event.
* @param source Source table model *
* @param firstRow First row of update * @param source The source object
* @param lastRow Last row of update * @param firstRow The first row of update
* @param lastRow The last row of update
*/ */
public TableModelEvent(TableModel source, int firstRow, public TableModelEvent(TableModel source, int firstRow, int lastRow)
int lastRow) { {
this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE); this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE);
} // TableModelEvent() }
/** /**
* Constructor TableModelEvent * Creates a <code>TableModelEvent</code> event.
* @param source Source table model *
* @param firstRow First row of update * @param source The source object
* @param lastRow Last row of update * @param firstRow The first row of update
* @param column Affected column * @param lastRow The last row of update
* @param column The affected column
*/ */
public TableModelEvent(TableModel source, int firstRow, public TableModelEvent(TableModel source, int firstRow, int lastRow, int column)
int lastRow, int column) { {
this(source, firstRow, lastRow, column, UPDATE); this(source, firstRow, lastRow, column, UPDATE);
} // TableModelEvent() }
/** /**
* Constructor TableModelEvent * Creates a <code>TableModelEvent</code> event.
* @param source Source table model *
* @param firstRow First row of update * @param source The source object
* @param lastRow Last row of update * @param firstRow The first row of update
* @param column Affected column * @param lastRow The last row of update
* @param type Type of change * @param column The affected column
* @param type The type of change
*/ */
public TableModelEvent(TableModel source, int firstRow, public TableModelEvent(TableModel source, int firstRow, int lastRow, int column, int type)
int lastRow, int column, int type) { {
super(source); super(source);
this.firstRow = firstRow; this.firstRow = firstRow;
this.lastRow = lastRow; this.lastRow = lastRow;
this.column = column; this.column = column;
this.type = type; this.type = type;
} // TableModelEvent() }
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/** /**
* getColumn * Returns the affected column of this event.
* @returns column
*/ */
public int getColumn() { public int getColumn()
{
return column; return column;
} // getColumn() }
/** /**
* getFirstRow * Returns the first affected row of this event.
* @returns row
*/ */
public int getFirstRow() { public int getFirstRow()
{
return firstRow; return firstRow;
} // getFirstRow() }
/** /**
* getLastRow * Returns the last affected row of this event.
* @returns row
*/ */
public int getLastRow() { public int getLastRow()
{
return lastRow; return lastRow;
} // getLastRow() }
/** /**
* Get type * Returns the type of change of this event.
* @returns Type of event
*/ */
public int getType() { public int getType()
{
return type; return type;
} // getType() }
}
} // TableModelEvent
...@@ -42,22 +42,23 @@ import java.util.EventListener; ...@@ -42,22 +42,23 @@ import java.util.EventListener;
import javax.swing.tree.ExpandVetoException; import javax.swing.tree.ExpandVetoException;
/** /**
* TreeWillExpandListener interface
* @author Andrew Selkirk * @author Andrew Selkirk
*/ */
public interface TreeWillExpandListener extends EventListener { public interface TreeWillExpandListener extends EventListener
{
/** /**
* Tree will collapse * Invoked whenever a node in the tree is about to be collapsed.
* @param event Tree Expansion Event *
* @param event The tree expansion Event
*/ */
public void treeWillCollapse(TreeExpansionEvent event); public void treeWillCollapse(TreeExpansionEvent event)
throws ExpandVetoException;
/** /**
* Tree will expand * Invoked whenever a node in the tree is about to be expanded.
* @param event Tree Expansion Event *
* @param event The tree expansion Event
*/ */
public void treeWillExpand(TreeExpansionEvent event); public void treeWillExpand(TreeExpansionEvent event)
throws ExpandVetoException;
}
} // TreeWillExpandListener
/* DesktopIconUI.java -- /* DesktopIconUI.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -38,22 +38,19 @@ exception statement from your version. */ ...@@ -38,22 +38,19 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
/** /**
* DesktopIconUI * An abstract base class for delegates that implement the pluggable
* @author Andrew Selkirk * look and feel for a desktop icon.
* @version 1.0 *
* @author Andrew Selkirk (aselkirk@sympatico.ca)
* @author Sascha Brawer (brawer@dandelis.ch)
*/ */
public abstract class DesktopIconUI extends ComponentUI { public abstract class DesktopIconUI
extends ComponentUI
//------------------------------------------------------------- {
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor DesktopIconUI * Constructs a new <code>DesktopIconUI</code>.
*/ */
public DesktopIconUI() { public DesktopIconUI()
// TODO {
} // DesktopIconUI() }
}
} // DesktopIconUI
/* DesktopPaneUI.java -- /* DesktopPaneUI.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -38,22 +38,22 @@ exception statement from your version. */ ...@@ -38,22 +38,22 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
/** /**
* DesktopPaneUI * An abstract base class for delegates that implement the pluggable
* @author Andrew Selkirk * look and feel for a <code>JDesktopPane</code>.
* @version 1.0 *
* @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
//------------------------------------------------------------- {
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor DesktopPaneUI * Constructs a new <code>DesktopPaneUI</code>.
*/ */
public DesktopPaneUI() { public DesktopPaneUI()
// TODO {
} // DesktopPaneUI() }
}
} // DesktopPaneUI
/* DimensionUIResource.java /* DimensionUIResource.java
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -37,14 +37,32 @@ exception statement from your version. */ ...@@ -37,14 +37,32 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
import java.awt.Dimension; 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 }
/* FileChooserUI.java -- /* FileChooserUI.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -37,75 +37,100 @@ exception statement from your version. */ ...@@ -37,75 +37,100 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
// Imports import java.io.File;
import java.io.*; import javax.swing.JFileChooser;
import javax.swing.*;
import javax.swing.filechooser.*;
import javax.swing.filechooser.FileFilter; import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileView;
/** /**
* FileChooserUI * An abstract base class for delegates that implement the pluggable
* @author Andrew Selkirk * look and feel for a <code>JFileChooser</code>.
* @version 1.0 *
* @see javax.swing.JFileChooser
*
* @author Andrew Selkirk (aselkirk@sympatico.ca)
* @author Sascha Brawer (brawer@dandelis.ch)
*/ */
public abstract class FileChooserUI extends ComponentUI { public abstract class FileChooserUI
extends ComponentUI
//------------------------------------------------------------- {
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor FileChooserUI * Constructs a new <code>FileChooserUI</code>.
*/ */
public FileChooserUI() { public FileChooserUI()
// TODO {
} // FileChooserUI() }
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/** /**
* getAcceptAllFileFilter * Returns a <code>FileFilter</code> that accepts every file. While
* @param chooser TODO * the filtering itself is not specific to any look and feel, the
* @returns FileFilter * 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); public abstract FileFilter getAcceptAllFileFilter(JFileChooser chooser);
/** /**
* getFileView * Returns a view to a file, which is able to retrieve its name,
* @param chooser TODO * icon, and other properties that are relevant for presenting
* @returns FileView * 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); public abstract FileView getFileView(JFileChooser chooser);
/** /**
* getApproveButtonText * Determines which text is appropriate for the approve button
* @param chooser TODO * according to the design guidelines of the implemented
* @returns String * 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); public abstract String getApproveButtonText(JFileChooser chooser);
/** /**
* getDialogTitle * Determines which text is appropriate for the title bar of a
* @param chooser TODO * <code>JFileChooser</code> according to the design guidelines of
* @returns String * 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); public abstract String getDialogTitle(JFileChooser chooser);
/** /**
* rescanCurrentDirectory * Refreshes the currently displayed directory.
* @param value0 TODO *
* @param chooser the <code>JFileChooser</code> whose
* dialog title needs re-scanning.
*/ */
public abstract void rescanCurrentDirectory(JFileChooser chooser); public abstract void rescanCurrentDirectory(JFileChooser chooser);
/** /**
* ensureFileIsVisible * Ensures that a specified file is visible in the
* @param chooser TODO * <code>JFileChooser</code>
* @param file TODO *
* @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); public abstract void ensureFileIsVisible(JFileChooser chooser, File file);
}
} // FileChooserUI
/* FontUIResource.java /* FontUIResource.java
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -37,18 +37,65 @@ exception statement from your version. */ ...@@ -37,18 +37,65 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
import java.awt.Font; 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) /**
{ * Constructs a new <code>FontUIResource</code> given
super(f.getName(), f.getStyle(), f.getSize()); * 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) public FontUIResource(String name, int style, int size)
{ {
super(name, style, 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());
}
}
/* IconUIResource.java /* IconUIResource.java
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -37,29 +37,86 @@ exception statement from your version. */ ...@@ -37,29 +37,86 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
import java.awt.Component; import java.awt.Component;
import java.awt.Graphics; import java.awt.Graphics;
import java.io.Serializable; import java.io.Serializable;
import javax.swing.Icon; 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; 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) 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) 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() 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() public int getIconHeight()
{ {
return 0; return delegate.getIconHeight();
} }
} // class IconUIResource }
/* InputMapUIResource.java -- /* InputMapUIResource.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -37,26 +37,27 @@ exception statement from your version. */ ...@@ -37,26 +37,27 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
// Imports import javax.swing.InputMap;
import javax.swing.*;
/** /**
* InputMapUIResource * An <code>InputMap</code> that is marked as <code>UIResource</code>,
* @author Andrew Selkirk * which indicates that it has been installed by a pluggable
* @version 1.0 * 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 { public class InputMapUIResource
extends InputMap
//------------------------------------------------------------- implements UIResource
// Initialization --------------------------------------------- {
//-------------------------------------------------------------
/** /**
* Constructor InputMapUIResource * Constructs a new <code>InputMapUIResource</code>.
*/ */
public InputMapUIResource() { public InputMapUIResource()
// TODO {
} // InputMapUIResource() }
}
} // InputMapUIResource
/* InsetsUIResource.java /* InsetsUIResource.java
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -37,14 +37,41 @@ exception statement from your version. */ ...@@ -37,14 +37,41 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
import java.awt.Insets; 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) public InsetsUIResource(int top, int left, int bottom, int right)
{ {
super(top, left, bottom, right); super(top, left, bottom, right);
} }
} // class InsetsUIResource }
/* InternalFrameUI.java -- /* InternalFrameUI.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -37,23 +37,23 @@ exception statement from your version. */ ...@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
/** /**
* InternalFrameUI * An abstract base class for delegates that implement the pluggable
* @author Andrew Selkirk * look and feel for a <code>JInternalFrame</code>.
* @version 1.0 *
* @see javax.swing.JInternalFrame
*
* @author Andrew Selkirk (aselkirk@sympatico.ca)
* @author Sascha Brawer (brawer@dandelis.ch)
*/ */
public abstract class InternalFrameUI extends ComponentUI { public abstract class InternalFrameUI
extends ComponentUI
//------------------------------------------------------------- {
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor InternalFrameUI * Constructs a new <code>InternalFrameUI</code>.
*/ */
public InternalFrameUI() { public InternalFrameUI()
// TODO {
} // InternalFrameUI() }
}
} // InternalFrameUI
/* LabelUI.java /* LabelUI.java
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -38,7 +38,22 @@ exception statement from your version. */ ...@@ -38,7 +38,22 @@ exception statement from your version. */
package javax.swing.plaf; 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()
{
}
} }
/* ListUI.java /* ListUI.java
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -38,7 +38,77 @@ exception statement from your version. */ ...@@ -38,7 +38,77 @@ exception statement from your version. */
package javax.swing.plaf; 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);
} }
/* MenuBarUI.java -- /* MenuBarUI.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -37,23 +37,23 @@ exception statement from your version. */ ...@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
/** /**
* MenuBarUI * An abstract base class for delegates that implement the pluggable
* @author Andrew Selkirk * look and feel for a <code>JMenuBar</code>.
* @version 1.0 *
* @see javax.swing.JMenuBar
*
* @author Andrew Selkirk (aselkirk@sympatico.ca)
* @author Sascha Brawer (brawer@dandelis.ch)
*/ */
public abstract class MenuBarUI extends ComponentUI { public abstract class MenuBarUI
extends ComponentUI
//------------------------------------------------------------- {
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor MenuBarUI * Constructs a new <code>MenuBarUI</code>.
*/ */
public MenuBarUI() { public MenuBarUI()
// TODO {
} // MenuBarUI() }
}
} // MenuBarUI
/* MenuItemUI.java -- /* MenuItemUI.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -37,23 +37,23 @@ exception statement from your version. */ ...@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
/** /**
* MenuItemUI * An abstract base class for delegates that implement the pluggable
* @author Andrew Selkirk * look and feel for a <code>JMenuItem</code>.
* @version 1.0 *
* @see javax.swing.JMenuItem
*
* @author Andrew Selkirk (aselkirk@sympatico.ca)
* @author Sascha Brawer (brawer@dandelis.ch)
*/ */
public abstract class MenuItemUI extends ButtonUI { public abstract class MenuItemUI
extends ButtonUI
//------------------------------------------------------------- {
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor MenuItemUI * Constructs a new <code>MenuItemUI</code>.
*/ */
public MenuItemUI() { public MenuItemUI()
// TODO {
} // MenuItemUI() }
}
} // MenuItemUI
/* OptionPaneUI.java /* OptionPaneUI.java
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -35,10 +35,41 @@ this exception to your version of the library, but you are not ...@@ -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 obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */ exception statement from your version. */
package javax.swing.plaf; 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);
} }
/* PanelUI.java /* PanelUI.java
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -38,7 +38,21 @@ exception statement from your version. */ ...@@ -38,7 +38,21 @@ exception statement from your version. */
package javax.swing.plaf; 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()
{
}
} }
/* ProgressBarUI.java -- /* ProgressBarUI.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -37,23 +37,23 @@ exception statement from your version. */ ...@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf; package javax.swing.plaf;
/** /**
* ProgressBarUI * An abstract base class for delegates that implement the pluggable
* @author Andrew Selkirk * look and feel for a <code>JProgressBar</code>.
* @version 1.0 *
* @see javax.swing.JProgressBar
*
* @author Andrew Selkirk (aselkirk@sympatico.ca)
* @author Sascha Brawer (brawer@dandelis.ch)
*/ */
public abstract class ProgressBarUI extends ComponentUI { public abstract class ProgressBarUI
extends ComponentUI
//------------------------------------------------------------- {
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/** /**
* Constructor ProgressBarUI * Constructs a new <code>ProgressBarUI</code>.
*/ */
public ProgressBarUI() { public ProgressBarUI()
// TODO {
} // ProgressBarUI() }
}
} // ProgressBarUI
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment