public class MapController extends java.lang.Object implements MapConstants
CALIFORNIA, CALIFORNIA_COLOR, HEARTLAND, HEARTLAND_COLOR, MOUNTAIN, MOUNTAIN_COLOR, NORTHERN_CRESCENT, NORTHERN_CRESCENT_COLOR, NORTHERN_PLAINS, NORTHERN_PLAINS_COLOR, SELECT_RADIUS, SOUTHEAST, SOUTHEAST_COLOR, SOUTHERN_PLAINS, SOUTHERN_PLAINS_COLOR, UNSELECT_RADIUS| Constructor and Description |
|---|
MapController() |
| Modifier and Type | Method and Description |
|---|---|
void |
colorTakenRegions(javafx.scene.Node mapNode,
java.util.TreeMap<EnumRegion,java.lang.String> regions)
Colors a taken region red
|
void |
handleMouseClicked(javafx.scene.input.MouseEvent event)
Defines the behavior of the map whena region is click on by the user's mouse
|
void |
handleMouseEntered(javafx.scene.input.MouseEvent event)
Defines the behavior of the map when a region is entered by the user's mouse
|
void |
handleMouseExited(javafx.scene.input.MouseEvent event)
Defines the behavior of the map when a region is exited by the user's mouse
|
void |
handleMouseMoved(javafx.scene.input.MouseEvent event)
Defines the behavior of the map when the mouse is moved by the user
|
void |
setClient(Client client)
Initializes the reference tot he client that is associated with this controller
|
static <T extends MapController> |
setCurrentController(java.lang.Class<T> controllerClass)
Sets the current controller for the map
|
void |
styleRegion(javafx.scene.Node mapNode,
EnumRegion region,
javafx.scene.paint.Color color,
javafx.scene.effect.Effect effect)
Styles a specified region in the FXML US map with a specified color and an optional, nullable style effect.
|
public void handleMouseEntered(javafx.scene.input.MouseEvent event)
event - Mouse event that triggered the entering of the regionpublic void handleMouseExited(javafx.scene.input.MouseEvent event)
event - Mouse event that was triggered upon exiting a regionpublic void handleMouseMoved(javafx.scene.input.MouseEvent event)
event - Mouse event that was triggered upon moving the mousepublic void handleMouseClicked(javafx.scene.input.MouseEvent event)
event - Mouse event that was triggered upon clicking a regionpublic static <T extends MapController> void setCurrentController(java.lang.Class<T> controllerClass)
T - the class type of controllercontrollerClass - the controller to set as currentpublic void styleRegion(javafx.scene.Node mapNode,
EnumRegion region,
javafx.scene.paint.Color color,
javafx.scene.effect.Effect effect)
mapNode - the parent-most Node in the FXML file for the US mapregion - the specified region to stylecolor - the color to style the region witheffect - the optional effect to add to the regionpublic void colorTakenRegions(javafx.scene.Node mapNode,
java.util.TreeMap<EnumRegion,java.lang.String> regions)
mapNode - the parent-most Node in the FXML file for the US mapregions - the specifies treemap of taken regions to color as takenpublic void setClient(Client client)
client - Client to be referenced