/** * Returns a color from the defaults. If the value for {@code key} is not * a {@code Color}, {@code null} is returned. * * @param key * an {@code Object} specifying the color * @return the {@code Color} object * @throws NullPointerException * if {@code key} is {@code null} */ public static Color getColor(Object key) { return getColor(key, null); }
/** * Returns a color from the defaults. If the value for {@code key} is not * a {@code Color}, {@code null} is returned. * * @param key * an {@code Object} specifying the color * @return the {@code Color} object * @throws NullPointerException * if {@code key} is {@code null} */ public static Color getColor(Object key) { return getColor(key, null); }
/** * Returns a color from the defaults. If the value for {@code key} is not * a {@code Color}, {@code null} is returned. * * @param key * an {@code Object} specifying the color * @return the {@code Color} object * @throws NullPointerException * if {@code key} is {@code null} */ public static Color getColor(Object key) { return getColor(key, null); }
/** * Returns a color from the defaults. If the value for {@code key} is not * a {@code Color}, {@code null} is returned. * * @param key * an {@code Object} specifying the color * @return the {@code Color} object * @throws NullPointerException * if {@code key} is {@code null} */ public static Color getColor(Object key) { return getColor(key, null); }
/** * @param key * @return */ private Color getUIColor(String key) { return UIManagerExt.getColor(getUIPrefix() + key); }
/** * @param key * @return */ private Color getUIColor(String key) { return UIManagerExt.getColor(getUIPrefix() + key); }
/** * @param key * @return */ private Color getUIColor(String key) { return UIManagerExt.getColor(getUIPrefix() + key); }
/** * Returns a Color to for odd row background if this context should handle the * alternating row color AND the UIManager has the alternateRowColor property set. * Returns null otherwise. * * @return the color to use for odd row background, or null if either this context * does not handle or no alternate row color is set. */ protected Color getAlternateRowColor() { if (!Boolean.TRUE.equals(UIManager.get(HANDLE_ALTERNATE_ROW_BACKGROUND))) return null; return UIManagerExt.getColor(getUIPrefix() + "alternateRowColor"); }
/** * @param key * @return */ private Color getUIColor(String key) { return UIManagerExt.getColor(getUIPrefix() + key); }
/** * Returns a Color to for odd row background if this context should handle the * alternating row color AND the UIManager has the alternateRowColor property set. * Returns null otherwise. * * @return the color to use for odd row background, or null if either this context * does not handle or no alternate row color is set. */ protected Color getAlternateRowColor() { if (!Boolean.TRUE.equals(UIManager.get(HANDLE_ALTERNATE_ROW_BACKGROUND))) return null; return UIManagerExt.getColor(getUIPrefix() + "alternateRowColor"); }
/** * Returns a Color to for odd row background if this context should handle the * alternating row color AND the UIManager has the alternateRowColor property set. * Returns null otherwise. * * @return the color to use for odd row background, or null if either this context * does not handle or no alternate row color is set. */ protected Color getAlternateRowColor() { if (!Boolean.TRUE.equals(UIManager.get(HANDLE_ALTERNATE_ROW_BACKGROUND))) return null; return UIManagerExt.getColor(getUIPrefix() + "alternateRowColor"); }
/** * Returns a Color to for odd row background if this context should handle the * alternating row color AND the UIManager has the alternateRowColor property set. * Returns null otherwise. * * @return the color to use for odd row background, or null if either this context * does not handle or no alternate row color is set. */ protected Color getAlternateRowColor() { if (!Boolean.TRUE.equals(UIManager.get(HANDLE_ALTERNATE_ROW_BACKGROUND))) return null; return UIManagerExt.getColor(getUIPrefix() + "alternateRowColor"); }
/** * @param key * @return */ private Color getUIColor(String key) { return UIManagerExt.getColor(getUIPrefix() + key); }
private void install() { unselectableDayForeground = UIManagerExt.getColor("JXMonthView.unselectableDayForeground"); textCross = new TextCrossingPainter<JLabel>(); cellContext = new CalendarCellContext(); installProviders(); }
private void install() { unselectableDayForeground = UIManagerExt.getColor("JXMonthView.unselectableDayForeground"); textCross = new TextCrossingPainter<JLabel>(); cellContext = new CalendarCellContext(); installProviders(); }
private void install() { unselectableDayForeground = UIManagerExt.getColor("JXMonthView.unselectableDayForeground"); textCross = new TextCrossingPainter<JLabel>(); cellContext = new CalendarCellContext(); installProviders(); }
private void install() { unselectableDayForeground = UIManagerExt.getColor("JXMonthView.unselectableDayForeground"); textCross = new TextCrossingPainter<JLabel>(); cellContext = new CalendarCellContext(); installProviders(); }
private void install() { unselectableDayForeground = UIManagerExt.getColor("JXMonthView.unselectableDayForeground"); textCross = new TextCrossingPainter<JLabel>(); cellContext = new CalendarCellContext(); installProviders(); }
/** * test that the getBoolean doesn't choke on non-Booleans */ @Test public void testGetColorLenientWithUnparseable() { String key = "badColor"; Locale locale = JComponent.getDefaultLocale(); String columnString = UIManagerExt.getString(key, locale); if (columnString == null) { LOG.info("cant run test - no resource found for key: " + key); return; } try { Color.decode(columnString); LOG.info("cant run test - valid integer: " + columnString); } catch (Exception ex) { // must not bark UIManagerExt.getColor(key, locale); } }
/** * test that we get a boolean from the localized resource. */ @Test public void testGetColorFromResource() { String key = "goodColor"; Locale locale = JComponent.getDefaultLocale(); String columnString = UIManagerExt.getString(key, locale); if (columnString == null) { LOG.info("cant run test - no resource found for key: " + key); return; } Object value = UIManagerExt.getColor(key, locale); assertNotNull(value); assertEquals(Color.decode(columnString), value); }