|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.game.Juzzle.PuzzlePartList
PuzzlePartList create the pieces of the image and controls these
| Inner Class Summary | |
static class |
PuzzlePartList.PuzzlePart
class for one piece |
| Field Summary | |
protected java.awt.image.BufferedImage |
bimage
reference to the current game image |
protected PuzzlePartList.PuzzlePart |
dragGroup
selected group to drag. dragPart is a member of this group |
protected PuzzlePartList.PuzzlePart |
dragPart
selected part to drag. |
protected PuzzlePartList.PuzzlePart |
first
anchor for first and last part of list |
protected int |
imageHeight
current game image height |
protected int |
imageWidth
current game image width |
protected PuzzlePartList.PuzzlePart |
last
anchor for first and last part of list |
protected int |
puzzleCount
solved parts |
protected PuzzlePartList.PuzzlePart[] |
pz_array
array of parts |
| Constructor Summary | |
PuzzlePartList(java.awt.image.BufferedImage bimage,
int x_parts,
int y_parts,
java.awt.Dimension random_size)
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 |
protected void |
moveLocationGroup(PuzzlePartList.PuzzlePart group,
int dx,
int dy)
move the selected group |
boolean |
selectPart__(java.awt.Point point)
another version only for part, don't used |
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 |
protected void |
updateGroup(PuzzlePartList.PuzzlePart dragGroup,
PuzzlePartList.PuzzlePart node,
PuzzlePartList.PuzzlePart node2)
update the list and shape of group |
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 |
| Field Detail |
protected java.awt.image.BufferedImage bimage
protected int imageWidth
protected int imageHeight
protected PuzzlePartList.PuzzlePart first
protected PuzzlePartList.PuzzlePart last
protected PuzzlePartList.PuzzlePart[] pz_array
protected int puzzleCount
protected PuzzlePartList.PuzzlePart dragPart
protected PuzzlePartList.PuzzlePart dragGroup
| Constructor Detail |
public PuzzlePartList(java.awt.image.BufferedImage bimage,
int x_parts,
int y_parts,
java.awt.Dimension random_size)
bimage - reference to the game imagex_parts - horizontal diviriony_parts - vertical divisionrandom_size - max width and height for the random calculation| 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 boolean selectPart__(java.awt.Point point)
public 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 position
protected void moveLocationGroup(PuzzlePartList.PuzzlePart group,
int dx,
int dy)
group - group to movedx - new x positiondy - new y positionpublic void updatePart()
updatePart in interface IPuzzlePartList
protected void updateGroup(PuzzlePartList.PuzzlePart dragGroup,
PuzzlePartList.PuzzlePart node,
PuzzlePartList.PuzzlePart node2)
dragGroup - group to changenode - node of dragGroup that passnode2 - node of another group that pass
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||