Package it.polimi.ingsw.view.GUI
Class Board
- java.lang.Object
-
- it.polimi.ingsw.view.GUI.Board
-
- All Implemented Interfaces:
Observer<ChatMessage>,Controller
public class Board extends Object implements Controller, Observer<ChatMessage>
-
-
Constructor Summary
Constructors Constructor Description Board()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangePage(Boolean status)Change viewvoidchooseAction(MouseEvent event)Send player's actions to servervoidchooseCell(MouseEvent event)After choosing the grid on board, shows all available actions for the chosen gridvoidchooseColor(MouseEvent event)Set worker's color and send the choice to servervoidcloseConsequence(MouseEvent event)Close the preview of showConsequence()voidcloseGod(MouseEvent event)Close showGod()voidcloseWorker(MouseEvent e)Close the showWorker() previewvoidinitialize()Initialize the boardvoidreSet()Reload the board for all playersvoidsendMessage()Message to sendstatic voidsetController(MainController controller)voidsetDimension(double width, double height)set view's dimensionvoidshowConsequence(MouseEvent event)After choosing the block, it shows the preview of actionsvoidshowGod(MouseEvent event)Show god power's image descriptionvoidshowWorker(MouseEvent e)Show worker's preview on the boardvoidupdate(ChatMessage message)Receive message from server
-
-
-
Method Detail
-
setController
public static void setController(MainController controller)
-
sendMessage
public void sendMessage()
Message to send
-
initialize
public void initialize()
Initialize the board
-
showWorker
public void showWorker(MouseEvent e)
Show worker's preview on the board- Parameters:
e- mouse event
-
closeWorker
public void closeWorker(MouseEvent e)
Close the showWorker() preview- Parameters:
e- mouse event
-
showConsequence
public void showConsequence(MouseEvent event)
After choosing the block, it shows the preview of actions- Parameters:
event- mouse event
-
closeConsequence
public void closeConsequence(MouseEvent event)
Close the preview of showConsequence()- Parameters:
event- mouse event
-
showGod
public void showGod(MouseEvent event)
Show god power's image description- Parameters:
event- mouse event
-
closeGod
public void closeGod(MouseEvent event)
Close showGod()- Parameters:
event- event
-
chooseColor
public void chooseColor(MouseEvent event)
Set worker's color and send the choice to server- Parameters:
event- mouse event
-
chooseAction
public void chooseAction(MouseEvent event)
Send player's actions to server- Parameters:
event- mouse event
-
chooseCell
public void chooseCell(MouseEvent event)
After choosing the grid on board, shows all available actions for the chosen grid- Parameters:
event- mouse event
-
reSet
public void reSet()
Reload the board for all players- Specified by:
reSetin interfaceController
-
setDimension
public void setDimension(double width, double height)set view's dimension- Specified by:
setDimensionin interfaceController- Parameters:
width- widthheight- height
-
changePage
public void changePage(Boolean status)
Change view- Specified by:
changePagein interfaceController- Parameters:
status- if it's allowed to change view
-
update
public void update(ChatMessage message)
Receive message from server- Specified by:
updatein interfaceObserver<ChatMessage>- Parameters:
message- message
-
-