package org.ka2ddo.yaac;
/*
 * Copyright (C) 2011-2012 Andrew Pavlin, KA2DDO
 * This file is part of the sample plugin for YAAC (Yet Another APRS Client).
 *
 *  YAAC is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  YAAC is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  and GNU Lesser General Public License along with YAAC.  If not,
 *  see <http://www.gnu.org/licenses/>.
 */
import org.ka2ddo.yaac.ax25.StationTracker;
import org.ka2ddo.yaac.pluginapi.Provider;

/**
 * This sample plugin provides a few additional functions and an alternate properties
 * file for testing the plugin API.
 */
public class SamplePluginProvider extends Provider {
    public SamplePluginProvider() {
        super("YAAC Sample Plug-in", "V0.0", "by Andrew Pavlin, KA2DDO", "<html>Sample plug-in for YAAC</html>");
    }

    /**
     * Execute this function after calling all of the other functions of the
     * Provider. This allows any Provider-specific initialization to run after menus
     * and drivers are loaded.
     */
    @Override
    public void runInitializersAfter() {
        if (!Boolean.parseBoolean((String)YAAC.getProps().get(YAAC.OPT_GUI))) {
            // add announcement listener for changes in station positions
            StationTracker.getInstance().addTrackerListener(new SampleVectorCalculator());
        }
    }
}
