1 /*
2 * (C) 2002 David Carr david@carr.name
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 package net.sourceforge.mflow.api.base;
20
21 import java.awt.Frame;
22
23 import javax.swing.Icon;
24
25 import net.sourceforge.mflow.api.MsgFlowComponent;
26
27 /***
28 * Abstract implementation of MsgFlowComponent
29 *
30 * @author <a href="mailto:david@carr.name">David Carr</a>
31 * @version $Revision: 1.3 $
32 */
33 public abstract class AbstractMsgFlowComponent implements MsgFlowComponent {
34 /***
35 * Private storage for the name, initialized to the Class name
36 *
37 * @todo pretty this up
38 */
39 private String name =
40 getClass().getName().substring(getClass().getName().lastIndexOf('.') + 1);
41
42 /***
43 * Private storage for the icon
44 */
45 private Icon icon;
46
47 /***
48 * Does nothing.
49 *
50 * @param aOwner the owner of the dialog to show
51 */
52 public void configure(final Frame aOwner) {
53 //Does nothing
54 }
55
56 /***
57 * Gets the icon for this component.
58 *
59 * @return the icon for this component, possibly null.
60 */
61 public final Icon getIcon() {
62 return this.icon;
63 }
64
65 /***
66 * Sets the icon for this component.
67 *
68 * @param aIcon the new icon
69 */
70 protected final void setIcon(final Icon aIcon) {
71 this.icon = aIcon;
72 }
73
74 /***
75 * Gets the name of this instance, set to the name of the class by default
76 * (excluding the package name)
77 *
78 * @return the name of this instance
79 */
80 public final String getName() {
81 return this.name;
82 }
83
84 /***
85 * Sets the name of this instance
86 *
87 * @param aName the new name for the instance
88 */
89 public final void setName(final String aName) {
90 this.name = aName;
91 }
92 }
This page was automatically generated by Maven