KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > memoire > vainstall > builder > action > AbstractVAIBuilderAction


1 /*
2  * $RCSfile: AbstractVAIBuilderAction.java,v $
3  * @modification $Date: 2001/09/28 19:31:19 $
4  * @version $Id: AbstractVAIBuilderAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
5  *
6  */

7
8 package com.memoire.vainstall.builder.action;
9
10 import com.memoire.vainstall.builder.VAIBuilderController;
11 import com.memoire.vainstall.builder.VAIBuilderModel;
12
13 import javax.swing.AbstractAction JavaDoc;
14
15 /**
16  * This is an abstract class that extends the AbstractAction class
17  * with the knowledge of the VAIBuilderController and VAIBuilderModel.
18  *
19  * This class is single threaded and subclasses only have to implement
20  * the runnit method.
21  *
22  * @see javax.swing.AbstractAction
23  * @see com.memoire.vainstall.builder.VAIBuilderController
24  * @see com.memoire.vainstall.builder.VAIBuilderModel
25  *
26  * @author Henrik Falk
27  * @version $Id: AbstractVAIBuilderAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
28  */

29 public abstract class AbstractVAIBuilderAction extends AbstractAction JavaDoc {
30
31     /**
32      * The controller of the builder
33      */

34     VAIBuilderController controller;
35
36     /**
37      * The data model of the builder
38      */

39     VAIBuilderModel model;
40
41     /**
42      * Default constructor
43      */

44     public AbstractVAIBuilderAction() {
45         super();
46     }
47
48     /**
49      * actionPerformed
50      * @param evt java.awt.event.ActionEvent
51      */

52     public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
53         runnit();
54     }
55
56     /**
57      * This method must be implemented by subclasses
58      */

59     public abstract void runnit();
60
61     /**
62      * Initializes this action
63      * @param controller VAIBuilderController
64      */

65     public void initialize(VAIBuilderController controller) {
66         this.controller = controller;
67         this.model = controller.getModel();
68     }
69
70     /**
71      * Returns the controller
72      * @return a VAIBuilderController
73      */

74     protected VAIBuilderController getController() {
75         return controller;
76     }
77  
78     /**
79      * Returns the model
80      * @return a VAIBuilderModel
81      */

82     protected VAIBuilderModel getModel() {
83         return model;
84     }
85
86 }
87
Popular Tags