01: /*
02: * Beryl - A web platform based on XML, XSLT and Java
03: * This file is part of the Beryl XML GUI
04: *
05: * Copyright (C) 2004 Wenzel Jakob <wazlaf@tigris.org>
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11:
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this program; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-3107 USA
20: */
21:
22: package org.beryl.gui;
23:
24: /**
25: * A GUIEvent indicates an event in the XML GUI, such as a
26: * button press or a right mouse click. It does, however, not
27: * indicate any data changes. this is done by ModelChangeEvent
28: */
29:
30: public class GUIEvent {
31: private Widget source = null;
32: private String name = null;
33: private Object swingEvent = null;
34: private Object data = null;
35:
36: public GUIEvent(Widget source, String name, Object swingEvent,
37: Object data) {
38: this (source, name, swingEvent);
39:
40: this .data = data;
41: }
42:
43: public GUIEvent(Widget source, String name, Object swingEvent) {
44: this .name = name;
45: this .source = source;
46: this .swingEvent = swingEvent;
47: }
48:
49: public Widget getSource() {
50: return source;
51: }
52:
53: public Object getSwingEvent() {
54: return swingEvent;
55: }
56:
57: public Object getData() {
58: return data;
59: }
60:
61: /**
62: * This may be changed, used to make DnD work
63: */
64: public void setData(Object data) {
65: this .data = data;
66: }
67:
68: public String getName() {
69: return name;
70: }
71:
72: public String toString() {
73: return "org.beryl.gui.GuiEvent[name=\"" + name + "\", source="
74: + source + "]";
75: }
76: }
|