* indicate that annotation colours are applied across all groups (pre
* Jalview 2.8.1 behaviour)
*/
- boolean doGroupAnnColour = isVersionStringLaterThan("2.8.1",
- object.getVersion());
+ boolean doGroupAnnColour = Jalview2XML.isVersionStringLaterThan(
+ "2.8.1", object.getVersion());
AlignmentPanel ap = null;
boolean isnewview = true;
* @return true if version is development/null or evaluates to the same or
* later X.Y.Z (where X,Y,Z are like [0-9]+b?[0-9]*)
*/
- protected boolean isVersionStringLaterThan(String supported,
+ public static boolean isVersionStringLaterThan(String supported,
String version)
{
if (version == null || version.equalsIgnoreCase("DEVELOPMENT BUILD")
String fileT = fileV.nextToken().toLowerCase().replace('b', '.');
try
{
- if (Float.valueOf(curT) > Float.valueOf(fileT))
+ float supportedVersionToken = Float.parseFloat(curT);
+ float myVersiontoken = Float.parseFloat(fileT);
+ if (supportedVersionToken > myVersiontoken)
{
// current version is newer than the version that wrote the file
return false;
}
+ if (supportedVersionToken < myVersiontoken)
+ {
+ // current version is older than the version that wrote the file
+ return true;
+ }
} catch (NumberFormatException nfe)
{
System.err