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