001 /*
002 * $Id: PipelineEvent.java,v 1.3 2006/03/15 15:56:01 kleopatra Exp $
003 *
004 * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
005 * Santa Clara, California 95054, U.S.A. All rights reserved.
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * You should have received a copy of the GNU Lesser General Public
018 * License along with this library; if not, write to the Free Software
019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
020 */
021
022 package org.jdesktop.swingx.decorator;
023
024 import java.util.EventObject;
025
026
027 /**
028 * Defines an event that encapsulates changes to a pipeline.
029 *
030 * @author Ramesh Gupta
031 */
032 public class PipelineEvent extends EventObject
033 {
034 /** Identifies one or more changes in the pipeline. */
035 public static final int CONTENTS_CHANGED = 0;
036
037 /** Identifies a order change of the interactive sorter. */
038 public static final int SORT_ORDER_CHANGED = 1;
039 private int type;
040
041 /**
042 * Returns the event type. The possible values are:
043 * <ul>
044 * <li> {@link #CONTENTS_CHANGED}
045 * <li> {@link #SORT_ORDER_CHANGED }
046 * </ul>
047 *
048 * @return an int representing the type value
049 */
050 public int getType() { return type; }
051
052 /**
053 * Constructs a PipelineEvent object.
054 *
055 * @param source the source Object (typically <code>this</code>)
056 * @param type an int specifying the event type
057 */
058 public PipelineEvent(Object source, int type) {
059 super(source);
060 this.type = type;
061 }
062
063 /**
064 * Returns a string representation of this event. This method
065 * is intended to be used only for debugging purposes, and the
066 * content and format of the returned string may vary between
067 * implementations. The returned string may be empty but may not
068 * be <code>null</code>.
069 *
070 * @return a string representation of this event.
071 */
072 public String toString() {
073 return getClass().getName() + "[type=" + type + "]";
074 }
075 }
076
077
078