Search in sources :

Example 6 with RoundedButton

use of net.technicpack.ui.controls.RoundedButton in project LauncherV3 by TechnicPack.

the class InstallerFrame method setupPortableMode.

private void setupPortableMode(JPanel panel) {
    panel.setLayout(new GridBagLayout());
    JLabel portableSpiel = new JLabel("<html><body align=\"left\" style='margin-right:10px;'>" + resources.getString("launcher.installer.portablespiel") + "</body></html>");
    portableSpiel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    portableSpiel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    portableSpiel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    panel.add(portableSpiel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(9, 8, 9, 3), 0, 0));
    panel.add(Box.createGlue(), new GridBagConstraints(0, 1, 3, 1, 1.0, 0.7, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    JLabel installFolderLabel = new JLabel(resources.getString("launcher.installer.folder"));
    installFolderLabel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    installFolderLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    panel.add(installFolderLabel, new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 24, 0, 8), 0, 0));
    String installDir = "";
    if (settings.isPortable())
        installDir = settings.getTechnicRoot().getAbsolutePath();
    portableInstallDir = new JTextField(installDir);
    portableInstallDir.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    portableInstallDir.setForeground(LauncherFrame.COLOR_BLUE);
    portableInstallDir.setBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    portableInstallDir.setHighlighter(null);
    portableInstallDir.setEditable(false);
    portableInstallDir.setCursor(null);
    portableInstallDir.setBorder(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 8));
    panel.add(portableInstallDir, new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 16));
    RoundedButton selectInstall = new RoundedButton(resources.getString("launcher.installer.select"));
    selectInstall.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    selectInstall.setContentAreaFilled(false);
    selectInstall.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    selectInstall.setHoverForeground(LauncherFrame.COLOR_BLUE);
    selectInstall.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            selectPortable();
        }
    });
    panel.add(selectInstall, new GridBagConstraints(2, 2, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 0, 16), 0, 0));
    panel.add(Box.createGlue(), new GridBagConstraints(0, 3, 3, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    String defaultLocaleText = resources.getString("launcheroptions.language.default");
    if (!resources.isDefaultLocaleSupported()) {
        defaultLocaleText = defaultLocaleText.concat(" (" + resources.getString("launcheroptions.language.unavailable") + ")");
    }
    portableLanguages = new JComboBox();
    portableLanguages.addItem(new LanguageItem(ResourceLoader.DEFAULT_LOCALE, defaultLocaleText, resources));
    for (int i = 0; i < LauncherMain.supportedLanguages.length; i++) {
        portableLanguages.addItem(new LanguageItem(resources.getCodeFromLocale(LauncherMain.supportedLanguages[i]), LauncherMain.supportedLanguages[i].getDisplayName(LauncherMain.supportedLanguages[i]), resources.getVariant(LauncherMain.supportedLanguages[i])));
    }
    if (!settings.getLanguageCode().equalsIgnoreCase(ResourceLoader.DEFAULT_LOCALE)) {
        Locale loc = resources.getLocaleFromCode(settings.getLanguageCode());
        for (int i = 0; i < LauncherMain.supportedLanguages.length; i++) {
            if (loc.equals(LauncherMain.supportedLanguages[i])) {
                portableLanguages.setSelectedIndex(i + 1);
                break;
            }
        }
    }
    portableLanguages.setBorder(new RoundBorder(LauncherFrame.COLOR_SCROLL_THUMB, 1, 10));
    portableLanguages.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 14));
    portableLanguages.setUI(new LanguageCellUI(resources, new RoundedBorderFormatter(new LineBorder(Color.black, 1)), LauncherFrame.COLOR_SCROLL_TRACK, LauncherFrame.COLOR_SCROLL_THUMB));
    portableLanguages.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    portableLanguages.setBackground(LauncherFrame.COLOR_SELECTOR_BACK);
    portableLanguages.setRenderer(new LanguageCellRenderer(resources, "globe.png", LauncherFrame.COLOR_SELECTOR_BACK, LauncherFrame.COLOR_WHITE_TEXT));
    portableLanguages.setEditable(false);
    portableLanguages.setFocusable(false);
    portableLanguages.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            portableLanguageChanged();
        }
    });
    panel.add(portableLanguages, new GridBagConstraints(0, 4, 1, 0, 0, 0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(0, 8, 8, 0), 0, 0));
    portableInstallButton = new RoundedButton(resources.getString("launcher.installer.install"));
    portableInstallButton.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    portableInstallButton.setContentAreaFilled(false);
    portableInstallButton.setForeground(LauncherFrame.COLOR_GREY_TEXT);
    portableInstallButton.setHoverForeground(LauncherFrame.COLOR_BLUE);
    portableInstallButton.setBorder(BorderFactory.createEmptyBorder(5, 17, 10, 17));
    portableInstallButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            portableInstall();
        }
    });
    portableInstallButton.setEnabled(false);
    if (!installDir.equals("")) {
        portableInstallButton.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
        portableInstallButton.setEnabled(true);
    }
    panel.add(portableInstallButton, new GridBagConstraints(1, 4, 2, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 8, 8), 0, 0));
}
Also used : Locale(java.util.Locale) RoundedButton(net.technicpack.ui.controls.RoundedButton) ActionEvent(java.awt.event.ActionEvent) LineBorder(javax.swing.border.LineBorder) LanguageCellRenderer(net.technicpack.ui.controls.lang.LanguageCellRenderer) ActionListener(java.awt.event.ActionListener) LanguageCellUI(net.technicpack.ui.controls.lang.LanguageCellUI) RoundedBorderFormatter(net.technicpack.ui.controls.list.popupformatters.RoundedBorderFormatter) RoundBorder(net.technicpack.ui.controls.borders.RoundBorder) LanguageItem(net.technicpack.ui.listitems.LanguageItem)

Example 7 with RoundedButton

use of net.technicpack.ui.controls.RoundedButton in project LauncherV3 by TechnicPack.

the class FixRunDataDialog method buildRecommendedButtons.

private void buildRecommendedButtons(JPanel centerPanel, int gridBagIndex, Font font) {
    JPanel checkPanel = new JPanel();
    checkPanel.setOpaque(false);
    centerPanel.add(checkPanel, new GridBagConstraints(0, gridBagIndex++, 1, 1, 1.0f, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
    JLabel label = new JLabel(resourceLoader.getString("fixRunData.dontAskAgain"));
    label.setFont(font);
    label.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    checkPanel.add(label);
    rememberThis = new JCheckBox("", false);
    rememberThis.setHorizontalAlignment(SwingConstants.RIGHT);
    rememberThis.setBorder(BorderFactory.createEmptyBorder());
    rememberThis.setIconTextGap(0);
    rememberThis.setSelectedIcon(resourceLoader.getIcon("checkbox_closed.png"));
    rememberThis.setIcon(resourceLoader.getIcon("checkbox_open.png"));
    rememberThis.setFocusPainted(false);
    checkPanel.add(rememberThis);
    JPanel buttonPanel = new JPanel();
    buttonPanel.setOpaque(false);
    centerPanel.add(buttonPanel, new GridBagConstraints(0, gridBagIndex++, 1, 1, 1.0f, 1.0f, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(8, 0, 0, 0), 0, 0));
    RoundedButton cancelButton = new RoundedButton(resourceLoader.getString("fixRunData.cancel"));
    cancelButton.setFont(resourceLoader.getFont(ResourceLoader.FONT_OPENSANS, 16));
    cancelButton.setContentAreaFilled(false);
    cancelButton.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    cancelButton.setHoverForeground(LauncherFrame.COLOR_BLUE);
    cancelButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            result = Result.CANCEL;
            dispose();
        }
    });
    buttonPanel.add(cancelButton);
    buttonPanel.add(Box.createHorizontalGlue());
    RoundedButton okButton = new RoundedButton(resourceLoader.getString("fixRunData.OK"));
    okButton.setFont(resourceLoader.getFont(ResourceLoader.FONT_OPENSANS, 16));
    okButton.setContentAreaFilled(false);
    okButton.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    okButton.setHoverForeground(LauncherFrame.COLOR_BLUE);
    okButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            result = Result.ACCEPT;
            dispose();
        }
    });
    buttonPanel.add(okButton);
}
Also used : RoundedButton(net.technicpack.ui.controls.RoundedButton) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent)

Example 8 with RoundedButton

use of net.technicpack.ui.controls.RoundedButton in project LauncherV3 by TechnicPack.

the class FixRunDataDialog method buildFailureButtons.

private void buildFailureButtons(JPanel centerPanel, int gridBagIndex, Font font) {
    JPanel buttonPanel = new JPanel();
    buttonPanel.setOpaque(false);
    centerPanel.add(buttonPanel, new GridBagConstraints(0, gridBagIndex++, 1, 1, 1.0f, 1.0f, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(8, 0, 0, 0), 0, 0));
    RoundedButton okButton = new RoundedButton(resourceLoader.getString("fixRunData.OK"));
    okButton.setFont(resourceLoader.getFont(ResourceLoader.FONT_OPENSANS, 16));
    okButton.setContentAreaFilled(false);
    okButton.setBorder(BorderFactory.createEmptyBorder(5, 25, 5, 25));
    okButton.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    okButton.setHoverForeground(LauncherFrame.COLOR_BLUE);
    okButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            result = Result.OK;
            dispose();
        }
    });
    buttonPanel.add(okButton);
}
Also used : RoundedButton(net.technicpack.ui.controls.RoundedButton) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent)

Example 9 with RoundedButton

use of net.technicpack.ui.controls.RoundedButton in project LauncherV3 by TechnicPack.

the class InstallerFrame method setupStandardInstall.

private void setupStandardInstall(JPanel panel) {
    panel.setLayout(new GridBagLayout());
    JLabel standardSpiel = new JLabel("<html><body align=\"left\" style='margin-right:10px;'>" + resources.getString("launcher.installer.standardspiel") + "</body></html>");
    standardSpiel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    standardSpiel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    standardSpiel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    panel.add(standardSpiel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(9, 0, 0, 3), 0, 0));
    panel.add(Box.createGlue(), new GridBagConstraints(0, 1, 3, 1, 1.0, 0.7, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    standardDefaultDirectory = new JCheckBox(resources.getString("launcher.installer.default"));
    standardDefaultDirectory.setOpaque(false);
    standardDefaultDirectory.setHorizontalAlignment(SwingConstants.RIGHT);
    standardDefaultDirectory.setBorder(BorderFactory.createEmptyBorder());
    standardDefaultDirectory.setIconTextGap(0);
    standardDefaultDirectory.setSelectedIcon(resources.getIcon("checkbox_closed.png"));
    standardDefaultDirectory.setIcon(resources.getIcon("checkbox_open.png"));
    standardDefaultDirectory.setFocusPainted(false);
    standardDefaultDirectory.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    standardDefaultDirectory.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    standardDefaultDirectory.setIconTextGap(6);
    standardDefaultDirectory.setSelected(settings.isPortable() || settings.getTechnicRoot().getAbsolutePath().equals(OperatingSystem.getOperatingSystem().getUserDirectoryForApp("technic").getAbsolutePath()));
    standardDefaultDirectory.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            useDefaultDirectoryChanged();
        }
    });
    panel.add(standardDefaultDirectory, new GridBagConstraints(0, 2, 3, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 24, 12, 0), 0, 0));
    JLabel installFolderLabel = new JLabel(resources.getString("launcher.installer.folder"));
    installFolderLabel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    installFolderLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    panel.add(installFolderLabel, new GridBagConstraints(0, 3, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 24, 0, 8), 0, 0));
    String installDir = OperatingSystem.getOperatingSystem().getUserDirectoryForApp("technic").getAbsolutePath();
    if (!settings.isPortable())
        installDir = settings.getTechnicRoot().getAbsolutePath();
    standardInstallDir = new JTextField(installDir);
    standardInstallDir.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    standardInstallDir.setBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    standardInstallDir.setHighlighter(null);
    standardInstallDir.setEditable(false);
    standardInstallDir.setCursor(null);
    panel.add(standardInstallDir, new GridBagConstraints(1, 3, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 16));
    standardSelectButton = new RoundedButton(resources.getString("launcher.installer.select"));
    standardSelectButton.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    standardSelectButton.setContentAreaFilled(false);
    standardSelectButton.setHoverForeground(LauncherFrame.COLOR_BLUE);
    standardSelectButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            selectStandard();
        }
    });
    panel.add(standardSelectButton, new GridBagConstraints(2, 3, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 0, 16), 0, 0));
    useDefaultDirectoryChanged();
    panel.add(Box.createGlue(), new GridBagConstraints(0, 4, 3, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    String defaultLocaleText = resources.getString("launcheroptions.language.default");
    if (!resources.isDefaultLocaleSupported()) {
        defaultLocaleText = defaultLocaleText.concat(" (" + resources.getString("launcheroptions.language.unavailable") + ")");
    }
    standardLanguages = new JComboBox();
    standardLanguages.addItem(new LanguageItem(ResourceLoader.DEFAULT_LOCALE, defaultLocaleText, resources));
    for (int i = 0; i < LauncherMain.supportedLanguages.length; i++) {
        standardLanguages.addItem(new LanguageItem(resources.getCodeFromLocale(LauncherMain.supportedLanguages[i]), LauncherMain.supportedLanguages[i].getDisplayName(LauncherMain.supportedLanguages[i]), resources.getVariant(LauncherMain.supportedLanguages[i])));
    }
    if (!settings.getLanguageCode().equalsIgnoreCase(ResourceLoader.DEFAULT_LOCALE)) {
        Locale loc = resources.getLocaleFromCode(settings.getLanguageCode());
        for (int i = 0; i < LauncherMain.supportedLanguages.length; i++) {
            if (loc.equals(LauncherMain.supportedLanguages[i])) {
                standardLanguages.setSelectedIndex(i + 1);
                break;
            }
        }
    }
    standardLanguages.setBorder(new RoundBorder(LauncherFrame.COLOR_SCROLL_THUMB, 1, 10));
    standardLanguages.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 14));
    standardLanguages.setUI(new LanguageCellUI(resources, new RoundedBorderFormatter(new LineBorder(Color.black, 1)), LauncherFrame.COLOR_SCROLL_TRACK, LauncherFrame.COLOR_SCROLL_THUMB));
    standardLanguages.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    standardLanguages.setBackground(LauncherFrame.COLOR_SELECTOR_BACK);
    standardLanguages.setRenderer(new LanguageCellRenderer(resources, "globe.png", LauncherFrame.COLOR_SELECTOR_BACK, LauncherFrame.COLOR_WHITE_TEXT));
    standardLanguages.setEditable(false);
    standardLanguages.setFocusable(false);
    standardLanguages.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            standardLanguageChanged();
        }
    });
    panel.add(standardLanguages, new GridBagConstraints(0, 5, 1, 0, 0, 0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(0, 8, 8, 0), 0, 0));
    RoundedButton install = new RoundedButton(resources.getString("launcher.installer.install"));
    install.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    install.setContentAreaFilled(false);
    install.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    install.setHoverForeground(LauncherFrame.COLOR_BLUE);
    install.setBorder(BorderFactory.createEmptyBorder(5, 17, 10, 17));
    install.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            standardInstall();
        }
    });
    panel.add(install, new GridBagConstraints(1, 5, 2, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 8, 8), 0, 0));
}
Also used : Locale(java.util.Locale) RoundedButton(net.technicpack.ui.controls.RoundedButton) ActionEvent(java.awt.event.ActionEvent) LineBorder(javax.swing.border.LineBorder) LanguageCellRenderer(net.technicpack.ui.controls.lang.LanguageCellRenderer) ActionListener(java.awt.event.ActionListener) LanguageCellUI(net.technicpack.ui.controls.lang.LanguageCellUI) RoundedBorderFormatter(net.technicpack.ui.controls.list.popupformatters.RoundedBorderFormatter) RoundBorder(net.technicpack.ui.controls.borders.RoundBorder) LanguageItem(net.technicpack.ui.listitems.LanguageItem)

Example 10 with RoundedButton

use of net.technicpack.ui.controls.RoundedButton in project LauncherV3 by TechnicPack.

the class ModpackInfoPanel method initComponents.

private void initComponents(ImageRepository<ModpackModel> iconRepo, ImageRepository<ModpackModel> logoRepo, ActionListener modpackOptionsListener, IDiscordApi discordApi) {
    setLayout(new BorderLayout());
    background = new TiledBackground(null);
    background.setOpaque(true);
    background.setLayout(new BorderLayout());
    background.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    background.setBackground(LauncherFrame.COLOR_CENTRAL_BACK);
    background.setFilterImage(true);
    this.add(background, BorderLayout.CENTER);
    JPanel layoutPanel = new JPanel();
    layoutPanel.setOpaque(false);
    layoutPanel.setLayout(new BoxLayout(layoutPanel, BoxLayout.PAGE_AXIS));
    layoutPanel.setBorder(BorderFactory.createEmptyBorder(20, 0, 0, 0));
    background.add(layoutPanel, BorderLayout.CENTER);
    banner = new ModpackBanner(resources, iconRepo, modpackOptionsListener);
    banner.setBackground(LauncherFrame.COLOR_BANNER);
    banner.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0));
    layoutPanel.add(banner);
    JPanel rootFeedPanel = new JPanel();
    BorderLayout rootFeedLayout = new BorderLayout();
    rootFeedLayout.setVgap(10);
    rootFeedPanel.setLayout(rootFeedLayout);
    rootFeedPanel.setOpaque(false);
    rootFeedPanel.setBorder(BorderFactory.createEmptyBorder(16, 20, 20, 16));
    layoutPanel.add(rootFeedPanel);
    dataDisplay = new ModpackDataDisplay(resources, logoRepo, discordApi);
    rootFeedPanel.add(dataDisplay, BorderLayout.PAGE_START);
    JPanel feedBottom = new JPanel();
    feedBottom.setOpaque(false);
    feedBottom.setLayout(new GridBagLayout());
    rootFeedPanel.add(feedBottom, BorderLayout.CENTER);
    JPanel topline = new JPanel();
    topline.setOpaque(false);
    topline.setLayout(new BoxLayout(topline, BoxLayout.LINE_AXIS));
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.weightx = 1.0;
    constraints.weighty = 0.0;
    constraints.gridwidth = 3;
    constraints.gridheight = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    feedBottom.add(topline, constraints);
    JLabel toplineLabel = new JLabel(resources.getString("launcher.packfeed.title"));
    toplineLabel.setFont(resources.getFont(ResourceLoader.FONT_RALEWAY, 28));
    toplineLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    topline.add(toplineLabel);
    topline.add(Box.createHorizontalGlue());
    JButton leftButton = new JButton(resources.getIcon("status_left.png"));
    leftButton.setBorder(BorderFactory.createEmptyBorder());
    leftButton.setContentAreaFilled(false);
    leftButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            clickLeftFeedButton();
        }
    });
    topline.add(leftButton);
    JButton rightButton = new JButton(resources.getIcon("status_right.png"));
    rightButton.setBorder(BorderFactory.createEmptyBorder());
    rightButton.setContentAreaFilled(false);
    rightButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            clickRightFeedButton();
        }
    });
    topline.add(rightButton);
    JLabel label = new JLabel(resources.getString("launcher.packfeed.noupdates"));
    label.setFont(resources.getFont(ResourceLoader.FONT_RALEWAY, 20));
    label.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    feedGallery = new HorizontalGallery();
    feedGallery.setNoComponentsMessage(label);
    feedGallery.setBackground(LauncherFrame.COLOR_FEED_BACK);
    feedGallery.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
    constraints = new GridBagConstraints();
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.weightx = 1.0;
    constraints.weighty = 0.0;
    constraints.gridwidth = 3;
    constraints.gridheight = 1;
    constraints.ipady = 150;
    constraints.fill = GridBagConstraints.BOTH;
    feedBottom.add(feedGallery, constraints);
    constraints = new GridBagConstraints();
    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.weightx = 1.0;
    constraints.weighty = 0.0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    Component vertFill = Box.createVerticalStrut(12);
    feedBottom.add(vertFill, constraints);
    deleteButton = new RoundedButton(resources.getString("modpackoptions.delete.text"));
    deleteButton.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    deleteButton.setBorder(BorderFactory.createEmptyBorder(5, 17, 10, 17));
    deleteButton.setBackground(LauncherFrame.COLOR_FOOTER);
    deleteButton.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    deleteButton.setHoverForeground(LauncherFrame.COLOR_BLUE);
    deleteButton.setAlignmentX(RIGHT_ALIGNMENT);
    deleteButton.setFocusable(false);
    deleteButton.setContentAreaFilled(false);
    deleteButton.setShouldShowBackground(true);
    deleteButton.setIconTextGap(8);
    deleteButton.setHoverIcon(new ImageIcon(resources.colorImage(resources.getImage("delete_button.png"), LauncherFrame.COLOR_BLUE)));
    deleteButton.setIcon(new ImageIcon(resources.colorImage(resources.getImage("delete_button.png"), LauncherFrame.COLOR_BUTTON_BLUE)));
    feedBottom.add(deleteButton, new GridBagConstraints(0, 3, 1, 1, 1, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    constraints = new GridBagConstraints();
    constraints.gridx = 1;
    constraints.gridy = 3;
    constraints.weightx = 0.02;
    constraints.weighty = 0.0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    Component horizFill = Box.createGlue();
    feedBottom.add(horizFill, constraints);
    playButton = new RoundedButton(resources.getString("launcher.pack.launch"));
    playButton.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    playButton.setBorder(BorderFactory.createEmptyBorder(5, 17, 10, 17));
    playButton.setBackground(LauncherFrame.COLOR_FOOTER);
    playButton.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    playButton.setHoverForeground(LauncherFrame.COLOR_BLUE);
    playButton.setAlignmentX(RIGHT_ALIGNMENT);
    playButton.setFocusable(false);
    playButton.setContentAreaFilled(false);
    playButton.setShouldShowBackground(true);
    playButton.setIconTextGap(8);
    constraints = new GridBagConstraints();
    constraints.gridx = 2;
    constraints.gridy = 3;
    constraints.weightx = 0.0;
    constraints.weighty = 0.0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    feedBottom.add(playButton, constraints);
    feedBottom.add(Box.createVerticalGlue(), new GridBagConstraints(0, 4, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
}
Also used : RoundedButton(net.technicpack.ui.controls.RoundedButton) ActionEvent(java.awt.event.ActionEvent) HorizontalGallery(net.technicpack.ui.controls.feeds.HorizontalGallery) ActionListener(java.awt.event.ActionListener) TiledBackground(net.technicpack.ui.controls.TiledBackground)

Aggregations

RoundedButton (net.technicpack.ui.controls.RoundedButton)10 ActionEvent (java.awt.event.ActionEvent)9 ActionListener (java.awt.event.ActionListener)9 RoundBorder (net.technicpack.ui.controls.borders.RoundBorder)6 RoundedBorderFormatter (net.technicpack.ui.controls.list.popupformatters.RoundedBorderFormatter)6 MetalComboBoxUI (javax.swing.plaf.metal.MetalComboBoxUI)4 SimpleButtonComboUI (net.technicpack.ui.controls.list.SimpleButtonComboUI)4 Locale (java.util.Locale)3 LineBorder (javax.swing.border.LineBorder)3 BasicComboPopup (javax.swing.plaf.basic.BasicComboPopup)3 LanguageCellRenderer (net.technicpack.ui.controls.lang.LanguageCellRenderer)3 LanguageCellUI (net.technicpack.ui.controls.lang.LanguageCellUI)3 LanguageItem (net.technicpack.ui.listitems.LanguageItem)3 HyperlinkEvent (javax.swing.event.HyperlinkEvent)1 HyperlinkListener (javax.swing.event.HyperlinkListener)1 TiledBackground (net.technicpack.ui.controls.TiledBackground)1 HorizontalGallery (net.technicpack.ui.controls.feeds.HorizontalGallery)1 AdvancedCellRenderer (net.technicpack.ui.controls.list.AdvancedCellRenderer)1 SimpleScrollbarUI (net.technicpack.ui.controls.list.SimpleScrollbarUI)1