mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
0feccdc8b9
Tags: #pair[mra106, ajm412] #story[1245]
49 lines
1.2 KiB
Java
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);
|
|
});
|
|
|
|
}
|
|
}
|