示例#1
0
        public WorldWindowImpl()
        {
            this.sceneController = (SceneController)WorldWind.createConfigurationComponent(
                AVKey.SCENE_CONTROLLER_CLASS_NAME);

            // Set up to initiate a repaint whenever a file is retrieved and added to the local file store.
            WorldWind.getDataFileStore().addPropertyChangeListener(this);
        }
示例#2
0
        /**
         * Static method to create an object from a factory, a configuration source, and an optional configuration parameter
         * list.
         *
         * @param factoryKey   the key identifying the factory in {@link Configuration}.
         * @param configSource the configuration source. May be any of the types listed for {@link
         *                     #createFromConfigSource(object, SharpEarth.avlist.AVList)}
         * @param parameters       key-value parameters to override or supplement the information provided in the specified
         *                     configuration source. May be null.
         *
         * @return a new instance of the requested object.
         *
         * @throws ArgumentException if the factory key is null, or if the configuration source is null or an empty
         *                                  string.
         */
        public static object create(string factoryKey, object configSource, AVList parameters)
        {
            if (factoryKey == null)
            {
                string message = Logging.getMessage("generic.FactoryKeyIsNull");
                throw new ArgumentException(message);
            }

            if (WWUtil.isEmpty(configSource))
            {
                string message = Logging.getMessage("generic.ConfigurationSourceIsInvalid", configSource);
                throw new ArgumentException(message);
            }

            Factory factory = (Factory)WorldWind.createConfigurationComponent(factoryKey);

            return(factory.createFromConfigSource(configSource, parameters));
        }