Package com.starpoints.painter.editor
Class PainterFlashAnimationPlanets
- java.lang.Object
-
- com.starpoints.painter.PainterBase
-
- com.starpoints.painter.PainterMenu
-
- com.starpoints.painter.editor.PainterMenuHorizontal
-
- com.starpoints.painter.editor.PainterFlashAnimationPlanets
-
- All Implemented Interfaces:
InputController
,MenuListener
,LevelChangeListener
,Painter
public class PainterFlashAnimationPlanets extends PainterMenuHorizontal implements MenuListener
Painter for planet selection in editor.
-
-
Field Summary
-
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 PainterFlashAnimationPlanets()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyLevelProperties()
Applies the shop properties after the selected level changed.protected boolean
drawProbability(SelectionMenuEntry me)
Checks, if the probability string should be drawn for the menu item.int
getBaseHeight()
Gets the base height of this painter.protected Font
getFontSize(MenuEntry me)
Gets the font for the menu entries fontsize.protected java.lang.String
getImage(MenuEntry me)
int
getIndent()
Returns indent for text.int
getMouseAreaYSplit()
Gets the vertical coordinate, beyond which mouse coordinates are in second column.protected int
getSelectionIndex()
int
getYCenter(MenuEntry me)
boolean
isActive()
Checks, if this painter is currently active and wants to handle events.void
levelSetChanged()
Does nothing.void
menuEmptyClick()
Does nothing.void
menuEntryChanged(TextEntryMenuEntry me)
Does nothing.void
menuEntrySelected(MenuEntry me)
Does nothing.void
menuMouseOver(MenuEntry me)
Does nothing.void
menuSelectionChanged(SelectionMenuEntry me)
Called if a menu selection changed.boolean
mouseClicked(MouseEvent e)
Handles mouse clicksboolean
mouseMoved(MouseEvent e)
Handles mouse clicksprotected void
onSelectedIndexChange()
void
onStartGame(GameState state)
Called when a new game is started.void
paint(Graphics g, GameState state)
Paints the menu.protected void
paintMenuEntry(Graphics g, MenuEntry me, java.lang.String i)
Paints a menu entry.protected boolean
showSelected(MenuEntry me)
-
Methods inherited from class com.starpoints.painter.editor.PainterMenuHorizontal
drawAmount, drawImageFrame, getBaseWidth, getDisplayText, getImageScaleFactor, getMouseSelectionUpperYCoordinate, getProbabilityString, getTextXPosition, getXCenter, getYPercentageCoordinate, getYTextCoordinate, keyPressed, levelChanged, paintSelectionIcon, paintSelectionIcon, setMouseArea
-
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
-
-
-
-
Method Detail
-
onStartGame
public void onStartGame(GameState state)
Description copied from class:PainterBase
Called when a new game is started.- Specified by:
onStartGame
in interfacePainter
- Overrides:
onStartGame
in classPainterMenuHorizontal
- Parameters:
state
- The game state.
-
getBaseHeight
public int getBaseHeight()
Gets the base height of this painter.- Specified by:
getBaseHeight
in interfacePainter
- Overrides:
getBaseHeight
in classPainterMenuHorizontal
- Returns:
- 300.
-
getFontSize
protected Font getFontSize(MenuEntry me)
Gets the font for the menu entries fontsize.- Overrides:
getFontSize
in classPainterMenu
- Parameters:
me
- The menu entry.- Returns:
- The font.
-
getImage
protected java.lang.String getImage(MenuEntry me)
- Overrides:
getImage
in classPainterMenuHorizontal
-
getIndent
public int getIndent()
Returns indent for text.- Overrides:
getIndent
in classPainterBase
- Returns:
- 220.
-
showSelected
protected boolean showSelected(MenuEntry me)
- Overrides:
showSelected
in classPainterMenuHorizontal
- Parameters:
me
-- Returns:
-
getSelectionIndex
protected int getSelectionIndex()
- Overrides:
getSelectionIndex
in classPainterMenuHorizontal
- Returns:
-
applyLevelProperties
protected void applyLevelProperties()
Applies the shop properties after the selected level changed.- Specified by:
applyLevelProperties
in classPainterMenuHorizontal
-
isActive
public boolean isActive()
Description copied from class:PainterMenu
Checks, if this painter is currently active and wants to handle events.- Specified by:
isActive
in interfacePainter
- Overrides:
isActive
in classPainterMenu
- Returns:
-
paintMenuEntry
protected void paintMenuEntry(Graphics g, MenuEntry me, java.lang.String i)
Paints a menu entry.- Overrides:
paintMenuEntry
in classPainterMenuHorizontal
- Parameters:
g
-me
-
-
getMouseAreaYSplit
public int getMouseAreaYSplit()
Gets the vertical coordinate, beyond which mouse coordinates are in second column.- Overrides:
getMouseAreaYSplit
in classPainterMenuHorizontal
- Returns:
- Baseheight / 2 as default
-
getYCenter
public int getYCenter(MenuEntry me)
- Overrides:
getYCenter
in classPainterMenuHorizontal
- Parameters:
me
-- Returns:
-
drawProbability
protected boolean drawProbability(SelectionMenuEntry me)
Description copied from class:PainterMenuHorizontal
Checks, if the probability string should be drawn for the menu item.- Overrides:
drawProbability
in classPainterMenuHorizontal
- Parameters:
me
-- Returns:
- true, if the probability string should be drawn for the menu item.
-
menuSelectionChanged
public void menuSelectionChanged(SelectionMenuEntry me)
Description copied from interface:MenuListener
Called if a menu selection changed.- Specified by:
menuSelectionChanged
in interfaceMenuListener
- Parameters:
me
- The changed menu entry.
-
onSelectedIndexChange
protected void onSelectedIndexChange()
- Overrides:
onSelectedIndexChange
in classPainterMenuHorizontal
-
menuEntrySelected
public void menuEntrySelected(MenuEntry me)
Does nothing.- Specified by:
menuEntrySelected
in interfaceMenuListener
- Parameters:
me
- The changed menu entry.
-
menuMouseOver
public void menuMouseOver(MenuEntry me)
Does nothing.- Specified by:
menuMouseOver
in interfaceMenuListener
- Parameters:
me
- The changed menu entry.
-
menuEmptyClick
public void menuEmptyClick()
Does nothing.- Specified by:
menuEmptyClick
in interfaceMenuListener
-
menuEntryChanged
public void menuEntryChanged(TextEntryMenuEntry me)
Does nothing.- Specified by:
menuEntryChanged
in interfaceMenuListener
- Parameters:
me
- The menuentry.
-
levelSetChanged
public void levelSetChanged()
Does nothing.- Specified by:
levelSetChanged
in interfaceLevelChangeListener
-
mouseClicked
public boolean mouseClicked(MouseEvent e)
Handles mouse clicks- Specified by:
mouseClicked
in interfaceInputController
- Overrides:
mouseClicked
in 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:
mouseMoved
in interfaceInputController
- Overrides:
mouseMoved
in classPainterMenuHorizontal
- Parameters:
e
- MouseEvent.- Returns:
- true, if the event is handled by this InputController.
-
-