01: /*
02: * $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/actions/CallbackAction.java,v 1.1 2005/04/20 22:20:27 paulby Exp $
03: *
04: * Sun Public License Notice
05: *
06: * The contents of this file are subject to the Sun Public License Version
07: * 1.0 (the "License"). You may not use this file except in compliance with
08: * the License. A copy of the License is available at http://www.sun.com/
09: *
10: * The Original Code is the Java 3D(tm) Scene Graph Editor.
11: * The Initial Developer of the Original Code is Paul Byrne.
12: * Portions created by Paul Byrne are Copyright (C) 2002.
13: * All Rights Reserved.
14: *
15: * Contributor(s): Paul Byrne.
16: *
17: **/
18: package org.jdesktop.j3dedit.actions;
19:
20: /**
21: *
22: * @author Paul Byrne
23: * @version $Revision: 1.1 $
24: */
25: public class CallbackAction extends javax.swing.AbstractAction {
26:
27: private ActionCallbackInterface callback = null;
28:
29: /** Creates a new instance of CallbackAction */
30: public CallbackAction() {
31: super ();
32: ActionManager.addAction(this );
33: }
34:
35: public CallbackAction(String name, javax.swing.Icon icon) {
36: super (name, icon);
37: ActionManager.addAction(this );
38: }
39:
40: /**
41: * Set the callback for this action
42: */
43: public void setActionCallback(ActionCallbackInterface callback) {
44: this .callback = callback;
45: }
46:
47: /**
48: * Invoked when an action occurs.
49: */
50: public void actionPerformed(java.awt.event.ActionEvent event) {
51: if (callback != null)
52: callback.actionCallback(this, event);
53: }
54:
55: }
|