-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConnectButton.java
More file actions
57 lines (51 loc) · 1.34 KB
/
ConnectButton.java
File metadata and controls
57 lines (51 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Buttons used in GUI window corresponding to Connect Four game board squares
*
* @author greg
*/
public class ConnectButton extends javafx.scene.control.Button {
//location of button
private int row;
private int column;
/**
* ConnectButton Constructor
*
* @param label
* @param row
* @param column
*/
public ConnectButton(String label, int row, int column) {
super(label);
this.row = row;
this.column = column;
}
/**
* returns the row that the button is in the game board grid
*
* @return row - the row that the button is on the game board
*/
public int getRow() {
return this.row;
}
/**
* returns the column that the button is on the game board grid
*
* @return column - - the column that the button is on the game board
*/
public int getColumn() {
return this.column;
}
/**
* Returns the position of the button on the game board grid as a string
*
* @return string with format <row>,<column>
*/
public String toString() {
return "(<" + row + ">,<" + column + ">)";
}
}