Package net.sf.jmp3renamer.util

Examples of net.sf.jmp3renamer.util.MyLocale


        langpanel.add(langCombo);
        langCombo.setBounds(15, 30, 150, 25);
        mainPanel.add(langpanel, "LANGUAGE");
        List<String> supportedLanguages = Main.getSupportedLanguages();
        Iterator<String> it = supportedLanguages.iterator();
        MyLocale selected = null;
        List<MyLocale> locales = new ArrayList<MyLocale>();
        while (it.hasNext()) {
            String loc = it.next();
            MyLocale current = new MyLocale(new Locale(loc));
            if (loc.equals(Main.getProperty("lang"))) {
                selected = current;
            }
            locales.add(current);
        }
        Collections.sort(locales);
        Iterator<MyLocale> iter = locales.iterator();
        while (iter.hasNext()) {
            MyLocale element = iter.next();
            langCombo.addItem(element);
        }

        if (selected != null) {
            langCombo.setSelectedItem(selected);
View Full Code Here


        languageSelectorPanel.add(languageSelector);

        languageSelector.addItemListener(this);
        List<MyLocale> locales = new ArrayList<MyLocale>();
        for (String loc : Main.getSupportedLanguages()) {
            MyLocale current = new MyLocale(new Locale(loc));
            locales.add(current);
        }
        Collections.sort(locales);
        for (MyLocale element : locales) {
            languageSelector.addItem(element);
        }

        JPanel dummy = new JPanel(new GridLayout(2,1));
        englishTextArea.setEditable(false);
        englishTextArea.setLineWrap(true);
        englishTextArea.setWrapStyleWord(true);
        translatedTextArea.setLineWrap(true);
        translatedTextArea.setWrapStyleWord(true);
        dummy.setPreferredSize(new Dimension(0, 300));
        dummy.add(new JScrollPane(englishTextArea));
        dummy.add(new JScrollPane(translatedTextArea));

        JPanel rightPanel = new JPanel(new BorderLayout());
        rightPanel.add(languageSelectorPanel, BorderLayout.NORTH);
        rightPanel.add(new JScrollPane(table), BorderLayout.CENTER);
        rightPanel.add(dummy, BorderLayout.SOUTH);

        // splitpane
        splitpane.setLeftComponent(new JScrollPane(tree));
        splitpane.setRightComponent(rightPanel);
        splitpane.setDividerSize(5);
        splitpane.setDividerLocation(400);

        // control panel to the south
        bOk.addActionListener(this);
        bExport.addActionListener(this);
        bSave.addActionListener(this);
        controlPanel.add(bExport);
        controlPanel.add(bSave);
        controlPanel.add(bOk);

        // newLanguageSelector
        String[] locs = Locale.getISOLanguages();
        Arrays.sort(locs);
        for (String loc : locs) {
            newLanguageSelector.addItem( new MyLocale(new Locale(loc)) );
        }
        String i18n_newlang = I18N.translate("newLanguage");
        languageSelectorPanel.add(new JLabel("    "+i18n_newlang));
        languageSelectorPanel.add(newLanguageSelector);
        languageSelectorPanel.add(bAdd);
View Full Code Here

            addSelectedLanguage();
        }
    }

    private void addSelectedLanguage() {
        MyLocale locale = (MyLocale) newLanguageSelector.getSelectedItem();
        Main.getSupportedLanguages().add(locale.getLocale().getLanguage());
        languageSelector.addItem(locale);
        languageSelector.setSelectedItem(locale);
        this.locale = locale.getLocale().getLanguage();

        tree.repaint();
    }
View Full Code Here

TOP

Related Classes of net.sf.jmp3renamer.util.MyLocale

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.