/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package usda.weru.weps.location.mode;

import usda.weru.weps.location.Station;
import usda.weru.weps.location.chooser.StationChooser;

/**
 *
 * @author Joseph Levin <joelevin@weru.ksu.edu>
 */
public class NearestHandler extends ChoiceHandler{


    @Override
    protected void setView(StationChooser chooser){
        chooser.setView(StationChooser.View.Label);
    }

    @Override
    protected Station[] getValidStationChoices(BeanState state){
        //return the the nearest station regardless of distance
        return state.getDataModel().getNearestStations(state.getBean().getLatLong(), null, 1);
    }


    @Override
    public int getId() {
        return 4;
    }

    @Override
    public String getDisplayName() {
        return "Nearest Station";
    }

    @Override
    public String getName() {
        return "nearest";
    }  
}
