1 33 34 package com.icesoft.faces.context.effects; 35 36 39 public abstract class Effect { 40 41 42 protected EffectsArguments ea = new EffectsArguments(); 43 private boolean queued; 44 private boolean queueEnd; 45 private boolean fired; 46 private boolean transitory = true; 47 private float duration; 48 private float fps; private float from; 50 private float to; 51 private boolean sync; 52 private float delay; 53 private String queue; 54 private boolean submit; 55 private String id; 56 private String sequence; 57 private int sequenceId; 58 59 60 69 public boolean isTransitory() { 70 return transitory; 71 } 72 73 90 public void setTransitory(boolean transitory) { 91 this.transitory = transitory; 92 } 93 94 98 public boolean isQueued() { 99 return queued; 100 } 101 102 106 public void setQueued(boolean queued) { 107 this.queued = queued; 108 } 109 110 114 public boolean isQueueEnd() { 115 return queueEnd; 116 } 117 118 122 public void setQueueEnd(boolean queueEnd) { 123 this.queueEnd = queueEnd; 124 } 125 126 132 public boolean isFired() { 133 return fired; 134 } 135 136 145 public void setFired(boolean fired) { 146 this.fired = fired; 147 } 148 149 154 public float getDuration() { 155 return duration; 156 } 157 158 163 public void setDuration(float duration) { 164 this.duration = duration; 165 ea.add("duration", duration); 166 } 167 168 173 public float getFps() { 174 return fps; 175 } 176 177 182 public void setFps(float fps) { 183 if (fps > 25f) { 184 throw new IllegalArgumentException ("FPS max is 25"); 185 } 186 this.fps = fps; 187 ea.add("fps", fps); 188 } 189 190 196 public float getFrom() { 197 return from; 198 } 199 200 206 public void setFrom(float from) { 207 this.from = from; 208 ea.add("from", from); 209 } 210 211 217 public float getTo() { 218 return to; 219 } 220 221 227 public void setTo(float to) { 228 this.to = to; 229 ea.add("to", to); 230 } 231 232 240 public boolean isSync() { 241 return sync; 242 } 243 244 252 public void setSync(boolean sync) { 253 this.sync = sync; 254 ea.add("sync", sync); 255 } 256 257 258 263 public float getDelay() { 264 return delay; 265 } 266 267 272 public void setDelay(float delay) { 273 this.delay = delay; 274 ea.add("delay", delay); 275 } 276 277 285 public String getQueue() { 286 return queue; 287 } 288 289 297 public void setQueue(String queue) { 298 this.queue = queue; 299 ea.add("queue", queue); 300 } 301 302 307 public boolean isSubmit() { 308 return submit; 309 } 310 311 319 public void setSubmit(boolean submit) { 320 this.submit = submit; 321 ea.add("submit", submit); 322 } 323 324 325 330 public abstract String getFunctionName(); 331 332 333 public String toString(String var, String lastCall) { 334 if (queued) { 335 ea.add("queue", "front"); 336 } 337 if (queueEnd) { 338 ea.add("queue", "end"); 339 } 340 if (!transitory) { 341 ea.add("uploadCSS", "true"); 342 } 343 if (lastCall != null) { 344 ea.addFunction("iceFinish", "function(){" + lastCall + "}"); 345 } 346 return getFunctionName() + "(" + var + ea.toString(); 347 } 348 349 public String toString() { 350 return toString("id", null); 351 } 352 353 358 public String getId() { 359 return id; 360 } 361 362 367 public void setId(String id) { 368 this.id = id; 369 } 370 371 372 377 public String getSequence() { 378 return sequence; 379 } 380 381 386 public void setSequence(String sequence) { 387 this.sequence = sequence; 388 } 389 390 395 public int getSequenceId() { 396 return sequenceId; 397 } 398 399 404 public void setSequenceId(int sequenceId) { 405 this.sequenceId = sequenceId; 406 } 407 408 public void setOptions(String options){ 409 ea.setOptions(options); 410 } 411 412 public int hashCode() { 413 return getIntfromString(toString()); 414 } 415 416 public int getIntfromString(String s) { 417 int r = 0; 418 char[] ca = s.toCharArray(); 419 for (int i = 0; i < ca.length; i++) { 420 r += (int) ca[i]; 421 } 422 return r; 423 } 424 425 } 426 | Popular Tags |