aboutsummaryrefslogtreecommitdiff
path: root/libjava/javax/swing/event/HyperlinkEvent.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-06-24 20:17:27 +0000
committerMichael Koch <konqueror@gmx.de>2003-06-24 20:17:27 +0000
commit428e542390f5d5bd1e6c6037b75a095be83e9bb3 (patch)
tree8d80296e8b413cdaf683251d6bff73920ddd04ee /libjava/javax/swing/event/HyperlinkEvent.java
parentc44a40f4df3f1f6272508c062d3ef305e0e11aaa (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@68438 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/javax/swing/event/HyperlinkEvent.java')
-rw-r--r--libjava/javax/swing/event/HyperlinkEvent.java256
1 files changed, 109 insertions, 147 deletions
diff --git a/libjava/javax/swing/event/HyperlinkEvent.java b/libjava/javax/swing/event/HyperlinkEvent.java
index 26ccaa81c50..a6bef2e679b 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;
+ }
+}