Class ScenePolygonInitialzer
- java.lang.Object
-
- ch.sahits.game.openpatrician.display.gameplay.impl.ScenePolygonInitialzer
-
- Direct Known Subclasses:
AbstractMarketPlaceBuildingPolygonInitializer
,ArmoryPolygonInitializer
,LoanerScenePolygonInitializer
,MarketScenePolygonInitializer
,PortScenePolygonInitializer
,ShipyardScenePolygonInitializer
,TavernScenePolygonInitializer
public abstract class ScenePolygonInitialzer extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ScenePolygonInitialzer.PolygonComparator
Comparator based on descending order of the entries key values.
-
Field Summary
Fields Modifier and Type Field Description private IPolygonScaling
scaler
private java.lang.String
SCENE_IMAGE_NAME
protected IDataImageLoader
xmlLoader
-
Constructor Summary
Constructors Constructor Description ScenePolygonInitialzer(java.lang.String sceneName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private void
addAction(NamedPolygon poly)
Add an event to the polygon.protected abstract javafx.event.EventHandler<javafx.scene.input.MouseEvent>
createEventHandler(java.lang.String name)
Create an event handler for the clicking on the polygon with the given name.java.util.List<javafx.scene.shape.Polygon>
initialzePolygons(ImageScaleState state)
Initialize the polygons defined in the metadata considering the proper scaling and cropping.
-
-
-
Field Detail
-
SCENE_IMAGE_NAME
private final java.lang.String SCENE_IMAGE_NAME
-
xmlLoader
@Autowired @Qualifier("xmlImageLoader") protected IDataImageLoader xmlLoader
-
scaler
@Autowired @Qualifier("polygonScaling") private IPolygonScaling scaler
-
-
Method Detail
-
initialzePolygons
public java.util.List<javafx.scene.shape.Polygon> initialzePolygons(ImageScaleState state)
Initialize the polygons defined in the metadata considering the proper scaling and cropping.- Parameters:
state
- current state- Returns:
- List of polygons.
-
addAction
private void addAction(NamedPolygon poly)
Add an event to the polygon.- Parameters:
poly
- polygon
-
createEventHandler
protected abstract javafx.event.EventHandler<javafx.scene.input.MouseEvent> createEventHandler(java.lang.String name)
Create an event handler for the clicking on the polygon with the given name.- Parameters:
name
- of the polygon- Returns:
- EventHandler for the mouse click event
-
-