Class UIFactory
- java.lang.Object
-
- ch.sahits.game.openpatrician.display.service.UIFactory
-
- All Implemented Interfaces:
IInvalidatable
public class UIFactory extends java.lang.Object implements IInvalidatable
Factory class for various instances.- Author:
- Andi Hotz, (c) Sahits GmbH, 2014 Created on Dec 01, 2014
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
UIFactory.JavaFXControlLoader
-
Field Summary
Fields Modifier and Type Field Description private IOpenPatricianApplicationWindow
applicationWindow
private org.springframework.context.ApplicationContext
context
private IJavaFXControlLoader
jfxControlLoader
private NonReplacableMap<java.lang.String,OpenPatricianScene>
sceneMap
Scenes must be declared as prototypes as they have constructor arguments, even though they actually are singletons.
-
Constructor Summary
Constructors Constructor Description UIFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CheatMenu
getCheatMenu(ICheatCommand command, javafx.beans.property.ReadOnlyDoubleProperty width)
Create the cheat menu control.CreditsScene
getCreditsScene()
HanseaticHistoryScene
getHanseaticHistoryScene()
InGameOptionsScene
getInGameOptionsScene()
IJavaFXControlLoader
getJavaFXControlLoader()
LoadGameScene
getLoadGameScene()
MainGameScene
getMainGameScene(double width, double heigth)
NewGameScene
getNewGameScene()
StartupScene
getStartupScene()
IDataImageLoader
getXMLImageLoader()
Retrieve the XML image loader for the main screenprivate void
init()
void
invalidate()
This method is called when the object is being invalidated.
-
-
-
Field Detail
-
context
@Autowired private org.springframework.context.ApplicationContext context
-
applicationWindow
private IOpenPatricianApplicationWindow applicationWindow
-
sceneMap
private final NonReplacableMap<java.lang.String,OpenPatricianScene> sceneMap
Scenes must be declared as prototypes as they have constructor arguments, even though they actually are singletons. Therefore cache them here with the bean name.
-
jfxControlLoader
private IJavaFXControlLoader jfxControlLoader
-
-
Method Detail
-
init
@PostConstruct private void init()
-
getXMLImageLoader
public IDataImageLoader getXMLImageLoader()
Retrieve the XML image loader for the main screen- Returns:
- image loader for XML defined images
-
getMainGameScene
public MainGameScene getMainGameScene(double width, double heigth)
-
getStartupScene
public StartupScene getStartupScene()
-
getHanseaticHistoryScene
public HanseaticHistoryScene getHanseaticHistoryScene()
-
getCreditsScene
public CreditsScene getCreditsScene()
-
getNewGameScene
public NewGameScene getNewGameScene()
-
getLoadGameScene
public LoadGameScene getLoadGameScene()
-
getInGameOptionsScene
public InGameOptionsScene getInGameOptionsScene()
-
getJavaFXControlLoader
public IJavaFXControlLoader getJavaFXControlLoader()
-
getCheatMenu
public CheatMenu getCheatMenu(ICheatCommand command, javafx.beans.property.ReadOnlyDoubleProperty width)
Create the cheat menu control.- Parameters:
command
- cheat command that is represented in the cheat menuwidth
- of the parent- Returns:
- cheat menu control
-
invalidate
public void invalidate()
Description copied from interface:IInvalidatable
This method is called when the object is being invalidated. The implementation depends upon the class to take care of invalidating/updating the internal state.- Specified by:
invalidate
in interfaceIInvalidatable
-
-