public static void setApplicationFont(Font f) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); synchronized(defaults) { for (Object ui_property: defaults.keySet()) { if (ui_property.toString().endsWith(".font")) { UIManager.put(ui_property, f); } } } }
public void unloadDefaults(Object[] keysAndValues) { for (int i = 0, c = keysAndValues.length; i < c; i = i + 2) { UIManager.getLookAndFeelDefaults().put(keysAndValues[i], null); } }
public static Font getSystemDefaultFont() { if (systemDefaultFont == null) { systemDefaultFont = (Font) UIManager.getLookAndFeelDefaults().get("defaultFont"); if (systemDefaultFont == null) { systemDefaultFont = new JLabel("").getFont(); } } return systemDefaultFont; }
public TristateCheckBoxIcon() { // Assume that the UI has not changed since the checkbos was created UIDefaults defaults = UIManager.getLookAndFeelDefaults(); final Icon icon = (Icon) defaults.get("CheckBox.icon"); iconHeight = icon.getIconHeight(); iconWidth = icon.getIconWidth(); }
/** * Sets the LayoutStyle instance to use for this look and feel. * You generally don't need to invoke this, instead use the getter which * will return the LayoutStyle appropriate for the current look and feel. * * @param layoutStyle the LayoutStyle to use; a value of null indicates * the default should be used */ public static void setSharedInstance(LayoutStyle layoutStyle) { UIManager.getLookAndFeelDefaults().put("LayoutStyle.instance", layoutStyle); }
public void run() { try { UIManager.setLookAndFeel(variant); UIManager.getLookAndFeelDefaults().put("ClassLoader", JPanel.class.getClassLoader()); checkSubstanceLafLoaded(); } catch (Exception e) { logger.log(Level.SEVERE, "Error loading Substance look and feel: " + e.getMessage(), e); System.out.println("Substance Graphite failed to initialize"); } } });
/** * Constructs a new SkinLookAndFeel */ public SkinLookAndFeel() { UIManager.getLookAndFeelDefaults().put( "ClassLoader", getClass().getClassLoader()); }
/** * Returns the icon to use if the image couldn't be found. */ public Icon getNoImageIcon() { return (Icon) UIManager.getLookAndFeelDefaults().get(MISSING_IMAGE); }
private static void debugUIDefaults(){ UIDefaults def = UIManager.getLookAndFeelDefaults(); Enumeration enumer = def.keys(); while (enumer.hasMoreElements()) { Object item = enumer.nextElement(); System.out.println(item +" " + def.get(item)); } }
/** * @deprecated no longer needed */ public static void enable() throws javax.swing.UnsupportedLookAndFeelException { SkinLookAndFeel lnf = new SkinLookAndFeel(); UIManager.setLookAndFeel(lnf); UIManager.getLookAndFeelDefaults().put("ClassLoader", lnf.getClass().getClassLoader()); }
ActionMap getActionMap() { ActionMap map = (ActionMap)UIManager.get("ScrollPane.actionMap"); if (map == null) { map = createActionMap(); if (map != null) { UIManager.getLookAndFeelDefaults().put("ScrollPane.actionMap", map); } } return map; }
ActionMap getActionMap() { ActionMap map = (ActionMap) UIManager.get("TabbedPane.actionMap"); if (map == null) { map = createActionMap(); if (map != null) { UIManager.getLookAndFeelDefaults().put("TabbedPane.actionMap", map); } } return map; }
public static void setDefaultSize(int size) { UIManager.getLookAndFeelDefaults().keySet().stream() .filter(key -> StringUtils.containsIgnoreCase(key.toString(), "font")) .forEach(key -> { Font font = UIManager.getDefaults().getFont(key); if (font != null) { font = font.deriveFont((float) size); UIManager.put(key, font); } }); } }
ActionMap getActionMap() { String propertyPrefix = getPropertyPrefix(); String uiKey = propertyPrefix + ".actionMap"; ActionMap am = (ActionMap) UIManager.get(uiKey); if(am == null) { am = createActionMap(); UIManager.getLookAndFeelDefaults().put(uiKey, am); } return am; }
public static void setDefaultFont(Font font) { if (canChangeSize()) { getSystemDefaultFont(); // Make sure the system default font is saved first defaultFont = font; scale = -1; // force it to be recalculated UIManager.getLookAndFeelDefaults().put("defaultFont", font); } }
ActionMap getActionMap() { ActionMap map = (ActionMap) UIDefaultsLookup.get("Popup.actionMap"); if (map == null) { map = createActionMap(); if (map != null) { UIManager.getLookAndFeelDefaults().put("Popup.actionMap", map); } } return map; }
ActionMap getActionMap() { ActionMap map = (ActionMap) UIDefaultsLookup.get("JideTabbedPane.actionMap"); if (map == null) { map = createActionMap(); if (map != null) { UIManager.getLookAndFeelDefaults().put("JideTabbedPane.actionMap", map); } } return map; }
protected ActionMap getActionMap() { String propertyPrefix = getPropertyPrefix(); String uiKey = propertyPrefix + ".actionMap"; ActionMap am = (ActionMap) UIDefaultsLookup.get(uiKey); if (am == null) { am = createActionMap(); UIManager.getLookAndFeelDefaults().put(uiKey, am); } return am; }
protected ActionMap getActionMap() { String propertyPrefix = getPropertyPrefix(); String uiKey = propertyPrefix + ".actionMap"; ActionMap am = (ActionMap) UIDefaultsLookup.get(uiKey); if (am == null) { am = createActionMap(); UIManager.getLookAndFeelDefaults().put(uiKey, am); } return am; }
protected ActionMap getActionMap() { String propertyPrefix = getPropertyPrefix(); String uiKey = propertyPrefix + ".actionMap"; ActionMap am = (ActionMap) UIDefaultsLookup.get(uiKey); if (am == null) { am = createActionMap(); UIManager.getLookAndFeelDefaults().put(uiKey, am); } return am; }