public abstract class NewTheme<S extends PuzzleInstance>
extends java.lang.Object
Constructor and Description |
---|
NewTheme() |
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics g,
S game,
int width,
int height,
double scale) |
abstract void |
drawAnimation(java.awt.Graphics g,
S game)
Defines how the Theme subclass should handle animation.
|
void |
drawBWVertex(java.awt.Graphics2D g,
S game,
Vertex v,
java.awt.Point where) |
void |
drawNormalVertex(java.awt.Graphics2D g,
S game,
Vertex v)
Draws a vertex in its normal state using the overridden drawVertex method.
|
void |
drawSelectedVertex(java.awt.Graphics2D g,
S game,
Vertex v)
Draws a vertex in its selected state using the overridden drawVertex method.
|
void |
drawTargetVertex(java.awt.Graphics2D g,
S game,
Vertex v)
Draws a vertex in its targeted state using the overridden drawVertex method.
|
abstract void |
drawVertex(java.awt.Graphics2D g,
S game,
Vertex v)
Dictates how a vertex should be drawn.
|
static int |
getAnimationFrame() |
abstract int[] |
getAnimationStage(Vertex v,
S game)
Return a number or set of numbers that identifies what stage of drawing animation this vertex is at.
|
abstract int |
getBoundingHeight()
Defines the height of the box used to determine the clickable area of a vertex.
|
abstract int |
getBoundingWidth()
Defines the width of the box used to determine the clickable area of a vertex.
|
float |
getBrightnessFactor()
Returns the brightness factor drawing target vertices using the default drawTargetVertex method.
|
abstract int |
getDrawingHeight()
Defines the width of the drawable area of a vertex.
|
abstract int |
getDrawingWidth()
Defines the width of the drawable area of a vertex.
|
abstract java.awt.Color |
getEdgeColor(S game,
Vertex a,
Vertex b)
Defines the color used for drawing edges.
|
abstract int |
getNumberAnimatingFrames() |
static NewTheme<?> |
getTheme(java.lang.String theme_name) |
abstract java.lang.String |
getThemeName() |
abstract java.awt.Point |
getVertexCenter()
Defines the intended center point, relative to the origin (0, 0), on the image created by drawVertex.
|
java.util.ArrayList<Vertex> |
getVerticesSortedByY(java.util.ArrayList<Vertex> vertsToSort)
This method returns a list of all the vertices in the current graph.
|
boolean |
isAnimatingConfig() |
boolean |
isBlinkEdges() |
boolean |
isDrawCurvyEdges() |
void |
setAnimatingConfig(boolean animatingConfig) |
static void |
setAnimationFrame(int animationFrame) |
void |
setBlinkEdges(boolean blinkEdges) |
void |
setDrawCurvyEdges(boolean drawCurvyEdges) |
abstract void |
setupMoveAnimation(DoubleVertexEvent<?> event)
Assumes the event is a
|
void |
tick() |
void |
tickIt()
A convenience method to allow subclasses of Theme to override tick() while still retaining the basic animation
advancing functionality.
|
public static NewTheme<?> getTheme(java.lang.String theme_name)
public abstract java.lang.String getThemeName()
public abstract int getBoundingWidth()
public abstract int getBoundingHeight()
public abstract int getDrawingWidth()
public abstract int getDrawingHeight()
public abstract java.awt.Point getVertexCenter()
public abstract void setupMoveAnimation(DoubleVertexEvent<?> event)
event
- public abstract int getNumberAnimatingFrames()
public abstract void drawVertex(java.awt.Graphics2D g, S game, Vertex v)
g
- The graphics object to draw ongame
- The PuzzleInstance subclass containing game datav
- The vertex to be drawnpublic abstract java.awt.Color getEdgeColor(S game, Vertex a, Vertex b)
game
- The PuzzleInstance subclass containing game dataa
- The first vertex connected by an edgeb
- The second vertex connected by this edgepublic abstract void drawAnimation(java.awt.Graphics g, S game)
g
- game
- public abstract int[] getAnimationStage(Vertex v, S game)
game
- TODOpublic void tickIt()
public void tick()
public void drawNormalVertex(java.awt.Graphics2D g, S game, Vertex v)
g
- The graphics object to draw ongame
- The PuzzleInstance subclass containing game datav
- The vertex to be drawnpublic void drawTargetVertex(java.awt.Graphics2D g, S game, Vertex v)
g
- The graphics object to draw ongame
- The PuzzleInstance subclass containing game datav
- The vertex to be drawnpublic void drawBWVertex(java.awt.Graphics2D g, S game, Vertex v, java.awt.Point where)
public void drawSelectedVertex(java.awt.Graphics2D g, S game, Vertex v)
g
- The graphics object to draw ongame
- The PuzzleInstance subclass containing game datav
- The vertex to be drawnpublic float getBrightnessFactor()
public void draw(java.awt.Graphics g, S game, int width, int height, double scale)
public java.util.ArrayList<Vertex> getVerticesSortedByY(java.util.ArrayList<Vertex> vertsToSort)
public boolean isDrawCurvyEdges()
public void setDrawCurvyEdges(boolean drawCurvyEdges)
public boolean isBlinkEdges()
public void setBlinkEdges(boolean blinkEdges)
public static int getAnimationFrame()
public static void setAnimationFrame(int animationFrame)
public boolean isAnimatingConfig()
public void setAnimatingConfig(boolean animatingConfig)