Merge sources from S-Core's RSA git (release)
[sdk/ide/common-eplugin.git] / org.tizen.common.externals / src / org / mihalis / opal / transitionComposite / TransitionFactory.java
1 /*******************************************************************************\r
2  * Copyright (c) 2011 Laurent CARON.\r
3  * All rights reserved. This program and the accompanying materials\r
4  * are made available under the terms of the Eclipse Public License v1.0\r
5  * which accompanies this distribution, and is available at\r
6  * http://www.eclipse.org/legal/epl-v10.html\r
7  *\r
8  * Contributors:\r
9  *     Laurent CARON (laurent.caron@gmail.com) - initial API and implementation\r
10  *******************************************************************************/\r
11 package org.mihalis.opal.transitionComposite;\r
12 \r
13 /**\r
14  * This class is a transition factory\r
15  */\r
16 public class TransitionFactory {\r
17 \r
18         /**\r
19          * @param transition transition to get\r
20          * @return a transition corresponding to the <code>transition</code>\r
21          *         parameter\r
22          */\r
23         public static Transition getTransitionFor(final TRANSITIONS transition) {\r
24                 switch (transition) {\r
25                 case DOWN_TO_UP:\r
26                         return new DownUpTransition();\r
27                 case DOWN_TO_UP_AND_APPEAR:\r
28                         return new DownUpAppearTransition();\r
29                 case LEFT_TO_RIGHT:\r
30                         return new LeftRightTransition();\r
31                 case LEFT_TO_RIGHT_AND_APPEAR:\r
32                         return new LeftRightAppearTransition();\r
33                 case NONE:\r
34                         return new NoTransition();\r
35                 case RIGHT_TO_LEFT:\r
36                         return new RightLeftTransition();\r
37                 case RIGHT_TO_LEFT_AND_APPEAR:\r
38                         return new RightLeftAppearTransition();\r
39                 case UP_TO_DOWN:\r
40                         return new UpDownTransition();\r
41                 case UP_TO_DOWN_AND_APPEAR:\r
42                         return new UpDownAppearTransition();\r
43         default:\r
44             return null;\r
45                 }\r
46         }\r
47 \r
48 }\r