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: * The appear effect will transition an HTML element from one opacity to
038: * another. By default if will transition from invisible to 100% opacity.
039: */
040: public class Appear extends Effect {
041:
042: private float from = 0.0f;
043: private float to = 1.0f;
044:
045: /**
046: * Default. Transition from invisible to 100%
047: */
048: public Appear() {
049: ea.add("from", from);
050: ea.add("to", to);
051: }
052:
053: /**
054: * Transition between two opacities. Max value i 1.0 min value 0.0. 1.0 =
055: * 100% 0.0 = 0%
056: *
057: * @param from
058: * @param to
059: */
060: public Appear(float from, float to) {
061: setFrom(from);
062: setTo(to);
063: }
064:
065: /**
066: * Get Start opacity
067: *
068: * @return
069: */
070: public float getFrom() {
071: return from;
072: }
073:
074: /**
075: * Set start opacity
076: *
077: * @param from
078: */
079: public void setFrom(float from) {
080: this .from = from;
081: ea.add("from", from);
082: }
083:
084: /**
085: * Get end opacity
086: *
087: * @return
088: */
089: public float getTo() {
090: return to;
091: }
092:
093: /**
094: * Set end opacity
095: *
096: * @param to
097: */
098: public void setTo(float to) {
099: this .to = to;
100: ea.add("to", to);
101: }
102:
103: /**
104: * The javascript function call.
105: *
106: * @return
107: */
108: public String getFunctionName() {
109: return "Effect.Appear";
110: }
111:
112: public int hashCode() {
113: int from = (int) (this .from * 100);
114: int to = (int) (this .to * 100);
115: return EffectHashCode.APPEAR * from * to;
116: }
117: }
|