diff options
author | Michael Koch <konqueror@gmx.de> | 2003-06-24 20:17:27 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-06-24 20:17:27 +0000 |
commit | bbe53f03c8de1126e442866620409007c7df88fe (patch) | |
tree | 8d80296e8b413cdaf683251d6bff73920ddd04ee /libjava/javax/swing/event | |
parent | 7aff2f289b390ebab933209b9eb1a9de5354dbfe (diff) | |
download | gcc-bbe53f03c8de1126e442866620409007c7df88fe.zip gcc-bbe53f03c8de1126e442866620409007c7df88fe.tar.gz gcc-bbe53f03c8de1126e442866620409007c7df88fe.tar.bz2 |
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
Diffstat (limited to 'libjava/javax/swing/event')
-rw-r--r-- | libjava/javax/swing/event/AncestorEvent.java | 144 | ||||
-rw-r--r-- | libjava/javax/swing/event/HyperlinkEvent.java | 256 | ||||
-rw-r--r-- | libjava/javax/swing/event/InternalFrameEvent.java | 136 | ||||
-rw-r--r-- | libjava/javax/swing/event/ListDataEvent.java | 141 | ||||
-rw-r--r-- | libjava/javax/swing/event/TableModelEvent.java | 269 | ||||
-rw-r--r-- | libjava/javax/swing/event/TreeWillExpandListener.java | 33 |
6 files changed, 406 insertions, 573 deletions
diff --git a/libjava/javax/swing/event/AncestorEvent.java b/libjava/javax/swing/event/AncestorEvent.java index 0c86bad..7acc288 100644 --- a/libjava/javax/swing/event/AncestorEvent.java +++ b/libjava/javax/swing/event/AncestorEvent.java @@ -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; + } +} diff --git a/libjava/javax/swing/event/HyperlinkEvent.java b/libjava/javax/swing/event/HyperlinkEvent.java index 26ccaa8..a6bef2e 100644 --- a/libjava/javax/swing/event/HyperlinkEvent.java +++ b/libjava/javax/swing/event/HyperlinkEvent.java @@ -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; + } +} diff --git a/libjava/javax/swing/event/InternalFrameEvent.java b/libjava/javax/swing/event/InternalFrameEvent.java index 345568b..d802cd2 100644 --- a/libjava/javax/swing/event/InternalFrameEvent.java +++ b/libjava/javax/swing/event/InternalFrameEvent.java @@ -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; + } +} diff --git a/libjava/javax/swing/event/ListDataEvent.java b/libjava/javax/swing/event/ListDataEvent.java index 4c6e39f..46f567a 100644 --- a/libjava/javax/swing/event/ListDataEvent.java +++ b/libjava/javax/swing/event/ListDataEvent.java @@ -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; + } +} diff --git a/libjava/javax/swing/event/TableModelEvent.java b/libjava/javax/swing/event/TableModelEvent.java index c598955..222d194c 100644 --- a/libjava/javax/swing/event/TableModelEvent.java +++ b/libjava/javax/swing/event/TableModelEvent.java @@ -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; + } +} diff --git a/libjava/javax/swing/event/TreeWillExpandListener.java b/libjava/javax/swing/event/TreeWillExpandListener.java index e11416d..c286fef 100644 --- a/libjava/javax/swing/event/TreeWillExpandListener.java +++ b/libjava/javax/swing/event/TreeWillExpandListener.java @@ -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; +} |