Package com.starpoints.painter.editor
Class PainterTabbedMenu
- java.lang.Object
-
- com.starpoints.painter.PainterBase
-
- com.starpoints.painter.PainterMenu
-
- com.starpoints.painter.editor.PainterTabbedMenu
-
- All Implemented Interfaces:
InputController,Painter
- Direct Known Subclasses:
PainterFlashAnimationInfoMenu,PainterLevelInfoMenu,PainterShopInfoMenu
public class PainterTabbedMenu extends PainterMenu
Painter for tabbed submenus in editor.
-
-
Field Summary
Fields Modifier and Type Field Description protected static intTABHEADER_HEIGHT-
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 PainterTabbedMenu()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMenu(PainterMenuHorizontal menu, java.lang.String text)intgetBaseHeight()Gets the base height of this painter.intgetBaseWidth()Gets the base width of this painter.booleankeyPressed(KeyEvent e)Processes keys in menu.booleanmouseClicked(MouseEvent e)Handles mouse clicksbooleanmouseMoved(MouseEvent e)Handles mouse moves.voidonStartGame(GameState state)Called if game is started.protected voidonTabChange(int activeTab2)voidpaint(Graphics g, GameState state)Paints the menu.voidselectTab(int tab)voidsetArea(Rectangle area)Sets the size for this Painter.-
Methods inherited from class com.starpoints.painter.PainterMenu
addMenuEntry, addMenuListener, draw, drawBackgroundImage, findIntegerIndex, findIntegerIndex, fireEmptyClickEvent, fireMenuEntryMouseOverEvent, fireMenuEntrySelectedEvent, fireMenuEntrySelectionChangedEvent, focusFirst, getButtonScalingFactor, getButtonXPos, getButtonYPos, getFocussedEntry, getFontSize, getLeftMouseBorder, getRightMouseBorder, handleEvent, isActive, isDownKey, isEnterKey, isFinished, isLeftKey, isRightKey, isShowingButtons, isUpKey, paintMenuEntry, removeMenuEntry, removeMenuListener, setActive, setFinished, setMouseArea, setShowButtons
-
Methods inherited from class com.starpoints.painter.PainterBase
draw, drawShaded, drawShaded, getArea, getEditor, getHeight, getIndent, getRepaintFactor, getWidth, getXFactor, getYFactor, isInputController, 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
-
TABHEADER_HEIGHT
protected static final int TABHEADER_HEIGHT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBaseWidth
public int getBaseWidth()
Gets the base width of this painter.- Specified by:
getBaseWidthin interfacePainter- Overrides:
getBaseWidthin classPainterBase- Returns:
- 1070.
-
getBaseHeight
public int getBaseHeight()
Gets the base height of this painter.- Specified by:
getBaseHeightin interfacePainter- Overrides:
getBaseHeightin classPainterBase- Returns:
- 770.
-
paint
public void paint(Graphics g, GameState state)
Paints the menu.- Specified by:
paintin interfacePainter- Overrides:
paintin classPainterMenu- Parameters:
g- The graphics.state- The game state.
-
addMenu
public void addMenu(PainterMenuHorizontal menu, java.lang.String text)
-
setArea
public void setArea(Rectangle area)
Sets the size for this Painter. All graphic operations should be restricted to this area.- Specified by:
setAreain interfacePainter- Overrides:
setAreain classPainterBase- Parameters:
area- The area.
-
selectTab
public void selectTab(int tab)
-
keyPressed
public boolean keyPressed(KeyEvent e)
Processes keys in menu.- Specified by:
keyPressedin interfaceInputController- Overrides:
keyPressedin classPainterMenu- Parameters:
e- KeyEvent.- Returns:
- true, if the event is handled by this InputController.
-
mouseClicked
public boolean mouseClicked(MouseEvent e)
Handles mouse clicks- Specified by:
mouseClickedin interfaceInputController- Overrides:
mouseClickedin classPainterMenu- Parameters:
e- MouseEvent.- Returns:
- true, if the event is handled by this InputController.
-
onTabChange
protected void onTabChange(int activeTab2)
-
mouseMoved
public boolean mouseMoved(MouseEvent e)
Handles mouse moves.- Specified by:
mouseMovedin interfaceInputController- Overrides:
mouseMovedin classPainterMenu- Parameters:
e- MouseEvent- Returns:
- true, if the event is handled by this InputController.
-
onStartGame
public void onStartGame(GameState state)
Called if game is started.- Specified by:
onStartGamein interfacePainter- Overrides:
onStartGamein classPainterBase- Parameters:
state- The game state.
-
-