Files
Party-Parrots-At-Sea/src/main/java/seng302/visualiser/controllers/PlayerCell.java
T
Michael Rausch 0feccdc8b9 Replaced existing views with new views and controllers from the test repository.
Tags: #pair[mra106, ajm412] #story[1245]
2017-09-07 16:32:34 +12:00

49 lines
1.2 KiB
Java

package seng302.visualiser.controllers;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.effect.DropShadow;
import javafx.scene.layout.GridPane;
import javafx.scene.paint.Color;
public class PlayerCell {
@FXML
private Label playerName;
@FXML
private GridPane playerListCell;
private String name;
public PlayerCell(String playerName) {
this.name = playerName;
}
public void initialize() {
playerName.setText(name);
DropShadow dropShadow = new DropShadow();
dropShadow.setRadius(10.0);
dropShadow.setOffsetX(3.0);
dropShadow.setOffsetY(4.0);
dropShadow.setColor(Color.color(0, 0, 0, 0.1));
playerListCell.setEffect(dropShadow);
DropShadow dropShadow2 = new DropShadow();
dropShadow2.setRadius(10.0);
dropShadow2.setOffsetX(5.0);
dropShadow2.setOffsetY(6.0);
dropShadow2.setColor(Color.color(0, 0, 0, 0.3));
playerListCell.setOnMouseEntered(event -> {
playerListCell.setEffect(dropShadow2);
});
playerListCell.setOnMouseExited(event -> {
playerListCell.setEffect(dropShadow);
});
}
}