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: * script.aculo.us scale effect
038: *
039: * Grow or shrink an element by a specifed percent. (Default 50%)
040: */
041: public class Scale extends Effect {
042:
043: private boolean scaleX = true;
044: private boolean scaleY = true;
045: private boolean scaleContent = true;
046: private boolean scaleFromCenter = false;
047: private String scaleMode = "box";
048: private float scaleFrom = 100.0f;
049: private float scaleTo = 50.0f;
050:
051: public Scale(float to) {
052: this .scaleTo = to;
053: ea.add("scaleX", scaleX);
054: ea.add("scaleY", scaleY);
055: ea.add("scaleContent", scaleContent);
056: ea.add("scaleFromCenter", scaleFromCenter);
057: ea.add("scaleMode", scaleMode);
058: ea.add("scaleFrom", scaleFrom);
059: ea.add("scaleTo", scaleTo);
060: }
061:
062: public boolean isScaleX() {
063: return scaleX;
064: }
065:
066: public void setScaleX(boolean scaleX) {
067: this .scaleX = scaleX;
068: ea.add("scaleX", scaleX);
069: }
070:
071: public boolean isScaleY() {
072: return scaleY;
073: }
074:
075: public void setScaleY(boolean scaleY) {
076: this .scaleY = scaleY;
077: ea.add("scaleY", scaleY);
078: }
079:
080: public boolean isScaleContent() {
081: return scaleContent;
082: }
083:
084: public void setScaleContent(boolean scaleContent) {
085: this .scaleContent = scaleContent;
086: ea.add("scaleContent", scaleContent);
087: }
088:
089: public boolean isScaleFromCenter() {
090: return scaleFromCenter;
091: }
092:
093: public void setScaleFromCenter(boolean scaleFromCenter) {
094: this .scaleFromCenter = scaleFromCenter;
095: ea.add("scaleFromCenter", scaleFromCenter);
096: }
097:
098: public String getScaleMode() {
099: return scaleMode;
100: }
101:
102: public void setScaleMode(String scaleMode) {
103: this .scaleMode = scaleMode;
104: ea.add("scaleMode", scaleMode);
105: }
106:
107: public float getScaleFrom() {
108: return scaleFrom;
109: }
110:
111: public void setScaleFrom(float scaleFrom) {
112: this .scaleFrom = scaleFrom;
113: ea.add("scaleFrom", scaleFrom);
114: }
115:
116: public float getScaleTo() {
117: return scaleTo;
118: }
119:
120: public void setScaleTo(float scaleTo) {
121: this .scaleTo = scaleTo;
122: ea.add("scaleTo", scaleTo);
123: }
124:
125: public String getFunctionName() {
126: return "new Effect.Scale";
127: }
128:
129: public String toString(String var, String lastCall) {
130: if (isQueued()) {
131: ea.add("queue", "front");
132: }
133: if (isQueueEnd()) {
134: ea.add("queue", "end");
135: }
136: if (!isTransitory()) {
137: ea.add("uploadCSS", "true");
138: }
139: if (lastCall != null) {
140: ea.addFunction("iceFinish", "function(){" + lastCall + "}");
141: }
142: return "new Effect.Scale(" + var + ", " + scaleTo
143: + ea.toString();
144: }
145:
146: public String toString() {
147: return toString("id", null);
148: }
149:
150: }
|