|
||||||||||
| 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
javax.swing.JPanel
org.vizzini.ui.game.AbstractEnvironmentUISwing
org.vizzini.ui.game.boardgame.AbstractGridBoardUISwing
org.vizzini.ui.game.boardgame.GridBoard3DUISwing
public abstract class GridBoard3DUISwing
Provides functionality for Swing 3D grid board environment user interfaces in the game framework.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected Arrangement |
_arrangement
The board arrangement. |
protected BoardShape[] |
_boards
The 2D board levels. |
protected IViewerSwing |
_viewer
Handle to the object viewer. |
static int |
BOARD_SEPARATION
Separation distance between board levels. |
| Fields inherited from class org.vizzini.ui.game.boardgame.AbstractGridBoardUISwing |
|---|
LABEL_PAINTED_PROPERTY |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 org.vizzini.ui.game.boardgame.IGridBoard3DUISwing |
|---|
ARRANGEMENT_PROPERTY |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
GridBoard3DUISwing()
Construct this object. |
|
| Method Summary | |
|---|---|
void |
add(HighlightData highlightData)
Add the given highlight data. |
void |
cantActionPerformed(ActionEvent event)
Callback for the cant action. |
void |
clearHighlights()
Clear the highlighted positions. |
void |
configure(Properties properties)
Configure this environment. |
protected void |
createAndPlaceTokenUI(IToken token,
Class type,
int file,
int rank,
int level)
Create and place a new token user interface component. |
JMenu |
createArrangementUI()
Create an arrangement user interface widget. |
protected void |
createBoards(Color boardColor,
int realFileCount,
int realRankCount,
int levelCount,
Arrangement arrangement)
Create the boards. |
JCheckBoxMenuItem |
createLabelPaintedUI()
Create a label painted user interface widget. |
protected ITokenUI |
createTokenUI(IToken token,
Class type)
Create a token user interface component for the given agent. |
protected void |
fillAdditionalViewMenuItems(JMenu viewMenu)
Fill in additional view menu items. |
protected ITokenUI |
get(int file,
int rank,
int level)
Return the token UI at the given position. |
Arrangement |
getArrangement()
Return the board arrangement. |
protected BoardShape |
getBoardUI(IntegerPosition position)
Return the board which contains the given position. |
protected BoardShape |
getBoardUI(int file,
int rank,
int level)
Return the board which contains the given position. |
double |
getMagnify()
Return the magnification. |
Markings |
getMarkings()
Return the board markings. |
IViewerSwing |
getObjectViewer()
Return the object viewer. |
IPosition |
getPositionForPoint(Point point)
Map the screen coordinates to a board position. |
protected abstract Class |
getTokenUIClassFor(IToken token)
Return the proper ITokenUI type for the given token. |
protected boolean |
isArrangement(Arrangement arrangement)
Return true if the given arrangement matches the current setting. |
void |
labelPaintedActionPerformed(ActionEvent event)
Callback for the label painted action. |
protected void |
reconcileBoard(IGridBoard board)
Reconcile the token UIs with the real board environment. |
void |
remove(HighlightData highlightData)
Remove the given highlight data. |
protected void |
remove(ITokenUI tokenUI,
int file,
int rank,
int level)
Remove the token at the given position. |
void |
reset()
Reset. |
void |
setArrangement(Arrangement arrangement)
Set the board arrangement. |
void |
setBoardColor(Color color)
Set the board color. |
void |
setCurrentHighlightData(HighlightData highlightData)
Set the current highlight data. |
void |
setEnvironment(IEnvironment environment)
Set the environment this UI represents. |
void |
setLabelColor(Color color)
Set the label color. |
void |
setLabelPainted(boolean isLabelPainted)
Set the label painted flag. |
void |
setMagnify(double magnify)
Set the magnification. |
void |
setMarkings(Markings markings,
Color firstColor,
Color secondColor)
Set the board markings by adjusting their colors. |
void |
setViewerColor(Color color)
Set the viewer background color. |
void |
skewActionPerformed(ActionEvent event)
Callback for the skew action. |
void |
slantActionPerformed(ActionEvent event)
Callback for the slant action. |
void |
uprightActionPerformed(ActionEvent event)
Callback for the upright action. |
| Methods inherited from class org.vizzini.ui.game.AbstractEnvironmentUISwing |
|---|
assignAgentListener, assignAgentListeners, getEnvironment, getSupport, init, isAudioOn, removeAgentListener, removeAgentListeners, scoreChange, setAudioOn |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.vizzini.ui.game.IEnvironmentUI |
|---|
assignAgentListeners, getEnvironment, isAudioOn, removeAgentListeners, setAudioOn |
| Methods inherited from interface org.vizzini.game.event.IStateListener |
|---|
stateChange |
| Methods inherited from interface org.vizzini.game.event.IScoreListener |
|---|
scoreChange |
| Field Detail |
|---|
public static final int BOARD_SEPARATION
protected Arrangement _arrangement
protected BoardShape[] _boards
protected IViewerSwing _viewer
| Constructor Detail |
|---|
public GridBoard3DUISwing()
| Method Detail |
|---|
public void add(HighlightData highlightData)
add in interface IGridBoardUISwingpublic void cantActionPerformed(ActionEvent event)
event - Action event.public void clearHighlights()
clearHighlights in interface IGridBoardUISwing
public void configure(Properties properties)
throws InstantiationException,
IllegalAccessException
configure in interface IEnvironmentUIconfigure in class AbstractGridBoardUISwingproperties - Source of configuration information.
InstantiationException
IllegalAccessExceptionpublic JMenu createArrangementUI()
IGridBoard3DUISwing
createArrangementUI in interface IGridBoard3DUISwingpublic JCheckBoxMenuItem createLabelPaintedUI()
public Arrangement getArrangement()
IGridBoard3DUISwing
getArrangement in interface IGridBoard3DUISwingpublic double getMagnify()
IGridBoard3DUISwing
getMagnify in interface IGridBoard3DUISwingpublic Markings getMarkings()
IGridBoard3DUISwing
getMarkings in interface IGridBoard3DUISwingpublic IViewerSwing getObjectViewer()
public IPosition getPositionForPoint(Point point)
getPositionForPoint in interface IGridBoardUISwingpoint - A mouse click point.public void labelPaintedActionPerformed(ActionEvent event)
public void remove(HighlightData highlightData)
remove in interface IGridBoardUISwingpublic void reset()
reset in interface IEnvironmentUIreset in class AbstractEnvironmentUISwingpublic void setArrangement(Arrangement arrangement)
IGridBoard3DUISwing
setArrangement in interface IGridBoard3DUISwingarrangement - The board arrangement, UPRIGHT, CANT, SLANT, or
SKEW.public void setBoardColor(Color color)
setBoardColor in interface IGridBoardUISwingsetBoardColor in class AbstractGridBoardUISwingpublic void setCurrentHighlightData(HighlightData highlightData)
setCurrentHighlightData in class AbstractGridBoardUISwinghighlightData - The currentHighlightData to set.public void setEnvironment(IEnvironment environment)
setEnvironment in interface IEnvironmentUIsetEnvironment in class AbstractEnvironmentUISwingenvironment - Environment.public void setLabelColor(Color color)
setLabelColor in interface IGridBoardUISwingsetLabelColor in class AbstractGridBoardUISwingpublic void setLabelPainted(boolean isLabelPainted)
setLabelPainted in interface IGridBoardUISwingsetLabelPainted in class AbstractGridBoardUISwingpublic void setMagnify(double magnify)
IGridBoard3DUISwing
setMagnify in interface IGridBoard3DUISwingmagnify - The new magnification.
public void setMarkings(Markings markings,
Color firstColor,
Color secondColor)
IGridBoard3DUISwing
setMarkings in interface IGridBoard3DUISwingmarkings - The board markings, VARYING or CONSTANT.firstColor - The color at 0,0.secondColor - The other color.public void setViewerColor(Color color)
public void skewActionPerformed(ActionEvent event)
event - Action event.public void slantActionPerformed(ActionEvent event)
event - Action event.public void uprightActionPerformed(ActionEvent event)
event - Action event.protected abstract Class getTokenUIClassFor(IToken token)
protected void createAndPlaceTokenUI(IToken token,
Class type,
int file,
int rank,
int level)
token - Token.type - Token class to create.file - The file position.rank - The rank position.level - The level position.
protected void createBoards(Color boardColor,
int realFileCount,
int realRankCount,
int levelCount,
Arrangement arrangement)
protected ITokenUI createTokenUI(IToken token,
Class type)
token - Token.type - Token UI class.protected void fillAdditionalViewMenuItems(JMenu viewMenu)
fillAdditionalViewMenuItems in class AbstractGridBoardUISwingviewMenu - View menu.
protected ITokenUI get(int file,
int rank,
int level)
protected BoardShape getBoardUI(IntegerPosition position)
protected BoardShape getBoardUI(int file,
int rank,
int level)
protected boolean isArrangement(Arrangement arrangement)
arrangement - Arrangement in question.protected void reconcileBoard(IGridBoard board)
reconcileBoard in class AbstractGridBoardUISwingboard - The current board environment.
protected void remove(ITokenUI tokenUI,
int file,
int rank,
int level)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |