01: /**
02: * Copyright 2006 Sun Microsystems, Inc., 4150 Network Circle,
03: * Santa Clara, California 95054, U.S.A. All rights reserved.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18: */package org.jdesktop.swingx.event;
19:
20: import java.util.Date;
21: import java.util.EventObject;
22: import java.util.SortedSet;
23:
24: import org.jdesktop.swingx.DateSelectionModel;
25:
26: /**
27: * @author Joshua Outwater
28: */
29: public class DateSelectionEvent extends EventObject {
30: public static enum EventType {
31: DATES_ADDED, DATES_REMOVED, DATES_SET, SELECTION_CLEARED, SELECTABLE_DATES_CHANGED, SELECTABLE_RANGE_CHANGED, UNSELECTED_DATES_CHANGED, LOWER_BOUND_CHANGED, UPPER_BOUND_CHANGED
32: }
33:
34: private EventType eventType;
35:
36: /**
37: * Constructs a prototypical Event.
38: *
39: * @param source The object on which the Event initially occurred.
40: * @throws IllegalArgumentException if source is null.
41: */
42: public DateSelectionEvent(Object source, EventType eventType) {
43: super (source);
44: this .eventType = eventType;
45: }
46:
47: public SortedSet<Date> getSelection() {
48: return ((DateSelectionModel) source).getSelection();
49: }
50:
51: public final EventType getEventType() {
52: return eventType;
53: }
54: }
|