class PositionFormatter extends BaseLocationFormatter {

    @Override
    public Object formatCell(String cellValue, String fmtString) throws ParseException
    {
        LatLonAlt value = LatLonAlt.parse(cellValue);
        if (value == null)
        {
            return null;
        }

        CoordFormat fmt = CoordFormat.fromString(fmtString);
        double latitude = value.getLatD();
        double longitude = value.getLonD();
        if (fmt == CoordFormat.DMS)
        {
            return degToDms(latitude, 'N', 'S') + " " + degToDms(longitude, 'E', 'W');
        }
        else if (fmt == CoordFormat.DDM)
        {
            return LatLonAlt.latToDdmString(latitude, 3) + " "
                    + LatLonAlt.lonToDdmString(longitude, 3);
        }
        else
        {
            return latitude + " " + longitude;
        }
    }

    public  PositionFormatter(PreferencesRegistry registry);

}