MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / setLookAndFeel

Method setLookAndFeel

ij/src/main/java/ij/util/Java2.java:59–72  ·  view source on GitHub ↗

Sets the Swing look and feel.

(LookAndFeel newLookAndFeel)

Source from the content-addressed store, hash-verified

57
58 /** Sets the Swing look and feel. */
59 @AstroImageJ(reason = "update keymapping on mac for copy/paste", modified = true)
60 public static void setLookAndFeel(LookAndFeel newLookAndFeel) {
61 if (IJ.isMacOSX()) {
62 InputMap im = (InputMap) UIManager.get("TextField.focusInputMap");
63 im.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_DOWN_MASK), DefaultEditorKit.copyAction);
64 im.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_DOWN_MASK), DefaultEditorKit.pasteAction);
65 im.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_DOWN_MASK), DefaultEditorKit.cutAction);
66 }
67 if (!IJ.isWindows() || newLookAndFeel==null)
68 return;
69 try {
70 UIManager.setLookAndFeel(newLookAndFeel);
71 } catch(Throwable t) {}
72 }
73
74 /** Returns the current Swing look and feel or null. */
75 public static LookAndFeel getLookAndFeel() {

Callers 9

jSaveMethod · 0.95
openMultipleMethod · 0.95
jOpenMethod · 0.95
initMethod · 0.95
setSystemLookAndFeelMethod · 0.45
actionPerformedMethod · 0.45
mainMethod · 0.45

Calls 4

isMacOSXMethod · 0.95
isWindowsMethod · 0.95
getMethod · 0.45
putMethod · 0.45

Tested by 1

actionPerformedMethod · 0.36