Package mage.client.util.gui

Examples of mage.client.util.gui.ColorsChooser


    JPanel p0 = new JPanel();
    p0.setLayout(new BoxLayout(p0, BoxLayout.Y_AXIS));
    JLabel text = new JLabel("Choose color for your deck: ");
    p0.add(text);
    p0.add(Box.createVerticalStrut(5));
    final ColorsChooser colorsChooser = new ColorsChooser("bu");
    p0.add(colorsChooser);

    final JButton btnGenerate = new JButton("Ok");
    btnGenerate.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        btnGenerate.setEnabled(false);
        colorsChooser.setEnabled(false);
        selectedColors = (String) colorsChooser.getSelectedItem();
        dlg.setVisible(false);
      }
    });
    final JButton btnCancel = new JButton("Cancel");
    btnCancel.addActionListener(new ActionListener() {
View Full Code Here


        text.setAlignmentX(Component.CENTER_ALIGNMENT);
        p0.add(text);

        p0.add(Box.createVerticalStrut(5));
        String chosen = MageFrame.getPreferences().get("genDeckColor", "u");
        final ColorsChooser colorsChooser = new ColorsChooser(chosen);
        p0.add(colorsChooser);

        p0.add(Box.createVerticalStrut(5));
        JLabel text2 = new JLabel("(X - random color)");
        text2.setAlignmentX(Component.CENTER_ALIGNMENT);
        p0.add(text2);

        p0.add(Box.createVerticalStrut(5));
        JPanel jPanel = new JPanel();
        JLabel text3 = new JLabel("Choose sets:");
        cbSets = new JComboBox(ConstructedFormats.getTypes());
        cbSets.setSelectedIndex(0);
        cbSets.setPreferredSize(new Dimension(300, 25));
        cbSets.setMaximumSize(new Dimension(300, 25));
        cbSets.setAlignmentX(Component.LEFT_ALIGNMENT);
        jPanel.add(text3);
        jPanel.add(cbSets);
        p0.add(jPanel);

        String prefSet = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_DECK_GENERATOR_SET, null);
        if (prefSet != null) {
            cbSets.setSelectedItem(prefSet);
        }

        p0.add(Box.createVerticalStrut(5));
        JPanel jPanel2 = new JPanel();
        JLabel textDeckSize = new JLabel("Deck size:");
        cbDeckSize = new JComboBox(new String[]{"40","60"});
        cbDeckSize.setSelectedIndex(0);
        cbDeckSize.setPreferredSize(new Dimension(300, 25));
        cbDeckSize.setMaximumSize(new Dimension(300, 25));
        cbDeckSize.setAlignmentX(Component.LEFT_ALIGNMENT);
        jPanel2.add(textDeckSize);
        jPanel2.add(cbDeckSize);
        p0.add(jPanel2);

        String prefSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_DECK_GENERATOR_DECK_SIZE, "60");
        if (prefSet != null) {
            cbDeckSize.setSelectedItem(prefSize);
        }

        final JButton btnGenerate = new JButton("Ok");
        btnGenerate.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                btnGenerate.setEnabled(false);
                colorsChooser.setEnabled(false);
                selectedColors = (String) colorsChooser.getSelectedItem();
                dlg.setVisible(false);
                MageFrame.getPreferences().put("genDeckColor", selectedColors);
            }
        });
        final JButton btnCancel = new JButton("Cancel");
View Full Code Here

TOP

Related Classes of mage.client.util.gui.ColorsChooser

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.