KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > monitorenter > gui > chart > events > AJComponentAction


1 /*
2  * AJComponentAction, base for actions to trigger on JComponents.
3  * Copyright (C) Achim Westermann, created on 10.12.2004, 13:48:55
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
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  *
19  * If you modify or optimize the code in a useful way please let me know.
20  * Achim.Westermann@gmx.de
21  *
22  */

23 package info.monitorenter.gui.chart.events;
24
25 import java.beans.PropertyChangeListener JavaDoc;
26
27 import javax.swing.AbstractAction JavaDoc;
28 import javax.swing.JComponent JavaDoc;
29
30 /**
31  * <p>
32  * The base class that connects triggered actions with an
33  * {@link javax.swing.JComponent} instance.
34  * </p>
35  * <p>
36  * Every subclass may delegate it's constructor-given <code>JComponent</code>
37  * instance as protected member <code>m_component</code>.
38  * </p>
39  *
40  * @author <a HREF="mailto:Achim.Westermann@gmx.de">Achim Westermann </a>
41  *
42  * @version $Revision: 1.2 $
43  *
44  */

45 public abstract class AJComponentAction extends AbstractAction JavaDoc implements PropertyChangeListener JavaDoc {
46
47   /** The target of this action. */
48   protected JComponent JavaDoc m_component;
49
50   /**
51    * Create an <code>Action</code> that accesses the <code>JComponent</code>
52    * and identifies itself with the given action String.
53    *
54    * @param component
55    * the target the action will work on.
56    *
57    * @param description
58    * the descriptive <code>String</code> that will be displayed by
59    * {@link javax.swing.AbstractButton} subclasses that get this
60    * <code>Action</code> assigned (
61    * {@link javax.swing.AbstractButton#setAction(javax.swing.Action)}).
62    */

63   public AJComponentAction(final JComponent JavaDoc component, final String JavaDoc description) {
64     super(description);
65     this.m_component = component;
66   }
67 }
68
Popular Tags