Package slash.navigation.fpl

Examples of slash.navigation.fpl.CountryCode


*/

public class CountryCodeListCellRenderer extends DefaultListCellRenderer {
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        CountryCode countryCode = CountryCode.class.cast(value);
        String text;
        if (countryCode != null) {
            if (None.equals(countryCode))
                text = RouteConverter.getBundle().getString("country-code-none");
            else
                text = countryCode.name().replaceAll("_", " ") +
                        " (" + countryCode.value() + ")";
        } else
            text = null;
        label.setText(text);
        return label;
    }
View Full Code Here


        comboBoxCountryCode.setModel(new DefaultComboBoxModel(CountryCode.values()));
        comboBoxCountryCode.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() != SELECTED)
                    return;
                CountryCode countryCode = (CountryCode) e.getItem();
                getPosition().setCountryCode(countryCode);
                validateModel();
            }
        });
        comboBoxWaypointType.setRenderer(new WaypointTypeListCellRenderer());
View Full Code Here

    private void updateView() {
        labelPosition.setText(format(RouteConverter.getBundle().getString("position-index"), index + 1, route.getPositionCount()));
        GarminFlightPlanPosition position = getPosition();
        textFieldDescription.setText(position.getDescription());
        CountryCode countryCode = position.getCountryCode();
        comboBoxCountryCode.setSelectedItem(countryCode == null ? None : countryCode);
        textFieldIdentifier.setText(position.getIdentifier());
        comboBoxWaypointType.setSelectedItem(position.getWaypointType());
        validateModel();
    }
View Full Code Here

TOP

Related Classes of slash.navigation.fpl.CountryCode

Copyright © 2018 www.massapicom. 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.