Examples of PreviewLabel


Examples of com.mucommander.ui.chooser.PreviewLabel

    }

    private JPanel createFreeSpacePanel(FontChooser chooser, ColorButton foreground, ColorButton background, ColorButton border) {
        JPanel       colorPanel;
        JPanel       flowPanel;
        PreviewLabel previewLabel;

        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 = 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);
        }

        flowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        flowPanel.add(colorPanel);
View Full Code Here

Examples of com.mucommander.ui.chooser.PreviewLabel

    private void initUI() {
        JPanel       mainPanel;
        ColorButton  foreground;
        ColorButton  background;
        ColorButton  border;
        PreviewLabel previewLabel;
        PreviewLabel borderPreviewLabel;
        FontChooser  fontChooser;

        JTabbedPane tabbedPane;
        fontChooser = createFontChooser(ThemeData.STATUS_BAR_FONT);

        // Initialises the foreground color button.
        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.
        background = new ColorButton(parent, themeData, ThemeData.STATUS_BAR_BACKGROUND_COLOR, PreviewLabel.BACKGROUND_COLOR_PROPERTY_NAME, previewLabel = new PreviewLabel());
        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);

        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));
View Full Code Here

Examples of com.mucommander.ui.chooser.PreviewLabel

     * @param backgroundId identifier of the color to display in the background button.
     * @param comp         component to register as a listener on the color buttons.
     */
    protected PreviewLabel addColorButtons(ProportionalGridPanel gridPanel, FontChooser fontChooser, String label, int foregroundId, int backgroundId, JComponent comp) {
        ColorButton  colorButton;
        PreviewLabel previewLabel;

        // Adds the row's caption label.
        gridPanel.add(createCaptionLabel(label));

        // Initialises the color buttons' preview label.
        previewLabel = new PreviewLabel();
        previewLabel.setTextPainted(true);
        addFontChooserListener(fontChooser, previewLabel);

        // Creates the foreground color button.
        gridPanel.add(colorButton = new ColorButton(parent, themeData, foregroundId, PreviewLabel.FOREGROUND_COLOR_PROPERTY_NAME, previewLabel));
        if(comp != null)
View Full Code Here

Examples of com.mucommander.ui.chooser.PreviewLabel


    // - UI initialisation ---------------------------------------------------------------
    // -----------------------------------------------------------------------------------
    private void addForegroundColor(JPanel to, int colorId, ColorButton background, FontChooser fontChooser, FilePreviewPanel previewPanel) {
        PreviewLabel preview;
        ColorButton  button;

        preview = new PreviewLabel();
        preview.setTextPainted(true);
        background.addUpdatedPreviewComponent(preview);
        addFontChooserListener(fontChooser, preview);
        to.add(button = new ColorButton(parent, themeData, colorId, PreviewLabel.FOREGROUND_COLOR_PROPERTY_NAME, preview));
        button.addUpdatedPreviewComponent(previewPanel);
    }
View Full Code Here

Examples of com.mucommander.ui.chooser.PreviewLabel

     * @return the JPanel that contains all of the item's color configuration elements.
     */
    private JPanel createItemColorsPanel(FontChooser fontChooser) {
        ProportionalGridPanel gridPanel;   // Contains all the color buttons.
        JPanel                colorsPanel; // Used to wrap the colors panel in a flow layout.
        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")));
View Full Code Here

Examples of com.mucommander.ui.chooser.PreviewLabel

     * @return the JPanel that contains all of the header's color configuration elements.
     */
    private JPanel createHeaderColorsPanel(FontChooser fontChooser) {
        ProportionalGridPanel gridPanel;   // Contains all the color buttons.
        JPanel                colorsPanel; // Used to wrap the colors panel in a flow layout.
        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;
        gridPanel.add(butt = new ColorButton(parent, themeData, ThemeData.QUICK_LIST_HEADER_SECONDARY_BACKGROUND_COLOR, PreviewLabel.BACKGROUND_COLOR_PROPERTY_NAME, label3));//.addPropertyChangeListener(this);
        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);
View Full Code Here

Examples of com.mucommander.ui.chooser.PreviewLabel

    private JPanel createConfigurationPanel() {
        FontChooser           fontChooser;
        YBoxPanel             mainPanel;
        JPanel                flowPanel;
        ProportionalGridPanel colorsPanel;
        PreviewLabel          label;

        fontChooser = createFontChooser(ThemeData.LOCATION_BAR_FONT);
        addFontChooserListener(fontChooser, normalPreview);
        addFontChooserListener(fontChooser, progressPreview);

        addLabelRow(colorsPanel = new ProportionalGridPanel(3), false);

        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);

        flowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        flowPanel.add(colorsPanel);
        flowPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("theme_editor.colors")));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.