Package provided.owlMaps.control
Interface IOwlMapControl
- All Known Implementing Classes:
OwlMapControl
public interface IOwlMapControl
Main top-level OwlMaps entity that starts/stops the OwlMaps system and instantiates the map, map component factory, map utilities, etc.
ONLY instantiate an instance of this interface by using its static make() method!
Do NOT attempt to directly instantiate any implementation of this interface!
- Author:
- swong
-
Method Summary
Modifier and Type Method Description IOwlMap
getMap()
Get the map objectIMapComponentFactory
getMapComponentFactory()
Get the current IMapComponentFactory objectIOwlMapUtils
getMapUtils()
Get the IOwlMapUtils configured for this system.static IOwlMapControl
make(java.lang.String googleMapsApiKey, MapLengthUnits systemLengthUnit, java.util.function.Consumer<java.lang.String> loggerFn)
Instantiate an IOwlMapControl instancevoid
setMakeDevTools(boolean makeDevTools)
Enables the display of the browser dev console windowjavax.swing.JComponent
start(provided.mixedData.IMixedDataDictionary mapOptions, java.lang.Runnable onMapLoad)
Make the map JComponent and start the mapping system.void
stop()
Stop the map engine.
-
Method Details
-
getMapUtils
IOwlMapUtils getMapUtils()Get the IOwlMapUtils configured for this system.- Returns:
- an IOwlMapUtils instance
-
start
javax.swing.JComponent start(provided.mixedData.IMixedDataDictionary mapOptions, java.lang.Runnable onMapLoad) throws java.lang.ClassNotFoundExceptionMake the map JComponent and start the mapping system. THIS METHOD MUST BE RUN FROM THE GUI THREAD!!- Parameters:
mapOptions
- A dictionary of IMapOptions to use when creating the maponMapLoad
- A Runnable to run when the map has finished loading.- Returns:
- A JComponent that will display the map.
- Throws:
java.lang.ClassNotFoundException
- If an unknown map option is encountered
-
getMap
IOwlMap getMap()Get the map object- Returns:
- The map object
-
stop
void stop()Stop the map engine. Must be called when app exits or engine will keep running. -
getMapComponentFactory
IMapComponentFactory getMapComponentFactory()Get the current IMapComponentFactory object- Returns:
- The current IMapComponentFactory object
-
setMakeDevTools
void setMakeDevTools(boolean makeDevTools)Enables the display of the browser dev console window- Parameters:
makeDevTools
- If true, show the dev console window
-
make
static IOwlMapControl make(java.lang.String googleMapsApiKey, MapLengthUnits systemLengthUnit, java.util.function.Consumer<java.lang.String> loggerFn)Instantiate an IOwlMapControl instance- Parameters:
googleMapsApiKey
- The Google Maps API key to useloggerFn
- An consumer to log strings to an external entitysystemLengthUnit
- The length unit to use by the system.- Returns:
- An instance of IOwlMapControl
-