Package com.starpoints.painter.editor
Class PainterFlashAnimationItems
- java.lang.Object
-
- com.starpoints.painter.PainterBase
-
- com.starpoints.painter.PainterMenu
-
- com.starpoints.painter.editor.PainterMenuHorizontal
-
- com.starpoints.painter.editor.PainterFlashAnimationItems
-
- All Implemented Interfaces:
InputController,MenuListener,LevelChangeListener,Painter
public class PainterFlashAnimationItems extends PainterMenuHorizontal implements MenuListener
Painter for starting item selection for flash animations in editor.
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]energyCountsNumbers corresponding to the energy entries.protected java.lang.String[]energyEntriesEnergy entries.protected int[]moneyCountsNumbers corresponding to the energy entries.protected java.lang.String[]moneyEntriesEnergy entries.protected int[]slotCountsSlot counts corresponding to the number entries.protected java.lang.String[]slotEntriesSlot entries.-
Fields inherited from class com.starpoints.painter.editor.PainterMenuHorizontal
focussedIndex, selectionIndex
-
Fields inherited from class com.starpoints.painter.PainterMenu
active, button, button_clicked, buttonCounter, buttonLeft, buttonRight, entries, finished, firstTimeOpt, hideBackground, image, listeners, numberEntries, numbers, paintCount, showButtons
-
Fields inherited from class com.starpoints.painter.PainterBase
area, areas, bigFont, controller, gameInfo, medFont, mouseArea, offset, oldMouseArea, options, smallFont, state, verysmallFont, xfactor, yfactor
-
-
Constructor Summary
Constructors Constructor Description PainterFlashAnimationItems(PainterFactory painterFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyLevelProperties()Applies the shop properties after the selected level changed.protected voiddrawEnergyBar(Graphics g)Draws the energy bar.protected voiddrawMaxEnergyBar(Graphics g, GameState state)Draws the energy maximum bar.protected booleandrawProbability(SelectionMenuEntry me)Checks, if probability string is drawn.intgetBaseHeight()Gets the base height of this painter.protected java.lang.StringgetDisplayText(MenuEntry me)Returns the display text for the MenuEntry.protected FontgetFontSize(MenuEntry me)Gets the font for the menu entries fontsize.protected java.lang.StringgetImage(MenuEntry me)Gets an image for the MenuEntry.intgetIndent()Returns indent for text.intgetMouseAreaYSplit()Gets the vertical coordinate, beyond which mouse coordinates are in second column.intgetYCenter(MenuEntry me)Gets the yCenter position.booleanisActive()Checks, if this painter is active.voidlevelSetChanged()Does nothing.voidmenuEmptyClick()Does nothing.voidmenuEntryChanged(TextEntryMenuEntry me)Does nothing.voidmenuEntrySelected(MenuEntry me)Does nothing.voidmenuMouseOver(MenuEntry me)Does nothing.voidmenuSelectionChanged(SelectionMenuEntry me)Handles a menu selection change.booleanmouseClicked(MouseEvent e)Handles mouse clicksbooleanmouseMoved(MouseEvent e)Handles mouse clicksprotected voidonSelectedIndexChange()Updates after selection change.voidonStartGame(GameState state)Called when a new game is started.voidpaint(Graphics g, GameState state)Paints the menu.protected voidpaintMenuEntry(Graphics g, MenuEntry me, java.lang.String i)Paints a menu entry.protected voidselectItem(int index)Selects an item.-
Methods inherited from class com.starpoints.painter.editor.PainterMenuHorizontal
drawAmount, drawImageFrame, getBaseWidth, getImageScaleFactor, getMouseSelectionUpperYCoordinate, getProbabilityString, getSelectionIndex, getTextXPosition, getXCenter, getYPercentageCoordinate, getYTextCoordinate, keyPressed, levelChanged, paintSelectionIcon, paintSelectionIcon, setMouseArea, showSelected
-
Methods inherited from class com.starpoints.painter.PainterMenu
addMenuEntry, addMenuListener, draw, drawBackgroundImage, findIntegerIndex, findIntegerIndex, fireEmptyClickEvent, fireMenuEntryMouseOverEvent, fireMenuEntrySelectedEvent, fireMenuEntrySelectionChangedEvent, focusFirst, getButtonScalingFactor, getButtonXPos, getButtonYPos, getFocussedEntry, getLeftMouseBorder, getRightMouseBorder, handleEvent, isDownKey, isEnterKey, isFinished, isLeftKey, isRightKey, isShowingButtons, isUpKey, paintMenuEntry, removeMenuEntry, removeMenuListener, setActive, setFinished, setShowButtons
-
Methods inherited from class com.starpoints.painter.PainterBase
draw, drawShaded, drawShaded, getArea, getEditor, getHeight, getRepaintFactor, getWidth, getXFactor, getYFactor, isInputController, setArea, setController, setFontSize, setLevel, setOptions, setState
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.starpoints.event.InputController
getArea, getXFactor, getYFactor, setController
-
-
-
-
Field Detail
-
slotEntries
protected java.lang.String[] slotEntries
Slot entries.
-
slotCounts
protected int[] slotCounts
Slot counts corresponding to the number entries.
-
energyEntries
protected java.lang.String[] energyEntries
Energy entries.
-
energyCounts
protected int[] energyCounts
Numbers corresponding to the energy entries.
-
moneyEntries
protected java.lang.String[] moneyEntries
Energy entries.
-
moneyCounts
protected int[] moneyCounts
Numbers corresponding to the energy entries.
-
-
Constructor Detail
-
PainterFlashAnimationItems
public PainterFlashAnimationItems(PainterFactory painterFactory)
-
-
Method Detail
-
onStartGame
public void onStartGame(GameState state)
Description copied from class:PainterBaseCalled when a new game is started.- Specified by:
onStartGamein interfacePainter- Overrides:
onStartGamein classPainterMenuHorizontal- Parameters:
state- The game state.
-
getBaseHeight
public int getBaseHeight()
Gets the base height of this painter.- Specified by:
getBaseHeightin interfacePainter- Overrides:
getBaseHeightin classPainterMenuHorizontal- Returns:
- 300.
-
getImage
protected java.lang.String getImage(MenuEntry me)
Gets an image for the MenuEntry.- Overrides:
getImagein classPainterMenuHorizontal- Returns:
- The image name.
-
getIndent
public int getIndent()
Returns indent for text.- Overrides:
getIndentin classPainterBase- Returns:
- 240.
-
getFontSize
protected Font getFontSize(MenuEntry me)
Gets the font for the menu entries fontsize.- Overrides:
getFontSizein classPainterMenu- Parameters:
me- The menu entry.- Returns:
- Font.DIALOG_24;
-
applyLevelProperties
protected void applyLevelProperties()
Applies the shop properties after the selected level changed.- Specified by:
applyLevelPropertiesin classPainterMenuHorizontal
-
isActive
public boolean isActive()
Checks, if this painter is active.- Specified by:
isActivein interfacePainter- Overrides:
isActivein classPainterMenu- Returns:
- true, if FlashAnimationInfo is edited.
-
paintMenuEntry
protected void paintMenuEntry(Graphics g, MenuEntry me, java.lang.String i)
Paints a menu entry.- Overrides:
paintMenuEntryin classPainterMenuHorizontal- Parameters:
g- The graphics.me- The MenuEntry.i- The display string.
-
getMouseAreaYSplit
public int getMouseAreaYSplit()
Gets the vertical coordinate, beyond which mouse coordinates are in second column.- Overrides:
getMouseAreaYSplitin classPainterMenuHorizontal- Returns:
- Baseheight / 2 as default
-
getYCenter
public int getYCenter(MenuEntry me)
Gets the yCenter position.- Overrides:
getYCenterin classPainterMenuHorizontal- Parameters:
me- The menu entry.- Returns:
- The yCenter position.
-
drawProbability
protected boolean drawProbability(SelectionMenuEntry me)
Checks, if probability string is drawn.- Overrides:
drawProbabilityin classPainterMenuHorizontal- Parameters:
me- The menu entry.- Returns:
- false.
-
menuSelectionChanged
public void menuSelectionChanged(SelectionMenuEntry me)
Handles a menu selection change.- Specified by:
menuSelectionChangedin interfaceMenuListener- Parameters:
me- The menu entry.
-
selectItem
protected void selectItem(int index)
Selects an item.- Parameters:
index- The item index.
-
onSelectedIndexChange
protected void onSelectedIndexChange()
Updates after selection change.- Overrides:
onSelectedIndexChangein classPainterMenuHorizontal
-
menuEntrySelected
public void menuEntrySelected(MenuEntry me)
Does nothing.- Specified by:
menuEntrySelectedin interfaceMenuListener- Parameters:
me- The changed menu entry.
-
menuMouseOver
public void menuMouseOver(MenuEntry me)
Does nothing.- Specified by:
menuMouseOverin interfaceMenuListener- Parameters:
me- The changed menu entry.
-
menuEmptyClick
public void menuEmptyClick()
Does nothing.- Specified by:
menuEmptyClickin interfaceMenuListener
-
menuEntryChanged
public void menuEntryChanged(TextEntryMenuEntry me)
Does nothing.- Specified by:
menuEntryChangedin interfaceMenuListener- Parameters:
me- The menuentry.
-
levelSetChanged
public void levelSetChanged()
Does nothing.- Specified by:
levelSetChangedin interfaceLevelChangeListener
-
mouseClicked
public boolean mouseClicked(MouseEvent e)
Handles mouse clicks- Specified by:
mouseClickedin interfaceInputController- Overrides:
mouseClickedin classPainterMenuHorizontal- Parameters:
e- MouseEvent.- Returns:
- true, if the event is handled by this InputController.
-
mouseMoved
public boolean mouseMoved(MouseEvent e)
Handles mouse clicks- Specified by:
mouseMovedin interfaceInputController- Overrides:
mouseMovedin classPainterMenuHorizontal- Parameters:
e- MouseEvent.- Returns:
- true, if the event is handled by this InputController.
-
paint
public void paint(Graphics g, GameState state)
Paints the menu.- Specified by:
paintin interfacePainter- Overrides:
paintin classPainterMenuHorizontal- Parameters:
g- The graphics.state- The game state.
-
getDisplayText
protected java.lang.String getDisplayText(MenuEntry me)
Returns the display text for the MenuEntry.- Overrides:
getDisplayTextin classPainterMenuHorizontal- Parameters:
me- The MenuEntry- Returns:
- me.getDisplayText();
-
drawEnergyBar
protected void drawEnergyBar(Graphics g)
Draws the energy bar.- Parameters:
g- The graphics.
-
-