Search in sources :

Example 1 with ProportionalGridPanel

use of com.mucommander.commons.util.ui.layout.ProportionalGridPanel in project mucommander by mucommander.

the class QuickListPanel method createItemColorsPanel.

// - UI initialization ---------------------------------------------------------------
// -----------------------------------------------------------------------------------
/**
 * Creates the JPanel that contains all of the item's color configuration elements.
 * @param fontChooser font chooser used by the editor panel.
 * @return the JPanel that contains all of the item's color configuration elements.
 */
private JPanel createItemColorsPanel(FontChooser fontChooser) {
    // Contains all the color buttons.
    ProportionalGridPanel gridPanel;
    // Used to wrap the colors panel in a flow layout.
    JPanel colorsPanel;
    PreviewLabel label;
    // Initialisation.
    gridPanel = new ProportionalGridPanel(3);
    // Header.
    addLabelRow(gridPanel, false);
    label = new PreviewLabel();
    // Color buttons.
    addColorButtons(gridPanel, fontChooser, "theme_editor.normal", ThemeData.QUICK_LIST_ITEM_FOREGROUND_COLOR, ThemeData.QUICK_LIST_ITEM_BACKGROUND_COLOR, label).addPropertyChangeListener(this);
    addColorButtons(gridPanel, fontChooser, "theme_editor.selected", ThemeData.QUICK_LIST_SELECTED_ITEM_FOREGROUND_COLOR, ThemeData.QUICK_LIST_SELECTED_ITEM_BACKGROUND_COLOR, label).addPropertyChangeListener(this);
    label.addPropertyChangeListener(this);
    // Wraps everything in a flow layout.
    colorsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    colorsPanel.add(gridPanel);
    colorsPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("theme_editor.colors")));
    return colorsPanel;
}
Also used : JPanel(javax.swing.JPanel) PreviewLabel(com.mucommander.ui.chooser.PreviewLabel) FlowLayout(java.awt.FlowLayout) ProportionalGridPanel(com.mucommander.commons.util.ui.layout.ProportionalGridPanel)

Example 2 with ProportionalGridPanel

use of com.mucommander.commons.util.ui.layout.ProportionalGridPanel in project mucommander by mucommander.

the class QuickListPanel method createHeaderColorsPanel.

/**
 * Creates the JPanel that contains all of the header's color configuration elements.
 * @param fontChooser font chooser used by the editor panel.
 * @return the JPanel that contains all of the header's color configuration elements.
 */
private JPanel createHeaderColorsPanel(FontChooser fontChooser) {
    // Contains all the color buttons.
    ProportionalGridPanel gridPanel;
    // Used to wrap the colors panel in a flow layout.
    JPanel colorsPanel;
    PreviewLabel label;
    // Initialization.
    gridPanel = new ProportionalGridPanel(3);
    // Header.
    addLabelRow(gridPanel, false);
    label = new PreviewLabel();
    // Color buttons.
    addColorButtons(gridPanel, fontChooser, "", ThemeData.QUICK_LIST_HEADER_FOREGROUND_COLOR, ThemeData.QUICK_LIST_HEADER_BACKGROUND_COLOR, label).addPropertyChangeListener(this);
    label.addPropertyChangeListener(this);
    gridPanel.add(createCaptionLabel(""));
    gridPanel.add(new JLabel());
    PreviewLabel label3 = new PreviewLabel();
    ColorButton butt;
    // .addPropertyChangeListener(this);
    gridPanel.add(butt = new ColorButton(parent, themeData, ThemeData.QUICK_LIST_HEADER_SECONDARY_BACKGROUND_COLOR, PreviewLabel.BACKGROUND_COLOR_PROPERTY_NAME, label3));
    label3.setTextPainted(true);
    label3.addPropertyChangeListener(this);
    butt.addUpdatedPreviewComponent(label3);
    // Wraps everything in a flow layout.
    colorsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    colorsPanel.add(gridPanel);
    colorsPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("theme_editor.colors")));
    return colorsPanel;
}
Also used : JPanel(javax.swing.JPanel) PreviewLabel(com.mucommander.ui.chooser.PreviewLabel) FlowLayout(java.awt.FlowLayout) JLabel(javax.swing.JLabel) ProportionalGridPanel(com.mucommander.commons.util.ui.layout.ProportionalGridPanel)

Example 3 with ProportionalGridPanel

use of com.mucommander.commons.util.ui.layout.ProportionalGridPanel in project mucommander by mucommander.

the class ShellPanel method createConfigurationPanel.

private JComponent createConfigurationPanel(int fontId, int foregroundId, int backgroundId, int selectedForegroundId, int selectedBackgroundId, JComponent fontListener) {
    YBoxPanel mainPanel;
    ProportionalGridPanel colorPanel;
    JPanel flowPanel;
    FontChooser fontChooser;
    mainPanel = new YBoxPanel();
    fontChooser = createFontChooser(fontId);
    mainPanel.add(fontChooser);
    mainPanel.addSpace(10);
    addFontChooserListener(fontChooser, fontListener);
    colorPanel = new ProportionalGridPanel(3);
    addLabelRow(colorPanel, false);
    addColorButtons(colorPanel, fontChooser, "theme_editor.normal", foregroundId, backgroundId).addPropertyChangeListener(this);
    addColorButtons(colorPanel, fontChooser, "theme_editor.selected", selectedForegroundId, selectedBackgroundId).addPropertyChangeListener(this);
    flowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(colorPanel);
    flowPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("theme_editor.colors")));
    mainPanel.add(flowPanel);
    return createScrollPane(mainPanel);
}
Also used : YBoxPanel(com.mucommander.commons.util.ui.layout.YBoxPanel) FontChooser(com.mucommander.ui.chooser.FontChooser) ProportionalGridPanel(com.mucommander.commons.util.ui.layout.ProportionalGridPanel)

Example 4 with ProportionalGridPanel

use of com.mucommander.commons.util.ui.layout.ProportionalGridPanel in project mucommander by mucommander.

the class StatusBarPanel method createFreeSpacePanel.

private JPanel createFreeSpacePanel(FontChooser chooser, ColorButton foreground, ColorButton background, ColorButton border) {
    JPanel colorPanel = new ProportionalGridPanel(2);
    colorPanel.add(new JLabel());
    colorPanel.add(createCaptionLabel("theme_editor.color"));
    colorPanel.add(createCaptionLabel("theme_editor.background"));
    colorPanel.add(background);
    colorPanel.add(createCaptionLabel("theme_editor.border"));
    colorPanel.add(border);
    for (int i = 0; i < 3; i++) {
        PreviewLabel previewLabel = new PreviewLabel();
        previewLabel.setOverlayUnderText(true);
        previewLabel.setTextPainted(true);
        foreground.addUpdatedPreviewComponent(previewLabel);
        background.addUpdatedPreviewComponent(previewLabel);
        border.addUpdatedPreviewComponent(previewLabel);
        addFontChooserListener(chooser, previewLabel);
        colorPanel.add(createCaptionLabel(WARNING_LEVEL_LABELS[i]));
        colorPanel.add(new ColorButton(parent, themeData, WARNING_LEVEL_COLOR_IDS[i], PreviewLabel.OVERLAY_COLOR_PROPERTY_NAME, previewLabel));
        previewLabel.addPropertyChangeListener(this);
    }
    JPanel flowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(colorPanel);
    return flowPanel;
}
Also used : PreviewLabel(com.mucommander.ui.chooser.PreviewLabel) ProportionalGridPanel(com.mucommander.commons.util.ui.layout.ProportionalGridPanel)

Example 5 with ProportionalGridPanel

use of com.mucommander.commons.util.ui.layout.ProportionalGridPanel in project mucommander by mucommander.

the class StatusBarPanel method createGeneralPanel.

private JPanel createGeneralPanel(FontChooser chooser, ColorButton foreground) {
    // Initialises the color panel.
    JPanel colorPanel = new ProportionalGridPanel(2);
    colorPanel.add(createCaptionLabel("theme_editor.text"));
    colorPanel.add(foreground);
    // Wraps the color panel in a flow layout.
    JPanel flowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(colorPanel);
    flowPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("theme_editor.colors")));
    // Creates the general panel.
    YBoxPanel mainPanel = new YBoxPanel();
    mainPanel.add(chooser);
    mainPanel.addSpace(10);
    mainPanel.add(flowPanel);
    return mainPanel;
}
Also used : YBoxPanel(com.mucommander.commons.util.ui.layout.YBoxPanel) ProportionalGridPanel(com.mucommander.commons.util.ui.layout.ProportionalGridPanel)

Aggregations

ProportionalGridPanel (com.mucommander.commons.util.ui.layout.ProportionalGridPanel)11 YBoxPanel (com.mucommander.commons.util.ui.layout.YBoxPanel)4 PreviewLabel (com.mucommander.ui.chooser.PreviewLabel)4 FlowLayout (java.awt.FlowLayout)4 JPanel (javax.swing.JPanel)4 JLabel (javax.swing.JLabel)3 FontChooser (com.mucommander.ui.chooser.FontChooser)2 PrefComboBox (com.mucommander.ui.dialog.pref.component.PrefComboBox)1 Theme (com.mucommander.ui.theme.Theme)1 Component (java.awt.Component)1 BufferedImage (java.awt.image.BufferedImage)1 ImageIcon (javax.swing.ImageIcon)1 JButton (javax.swing.JButton)1 JList (javax.swing.JList)1 BasicComboBoxRenderer (javax.swing.plaf.basic.BasicComboBoxRenderer)1