01: /*
02: * Gruntspud
03: *
04: * Copyright (C) 2002 Brett Smith.
05: *
06: * Written by: Brett Smith <t_magicthize@users.sourceforge.net>
07: *
08: * This program is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU Library General Public License
10: * as published by the Free Software Foundation; either version 2 of
11: * the License, or (at your option) any later version.
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
15: * GNU Library General Public License for more details.
16: *
17: * You should have received a copy of the GNU Library General Public
18: * License along with this program; if not, write to the Free Software
19: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20: */
21:
22: package gruntspud.ui.view;
23:
24: import java.util.EventObject;
25:
26: /**
27: * Description of the Class
28: *
29: *@author magicthize
30: *@created 26 May 2002
31: */
32: public class ViewEvent extends EventObject {
33: public final static int SELECTION_CHANGED = 1;
34: public final static int HOME_CHANGED = 2;
35: public final static int CWD_CHANGED = 3;
36: public final static int VIEW_CHANGED = 4;
37: public final static int VIEW_REMOVED = 5;
38: public final static int TREE_STARTED_LOADING = 6;
39: public final static int TREE_FINISHED_LOADING = 7;
40: public final static int HOME_CHANGING = 8;
41: public final static int NODES_UPDATED = 9;
42: private int type;
43: private boolean adjusting;
44:
45: /**
46: * Creates a new ViewEvent object.
47: *
48: * @param source DOCUMENT ME!
49: * @param type DOCUMENT ME!
50: * @param adjusting DOCUMENT ME!
51: */
52: public ViewEvent(Object source, int type, boolean adjusting) {
53: super (source);
54: this .adjusting = adjusting;
55: this .type = type;
56: }
57:
58: /**
59: * DOCUMENT ME!
60: *
61: * @param source DOCUMENT ME!
62: */
63: public void setSource(Object source) {
64: this .source = source;
65: }
66:
67: /**
68: * DOCUMENT ME!
69: *
70: * @return DOCUMENT ME!
71: */
72: public int getType() {
73: return type;
74: }
75:
76: /**
77: * DOCUMENT ME!
78: *
79: * @return DOCUMENT ME!
80: */
81: public boolean isAdjusting() {
82: return adjusting;
83: }
84:
85: /**
86: * DOCUMENT ME!
87: *
88: * @return DOCUMENT ME!
89: */
90: public String toString() {
91: return "VIEW EVENT SOURCE = " + getSource() + " TYPE="
92: + getType() + " ADJ = " + isAdjusting();
93: }
94: }
|