Package com.starpoints.painter
Class PainterFactory
- java.lang.Object
-
- com.starpoints.painter.PainterFactory
-
public class PainterFactory extends java.lang.ObjectFactory for painter creation and UI layouting.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PainterFactory(StarpointController context)Creates a new Painter Factory.
-
Method Summary
-
-
-
Field Detail
-
painterSets
protected java.util.HashMap<StarpointMode,PainterSet> painterSets
-
painterBackground
protected PainterBackground painterBackground
-
painterMenu
protected PainterMainMenu painterMenu
-
textCanvas
protected PainterText textCanvas
-
levelIntro
protected PainterLevelIntro levelIntro
-
painterLevelInfo
protected PainterLevelInfo painterLevelInfo
-
painterGameMenu
protected PainterGameMenu painterGameMenu
-
painterDimmer
protected PainterDimmer painterDimmer
-
painterGameDimmer
protected PainterDimmer painterGameDimmer
-
painterFlashAnimation
protected PainterFlashAnimation painterFlashAnimation
-
painterGameFinishedAnimation
protected PainterGameFinishedAnimation painterGameFinishedAnimation
-
painter2DArena
protected Painter2DArena painter2DArena
-
painterCredits
protected PainterCredits painterCredits
-
painterGameMessage
protected PainterGameMessage painterGameMessage
-
painterOptions
protected PainterOptions painterOptions
-
painterPlayerInfo
protected PainterPlayerInfos painterPlayerInfo
-
painterLevelIntro
protected PainterLevelIntro painterLevelIntro
-
painterMessage
protected PainterMessageText painterMessage
-
painterNetworkMenu
protected PainterNetworkMenu painterNetworkMenu
-
painterMenuText
protected PainterText painterMenuText
-
painterShop
protected PainterShop painterShop
-
painterTutorial
protected PainterTutorial painterTutorial
-
painterControlButtons
protected PainterControlButtons painterControlButtons
-
painterKeyboard
protected PainterKeyboard painterKeyboard
-
painterMenuKeyboard
protected PainterMenuKeyboard painterMenuKeyboard
-
painterInventory
protected PainterInventory painterInventory
-
painterSkinSelection
protected PainterSkinSelection painterSkinSelection
-
painterItem
protected PainterItem painterItem
-
painterFigure
protected PainterFigure painterFigure
-
painterPlayerFigure
protected PainterPlayerFigure painterPlayerFigure
-
painterFog
protected PainterFog painterFog
-
painterSavedGamesMenu
protected PainterSavedGamesMenu painterSavedGamesMenu
-
lastSplit
protected static int lastSplit
-
firstTime
protected boolean firstTime
-
registeredPainters
protected java.util.Hashtable<java.lang.String,PainterThing> registeredPainters
-
painterEditorMenu
protected PainterEditorMenu painterEditorMenu
-
painterLevelOverview
protected PainterLevelOverview painterLevelOverview
-
painterLevelItems
protected PainterLevelItems painterLevelItems
-
painterLevelColors
protected PainterLevelColors painterLevelColors
-
painterLevelFogs
protected PainterLevelFogs painterLevelFogs
-
painterLevelEnemies
protected PainterLevelEnemies painterLevelEnemies
-
painterFieldEditor
protected PainterFieldEditor painterFieldEditor
-
painterLevelProps
protected PainterLevelProps painterLevelProps
-
painterThingProps
protected PainterThingProps painterThingProps
-
painterShopInfoMenu
protected PainterShopInfoMenu painterShopInfoMenu
-
painterShopItems
protected PainterShopItems painterShopItems
-
painterShopEditor
protected PainterShopEditor painterShopEditor
-
painterShopProps
protected PainterShopProps painterShopProps
-
painterShopItemProps
protected PainterShopItemProps painterShopItemProps
-
painterFlashAnimationInfoMenu
protected PainterFlashAnimationInfoMenu painterFlashAnimationInfoMenu
-
painterFlashAnimationItems
protected PainterFlashAnimationItems painterFlashAnimationItems
-
painterFlashPlanets
protected PainterFlashAnimationPlanets painterFlashPlanets
-
painterFlashAnimationEditor
protected PainterFlashAnimationEditor painterFlashAnimationEditor
-
painterFlashAnimationItemProps
protected PainterFlashAnimationItemProps painterFlashAnimationItemProps
-
painterEditorHelp
protected PainterEditorHelp painterEditorHelp
-
painterLevelSetsMenu
protected PainterLevelSetsMenu painterLevelSetsMenu
-
controller
protected StarpointController controller
-
painterConfirmMenu
protected PainterConfirmMenu painterConfirmMenu
-
painterSet3D
protected PainterSet painterSet3D
-
painterSet3DMenu
protected PainterSet painterSet3DMenu
-
painterSet3DOptions
protected PainterSet painterSet3DOptions
-
painterLeaguePlayers
protected PainterLeaguePlayers painterLeaguePlayers
-
painterLeagueBoard
protected PainterLeagueBoard painterLeagueBoard
-
-
Constructor Detail
-
PainterFactory
public PainterFactory(StarpointController context)
Creates a new Painter Factory. Initializes all Painters, Paintersets etc.- Parameters:
context- Reference to the application context
-
-
Method Detail
-
layout
public void layout()
-
createMessagePainter
protected void createMessagePainter(Rectangle screenSize)
-
createGameMessagePainter
protected void createGameMessagePainter(Rectangle screenSize)
-
createPainterMenu
protected void createPainterMenu(StarpointController controller, Rectangle screenSize)
-
createBackground
protected void createBackground(StarpointController controller, Rectangle screenSize)
-
createFlashAnimationPainter
protected void createFlashAnimationPainter(StarpointController controller, Rectangle screenSize)
-
createGameFinishedAnimationPainter
protected void createGameFinishedAnimationPainter(StarpointController controller, Rectangle screenSize)
-
createPainterLevelIntro
protected void createPainterLevelIntro(Rectangle screenSize)
-
createPainterLevelInfo
protected void createPainterLevelInfo(Rectangle screenSize)
-
createArenaPainter2D
protected void createArenaPainter2D(StarpointController controller, Rectangle screenSize)
-
createPainterDimmer
protected void createPainterDimmer(Rectangle screenSize)
-
createPainterGameDimmer
protected void createPainterGameDimmer(StarpointController controller, Rectangle screenSize)
-
createPainterCredits
protected void createPainterCredits(Rectangle screenSize)
-
createPainterOptionsMenu
protected void createPainterOptionsMenu(StarpointController controller, Rectangle screenSize)
-
createPainterShop
protected void createPainterShop(StarpointController controller, Rectangle screenSize)
-
createPainterInventory
protected void createPainterInventory(StarpointController controller, Rectangle screenSize)
-
createPainterGameMenu
protected void createPainterGameMenu(StarpointController controller, Rectangle screenSize)
-
createPainterMenuText
protected void createPainterMenuText(Rectangle screenSize)
-
createPainterPlayerInfo
protected void createPainterPlayerInfo(StarpointController controller, Rectangle screenSize)
-
createPainterSkinSelection
protected void createPainterSkinSelection(StarpointController controller, Rectangle screenSize)
-
createPainterTutorial
protected void createPainterTutorial(Rectangle screenSize)
-
createPainterControlButtons
protected void createPainterControlButtons(StarpointController controller, Rectangle screenSize)
-
createPainterKeyboard
protected void createPainterKeyboard(StarpointController controller, Rectangle screenSize)
-
createPainterMenuKeyboard
protected void createPainterMenuKeyboard(StarpointController controller, Rectangle screenSize)
-
createPainterMenuSavedGames
protected void createPainterMenuSavedGames(StarpointController controller, Rectangle screenSize)
-
createPainterNetworkMenu
protected void createPainterNetworkMenu(StarpointController controller, Rectangle screenSize)
-
createPainterLeaguePlayers
protected void createPainterLeaguePlayers(StarpointController controller, Rectangle screenSize)
-
createPainterLeagueBoard
protected void createPainterLeagueBoard(StarpointController controller, Rectangle screenSize)
-
getHorizontalSplitY
protected int getHorizontalSplitY(Rectangle screenSize)
Gets the y position of the horizontal split during game.- Parameters:
screenSize- The screen size.- Returns:
- The y coordinate of the vertical split.
-
getVerticalSplitX
public int getVerticalSplitX(Rectangle screenSize)
Gets the x position of the vertical split during game. Calculates the needed width for the PlayerPanel based on an equal vertical and horizontal scaling factor.- Parameters:
screenSize- The screen size.- Returns:
- The y coordinate of the vertical split.
-
createMenuPainterSet
protected PainterSet createMenuPainterSet(StarpointController context, Rectangle screenSize)
-
createOptionsPainterSet
protected PainterSet createOptionsPainterSet(StarpointController context, Rectangle screenSize)
-
createCreditsPainterSet
protected PainterSet createCreditsPainterSet(StarpointController context, Rectangle screenSize)
-
createSkinSelectionPainterSet
protected PainterSet createSkinSelectionPainterSet(Rectangle screenSize)
-
create2DArenaPainterSet
protected PainterSet create2DArenaPainterSet(StarpointController context, Rectangle screenSize)
-
create3DArenaPainterSet
protected PainterSet create3DArenaPainterSet(StarpointController context, Rectangle screenSize)
-
create3DMenuPainterSet
protected PainterSet create3DMenuPainterSet(Rectangle screenSize)
-
createGameMenuPainterSet
protected PainterSet createGameMenuPainterSet(Rectangle screenSize)
-
createGameOptionsPainterSet
protected PainterSet createGameOptionsPainterSet(Rectangle screenSize)
-
create3DOptionsPainterSet
protected PainterSet create3DOptionsPainterSet(Rectangle screenSize)
-
createSavedGameSelectionPainterSet
protected PainterSet createSavedGameSelectionPainterSet(Rectangle screenSize)
-
createLevelSetSelectionPainterSet
protected PainterSet createLevelSetSelectionPainterSet(Rectangle screenSize)
-
createNetworkMenuPainterSet
protected PainterSet createNetworkMenuPainterSet(Rectangle screenSize)
-
createClientWaitPainterSet
protected PainterSet createClientWaitPainterSet(Rectangle screenSize)
-
createEditorPainterSet
protected PainterSet createEditorPainterSet(Rectangle screenSize)
-
initializeThingPainter
protected void initializeThingPainter()
-
getPainter
public Painter getPainter(StarpointMode mode)
Returns the Painter for a GameMode- Parameters:
mode- The game mode- Returns:
- The PainterSet for the mode.
-
getMessagePainter
public PainterMessageText getMessagePainter()
Gets the message painter.- Returns:
- The message painter.
-
getMenuTextPainter
public PainterText getMenuTextPainter()
Returns a menu text painter.- Returns:
- The menu text painter.
-
getMenuPainter
public PainterMainMenu getMenuPainter()
Returns the main menu painter.- Returns:
- The menu painter.
-
getTutor
public PainterTutorial getTutor()
Gets the tutor.- Returns:
- The tutor.
-
getXCoordinate
public int getXCoordinate(int x)
Gets the x coordinate of a point (as provided by the Painter2DArena).- Parameters:
x- The points x coordinate.- Returns:
- The x center coordinate.
-
getYCoordinate
public int getYCoordinate(int y)
Gets the y coordinate of a point (as provided by the Painter2DArena).- Parameters:
y- The points y coordinate.- Returns:
- The y center coordinate.
-
registerThingPainter
public void registerThingPainter(java.lang.String thingClass, java.lang.String painterClass)Registers a special painter for a thing.- Parameters:
thingClass- The things class name.painterClass- The Painter class for the thing.
-
getPainterForThing
public PainterThing getPainterForThing(ThingState thingState)
Gets a painter for the given Thing.- Parameters:
thingState- The thing.- Returns:
- The painter.
-
getPainterForThing
public PainterThing getPainterForThing(Thing thing)
Gets a painter for the given Thing.- Parameters:
thing- The thing.- Returns:
- The painter.
-
getPainterForClass
protected PainterThing getPainterForClass(java.lang.String clas)
Gets a PainterThing for the given class name.- Parameters:
clas- The Painter class.- Returns:
- The painter instance.
-
getDimmerPainter
public PainterDimmer getDimmerPainter()
Gets the Dimmer.- Returns:
- The dimmer.
-
getCreditsPainter
public PainterCredits getCreditsPainter()
Gets the Dimmer.- Returns:
- The dimmer.
-
getOptionsMenuPainter
public PainterOptions getOptionsMenuPainter()
Gets the Options Menu painter.- Returns:
- The options menu.
-
getGameMenuPainter
public PainterGameMenu getGameMenuPainter()
Gets the Game Menu painter.- Returns:
- The game menu.
-
getArenaPainter
public Painter2DArena getArenaPainter()
Gets the Arena painter.- Returns:
- The arena painter.
-
getMenuKeyboard
public PainterMenuKeyboard getMenuKeyboard()
Gets the menu keyboard.- Returns:
- The menu keyboard.
-
getSkinSelectionPainter
public PainterSkinSelection getSkinSelectionPainter()
Gets the skin selection painter.- Returns:
- The menu keyboard.
-
getFlashAnimationPainter
public PainterFlashAnimation getFlashAnimationPainter()
Gets the flash animation painter.- Returns:
- The FlashAnimation painter
-
getEditorLevelProps
public Painter getEditorLevelProps()
Gets the editor painter for level props.- Returns:
- The FlashAnimation painter
-
getEditorLevelInfoMenu
public PainterLevelInfoMenu getEditorLevelInfoMenu()
- Returns:
- the painterLevelInfoMenu
-
getController
public StarpointController getController()
Convenience method to get controller.- Returns:
- The Controlelr.
-
getBackgroundPainter
public PainterBackground getBackgroundPainter()
Gets the background painter.- Returns:
- The BackgroundPainter.
-
-