View Javadoc

1   /*
2    * Copyright 1999-2006 Faculty of Mathematics, Physics and Informatics, Comenius
3    * University, Bratislava. This file is protected by the Mozilla Public License
4    * version 1.1 (the License); you may not use this file except in compliance
5    * with the License. You may obtain a copy of the License at
6    * http://euromath2.sourceforge.net/license.html Unless required by applicable
7    * law or agreed to in writing, software distributed under the License is
8    * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9    * KIND, either express or implied. See the License for the specific language
10   * governing permissions and limitations under the License.
11   */
12  package sk.uniba.euromath.editor.textEditor;
13  
14  /***
15   * @author Tomáš Studva 15.8.2006
16   */
17  public enum Direction {
18          Left, Right, Up, Down;
19          
20          public static Direction getOpposite(Direction direction){
21                  switch (direction) {
22                  case Left:
23                          return Right;
24                  case Right:
25                          return Left;
26                  case Up:
27                          return Down;
28                  case Down:
29                          return Up;
30                  } 
31                  // not reachable
32                  throw new IllegalStateException();
33          }
34  }