diff --git a/src/main/java/com/r0r5chach/controllers/FiltersController.java b/src/main/java/com/r0r5chach/controllers/FiltersController.java index 6169ac0..5a70c93 100644 --- a/src/main/java/com/r0r5chach/controllers/FiltersController.java +++ b/src/main/java/com/r0r5chach/controllers/FiltersController.java @@ -13,41 +13,60 @@ import javafx.collections.FXCollections; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.ChoiceBox; -import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.control.ToggleGroup; import javafx.scene.control.RadioButton; /** * Class that defines the controller for the filters View (filters.fxml) of the GUI * Inherits from com.r0r5chach.controllers.Controller + * @author r0r5chach */ public class FiltersController implements Initializable { + /** + * Attribute that stores the filter for player number for the filter View + */ @FXML private TextField numberFilter; - + /** + * Attribute that stores the filter for player name for the filter View + */ @FXML private TextField nameFilter; - + /** + * Attribute that stores the filter for player level for the filter View + */ @FXML private ChoiceBox levelFilter; - + /** + * Attribute that stores the filter for player type for the filter View + */ @FXML private ToggleGroup typeFilter; - + /** + * Attribute that stores the filter for player's favorite agent for the filter View + */ @FXML private ChoiceBox agentFilter; - + /** + * Attribute that stores the filter for player's favorite attacker for the filter View + */ @FXML private ChoiceBox attackerFilter; - + /** + * Attribute that stores the filter for player's favorite defender for the filter View + */ @FXML private ChoiceBox defenderFilter; - - @FXML - private TextArea filterBox; - + /** + * Attribute that stores the Array of currently selected filters for the filter View + */ 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 public void initialize(URL url, ResourceBundle rb) { 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.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() { String[] output = new String[7]; for(int i= 0;i < output.length;i++ ) { @@ -86,11 +114,11 @@ public class FiltersController implements Initializable { filters = output; } - - public static String[] getFilters() { - return filters; - } - + /** + * Checks to see if a string is null + * @param string The string to be checked + * @return true if null; false otherwise + */ private boolean isNull(String string) { if (string == null) { return true; @@ -99,4 +127,4 @@ public class FiltersController implements Initializable { return false; } } -} +} \ No newline at end of file