001: /*
002: * Version: MPL 1.1/GPL 2.0/LGPL 2.1
003: *
004: * "The contents of this file are subject to the Mozilla Public License
005: * Version 1.1 (the "License"); you may not use this file except in
006: * compliance with the License. You may obtain a copy of the License at
007: * http://www.mozilla.org/MPL/
008: *
009: * Software distributed under the License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
011: * License for the specific language governing rights and limitations under
012: * the License.
013: *
014: * The Original Code is ICEfaces 1.5 open source software code, released
015: * November 5, 2006. The Initial Developer of the Original Code is ICEsoft
016: * Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
017: * 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
018: *
019: * Contributor(s): _____________________.
020: *
021: * Alternatively, the contents of this file may be used under the terms of
022: * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
023: * License), in which case the provisions of the LGPL License are
024: * applicable instead of those above. If you wish to allow use of your
025: * version of this file only under the terms of the LGPL License and not to
026: * allow others to use your version of this file under the MPL, indicate
027: * your decision by deleting the provisions above and replace them with
028: * the notice and other provisions required by the LGPL License. If you do
029: * not delete the provisions above, a recipient may use your version of
030: * this file under either the MPL or the LGPL License."
031: *
032: */
033:
034: package com.icesoft.faces.context.effects;
035:
036: /**
037: * Used to translate simple strings into effects
038: */
039: public class EffectBuilder {
040:
041: public static Effect build(String name) {
042: if ("appear".equalsIgnoreCase(name)) {
043: return new Appear();
044: }
045: if ("move".equalsIgnoreCase(name)) {
046: return new Move();
047: }
048:
049: if ("fade".equalsIgnoreCase(name)) {
050: System.err.println("Returning [" + Fade.class.getName()
051: + "]");
052: return new Fade();
053: }
054: if ("highlight".equalsIgnoreCase(name)) {
055: return new Highlight();
056: }
057: if ("pulsate".equalsIgnoreCase(name)) {
058: return new Pulsate();
059: }
060: if ("scale".equalsIgnoreCase(name)) {
061: return new Scale(.5f);
062: }
063: if ("puff".equalsIgnoreCase(name)) {
064: return new Puff();
065: }
066: if ("blindup".equalsIgnoreCase(name)) {
067: return new BlindUp();
068: }
069: if ("blinddown".equalsIgnoreCase(name)) {
070: return new BlindDown();
071: }
072: if ("swtichoff".equalsIgnoreCase(name)) {
073: return new SwitchOff();
074: }
075: if ("dropout".equalsIgnoreCase(name)) {
076: return new DropOut();
077: }
078: if ("shake".equalsIgnoreCase(name)) {
079: return new Shake();
080: }
081: if ("slidedown".equalsIgnoreCase(name)) {
082: return new SlideDown();
083: }
084: if ("slideup".equalsIgnoreCase(name)) {
085: return new SlideUp();
086: }
087: if ("squish".equalsIgnoreCase(name)) {
088: return new Squish();
089: }
090: if ("grow".equalsIgnoreCase(name)) {
091: return new Grow();
092: }
093: if ("shrink".equalsIgnoreCase(name)) {
094: return new Shrink();
095: }
096: if ("fold".equalsIgnoreCase(name)) {
097: return new Fold();
098: }
099: if ("opacity".equalsIgnoreCase(name)) {
100: return new Opacity();
101: }
102: return null;
103: }
104: }
|