Class 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
    • Field Detail

      • context

        @Autowired
        private org.springframework.context.ApplicationContext context
      • 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.
    • Constructor Detail

      • UIFactory

        public UIFactory()
    • 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)
      • 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 menu
        width - 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 interface IInvalidatable