KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > prefuse > action > GroupAction


1 package prefuse.action;
2
3 import prefuse.Visualization;
4
5 /**
6  * An Action that can be parameterized to process a particular group of items.
7  *
8  * @author <a HREF="http://jheer.org">jeffrey heer</a>
9  */

10 public abstract class GroupAction extends Action {
11
12     /** A reference to the group to be processed by this Action */
13     protected String JavaDoc m_group;
14     
15     /**
16      * Create a new GroupAction that processes all groups.
17      * @see prefuse.Visualization#ALL_ITEMS
18      */

19     public GroupAction() {
20         this((Visualization)null);
21     }
22
23     /**
24      * Create a new GroupAction that processes all groups.
25      * @param vis the {@link prefuse.Visualization} to process
26      * @see prefuse.Visualization#ALL_ITEMS
27      */

28     public GroupAction(Visualization vis) {
29         this(vis, Visualization.ALL_ITEMS);
30     }
31     
32     /**
33      * Create a new GroupAction that processes all groups.
34      * @param vis the {@link prefuse.Visualization} to process
35      * @param duration the duration of this Action
36      * @see prefuse.Visualization#ALL_ITEMS
37      */

38     public GroupAction(Visualization vis, long duration) {
39         this(vis, Visualization.ALL_ITEMS, duration);
40     }
41     
42     /**
43      * Create a new GroupAction that processes all groups.
44      * @param vis the {@link prefuse.Visualization} to process
45      * @param duration the duration of this Action
46      * @param stepTime the time to wait between invocations of this Action
47      * @see prefuse.Visualization#ALL_ITEMS
48      */

49     public GroupAction(Visualization vis, long duration, long stepTime) {
50         this(vis, Visualization.ALL_ITEMS, duration, stepTime);
51     }
52     
53     /**
54      * Create a new GroupAction that processes the specified group.
55      * @param group the name of the group to process
56      */

57     public GroupAction(String JavaDoc group) {
58         this(null, group);
59     }
60     
61     /**
62      * Create a new GroupAction that processes the specified group.
63      * @param group the name of the group to process
64      * @param duration the duration of this Action
65      */

66     public GroupAction(String JavaDoc group, long duration) {
67         this(null, group, duration);
68     }
69     
70     /**
71      * Create a new GroupAction that processes the specified group.
72      * @param group the name of the group to process
73      * @param duration the duration of this Action
74      * @param stepTime the time to wait between invocations of this Action
75      */

76     public GroupAction(String JavaDoc group, long duration, long stepTime) {
77         this(null, group, duration, stepTime);
78     }
79     
80     /**
81      * Create a new GroupAction that processes the specified group.
82      * @param vis the {@link prefuse.Visualization} to process
83      * @param group the name of the group to process
84      */

85     public GroupAction(Visualization vis, String JavaDoc group) {
86         super(vis);
87         m_group = group;
88     }
89     
90     /**
91      * Create a new GroupAction that processes the specified group.
92      * @param vis the {@link prefuse.Visualization} to process
93      * @param group the name of the group to process
94      * @param duration the duration of this Action
95      */

96     public GroupAction(Visualization vis, String JavaDoc group, long duration) {
97         super(vis, duration);
98         m_group = group;
99     }
100     
101     /**
102      * Create a new GroupAction that processes the specified group.
103      * @param vis the {@link prefuse.Visualization} to process
104      * @param group the name of the group to process
105      * @param duration the duration of this Action
106      * @param stepTime the time to wait between invocations of this Action
107      */

108     public GroupAction(Visualization vis, String JavaDoc group,
109                        long duration, long stepTime)
110     {
111         super(vis, duration, stepTime);
112         m_group = group;
113     }
114
115     // ------------------------------------------------------------------------
116

117     /**
118      * Get the name of the group to be processed by this Action.
119      * @return the name of the group to process
120      */

121     public String JavaDoc getGroup() {
122         return m_group;
123     }
124
125     /**
126      * Sets the name of the group to be processed by this Action.
127      * @param group the name of the group to process
128      */

129     public void setGroup(String JavaDoc group) {
130         m_group = group;
131     }
132     
133     // ------------------------------------------------------------------------
134

135     /**
136      * @see prefuse.action.Action#run(double)
137      */

138     public abstract void run(double frac);
139
140 } // end of class GroupAction
141
Popular Tags