|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.threerings.media.MediaPanel
com.threerings.media.VirtualMediaPanel
com.threerings.puzzle.client.PuzzleBoardView
com.threerings.puzzle.drop.client.DropBoardView
public abstract class DropBoardView
The drop board view displays a drop puzzle game in progress for a single player.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.media.MediaPanel |
|---|
com.threerings.media.MediaPanel.Obscurer |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.BaselineResizeBehavior |
| Field Summary | |
|---|---|
static Color |
CHAIN_COLOR
The color used to render chain reward scoring text. |
static Color |
SCORE_COLOR
The color used to render normal scoring text. |
| Fields inherited from class com.threerings.media.VirtualMediaPanel |
|---|
CENTER_ON_PATHABLE, ENCLOSE_PATHABLE, TRACK_PATHABLE |
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface com.threerings.puzzle.drop.data.DropPieceCodes |
|---|
DROP_BLOCK_PIECE_COUNT, PIECE_NONE |
| Fields inherited from interface com.threerings.util.DirectionCodes |
|---|
CARDINAL_DIRECTIONS, CCW, CW, DIRECTION_COUNT, DOWN, EAST, EASTNORTHEAST, EASTSOUTHEAST, FINE_DIRECTION_COUNT, HORIZONTAL, LEFT, NONE, NORTH, NORTHEAST, NORTHNORTHEAST, NORTHNORTHWEST, NORTHWEST, RIGHT, SOUTH, SOUTHEAST, SOUTHSOUTHEAST, SOUTHSOUTHWEST, SOUTHWEST, UP, VERTICAL, WEST, WESTNORTHWEST, WESTSOUTHWEST |
| Fields inherited from interface com.threerings.media.MediaConstants |
|---|
ALL, BACK, FRONT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
DropBoardView(PuzzleContext ctx,
int pwid,
int phei)
Constructs a drop board view. |
|
| Method Summary | |
|---|---|
void |
clearPiece(int xx,
int yy)
Clears out a piece from the board along with its piece sprite. |
void |
clearPieceSprite(int xx,
int yy)
Clears the specified piece from the board. |
void |
createPiece(int piece,
int sx,
int sy)
Creates a new piece sprite and places it directly in its correct position. |
void |
createPiece(int piece,
int sx,
int sy,
int tx,
int ty,
long duration)
Creates a new piece sprite and moves it into position on the board. |
DropSprite |
createPieces(int col,
int row,
int[] pieces,
int dist)
Creates a new drop sprite used to animate the given pieces falling in the specified column. |
ScoreAnimation |
createScoreAnimation(String score,
Color color,
Font font)
Creates and returns an animation showing the specified score floating up the view, with the label initially centered within the view. |
ScoreAnimation |
createScoreAnimation(String score,
Color color,
Font font,
int x,
int y,
int width,
int height)
Creates and returns an animation showing the specified score floating up the view. |
void |
dirtySegment(int dir,
int col,
int row,
int len)
Dirties the rectangle encompassing the segment with the given direction and length whose bottom-leftmost corner is at (col, row). |
int |
getPieceHeight()
Returns the height in pixels of a single board piece. |
com.threerings.media.image.Mirage |
getPieceImage(int piece)
Returns the image used to display the given piece at coordinates (0, 0) with
an orientation of DirectionCodes.NORTH. |
abstract com.threerings.media.image.Mirage |
getPieceImage(int piece,
int col,
int row,
int orient)
Returns the image used to display the given piece at the specified column and row with the given orientation. |
void |
getPiecePosition(int col,
int row,
Point pos)
Called by the DropSprite to populate pos with the screen coordinates
in pixels at which a piece at (col, row) in the board should be drawn. |
Dimension |
getPieceSegmentSize(int col,
int row,
int orient,
int len)
Called by the DropSprite to get the dimensions of the area that will be occupied by
rendering a piece segment of the given orientation and length whose bottom-leftmost corner
is at (col, row). |
com.threerings.media.sprite.Sprite |
getPieceSprite(int xx,
int yy)
Returns the piece sprite at the specified location. |
int |
getPieceWidth()
Returns the width in pixels of a single board piece. |
Dimension |
getPreferredSize()
|
boolean |
inBounds(int col,
int row)
Returns true if the specified coordinate is within the bounds of the board, false if it is not. |
void |
init(GameConfig config)
Initializes the board with the board dimensions. |
com.threerings.media.sprite.Sprite |
movePiece(int sx,
int sy,
int tx,
int ty,
long duration)
Instructs the view to move the piece at the specified starting position to the specified destination position. |
void |
paintBetween(Graphics2D gfx,
Rectangle dirtyRect)
|
void |
rotateDropBlock(DropBlockSprite sprite,
int orient)
Rotates the given drop block sprite to the specified orientation, updating the image as necessary. |
void |
setBoard(Board board)
Sets the board to be displayed. |
void |
updatePiece(int sx,
int sy)
Refreshes the piece sprite at the specified location, if no sprite exists at the location, one will be created. |
void |
updatePiece(int piece,
int sx,
int sy)
Updates the piece sprite at the specified location, if no sprite exists at the location, one will be created. |
| Methods inherited from class com.threerings.puzzle.client.PuzzleBoardView |
|---|
abortAnimation, addActionAnimation, addActionSprite, clearAnimations, clearSprites, createScoreAnimation, dumpActors, getActionAnimationCount, getActionCount, getActionSpriteCount, paintBehind, removeSprite, setBackgroundImage, setController, setPaused, trackAvoidAnimation |
| Methods inherited from class com.threerings.media.VirtualMediaPanel |
|---|
addViewTracker, clearPathable, doLayout, getViewBounds, removeViewTracker, setBackground, setBounds, setFollowsPathable, setViewLocation |
| Methods inherited from class com.threerings.media.MediaPanel |
|---|
addAnimation, addObscurer, addSprite, createGraphics, getAnimationManager, getComponent, getRegionManager, getSpriteManager, getTimeStamp, isManaged, isManaged, needsPaint, paint, removeObscurer, repaint, setOpaque, tick |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Color SCORE_COLOR
public static final Color CHAIN_COLOR
| Constructor Detail |
|---|
public DropBoardView(PuzzleContext ctx,
int pwid,
int phei)
| Method Detail |
|---|
public void init(GameConfig config)
init in class PuzzleBoardViewpublic int getPieceWidth()
public int getPieceHeight()
public void getPiecePosition(int col,
int row,
Point pos)
DropSprite to populate pos with the screen coordinates
in pixels at which a piece at (col, row) in the board should be drawn. Derived
classes may wish to override this method to allow specialized positioning of sprites.
public Dimension getPieceSegmentSize(int col,
int row,
int orient,
int len)
DropSprite to get the dimensions of the area that will be occupied by
rendering a piece segment of the given orientation and length whose bottom-leftmost corner
is at (col, row).
public void createPiece(int piece,
int sx,
int sy)
public void updatePiece(int sx,
int sy)
ImageSprite is
being used to display pieces. If createPieceSprite(int, int, int) is overridden to return a
non-ImageSprite, this method must also be customized.
public void updatePiece(int piece,
int sx,
int sy)
ImageSprite is
being used to display pieces. If createPieceSprite(int, int, int) is overridden to return a
non-ImageSprite, this method must also be customized.
public void createPiece(int piece,
int sx,
int sy,
int tx,
int ty,
long duration)
public com.threerings.media.sprite.Sprite movePiece(int sx,
int sy,
int tx,
int ty,
long duration)
public com.threerings.media.image.Mirage getPieceImage(int piece)
(0, 0) with
an orientation of DirectionCodes.NORTH. This serves as a convenience routine for those puzzles
that don't bother rendering their pieces differently when placed at different board
coordinates or in different orientations.
public abstract com.threerings.media.image.Mirage getPieceImage(int piece,
int col,
int row,
int orient)
public void setBoard(Board board)
PuzzleBoardView
setBoard in class PuzzleBoardView
public com.threerings.media.sprite.Sprite getPieceSprite(int xx,
int yy)
public void clearPieceSprite(int xx,
int yy)
public void clearPiece(int xx,
int yy)
public DropSprite createPieces(int col,
int row,
int[] pieces,
int dist)
public void dirtySegment(int dir,
int col,
int row,
int len)
(col, row).
public ScoreAnimation createScoreAnimation(String score,
Color color,
Font font)
score - the score text to display.color - the color of the text.font - the font.
public ScoreAnimation createScoreAnimation(String score,
Color color,
Font font,
int x,
int y,
int width,
int height)
score - the score text to display.color - the color of the text.font - the font to use.x - the left coordinate in board coordinates of the rectangle within which the score
is to be centered.y - the bottom coordinate in board coordinates of the rectangle within which the score
is to be centered.width - the width in board coordinates of the rectangle within which the score is to
be centered.height - the height in board coordinates of the rectangle within which the score is to
be centered.
public void rotateDropBlock(DropBlockSprite sprite,
int orient)
public void paintBetween(Graphics2D gfx,
Rectangle dirtyRect)
paintBetween in class PuzzleBoardViewpublic Dimension getPreferredSize()
getPreferredSize in class JComponent
public boolean inBounds(int col,
int row)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||