Source code: com/paradoxpoint/libitina/option/OptionEvent.java
1 /*
2 * Libitina - Funeral Monument Image Compositor
3 * Copyright (C) 2003,2004 Luke Imhoff
4 *
5 * Contact Info:
6 * luke@paradoxpoint.com
7 * Luke Imhoff
8 * 2514 Pied Piper Lane
9 * Wausau, WI 54403
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 *
25 * OptionEvent.java
26 *
27 * Created on June 9, 2003, 4:16 AM
28 */
29
30 package com.paradoxpoint.libitina.option;
31
32 import java.util.*;
33
34 /** A semantic event which indicates that an option's state has changed. This high-level event is generated by
35 * an OptionContainer when an option's state changes because of the user or
36 * programmatically. The event is passed to every ObjectListener object which registered to receive such events using the
37 * OptionContainer's addOptionListener method.
38 * @author Luke Imhoff
39 */
40 public class OptionEvent extends EventObject {
41
42 /** option */
43 protected AbstractOption option = null;
44 /** option state */
45 protected Object state = null;
46
47 /** Creates a new instance of OptionEvent
48 * @param source source of the event
49 * @param option option name
50 * @param state option state
51 */
52 public OptionEvent(Object source, AbstractOption option) {
53 super(source);
54 this.option = option;
55 this.state = option.getState();
56 }
57
58 /** Getter for property option.
59 * @return Value of property option.
60 *
61 */
62 public AbstractOption getOption() {
63 return option;
64 }
65
66 /** Getter for property state.
67 * @return Value of property state.
68 *
69 */
70 public java.lang.Object getState() {
71 return state;
72 }
73
74 }