01: /*
02: * $Id: PipelineEvent.java,v 1.3 2006/03/15 15:56:01 kleopatra Exp $
03: *
04: * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
05: * Santa Clara, California 95054, U.S.A. All rights reserved.
06: *
07: * This library 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 library 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 library; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20: */
21:
22: package org.jdesktop.swingx.decorator;
23:
24: import java.util.EventObject;
25:
26: /**
27: * Defines an event that encapsulates changes to a pipeline.
28: *
29: * @author Ramesh Gupta
30: */
31: public class PipelineEvent extends EventObject {
32: /** Identifies one or more changes in the pipeline. */
33: public static final int CONTENTS_CHANGED = 0;
34:
35: /** Identifies a order change of the interactive sorter. */
36: public static final int SORT_ORDER_CHANGED = 1;
37: private int type;
38:
39: /**
40: * Returns the event type. The possible values are:
41: * <ul>
42: * <li> {@link #CONTENTS_CHANGED}
43: * <li> {@link #SORT_ORDER_CHANGED }
44: * </ul>
45: *
46: * @return an int representing the type value
47: */
48: public int getType() {
49: return type;
50: }
51:
52: /**
53: * Constructs a PipelineEvent object.
54: *
55: * @param source the source Object (typically <code>this</code>)
56: * @param type an int specifying the event type
57: */
58: public PipelineEvent(Object source, int type) {
59: super (source);
60: this .type = type;
61: }
62:
63: /**
64: * Returns a string representation of this event. This method
65: * is intended to be used only for debugging purposes, and the
66: * content and format of the returned string may vary between
67: * implementations. The returned string may be empty but may not
68: * be <code>null</code>.
69: *
70: * @return a string representation of this event.
71: */
72: public String toString() {
73: return getClass().getName() + "[type=" + type + "]";
74: }
75: }
|