/** * Returns the hint {@linkplain GeoTools#getDefaultHints default value} for the specified key. * * @param key The hints key. * @return The value for the specified key, or {@code null} if the key did not have a mapping. * @since 2.4 */ public static Object getSystemDefault(final RenderingHints.Key key) { final boolean changed; final Object value; changed = ensureSystemDefaultLoaded(); value = GLOBAL.get(key); if (changed) { GeoTools.fireConfigurationChanged(); } return value; }
/** * Removes the specified hints from the set of {@linkplain GeoTools#getDefaultHints default * hints}. * * @param key The hints key that needs to be removed. * @return The value to which the key had previously been mapped, or {@code null} if the key did * not have a mapping. * @since 2.4 */ public static Object removeSystemDefault(final RenderingHints.Key key) { final boolean changed; final Object old; changed = ensureSystemDefaultLoaded(); old = GLOBAL.remove(key); if (changed || old != null) { GeoTools.fireConfigurationChanged(); } return old; }
/** * Adds all specified hints to the system hints. This is for {@link GeoTools#init} * implementation only. */ static void putSystemDefault(final RenderingHints hints) { ensureSystemDefaultLoaded(); Map<RenderingHints.Key, Object> map = toMap(hints); GLOBAL.putAll(map); GeoTools.fireConfigurationChanged(); }
/** * Adds a hint value to the set of {@linkplain GeoTools#getDefaultHints default hints}. Default * hints can be added by call to this {@code putDefaultHint} method, to the {@link * GeoTools#init} method or by {@linkplain System#getProperties system properties} with keys * defined by the {@link String} constants in the {@link GeoTools} class. * * @param key The hint key. * @param value The hint value. * @return The previous value of the specified key, or {@code null} if none. * @throws IllegalArgumentException If {@link Hints.Key#isCompatibleValue()} returns {@code * false} for the specified value. * @since 2.4 */ public static Object putSystemDefault(final RenderingHints.Key key, final Object value) { final boolean changed; final Object old; changed = ensureSystemDefaultLoaded(); old = GLOBAL.put(key, value); if (changed || !Utilities.equals(value, old)) { GeoTools.fireConfigurationChanged(); } return old; }
Map<?, ?> extra = null; final boolean changed; changed = ensureSystemDefaultLoaded(); if (!GLOBAL.isEmpty()) { extra = new HashMap<Object, Object>(GLOBAL);
/** * Returns a copy of the system hints. This is for {@link GeoTools#getDefaultHints} * implementation only. */ static Hints getDefaults(final boolean strict) { final Hints hints; final boolean changed = ensureSystemDefaultLoaded(); if (strict) { hints = new StrictHints(GLOBAL); } else { hints = new Hints(GLOBAL); } if (changed) { GeoTools.fireConfigurationChanged(); } return hints; }