Examples of distanceToUnit()


Examples of slash.navigation.common.UnitSystem.distanceToUnit()

            return "";
        UnitSystem unitSystem = RouteConverter.getInstance().getUnitSystemModel().getUnitSystem();
        double distanceInMeters = unitSystem.valueToUnit(distance);
        if (abs(distanceInMeters) < maximumDistanceDisplayedInMeters)
            return format("%d %s", round(distanceInMeters), unitSystem.getElevationName());
        double distanceInKiloMeters = unitSystem.distanceToUnit(distance / 1000.0);
        if (abs(distanceInMeters) < maximumDistanceDisplayedInHundredMeters)
            return format("%s %s", roundFraction(distanceInKiloMeters, 1), unitSystem.getDistanceName());
        return format("%d %s", round(distanceInKiloMeters), unitSystem.getDistanceName());
    }
View Full Code Here

Examples of slash.navigation.common.UnitSystem.distanceToUnit()

    private static String formatSpeed(Double speed) {
        if (speed == null)
            return "";
        UnitSystem unitSystem = RouteConverter.getInstance().getUnitSystemModel().getUnitSystem();
        Double speedInUnit = unitSystem.distanceToUnit(speed);
        if (abs(speedInUnit) < 10.0)
             return format("%s %s", roundFraction(speedInUnit, 1), unitSystem.getSpeedName());
        else
            return format("%d %s", round(speedInUnit), unitSystem.getSpeedName());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.