1 package nl.tudelft.goal.unreal.util.vecmathcheck;
2
3 import java.net.URL;
4
5 import javax.vecmath.Matrix3d;
6
7
8
9
10
11
12
13
14
15
16
17 public class VecmathCheck {
18
19 public static final String minimumVersion = "1.5";
20
21 public static boolean check() {
22
23 if(getSpecificationVersion() == null){
24
25 return true;
26 }
27
28 return Matrix3d.class.getPackage().isCompatibleWith(minimumVersion);
29 }
30
31 public static String getMinimumVersion() {
32 return minimumVersion;
33 }
34
35 public static String getSpecificationVersion() {
36 return Matrix3d.class.getPackage().getSpecificationVersion();
37 }
38
39 public static URL getPackageDir() {
40 return Matrix3d.class.getProtectionDomain().getCodeSource().getLocation();
41 }
42
43 public static String getErrorMessage() {
44 return "Version " + VecmathCheck.getMinimumVersion() + " of Vecmath.jar is required. "
45 + "You have version " + VecmathCheck.getSpecificationVersion() + " on your class path at:\n"
46 + VecmathCheck.getPackageDir() +".\n"
47 + "Please remove this version from the class path.";
48 }
49 }