|
||||||||||
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
public abstract class AbstractGridBoardUISwing
Provides base functionality for Swing 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 | |
---|---|
static String |
LABEL_PAINTED_PROPERTY
Name of the 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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
AbstractGridBoardUISwing()
Construct this object. |
Method Summary | |
---|---|
void |
clearCurrentHighlight()
Clear the current highlight. |
void |
clearLastMoveHighlight()
Clear the last move highlight. |
void |
clearSelectionHighlight()
Clear the selection highlight. |
void |
configure(Properties properties)
Configure this environment. |
protected void |
fillAdditionalViewMenuItems(JMenu viewMenu)
Fill in additional view menu items. |
Color |
getBoardColor()
Return the board color. |
Color |
getCurrentColor()
Return the current color. |
int |
getCurrentHighlightWidth()
|
Color |
getFirstColor()
Return the first color. |
Color |
getGridLineColor()
Return the grid line color. |
Color |
getLabelColor()
Return the label color. |
Color |
getLastMoveColor()
Return the last move color. |
int |
getLastMoveHighlightWidth()
|
protected AudioClip |
getPlacementAudioClip()
Return the placement audio clip. |
Color |
getSecondColor()
Return the second color. |
Color |
getSelectionColor()
Return the selection color. |
protected HighlightData |
getSelectionHighlightData()
|
int |
getSelectionHighlightWidth()
|
void |
highlightCurrentPosition(IntegerPosition position)
Set the current position. |
void |
highlightLastMovePosition(IntegerPosition position)
Highlight the given position. |
void |
highlightSelectedPosition(IntegerPosition selectedPosition)
Set the selected position. |
boolean |
isLabelPainted()
Return true if the label painted flag is true. |
protected boolean |
isPositionUsable(IntegerPosition position)
Return true if the given position is usable. |
protected abstract void |
reconcileBoard(IGridBoard board)
Reconcile the token UIs with the real board environment. |
void |
setBoardColor(Color color)
Set the board color. |
void |
setCurrentColor(Color color)
Set the current color. |
protected void |
setCurrentHighlightData(HighlightData currentHighlightData)
|
void |
setCurrentHighlightWidth(int currentHighlightWidth)
|
void |
setFirstColor(Color color)
Set the first color. |
void |
setGridLineColor(Color color)
Set the grid line color. |
void |
setLabelColor(Color color)
Set the label color. |
void |
setLabelPainted(boolean isLabelPainted)
Set the label painted flag. |
void |
setLastMoveColor(Color color)
Set the last move color. |
void |
setLastMoveHighlightWidth(int lastMoveHighlightWidth)
|
void |
setSecondColor(Color color)
Set the second color. |
void |
setSelectionColor(Color color)
Set the selection color. |
protected void |
setSelectionHighlightData(HighlightData selectionHighlightData)
|
void |
setSelectionHighlightWidth(int selectionHighlightWidth)
|
void |
stateChange(StateEvent event)
Respond to state change events. |
Methods inherited from class org.vizzini.ui.game.AbstractEnvironmentUISwing |
---|
assignAgentListener, assignAgentListeners, getEnvironment, getSupport, init, isAudioOn, removeAgentListener, removeAgentListeners, reset, scoreChange, setAudioOn, setEnvironment |
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.boardgame.IGridBoardUISwing |
---|
add, clearHighlights, getPositionForPoint, remove |
Methods inherited from interface org.vizzini.ui.game.IEnvironmentUI |
---|
assignAgentListeners, getEnvironment, isAudioOn, removeAgentListeners, reset, setAudioOn, setEnvironment |
Methods inherited from interface org.vizzini.game.event.IScoreListener |
---|
scoreChange |
Field Detail |
---|
public static final String LABEL_PAINTED_PROPERTY
Constructor Detail |
---|
public AbstractGridBoardUISwing()
Method Detail |
---|
public void clearCurrentHighlight()
clearCurrentHighlight
in interface IGridBoardUISwing
public void clearLastMoveHighlight()
clearLastMoveHighlight
in interface IGridBoardUISwing
public void clearSelectionHighlight()
clearSelectionHighlight
in interface IGridBoardUISwing
public void configure(Properties properties) throws InstantiationException, IllegalAccessException
configure
in interface IEnvironmentUI
configure
in class AbstractEnvironmentUISwing
properties
- Source of configuration information.
InstantiationException
IllegalAccessException
public Color getBoardColor()
getBoardColor
in interface IGridBoardUISwing
public Color getCurrentColor()
getCurrentColor
in interface IGridBoardUISwing
public int getCurrentHighlightWidth()
getCurrentHighlightWidth
in interface IGridBoardUISwing
public Color getFirstColor()
getFirstColor
in interface IGridBoardUISwing
public Color getGridLineColor()
getGridLineColor
in interface IGridBoardUISwing
public Color getLabelColor()
getLabelColor
in interface IGridBoardUISwing
public Color getLastMoveColor()
getLastMoveColor
in interface IGridBoardUISwing
public int getLastMoveHighlightWidth()
getLastMoveHighlightWidth
in interface IGridBoardUISwing
public Color getSecondColor()
getSecondColor
in interface IGridBoardUISwing
public Color getSelectionColor()
getSelectionColor
in interface IGridBoardUISwing
public int getSelectionHighlightWidth()
getSelectionHighlightWidth
in interface IGridBoardUISwing
public void highlightCurrentPosition(IntegerPosition position)
highlightCurrentPosition
in interface IGridBoardUISwing
public void highlightLastMovePosition(IntegerPosition position)
highlightLastMovePosition
in interface IGridBoardUISwing
public void highlightSelectedPosition(IntegerPosition selectedPosition)
highlightSelectedPosition
in interface IGridBoardUISwing
public boolean isLabelPainted()
isLabelPainted
in interface IGridBoardUISwing
public void setBoardColor(Color color)
setBoardColor
in interface IGridBoardUISwing
public void setCurrentColor(Color color)
setCurrentColor
in interface IGridBoardUISwing
public void setCurrentHighlightWidth(int currentHighlightWidth)
setCurrentHighlightWidth
in interface IGridBoardUISwing
currentHighlightWidth
- The currentHighlightWidth to set.public void setFirstColor(Color color)
setFirstColor
in interface IGridBoardUISwing
public void setGridLineColor(Color color)
setGridLineColor
in interface IGridBoardUISwing
public void setLabelColor(Color color)
setLabelColor
in interface IGridBoardUISwing
public void setLabelPainted(boolean isLabelPainted)
setLabelPainted
in interface IGridBoardUISwing
public void setLastMoveColor(Color color)
setLastMoveColor
in interface IGridBoardUISwing
public void setLastMoveHighlightWidth(int lastMoveHighlightWidth)
setLastMoveHighlightWidth
in interface IGridBoardUISwing
lastMoveHighlightWidth
- The lastMoveHighlightWidth to set.public void setSecondColor(Color color)
setSecondColor
in interface IGridBoardUISwing
public void setSelectionColor(Color color)
setSelectionColor
in interface IGridBoardUISwing
public void setSelectionHighlightWidth(int selectionHighlightWidth)
setSelectionHighlightWidth
in interface IGridBoardUISwing
selectionHighlightWidth
- The selectionHighlightWidth to set.public void stateChange(StateEvent event)
stateChange
in interface IStateListener
protected abstract void reconcileBoard(IGridBoard board)
board
- The current board environment.protected void fillAdditionalViewMenuItems(JMenu viewMenu)
viewMenu
- View menu.protected AudioClip getPlacementAudioClip()
protected HighlightData getSelectionHighlightData()
protected boolean isPositionUsable(IntegerPosition position)
protected void setCurrentHighlightData(HighlightData currentHighlightData)
currentHighlightData
- The currentHighlightData to set.protected void setSelectionHighlightData(HighlightData selectionHighlightData)
selectionHighlightData
- The selectionHighlightData to set.
|
||||||||||
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 |