KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * ATrace2DAction.java, base for actions to trigger on traces.
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 info.monitorenter.gui.chart.ITrace2D;
28
29 import javax.swing.AbstractAction JavaDoc;
30
31 /**
32  * <p>
33  * The base class that connects triggered actions with an {@link ITrace2D}
34  * instance.
35  * </p>
36  * <p>
37  * Every subclass may delegate it's constructor-given <code>ITrace2D</code>
38  * instance as protected member <code>trace</code>.
39  * </p>
40  *
41  * @author <a HREF="mailto:Achim.Westermann@gmx.de">Achim Westermann </a>
42  *
43  * @version $Revision: 1.2 $
44  *
45  */

46 public abstract class ATrace2DAction extends AbstractAction JavaDoc implements PropertyChangeListener JavaDoc {
47   /** The trace to trigger the action upon. */
48   protected ITrace2D m_trace;
49
50   /**
51    * Create an <code>Action</code> that accesses the trace and identifies
52    * itself with the given action String.
53    *
54    * @param trace
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 ATrace2DAction(final ITrace2D trace, final String JavaDoc description) {
64     super(description);
65     this.m_trace = trace;
66   }
67 }
68
Popular Tags