javadoc created

This commit is contained in:
Joshua Perry 2023-02-05 20:58:39 +00:00
parent 2a7a7c81e3
commit 11b61afade
1 changed files with 48 additions and 20 deletions

View File

@ -13,41 +13,60 @@ import javafx.collections.FXCollections;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
import javafx.scene.control.ChoiceBox; import javafx.scene.control.ChoiceBox;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.control.ToggleGroup; import javafx.scene.control.ToggleGroup;
import javafx.scene.control.RadioButton; import javafx.scene.control.RadioButton;
/** /**
* Class that defines the controller for the filters View (filters.fxml) of the GUI * Class that defines the controller for the filters View (filters.fxml) of the GUI
* Inherits from com.r0r5chach.controllers.Controller * Inherits from com.r0r5chach.controllers.Controller
* @author r0r5chach
*/ */
public class FiltersController implements Initializable { public class FiltersController implements Initializable {
/**
* Attribute that stores the filter for player number for the filter View
*/
@FXML @FXML
private TextField numberFilter; private TextField numberFilter;
/**
* Attribute that stores the filter for player name for the filter View
*/
@FXML @FXML
private TextField nameFilter; private TextField nameFilter;
/**
* Attribute that stores the filter for player level for the filter View
*/
@FXML @FXML
private ChoiceBox<Rank> levelFilter; private ChoiceBox<Rank> levelFilter;
/**
* Attribute that stores the filter for player type for the filter View
*/
@FXML @FXML
private ToggleGroup typeFilter; private ToggleGroup typeFilter;
/**
* Attribute that stores the filter for player's favorite agent for the filter View
*/
@FXML @FXML
private ChoiceBox<ValorantAgent> agentFilter; private ChoiceBox<ValorantAgent> agentFilter;
/**
* Attribute that stores the filter for player's favorite attacker for the filter View
*/
@FXML @FXML
private ChoiceBox<R6Attacker> attackerFilter; private ChoiceBox<R6Attacker> attackerFilter;
/**
* Attribute that stores the filter for player's favorite defender for the filter View
*/
@FXML @FXML
private ChoiceBox<R6Defender> defenderFilter; private ChoiceBox<R6Defender> defenderFilter;
/**
@FXML * Attribute that stores the Array of currently selected filters for the filter View
private TextArea filterBox; */
private static String[] filters; private static String[] filters;
/**
* Method that runs when the program initializes the edit View
* (param details copied from super implementation)
* @param url The location used to resolve relative paths for the root object
* @param rb The resources used to localize the root object
*/
@Override @Override
public void initialize(URL url, ResourceBundle rb) { public void initialize(URL url, ResourceBundle rb) {
attackerFilter.setItems(FXCollections.observableList(Arrays.asList(R6Attacker.values()))); attackerFilter.setItems(FXCollections.observableList(Arrays.asList(R6Attacker.values())));
@ -59,8 +78,17 @@ public class FiltersController implements Initializable {
levelFilter.setItems(FXCollections.observableList(Arrays.asList(Rank.values()))); levelFilter.setItems(FXCollections.observableList(Arrays.asList(Rank.values())));
levelFilter.setValue(Rank.NONE); levelFilter.setValue(Rank.NONE);
} }
/**
@FXML * Gets the Array of currently selected filters
* @return the Array of currently selected filters
*/
public static String[] getFilters() {
return filters;
}
/**
* Sets the currently selected filters based off of the selections on the filters View
*/
@FXML //Triggers when mouse leaves the area of any of the selection boxes
private void setFilters() { private void setFilters() {
String[] output = new String[7]; String[] output = new String[7];
for(int i= 0;i < output.length;i++ ) { for(int i= 0;i < output.length;i++ ) {
@ -86,11 +114,11 @@ public class FiltersController implements Initializable {
filters = output; filters = output;
} }
/**
public static String[] getFilters() { * Checks to see if a string is null
return filters; * @param string The string to be checked
} * @return true if null; false otherwise
*/
private boolean isNull(String string) { private boolean isNull(String string) {
if (string == null) { if (string == null) {
return true; return true;
@ -99,4 +127,4 @@ public class FiltersController implements Initializable {
return false; return false;
} }
} }
} }