Package com.starpoints.painter.editor
Class PainterFlashAnimationEditor
- java.lang.Object
-
- com.starpoints.painter.PainterBase
-
- com.starpoints.painter.editor.PainterFlashAnimationEditor
-
- All Implemented Interfaces:
InputController
,Painter
public class PainterFlashAnimationEditor extends PainterBase implements InputController
Painter for flash animation editing in editor.
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEBUG
static int
LINE_Y
static int
LINEWIDTH
static int
OFFSET
static int
XCENTER
-
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 PainterFlashAnimationEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addText()
protected void
attachToCenter()
Checks if mouse pos is nearly centered and sets mousepos to 0/0.int
getBaseHeight()
Gets the base height of this painter.int
getBaseWidth()
Gets the base width of this painter.int
getSelectedColor()
Gets the selected color of the color chooser.protected void
handleSelectionClick()
boolean
isActive()
Checks, if the painter is active.boolean
keyPressed(KeyEvent e)
Processes keys in textmode.boolean
mouseClicked(MouseEvent e)
Reacts to mouse events.boolean
mouseMoved(MouseEvent e)
Reacts to mouse move events from the gui.void
paint(Graphics g, GameState state)
Paints the editor field.protected void
paintFlashAnimation(Graphics g, FlashAnimationInfo fai)
Draws the planet images and texts of the FlashInformationInfo.protected void
paintLine(Graphics g, FlashAnimationInfo fai)
Paints the fix line and sun images.protected void
paintModeButton(Graphics g)
Paints the mode button.-
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
-
-
-
-
Field Detail
-
DEBUG
public static final boolean DEBUG
- See Also:
- Constant Field Values
-
OFFSET
public static final int OFFSET
- See Also:
- Constant Field Values
-
LINEWIDTH
public static final int LINEWIDTH
- See Also:
- Constant Field Values
-
LINE_Y
public static final int LINE_Y
- See Also:
- Constant Field Values
-
XCENTER
public static final int XCENTER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBaseWidth
public int getBaseWidth()
Gets the base width of this painter.- Specified by:
getBaseWidth
in interfacePainter
- Overrides:
getBaseWidth
in classPainterBase
- Returns:
- 1020.
-
getBaseHeight
public int getBaseHeight()
Gets the base height of this painter.- Specified by:
getBaseHeight
in interfacePainter
- Overrides:
getBaseHeight
in classPainterBase
- Returns:
- 626.
-
isActive
public boolean isActive()
Checks, if the painter is active.- Specified by:
isActive
in interfacePainter
- Overrides:
isActive
in classPainterBase
- Returns:
- true, if selected level is a Flash animation.
-
paint
public void paint(Graphics g, GameState state)
Paints the editor field.- Specified by:
paint
in interfacePainter
- Specified by:
paint
in classPainterBase
- Parameters:
g
- The Graphics.state
- GameState.
-
paintModeButton
protected void paintModeButton(Graphics g)
Paints the mode button.- Parameters:
g
- The graphics
-
paintFlashAnimation
protected void paintFlashAnimation(Graphics g, FlashAnimationInfo fai)
Draws the planet images and texts of the FlashInformationInfo.- Parameters:
g
- The graphics.fai
- The FlashAnimationInfo.
-
paintLine
protected void paintLine(Graphics g, FlashAnimationInfo fai)
Paints the fix line and sun images.- Parameters:
g
- The Graphics.fai
-
-
keyPressed
public boolean keyPressed(KeyEvent e)
Processes keys in textmode.- Specified by:
keyPressed
in interfaceInputController
- Parameters:
e
- The event.- Returns:
- true, if event is handled.
-
addText
protected void addText()
-
mouseClicked
public boolean mouseClicked(MouseEvent e)
Description copied from interface:InputController
Reacts to mouse events.- Specified by:
mouseClicked
in interfaceInputController
- Parameters:
e
- The mouse event.- Returns:
- true, if the event is handled by this InputController.
-
handleSelectionClick
protected void handleSelectionClick()
-
mouseMoved
public boolean mouseMoved(MouseEvent e)
Description copied from interface:InputController
Reacts to mouse move events from the gui.- Specified by:
mouseMoved
in interfaceInputController
- Parameters:
e
- The mouse event.- Returns:
- true, if the event is handled by this InputController.
-
attachToCenter
protected void attachToCenter()
Checks if mouse pos is nearly centered and sets mousepos to 0/0.
-
getSelectedColor
public int getSelectedColor()
Gets the selected color of the color chooser.- Returns:
- The selected color.
-
-