worldMapView.setCountryViewFactory(country -> {
CountryView view = new CountryView(country);
if (showColorsProperty.get()) {
view.getStyleClass().add("country" + ((country.ordinal() % 8) + 1));
}
return view;
});
worldMapView.setLocationViewFactory(location -> {
Circle circle = new Circle();
circle.getStyleClass().add("location");
circle.setRadius(4);
circle.setTranslateX(-4); // translate to center node on location
circle.setTranslateY(-4); // translate to center node on location
return circle;
});
Shown below is a screenshot of the world map view:
| Modifier and Type | Class and Description |
|---|---|
| public static enum | WorldMapView.
An enumerator listing all countries of the world. |
| public static class | WorldMapView.
A view used to visualize the bounds of a country via SVG. |
| public static class | WorldMapView.
An object using latitude and longitude information to specify a location in the real world. |
| public static enum | WorldMapView.
The selection modes supported by the view. |
| Modifier and Type | Field and Description |
|---|---|
| private final ListProperty | |
| private final ObjectProperty | |
| private final ObjectProperty | |
| private static final String | |
| private final ListProperty | |
| private final ObjectProperty | |
| private final ObjectProperty | |
| private final ListProperty | |
| private final ListProperty | |
| private final BooleanProperty | |
| private Tooltip | |
| private final DoubleProperty |
| Access | Constructor and Description |
|---|---|
| public | WorldMapView()
Constructs a new map view with an initially empty list of countries which will result in the entire world to be shown. |
| Modifier and Type | Method and Description |
|---|---|
| public final ListProperty | Returns: the list of countries shown by the mapA property used to store the list of countries that should be shown by the map. |
| public final ObjectProperty | Returns: the country selection mode propertyA property used to store the selection mode that will be applied for the selection of countries. |
| public final ObjectProperty | Returns: the country view factory propertyA property used to store a factory callback for creating new country views. |
| protected Skin | createDefaultSkin()
Overrides javafx. Create a new instance of the default skin for this control. |
| public final ObservableList | Returns: the list of countries shown by the mapReturns the list of countries that will be shown by the map. |
| public final WorldMapView. | Returns: the country selection modeReturns the value of |
| public final Callback | Returns: the country view factoryReturns the value of |
| public final ObservableList | |
| public final WorldMapView. | Returns: the location selection modeReturns the value of |
| public final Callback | Returns: the location view factoryReturns the value of |
| public final ObservableList | Returns: the list of selected countriesReturns the list of currently selected countries. |
| public final ObservableList | Returns: the list of selected locationsReturns the list of currently selected locations. |
| public String | getUserAgentStylesheet()
Overrides javafx. An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. |
| public final double | |
| public final boolean | |
| public final ObjectProperty | Returns: the location selection mode propertyA property used to store the selection mode that will be applied for the selection of locations. |
| public final ListProperty | |
| public final ObjectProperty | Returns: the location view factory propertyA property used to store a factory callback for creating new location views (nodes). |
| public final ListProperty | Returns: the selected countries propertyA property used for storing the list of selected countries (aka "the selection model"). |
| public final ListProperty | Returns: the selected locations propertyA property used for storing the list of selected locations (aka "the selection model"). |
| public final void | setCountries(ObservableList<WorldMapView.
the list of countries shown by the map countriesSets the list of countries that will be shown by the map. |
| public final void | setCountrySelectionMode(WorldMapView.
the country selection mode modeSets the value of |
| public final void | setCountryViewFactory(Callback<WorldMapView.
the country view factory factorySets the value of |
| public final void | setLocations(ObservableList<WorldMapView.
the list of locations locationsSets the list of locations shown by the map. |
| public final void | setLocationSelectionMode(WorldMapView.
the location selection mode modeSets the value of |
| public final void | setLocationViewFactory(Callback<WorldMapView.
the location view factory factorySets the value of |
| public final void | setSelectedCountries(ObservableList<WorldMapView.
the selected countries countriesSets the list of currently selected countries. |
| public final void | setSelectedLocations(ObservableList<WorldMapView.
the selected locations locationsSets the list of currently selected locations. |
| public final void | setShowLocations(boolean
if true then locations are shown show)Sets the value of |
| public final void | |
| public final BooleanProperty | Returns: a property to control the visibility of locationsA property used to control whether locations will be shown by the map or not. |
| public final DoubleProperty | Returns: the zoom factorA property used to store the current zoom factor, a value between 1 and 10. |