Revision: 4108 http://vexi.svn.sourceforge.net/vexi/?rev=4108&view=rev Author: clrg Date: 2011-04-14 00:34:47 +0000 (Thu, 14 Apr 2011)
Log Message: ----------- Smarten up Java platform selection (1.0 definitely *not* supported) - probably should forget <1.4 anyway Modified Paths: -------------- trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Platform.java Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Platform.java =================================================================== --- trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Platform.java 2011-04-11 23:40:46 UTC (rev 4107) +++ trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Platform.java 2011-04-14 00:34:47 UTC (rev 4108) @@ -85,12 +85,19 @@ } else { platform_class = "X11"; } - } else if (version.startsWith("1.0") || version.startsWith("1.1")) { - platform_class = "AWT"; - } else if (version.startsWith("1.2") || version.startsWith("1.3")) { - platform_class = "Java2"; - } else if (version.startsWith("1")) { - platform_class = "Swing"; + } else { + int secondDecimal = version.substring(version.indexOf('.') + 1).indexOf('.'); + if (secondDecimal != -1) { + version = version.substring(0, version.indexOf('.') + 1 + secondDecimal); + } + double versionNumber = Double.parseDouble(version); + if (versionNumber >= 1.4) { + platform_class = "Swing"; + } else if (versionNumber >= 1.1) { + platform_class = "AWT"; + } else { + criticalAbort(vendor+" "+version+" is currently unsupported"); + } } if (platform_class == null) { @@ -185,7 +192,7 @@ public static boolean needsAutoClick() { return platform._needsAutoClick(); } protected boolean _needsAutoClick() { return false; } - /** if true, org.ibex.Surface will generate a DoubleClick automatically after recieving two clicks in a short period of time */ + /** if true, org.ibex.Surface will generate a DoubleClick automatically after receiving two clicks in a short period of time */ public static boolean needsAutoDoubleClick() { return platform._needsAutoDoubleClick(); } protected boolean _needsAutoDoubleClick() { return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn