|
1 | 1 | package mdlaf;
|
2 | 2 |
|
3 | 3 | import mdlaf.components.button.MaterialButtonUI;
|
| 4 | +import mdlaf.components.checkBoxMenuItem.MaterialCheckBoxMenuItemUI; |
4 | 5 | import mdlaf.components.checkbox.MaterialCheckBoxUI;
|
5 | 6 | import mdlaf.components.combobox.MaterialComboBoxUI;
|
6 | 7 | import mdlaf.components.label.MaterialLabelUI;
|
@@ -57,6 +58,11 @@ public class MaterialLookAndFeel extends MetalLookAndFeel {
|
57 | 58 | private static final String sliderUI = MaterialSliderUI.class.getCanonicalName ();
|
58 | 59 | private static final String progressBarUI = MaterialProgressBarUI.class.getCanonicalName();
|
59 | 60 | private static final String radioButtonMenuItemUI = MaterialRadioButtonMenuItemUI.class.getCanonicalName();
|
| 61 | + private static final String checkBoxMenuItemUI = MaterialCheckBoxMenuItemUI.class.getCanonicalName(); |
| 62 | + |
| 63 | + public static String getCheckBoxMenuItemUI() { |
| 64 | + return checkBoxMenuItemUI; |
| 65 | + } |
60 | 66 |
|
61 | 67 | public static String getRadioButtonMenuItemUI() {
|
62 | 68 | return radioButtonMenuItemUI;
|
@@ -117,6 +123,7 @@ protected void initClassDefaults (UIDefaults table) {
|
117 | 123 | table.put ("SliderUI", sliderUI);
|
118 | 124 | table.put("ProgressBarUI", progressBarUI);
|
119 | 125 | table.put("RadioButtonMenuItemUI", radioButtonMenuItemUI);
|
| 126 | + table.put("CheckBoxMenuItemUI", checkBoxMenuItemUI); |
120 | 127 | }
|
121 | 128 |
|
122 | 129 | @Override
|
@@ -268,9 +275,22 @@ protected void initComponentDefaults (UIDefaults table) {
|
268 | 275 | table.put ("Tree.openIcon", new ImageIcon (MaterialImages.DOWN_ARROW));
|
269 | 276 | table.put ("Tree.selectionBorderColor", null);
|
270 | 277 |
|
| 278 | + table.put ("RadioButtonMenuItem.foreground", Color.BLACK); |
| 279 | + table.put ("RadioButtonMenuItem.selectionForeground", Color.BLACK); |
271 | 280 | //If it changes the background of the menuitem it must change this too, irrespective of its setting
|
272 | 281 | table.put("RadioButtonMenuItem.background", UIManager.getColor ("MenuItem.background"));
|
| 282 | + table.put("RadioButtonMenuItem.selectionBackground", MaterialColors.GRAY_200); |
| 283 | + table.put ("RadioButtonMenuItem.border", BorderFactory.createEmptyBorder (5, 5, 5, 5)); |
273 | 284 | table.put("RadioButtonMenuItem.checkIcon", new ImageIcon(MaterialImages.RADIO_BUTTON_OFF));
|
274 | 285 | table.put("RadioButtonMenuItem.selectedCheckIcon", new ImageIcon(MaterialImages.RADIO_BUTTON_ON));
|
| 286 | + |
| 287 | + //If it changes the background of the menuitem it must change this too, irrespective of its setting |
| 288 | + table.put("CheckBoxMenuItem.background", UIManager.getColor ("MenuItem.background")); |
| 289 | + table.put("CheckBoxMenuItem.selectionBackground", MaterialColors.GRAY_200); |
| 290 | + table.put ("CheckBoxMenuItem.foreground", Color.BLACK); |
| 291 | + table.put ("CheckBoxMenuItem.selectionForeground", Color.BLACK); |
| 292 | + table.put ("CheckBoxMenuItem.border", BorderFactory.createEmptyBorder (5, 5, 5, 5)); |
| 293 | + table.put("CheckBoxMenuItem.checkIcon", new ImageIcon(MaterialImages.UNCHECKED_BOX)); |
| 294 | + table.put("CheckBoxMenuItem.selectedCheckIcon", new ImageIcon(MaterialImages.PAINTED_CHECKED_BOX)); |
275 | 295 | }
|
276 | 296 | }
|
0 commit comments