|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.game.Juzzle.DummyPuzzlePartList
this class is used to write this code in the PuzzlePanel if no game is set:
partModel.doAnythingWithPart();
instead of:
if(part != null)
{
// do anything
}
for faster performance.
IPuzzlePartList,
PuzzlePartList,
PuzzlePanel| Constructor Summary | |
DummyPuzzlePartList()
simply constructor. |
|
| Method Summary | |
void |
deselectPart()
deselect the selected part if one selected |
PuzzlePartList.PuzzlePart |
getFirstNode()
return the first node |
PuzzlePartList.PuzzlePart[] |
getPartArray()
get the array with all parts, the array is never changing for a game, only the list is changing |
int |
getPartsCount()
return the puzzle part count |
int |
getSolvedPartsCount()
return the solved puzzle part count |
boolean |
isSelectedPart(PuzzlePartList.PuzzlePart part)
is the part the selected part or not |
void |
moveLocation(int dx,
int dy)
move the selected part |
boolean |
selectPart(java.awt.Point point)
select part at the point |
void |
setRedrawRect(java.awt.Rectangle repaintRect)
ask the model for the part that has changed and should be repainted |
void |
updatePart()
if the piece is releasing, test if it pass to another part and if true create a new part |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DummyPuzzlePartList()
| Method Detail |
public int getPartsCount()
getPartsCount in interface IPuzzlePartListpublic int getSolvedPartsCount()
getSolvedPartsCount in interface IPuzzlePartListpublic PuzzlePartList.PuzzlePart getFirstNode()
getFirstNode in interface IPuzzlePartListpublic PuzzlePartList.PuzzlePart[] getPartArray()
getPartArray in interface IPuzzlePartListpublic boolean isSelectedPart(PuzzlePartList.PuzzlePart part)
isSelectedPart in interface IPuzzlePartListpart - the part to comparepublic boolean selectPart(java.awt.Point point)
selectPart in interface IPuzzlePartListpoint - point for selectionpublic void deselectPart()
deselectPart in interface IPuzzlePartListpublic void setRedrawRect(java.awt.Rectangle repaintRect)
setRedrawRect in interface IPuzzlePartListrepaintRect - reference to the Rectangle, that get the repaint rectangle
public void moveLocation(int dx,
int dy)
moveLocation in interface IPuzzlePartListdx - new x positiondy - new y positionpublic void updatePart()
updatePart in interface IPuzzlePartList
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||