1 7 package javax.swing.event; 8 9 import java.util.EventObject ; 10 import java.net.URL ; 11 import javax.swing.text.Element ; 12 13 14 30 public class HyperlinkEvent extends EventObject { 31 32 42 public HyperlinkEvent(Object source, EventType type, URL u) { 43 this(source, type, u, null); 44 } 45 46 58 public HyperlinkEvent(Object source, EventType type, URL u, String desc) { 59 this(source, type, u, desc, null); 60 } 61 62 77 public HyperlinkEvent(Object source, EventType type, URL u, String desc, 78 Element sourceElement) { 79 super(source); 80 this.type = type; 81 this.u = u; 82 this.desc = desc; 83 this.sourceElement = sourceElement; 84 } 85 86 91 public EventType getEventType() { 92 return type; 93 } 94 95 101 public String getDescription() { 102 return desc; 103 } 104 105 110 public URL getURL() { 111 return u; 112 } 113 114 124 public Element getSourceElement() { 125 return sourceElement; 126 } 127 128 private EventType type; 129 private URL u; 130 private String desc; 131 private Element sourceElement; 132 133 134 138 public static final class EventType { 139 140 private EventType(String s) { 141 typeString = s; 142 } 143 144 147 public static final EventType ENTERED = new EventType("ENTERED"); 148 149 152 public static final EventType EXITED = new EventType("EXITED"); 153 154 157 public static final EventType ACTIVATED = new EventType("ACTIVATED"); 158 159 164 public String toString() { 165 return typeString; 166 } 167 168 private String typeString; 169 } 170 } 171 172 | Popular Tags |