27
27
import mdlaf .resources .MaterialImages ;
28
28
29
29
import javax .swing .*;
30
- import javax .swing .plaf .basic .BasicLookAndFeel ;
31
- import javax .swing .text .DefaultEditorKit ;
30
+ import javax .swing .plaf .metal .MetalLookAndFeel ;
32
31
import java .awt .*;
33
32
34
- public class MaterialLookAndFeel extends BasicLookAndFeel {
33
+ public class MaterialLookAndFeel extends MetalLookAndFeel {
35
34
36
35
private static final String buttonUI = MaterialButtonUI .class .getCanonicalName ();
37
36
private static final String textfieldUI = MaterialTextFieldUI .class .getCanonicalName ();
@@ -231,12 +230,6 @@ protected void initComponentDefaults (UIDefaults table) {
231
230
table .put ("TextArea.background" , MaterialColors .GRAY_200 );
232
231
table .put ("TextArea.border" , BorderFactory .createEmptyBorder ());
233
232
table .put ("TextArea.foreground" , Color .BLACK );
234
- table .put ("TextArea.font" , MaterialFonts .REGULAR );
235
- table .put ("TextArea.focusInputMap" , multilineInputMap );
236
-
237
- table .put ("TextPane.focusInputMap" , multilineInputMap );
238
-
239
- table .put ("EditorPane.focusInputMap" , multilineInputMap );
240
233
241
234
table .put ("ToggleButton.border" , BorderFactory .createEmptyBorder ());
242
235
table .put ("ToggleButton.font" , MaterialFonts .REGULAR );
@@ -261,69 +254,4 @@ protected void initComponentDefaults (UIDefaults table) {
261
254
table .put ("Tree.openIcon" , new ImageIcon (MaterialImages .DOWN_ARROW ));
262
255
table .put ("Tree.selectionBorderColor" , null );
263
256
}
264
-
265
- private Object multilineInputMap = new UIDefaults .LazyInputMap (new Object []{
266
- "ctrl C" , DefaultEditorKit .copyAction ,
267
- "ctrl V" , DefaultEditorKit .pasteAction ,
268
- "ctrl X" , DefaultEditorKit .cutAction ,
269
- "COPY" , DefaultEditorKit .copyAction ,
270
- "PASTE" , DefaultEditorKit .pasteAction ,
271
- "CUT" , DefaultEditorKit .cutAction ,
272
- "control INSERT" , DefaultEditorKit .copyAction ,
273
- "shift INSERT" , DefaultEditorKit .pasteAction ,
274
- "shift DELETE" , DefaultEditorKit .cutAction ,
275
- "shift LEFT" , DefaultEditorKit .selectionBackwardAction ,
276
- "shift KP_LEFT" , DefaultEditorKit .selectionBackwardAction ,
277
- "shift RIGHT" , DefaultEditorKit .selectionForwardAction ,
278
- "shift KP_RIGHT" , DefaultEditorKit .selectionForwardAction ,
279
- "ctrl LEFT" , DefaultEditorKit .previousWordAction ,
280
- "ctrl KP_LEFT" , DefaultEditorKit .previousWordAction ,
281
- "ctrl RIGHT" , DefaultEditorKit .nextWordAction ,
282
- "ctrl KP_RIGHT" , DefaultEditorKit .nextWordAction ,
283
- "ctrl shift LEFT" , DefaultEditorKit .selectionPreviousWordAction ,
284
- "ctrl shift KP_LEFT" , DefaultEditorKit .selectionPreviousWordAction ,
285
- "ctrl shift RIGHT" , DefaultEditorKit .selectionNextWordAction ,
286
- "ctrl shift KP_RIGHT" , DefaultEditorKit .selectionNextWordAction ,
287
- "ctrl A" , DefaultEditorKit .selectAllAction ,
288
- "HOME" , DefaultEditorKit .beginLineAction ,
289
- "END" , DefaultEditorKit .endLineAction ,
290
- "shift HOME" , DefaultEditorKit .selectionBeginLineAction ,
291
- "shift END" , DefaultEditorKit .selectionEndLineAction ,
292
-
293
- "UP" , DefaultEditorKit .upAction ,
294
- "KP_UP" , DefaultEditorKit .upAction ,
295
- "DOWN" , DefaultEditorKit .downAction ,
296
- "KP_DOWN" , DefaultEditorKit .downAction ,
297
- "PAGE_UP" , DefaultEditorKit .pageUpAction ,
298
- "PAGE_DOWN" , DefaultEditorKit .pageDownAction ,
299
- "shift PAGE_UP" , "selection-page-up" ,
300
- "shift PAGE_DOWN" , "selection-page-down" ,
301
- "ctrl shift PAGE_UP" , "selection-page-left" ,
302
- "ctrl shift PAGE_DOWN" , "selection-page-right" ,
303
- "shift UP" , DefaultEditorKit .selectionUpAction ,
304
- "shift KP_UP" , DefaultEditorKit .selectionUpAction ,
305
- "shift DOWN" , DefaultEditorKit .selectionDownAction ,
306
- "shift KP_DOWN" , DefaultEditorKit .selectionDownAction ,
307
- "ENTER" , DefaultEditorKit .insertBreakAction ,
308
- "BACK_SPACE" , DefaultEditorKit .deletePrevCharAction ,
309
- "shift BACK_SPACE" , DefaultEditorKit .deletePrevCharAction ,
310
- "ctrl H" , DefaultEditorKit .deletePrevCharAction ,
311
- "DELETE" , DefaultEditorKit .deleteNextCharAction ,
312
- "ctrl DELETE" , DefaultEditorKit .deleteNextWordAction ,
313
- "ctrl BACK_SPACE" , DefaultEditorKit .deletePrevWordAction ,
314
- "RIGHT" , DefaultEditorKit .forwardAction ,
315
- "LEFT" , DefaultEditorKit .backwardAction ,
316
- "KP_RIGHT" , DefaultEditorKit .forwardAction ,
317
- "KP_LEFT" , DefaultEditorKit .backwardAction ,
318
- "TAB" , DefaultEditorKit .insertTabAction ,
319
- "ctrl BACK_SLASH" , "unselect" /*DefaultEditorKit.unselectAction*/ ,
320
- "ctrl HOME" , DefaultEditorKit .beginAction ,
321
- "ctrl END" , DefaultEditorKit .endAction ,
322
- "ctrl shift HOME" , DefaultEditorKit .selectionBeginAction ,
323
- "ctrl shift END" , DefaultEditorKit .selectionEndAction ,
324
- "ctrl T" , "next-link-action" ,
325
- "ctrl shift T" , "previous-link-action" ,
326
- "ctrl SPACE" , "activate-link-action" ,
327
- "control shift O" , "toggle-componentOrientation" /*DefaultEditorKit.toggleComponentOrientation*/
328
- });
329
257
}
0 commit comments