Search in sources :

Example 6 with RoundBorder

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

the class LoginFrame method setCurrentUser.

protected void setCurrentUser(MojangUser mojangUser) {
    if (mojangUser == null) {
        clearCurrentUser();
        return;
    }
    password.setText("PASSWORD");
    password.setEditable(false);
    password.setForeground(LauncherFrame.COLOR_SCROLL_THUMB);
    password.setBorder(new RoundBorder(LauncherFrame.COLOR_SCROLL_THUMB, 1, 10));
    rememberAccount.setSelected(true);
    nameSelect.setSelectedItem(mojangUser);
}
Also used : RoundBorder(net.technicpack.ui.controls.borders.RoundBorder)

Example 7 with RoundBorder

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

the class OptionsDialog method setupJavaOptionsPanel.

private void setupJavaOptionsPanel(JPanel panel) {
    panel.setLayout(new GridBagLayout());
    JLabel versionLabel = new JLabel(resources.getString("launcheroptions.java.version"));
    versionLabel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    versionLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    panel.add(versionLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 60, 0, 0), 0, 0));
    versionSelect = new JComboBox();
    if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("mac")) {
        versionSelect.setUI(new MetalComboBoxUI());
    }
    versionSelect.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    versionSelect.setEditable(false);
    versionSelect.setBorder(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 10));
    versionSelect.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    versionSelect.setBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    SimpleButtonComboUI ui = new SimpleButtonComboUI(new RoundedBorderFormatter(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 0)), resources, LauncherFrame.COLOR_SCROLL_TRACK, LauncherFrame.COLOR_SCROLL_THUMB);
    versionSelect.setUI(ui);
    versionSelect.setFocusable(false);
    Object child = versionSelect.getAccessibleContext().getAccessibleChild(0);
    BasicComboPopup popup = (BasicComboPopup) child;
    JList list = popup.getList();
    list.setSelectionForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    list.setSelectionBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    list.setBackground(LauncherFrame.COLOR_CENTRAL_BACK_OPAQUE);
    panel.add(versionSelect, new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(8, 16, 8, 8), 0, 16));
    RoundedButton otherVersionButton = new RoundedButton(resources.getString("launcheroptions.java.otherversion"));
    otherVersionButton.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    otherVersionButton.setContentAreaFilled(false);
    otherVersionButton.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    otherVersionButton.setHoverForeground(LauncherFrame.COLOR_BLUE);
    otherVersionButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            selectOtherVersion();
        }
    });
    panel.add(otherVersionButton, new GridBagConstraints(2, 0, 5, 1, 2, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(8, 8, 8, 80), 0, 0));
    JLabel memLabel = new JLabel(resources.getString("launcheroptions.java.memory"));
    memLabel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    memLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    panel.add(memLabel, new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 60, 0, 0), 0, 0));
    memSelect = new JComboBox();
    if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("mac")) {
        memSelect.setUI(new MetalComboBoxUI());
    }
    memSelect.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    memSelect.setEditable(false);
    memSelect.setBorder(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 10));
    memSelect.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    memSelect.setBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    ui = new SimpleButtonComboUI(new RoundedBorderFormatter(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 0)), resources, LauncherFrame.COLOR_SCROLL_TRACK, LauncherFrame.COLOR_SCROLL_THUMB);
    memSelect.setUI(ui);
    memSelect.setFocusable(false);
    child = memSelect.getAccessibleContext().getAccessibleChild(0);
    popup = (BasicComboPopup) child;
    list = popup.getList();
    list.setSelectionForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    list.setSelectionBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    list.setBackground(LauncherFrame.COLOR_CENTRAL_BACK_OPAQUE);
    panel.add(memSelect, new GridBagConstraints(1, 1, 6, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(8, 16, 8, 80), 0, 16));
    JLabel argsLabel = new JLabel(resources.getString("launcheroptions.java.arguments"));
    argsLabel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    argsLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    panel.add(argsLabel, new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 60, 0, 0), 0, 0));
    javaArgs = new JTextArea(32, 4);
    javaArgs.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    javaArgs.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    javaArgs.setBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    javaArgs.setBorder(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 8));
    javaArgs.setCaretColor(LauncherFrame.COLOR_BUTTON_BLUE);
    javaArgs.setMargin(new Insets(16, 4, 16, 4));
    javaArgs.setLineWrap(true);
    javaArgs.setWrapStyleWord(true);
    javaArgs.setSelectionColor(LauncherFrame.COLOR_BUTTON_BLUE);
    javaArgs.setSelectedTextColor(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    panel.add(javaArgs, new GridBagConstraints(1, 2, 6, 2, 0, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(8, 16, 6, 80), 0, 0));
    JLabel autoApprovalLabel = new JLabel(resources.getString("launcheroptions.java.autoApprove"));
    autoApprovalLabel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    autoApprovalLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    panel.add(autoApprovalLabel, new GridBagConstraints(0, 4, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 20, 0, 0), 0, 0));
    askFirstBox = new JCheckBox("", false);
    askFirstBox.setOpaque(false);
    askFirstBox.setHorizontalAlignment(SwingConstants.RIGHT);
    askFirstBox.setBorder(BorderFactory.createEmptyBorder());
    askFirstBox.setIconTextGap(0);
    askFirstBox.setSelectedIcon(resources.getIcon("checkbox_closed.png"));
    askFirstBox.setIcon(resources.getIcon("checkbox_open.png"));
    askFirstBox.setFocusPainted(false);
    panel.add(askFirstBox, new GridBagConstraints(1, 4, 6, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 16, 8, 8), 0, 0));
    panel.add(Box.createGlue(), new GridBagConstraints(4, 5, 1, 1, 1, 0.5, 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) MetalComboBoxUI(javax.swing.plaf.metal.MetalComboBoxUI) SimpleButtonComboUI(net.technicpack.ui.controls.list.SimpleButtonComboUI) RoundedBorderFormatter(net.technicpack.ui.controls.list.popupformatters.RoundedBorderFormatter) ActionListener(java.awt.event.ActionListener) RoundBorder(net.technicpack.ui.controls.borders.RoundBorder) BasicComboPopup(javax.swing.plaf.basic.BasicComboPopup)

Example 8 with RoundBorder

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

the class ModpackOptionsDialog method selectRecommended.

protected void selectRecommended() {
    manualBuildList.setBorder(new RoundBorder(LauncherFrame.COLOR_GREY_TEXT, 1, 10));
    manualBuildList.setEnabled(false);
    manualBuildList.setSelectedItem(new PackBuildItem(modpack.getRecommendedBuild(), resources, modpack));
    this.modpack.setBuild(InstalledPack.RECOMMENDED);
}
Also used : PackBuildItem(net.technicpack.launcher.ui.listitems.PackBuildItem) RoundBorder(net.technicpack.ui.controls.borders.RoundBorder)

Example 9 with RoundBorder

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

the class ModpackOptionsDialog method selectManual.

protected void selectManual() {
    if (manualBuildList.getItemCount() == 0)
        return;
    if (manualBuildList.getSelectedItem() == null)
        manualBuildList.setSelectedItem(new PackBuildItem(modpack.getBuild(), resources, modpack));
    if (manualBuildList.getSelectedItem() == null)
        manualBuildList.setSelectedItem(new PackBuildItem(modpack.getRecommendedBuild(), resources, modpack));
    this.modpack.setBuild(((PackBuildItem) manualBuildList.getSelectedItem()).getBuildNumber());
    manualBuildList.setBorder(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 10));
    manualBuildList.setEnabled(true);
}
Also used : PackBuildItem(net.technicpack.launcher.ui.listitems.PackBuildItem) RoundBorder(net.technicpack.ui.controls.borders.RoundBorder)

Example 10 with RoundBorder

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

the class OptionsDialog method setupVideoOptionsPanel.

private void setupVideoOptionsPanel(JPanel panel) {
    panel.setLayout(new GridBagLayout());
    JLabel streamLabel = new JLabel(resources.getString("launcheroptions.video.windowSize"));
    streamLabel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    streamLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    panel.add(streamLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 40, 0, 0), 0, 0));
    windowSelect = new JComboBox();
    if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("mac")) {
        windowSelect.setUI(new MetalComboBoxUI());
    }
    windowSelect.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    windowSelect.setEditable(false);
    windowSelect.setBorder(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 10));
    windowSelect.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    windowSelect.setBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    windowSelect.setUI(new SimpleButtonComboUI(new RoundedBorderFormatter(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 0)), resources, LauncherFrame.COLOR_SCROLL_TRACK, LauncherFrame.COLOR_SCROLL_THUMB));
    windowSelect.setFocusable(false);
    Object child = windowSelect.getAccessibleContext().getAccessibleChild(0);
    BasicComboPopup popup = (BasicComboPopup) child;
    JList list = popup.getList();
    list.setSelectionForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    list.setSelectionBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    list.setBackground(LauncherFrame.COLOR_CENTRAL_BACK_OPAQUE);
    panel.add(windowSelect, new GridBagConstraints(1, 0, 1, 1, 0.5f, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(8, 16, 8, 16), 0, 16));
    JLabel widthLabel = new JLabel(resources.getString("launcheroptions.video.windowSize.width"));
    widthLabel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    widthLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    panel.add(widthLabel, new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    widthInput = new JTextField(3);
    widthInput.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    widthInput.setForeground(LauncherFrame.COLOR_BLUE);
    widthInput.setBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    widthInput.setBorder(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 8));
    widthInput.setCaretColor(LauncherFrame.COLOR_BLUE);
    widthInput.setText("800");
    panel.add(widthInput, new GridBagConstraints(3, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(8, 6, 8, 16), 0, 0));
    JLabel heightLabel = new JLabel(resources.getString("launcheroptions.video.windowSize.height"));
    heightLabel.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    heightLabel.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    panel.add(heightLabel, new GridBagConstraints(4, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    heightInput = new JTextField(3);
    heightInput.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    heightInput.setForeground(LauncherFrame.COLOR_BLUE);
    heightInput.setBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    heightInput.setBorder(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 8));
    heightInput.setCaretColor(LauncherFrame.COLOR_BLUE);
    heightInput.setText("600");
    panel.add(heightInput, new GridBagConstraints(5, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(8, 6, 8, 16), 0, 0));
    // Add show console field
    JLabel useStencilField = new JLabel(resources.getString("launcheroptions.video.stencil"));
    useStencilField.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    useStencilField.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    panel.add(useStencilField, new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10, 40, 0, 0), 0, 0));
    useStencil = new JComboBox();
    if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("mac")) {
        useStencil.setUI(new MetalComboBoxUI());
    }
    useStencil.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 16));
    useStencil.setEditable(false);
    useStencil.setBorder(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 10));
    useStencil.setForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    useStencil.setBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    useStencil.setUI(new SimpleButtonComboUI(new RoundedBorderFormatter(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 0)), resources, LauncherFrame.COLOR_SCROLL_TRACK, LauncherFrame.COLOR_SCROLL_THUMB));
    useStencil.setFocusable(false);
    child = useStencil.getAccessibleContext().getAccessibleChild(0);
    popup = (BasicComboPopup) child;
    list = popup.getList();
    list.setSelectionForeground(LauncherFrame.COLOR_BUTTON_BLUE);
    list.setSelectionBackground(LauncherFrame.COLOR_FORMELEMENT_INTERNAL);
    list.setBackground(LauncherFrame.COLOR_CENTRAL_BACK_OPAQUE);
    panel.add(useStencil, new GridBagConstraints(1, 1, 1, 1, 0.5f, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(8, 16, 8, 16), 0, 16));
    JLabel stencilInfo = new JLabel("") {

        @Override
        public Dimension getMaximumSize() {
            return getMinimumSize();
        }

        @Override
        public Dimension getPreferredSize() {
            return getMinimumSize();
        }
    };
    stencilInfo.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 12));
    stencilInfo.setForeground(LauncherFrame.COLOR_WHITE_TEXT);
    stencilInfo.setText("<html><body style=\"font-family:" + stencilInfo.getFont().getFamily() + ";color:#D0D0D0\">" + resources.getString("launcheroptions.video.stencil.info") + "</body></html>");
    panel.add(stencilInfo, new GridBagConstraints(2, 1, 4, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    panel.add(Box.createHorizontalStrut(60), new GridBagConstraints(7, 1, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 30, 0));
    panel.add(Box.createGlue(), new GridBagConstraints(0, 2, 8, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
}
Also used : MetalComboBoxUI(javax.swing.plaf.metal.MetalComboBoxUI) SimpleButtonComboUI(net.technicpack.ui.controls.list.SimpleButtonComboUI) RoundedBorderFormatter(net.technicpack.ui.controls.list.popupformatters.RoundedBorderFormatter) RoundBorder(net.technicpack.ui.controls.borders.RoundBorder) BasicComboPopup(javax.swing.plaf.basic.BasicComboPopup)

Aggregations

RoundBorder (net.technicpack.ui.controls.borders.RoundBorder)17 RoundedBorderFormatter (net.technicpack.ui.controls.list.popupformatters.RoundedBorderFormatter)7 ActionEvent (java.awt.event.ActionEvent)6 ActionListener (java.awt.event.ActionListener)6 RoundedButton (net.technicpack.ui.controls.RoundedButton)6 MetalComboBoxUI (javax.swing.plaf.metal.MetalComboBoxUI)5 SimpleButtonComboUI (net.technicpack.ui.controls.list.SimpleButtonComboUI)5 BasicComboPopup (javax.swing.plaf.basic.BasicComboPopup)4 Locale (java.util.Locale)3 LineBorder (javax.swing.border.LineBorder)3 PackBuildItem (net.technicpack.launcher.ui.listitems.PackBuildItem)3 LanguageCellRenderer (net.technicpack.ui.controls.lang.LanguageCellRenderer)3 LanguageCellUI (net.technicpack.ui.controls.lang.LanguageCellUI)3 LanguageItem (net.technicpack.ui.listitems.LanguageItem)3 DocumentEvent (javax.swing.event.DocumentEvent)1 DocumentListener (javax.swing.event.DocumentListener)1 AbstractDocument (javax.swing.text.AbstractDocument)1 AttributeSet (javax.swing.text.AttributeSet)1 BadLocationException (javax.swing.text.BadLocationException)1 DocumentFilter (javax.swing.text.DocumentFilter)1