Package com.starpoints.painter
Class PainterControlButtons
- java.lang.Object
-
- com.starpoints.painter.PainterBase
-
- com.starpoints.painter.PainterControlButtons
-
- All Implemented Interfaces:
InputController
,Painter
public class PainterControlButtons extends PainterBase implements InputController
Painter for Touchpad.
-
-
Field Summary
-
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 PainterControlButtons()
Creates a new PainterControlButtons.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBaseHeight()
Gets the base height of this painter.int
getBaseWidth()
Gets the base width of this painter.boolean
isActive()
Checks, if this painter is currently active and wants to handle events.boolean
keyPressed(KeyEvent e)
Does nothing.boolean
mouseClicked(MouseEvent e)
Handles mouse clicks.boolean
mouseMoved(MouseEvent e)
Does nothing.void
paint(Graphics g, GameState state)
Paints the touchpad.-
Methods inherited from class com.starpoints.painter.PainterBase
draw, drawShaded, drawShaded, getArea, getEditor, getHeight, getIndent, getRepaintFactor, getWidth, getXFactor, getYFactor, isInputController, onStartGame, 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
-
getBaseWidth
public int getBaseWidth()
Gets the base width of this painter.- Specified by:
getBaseWidth
in interfacePainter
- Overrides:
getBaseWidth
in classPainterBase
- Returns:
- 400.
-
getBaseHeight
public int getBaseHeight()
Gets the base height of this painter.- Specified by:
getBaseHeight
in interfacePainter
- Overrides:
getBaseHeight
in classPainterBase
- Returns:
- 400.
-
isActive
public boolean isActive()
Checks, if this painter is currently active and wants to handle events.- Specified by:
isActive
in interfacePainter
- Overrides:
isActive
in classPainterBase
- Returns:
- true, if touchpad option is on.
-
paint
public void paint(Graphics g, GameState state)
Paints the touchpad.- Specified by:
paint
in interfacePainter
- Specified by:
paint
in classPainterBase
- Parameters:
g
- The graphics.state
- The game state.
-
mouseClicked
public boolean mouseClicked(MouseEvent e)
Handles mouse clicks.- Specified by:
mouseClicked
in interfaceInputController
- Parameters:
e
- The mouse event.- Returns:
- true, if button was clicked.
-
mouseMoved
public boolean mouseMoved(MouseEvent e)
Does nothing.- Specified by:
mouseMoved
in interfaceInputController
- Parameters:
e
- The event.- Returns:
- false
-
keyPressed
public boolean keyPressed(KeyEvent e)
Does nothing.- Specified by:
keyPressed
in interfaceInputController
- Parameters:
e
- The event.- Returns:
- false
-
-