Search in sources :

Example 6 with PreviewLabel

use of com.mucommander.ui.chooser.PreviewLabel in project mucommander by mucommander.

the class LocationBarPanel method createConfigurationPanel.

private JPanel createConfigurationPanel() {
    FontChooser fontChooser = createFontChooser(ThemeData.LOCATION_BAR_FONT);
    addFontChooserListener(fontChooser, normalPreview);
    addFontChooserListener(fontChooser, progressPreview);
    ProportionalGridPanel colorsPanel = new ProportionalGridPanel(3);
    addLabelRow(colorsPanel, false);
    PreviewLabel label = new PreviewLabel();
    addColorButtons(colorsPanel, fontChooser, "theme_editor.normal", ThemeData.LOCATION_BAR_FOREGROUND_COLOR, ThemeData.LOCATION_BAR_BACKGROUND_COLOR, label).addPropertyChangeListener(this);
    addColorButtons(colorsPanel, fontChooser, "theme_editor.selected", ThemeData.LOCATION_BAR_SELECTED_FOREGROUND_COLOR, ThemeData.LOCATION_BAR_SELECTED_BACKGROUND_COLOR).addPropertyChangeListener(this);
    label.setTextPainted(true);
    addFontChooserListener(fontChooser, label);
    colorsPanel.add(createCaptionLabel("theme_editor.progress"));
    colorsPanel.add(new JLabel());
    colorsPanel.add(new ColorButton(parent, themeData, ThemeData.LOCATION_BAR_PROGRESS_COLOR, PreviewLabel.OVERLAY_COLOR_PROPERTY_NAME, label));
    label.addPropertyChangeListener(this);
    JPanel flowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(colorsPanel);
    flowPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("theme_editor.colors")));
    YBoxPanel mainPanel = new YBoxPanel();
    mainPanel.add(fontChooser);
    mainPanel.addSpace(10);
    mainPanel.add(flowPanel);
    return mainPanel;
}
Also used : PreviewLabel(com.mucommander.ui.chooser.PreviewLabel) YBoxPanel(com.mucommander.commons.util.ui.layout.YBoxPanel) FontChooser(com.mucommander.ui.chooser.FontChooser) ProportionalGridPanel(com.mucommander.commons.util.ui.layout.ProportionalGridPanel)

Example 7 with PreviewLabel

use of com.mucommander.ui.chooser.PreviewLabel in project mucommander by mucommander.

the class StatusBarPanel method initUI.

/**
 * Initialises the panel's UI.
 */
private void initUI() {
    PreviewLabel previewLabel;
    PreviewLabel borderPreviewLabel;
    FontChooser fontChooser = createFontChooser(ThemeData.STATUS_BAR_FONT);
    // Initialises the foreground color button.
    ColorButton foreground = new ColorButton(parent, themeData, ThemeData.STATUS_BAR_FOREGROUND_COLOR, PreviewLabel.FOREGROUND_COLOR_PROPERTY_NAME, previewLabel = new PreviewLabel());
    previewLabel.setTextPainted(true);
    addFontChooserListener(fontChooser, previewLabel);
    previewLabel.addPropertyChangeListener(this);
    // Initialises the background and border color buttons.
    ColorButton background = new ColorButton(parent, themeData, ThemeData.STATUS_BAR_BACKGROUND_COLOR, PreviewLabel.BACKGROUND_COLOR_PROPERTY_NAME, previewLabel = new PreviewLabel());
    ColorButton border = new ColorButton(parent, themeData, ThemeData.STATUS_BAR_BORDER_COLOR, PreviewLabel.BORDER_COLOR_PROPERTY_NAME, borderPreviewLabel = new PreviewLabel());
    // Initialises the background color preview.
    previewLabel.setTextPainted(true);
    foreground.addUpdatedPreviewComponent(previewLabel);
    border.addUpdatedPreviewComponent(previewLabel);
    addFontChooserListener(fontChooser, previewLabel);
    previewLabel.addPropertyChangeListener(this);
    // Initialises the border color preview.
    borderPreviewLabel.setTextPainted(true);
    foreground.addUpdatedPreviewComponent(borderPreviewLabel);
    background.addUpdatedPreviewComponent(borderPreviewLabel);
    addFontChooserListener(fontChooser, borderPreviewLabel);
    borderPreviewLabel.addPropertyChangeListener(this);
    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.add(Translator.get("theme_editor.general"), createGeneralPanel(fontChooser, foreground));
    tabbedPane.add(Translator.get("theme_editor.free_space"), createFreeSpacePanel(fontChooser, foreground, background, border));
    // Main layout.
    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(tabbedPane, BorderLayout.CENTER);
    mainPanel.add(createPreviewPanel(fontChooser), BorderLayout.EAST);
    // Aligns everything north.
    setLayout(new BorderLayout());
    add(mainPanel, BorderLayout.NORTH);
}
Also used : PreviewLabel(com.mucommander.ui.chooser.PreviewLabel) FontChooser(com.mucommander.ui.chooser.FontChooser)

Aggregations

PreviewLabel (com.mucommander.ui.chooser.PreviewLabel)7 ProportionalGridPanel (com.mucommander.commons.util.ui.layout.ProportionalGridPanel)4 FontChooser (com.mucommander.ui.chooser.FontChooser)2 FlowLayout (java.awt.FlowLayout)2 JPanel (javax.swing.JPanel)2 YBoxPanel (com.mucommander.commons.util.ui.layout.YBoxPanel)1 JLabel (javax.swing.JLabel)1