This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
connect-four/src/de/itsblue/ConnectFour/PlateInsertButton.java

57 lines
1.5 KiB
Java

/*
Connect four - written in java
Copyright (C) 2020 Oliver Schappacher and Dorian Zedler
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.itsblue.ConnectFour;
import javax.swing.*;
/**
* PlateInsertButton is a class mean for use with
* de.itsblue.ConnectFour.ButtonRow. It is a simple button with the extra
* property "index" which is used to store its index in the button row.
*
* @author Dorian Zedler
*/
public class PlateInsertButton extends JButton {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* The index of the button in a ButtonRow
*/
private int index;
/**
* Constructor
*
* @param index The index of the button in the ButtonRow
*/
PlateInsertButton(int index) {
this.index = index;
}
/**
* Function to get the index of the button
*/
public int getIndex() {
return index;
}
}