org.geotools.util.factory.GeoTools.fireConfigurationChanged()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中org.geotools.util.factory.GeoTools.fireConfigurationChanged()方法的一些代码示例,展示了GeoTools.fireConfigurationChanged()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeoTools.fireConfigurationChanged()方法的具体详情如下:
包路径:org.geotools.util.factory.GeoTools
类名称:GeoTools
方法名:fireConfigurationChanged

GeoTools.fireConfigurationChanged介绍

[英]Informs every listeners that system-wide configuration changed.
[中]通知每个侦听器系统范围的配置已更改。

代码示例

代码示例来源:origin: geotools/geotools

/**
 * Provides GeoTools with the JNDI context for resource lookup.
 *
 * @param applicationContext The initial context to use.
 * @see #getInitialContext
 * @since 2.4
 */
public static void init(final InitialContext applicationContext) {
  synchronized (GeoTools.class) {
    context = applicationContext;
  }
  fireConfigurationChanged();
}

代码示例来源:origin: geotools/geotools

/**
 * Adds a class loader to be included in the list of class loaders that are used to locate
 * GeoTools plug-ins.
 *
 * <p>Client code that calls this method may also need to call {@link
 * FactoryRegistry#scanForPlugins()} on any existing registry to force it to clear its cache and
 * use the added class loader to locate plugins.
 *
 * @param classLoader The class loader.
 */
public static void addClassLoader(ClassLoader classLoader) {
  addedClassLoaders.add(classLoader);
  fireConfigurationChanged();
}

代码示例来源:origin: geotools/geotools

/**
 * 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;
}

代码示例来源:origin: geotools/geotools

/**
 * Scans for factory plug-ins on the application class path. This method is needed because the
 * application class path can theoretically change, or additional plug-ins may become available.
 * Rather than re-scanning the classpath on every invocation of the API, the class path is
 * scanned automatically only on the first invocation. Clients can call this method to prompt a
 * re-scan. Thus this method need only be invoked by sophisticated applications which
 * dynamically make new plug-ins available at runtime.
 */
public static void scanForPlugins() {
  synchronized (ReferencingFactoryFinder.class) {
    authorityNames = null;
    if (registry != null) {
      registry.scanForPlugins();
    }
  }
  GeoTools.fireConfigurationChanged();
}

代码示例来源:origin: geotools/geotools

/**
 * 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;
}

代码示例来源:origin: geotools/geotools

/**
 * 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();
}

代码示例来源:origin: geotools/geotools

GeoTools.fireConfigurationChanged();

代码示例来源:origin: geotools/geotools

/**
 * 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;
}

代码示例来源:origin: geotools/geotools

/**
 * 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;
}

代码示例来源:origin: geotools/geotools

protected void setUp() throws Exception {
  // this is the only thing that actually forces CRS object to give up
  // its configuration, necessary when tests are run by Maven, one JVM for all
  // the tests in this module
  Hints.putSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
  GeoTools.fireConfigurationChanged();
  ft =
      DataUtilities.createType(
          "testType", "geom:Point:srid=4326,line:LineString,name:String,id:int");
  ff = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
  reprojector = new ReprojectingFilterVisitor(ff, ft);
}

相关文章