KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icesoft > icefaces > samples > showcase > components > effects > MoveBean


1 /*
2  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3  *
4  * "The contents of this file are subject to the Mozilla Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License at
7  * http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
11  * License for the specific language governing rights and limitations under
12  * the License.
13  *
14  * The Original Code is ICEfaces 1.5 open source software code, released
15  * November 5, 2006. The Initial Developer of the Original Code is ICEsoft
16  * Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
17  * 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
18  *
19  * Contributor(s): _____________________.
20  *
21  * Alternatively, the contents of this file may be used under the terms of
22  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
23  * License), in which case the provisions of the LGPL License are
24  * applicable instead of those above. If you wish to allow use of your
25  * version of this file only under the terms of the LGPL License and not to
26  * allow others to use your version of this file under the MPL, indicate
27  * your decision by deleting the provisions above and replace them with
28  * the notice and other provisions required by the LGPL License. If you do
29  * not delete the provisions above, a recipient may use your version of
30  * this file under either the MPL or the LGPL License."
31  *
32  */

33
34 package com.icesoft.icefaces.samples.showcase.components.effects;
35
36 import com.icesoft.faces.context.effects.Effect;
37 import com.icesoft.faces.context.effects.Move;
38
39 /**
40  * <p>The MoveBean class backs the Move effect demo.</p>
41  */

42 public class MoveBean {
43
44     // coordinates
45
private int x = 25;
46     private int y = 25;
47
48
49     // mode of move effect ("relative" or "absolute")
50
private String JavaDoc mode;
51
52     //effects
53
private Effect effectPanelGroup;
54     private Effect effectCommandButton;
55     private Effect effectInputText;
56     private Effect effectOutputText;
57     private Effect effectSelectOneMenu;
58     private Effect effectSelectManyListBox;
59     private String JavaDoc dummy;
60
61     private Effects effectsBean;
62
63     public MoveBean(Effects effectsBean) {
64         this.effectsBean = effectsBean;
65     }
66
67     /**
68      * Gets the X-Coordinate.
69      *
70      * @return the X-Coordinate
71      */

72     public int getX() {
73         return x;
74     }
75
76     /**
77      * Sets the X-Coordinate.
78      *
79      * @param x the X-Coordinate
80      */

81     public void setX(int x) {
82         this.x = x;
83     }
84
85     /**
86      * Gets the Y-Coordinate.
87      *
88      * @return the Y-Coordinate
89      */

90     public int getY() {
91         return y;
92     }
93
94     /**
95      * Sets the Y-Coordinate.
96      *
97      * @param y the Y-Coordinate
98      */

99     public void setY(int y) {
100         this.y = y;
101     }
102
103     /**
104      * Gets the mode of the move effect ("relative" or "absolute").
105      *
106      * @return the mode of move effect
107      */

108     public String JavaDoc getMode() {
109         return mode;
110     }
111
112     /**
113      * Sets the mode of the move effect ("relative" or "absolute").
114      *
115      * @param mode of move effect
116      */

117     public void setMode(String JavaDoc mode) {
118         this.mode = mode;
119     }
120
121     /**
122      * Applies the move effect to each component.
123      *
124      * @return null
125      */

126     public String JavaDoc invokeEffect() {
127         float seconds = effectsBean.getDurationPrimitive();
128
129         effectPanelGroup = new Move(x, y, mode);
130         effectCommandButton = new Move(x, y, mode);
131         effectInputText = new Move(x, y, mode);
132         effectOutputText = new Move(x, y, mode);
133         effectSelectOneMenu = new Move(x, y, mode);
134         effectSelectManyListBox = new Move(x, y, mode);
135
136         effectPanelGroup.setDuration(seconds);
137         effectCommandButton.setDuration(seconds);
138         effectInputText.setDuration(seconds);
139         effectOutputText.setDuration(seconds);
140         effectSelectOneMenu.setDuration(seconds);
141         effectSelectManyListBox.setDuration(seconds);
142         return null;
143     }
144
145     /**
146      * Returns the demo panels to their original place.
147      *
148      * @return null, no navigation
149      */

150     public String JavaDoc reset() {
151         mode = "absolute";
152         x = 0;
153         y = 0;
154         invokeEffect();
155         return null;
156     }
157
158     public Effect getEffectPanelGroup() {
159         return effectPanelGroup;
160     }
161
162     public void setEffectPanelGroup(Effect effectPanelGroup) {
163         this.effectPanelGroup = effectPanelGroup;
164     }
165
166     public Effect getEffectCommandButton() {
167         return effectCommandButton;
168     }
169
170     public void setEffectCommandButton(Effect effectCommandButton) {
171         this.effectCommandButton = effectCommandButton;
172     }
173
174     public Effect getEffectInputText() {
175         return effectInputText;
176     }
177
178     public void setEffectInputText(Effect effectInputText) {
179         this.effectInputText = effectInputText;
180     }
181
182     public Effect getEffectOutputText() {
183         return effectOutputText;
184     }
185
186     public void setEffectOutputText(Effect effectOutputText) {
187         this.effectOutputText = effectOutputText;
188     }
189
190     public Effect getEffectSelectOneMenu() {
191         return effectSelectOneMenu;
192     }
193
194     public void setEffectSelectOneMenu(Effect effectSelectOneMenu) {
195         this.effectSelectOneMenu = effectSelectOneMenu;
196     }
197
198     public Effect getEffectSelectManyListBox() {
199         return effectSelectManyListBox;
200     }
201
202     public void setEffectSelectManyListBox(Effect effectSelectManyListBox) {
203         this.effectSelectManyListBox = effectSelectManyListBox;
204     }
205
206     public String JavaDoc getDummy() {
207         return dummy;
208     }
209
210     public void setDummy(String JavaDoc dummy) {
211         this.dummy = dummy;
212     }
213
214     public String JavaDoc dummy() {
215         return null;
216     }
217 }
218
Popular Tags