001    package echopoint.jquery;
002    
003    import nextapp.echo.app.Component;
004    import nextapp.echo.app.PaneContainer;
005    
006    /**
007     * A component that renders an animated transition effect when its content is changed.
008     *
009     * This component is using the jQuery (http://www.jquery.com) and jQuery UI (http://www.jqueryui.com) projects.
010     *
011     * @author Mikael S\u00f6derman 2009-06-03
012     * @version $Id$
013     */
014    public class TransitionContainer extends Component implements PaneContainer {
015    
016        public static final int TYPE_IMMEDIATE_REPLACE = 0;
017        public static final int TYPE_BLIND = 1;
018        public static final int TYPE_BOUNCE = 2;
019        public static final int TYPE_CLIP = 3;
020        public static final int TYPE_DROP = 4;
021        public static final int TYPE_EXPLODE = 5;
022        public static final int TYPE_FOLD = 6;
023        public static final int TYPE_HIGHLIGHT = 7;
024        public static final int TYPE_PUFF = 8;
025        public static final int TYPE_PULSATE = 9;
026        public static final int TYPE_SCALE = 10;
027        public static final int TYPE_SHAKE = 11;
028        public static final int TYPE_SIZE = 12;
029        public static final int TYPE_SLIDE = 13;
030    
031        public static final String PROPERTY_TYPE = "type";
032        public static final String PROPERTY_DURATION = "duration";
033    
034        public static final int DEFAULT_DURATION = 550;
035    
036        public int getDuration() {
037               Integer duration = (Integer) get(PROPERTY_DURATION);
038               return duration == null ? DEFAULT_DURATION : duration.intValue();
039           }
040    
041        public void setDuration(int newValue) {
042            set(PROPERTY_DURATION, new Integer(newValue));
043        }
044    
045          public int getType() {
046            Integer type = (Integer) get(PROPERTY_TYPE);
047            return type == null ? TYPE_IMMEDIATE_REPLACE : type.intValue();
048        }
049    
050         public void setType(int newValue) {
051            set(PROPERTY_TYPE, new Integer(newValue));
052        }
053    
054    }