Package FLOTF
Class MainController
- java.lang.Object
- 
- FLOTF.MainController
 
- 
- All Implemented Interfaces:
- javafx.fxml.Initializable
 
 public class MainController extends java.lang.Object implements javafx.fxml.InitializableThis class controls the table display of parsed parts from the technical order PDF- Author:
- Bernard Chan, Sonali Loomba
 
- 
- 
Field SummaryFields Modifier and Type Field Description (package private) javafx.scene.text.Textfigurefx id of Text displaying the parts' corresponding figure number(package private) javafx.scene.text.TextfigureDescriptionfx id of Text displaying the parts' corresponding figure description(package private) javafx.scene.control.ButtonorderHistoryfx id of Button to open order history folder(package private) javafx.scene.control.TableView<Part>tableViewfx id of TableView with row objects of type Part
 - 
Constructor SummaryConstructors Constructor Description MainController()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.collections.ObservableList<Part>getPart()Creates a displayable list of all parts in technical order PDF fromTOParser.getParts()voidinitialize(java.net.URL url, java.util.ResourceBundle rb)Initializes MainController.fxml window Sets figure number and figure description for parts list Creates rows with columns displaying index, part number, cage number, description, units of assembly, usable on code, SMR code, and Order Button for each partvoidopenNSNWindow(javafx.event.ActionEvent e)Opens NSNController.fxmlvoidopenUserWindow(javafx.event.ActionEvent e)Opens UserEntryController.fxmlvoidorderHistoryClicked(javafx.event.ActionEvent e)Opens order history foldervoidpartClicked(Part part, javafx.event.ActionEvent e)Stores user's chosen part inPartInfo.currentPartFinds all possible matching NSNs for chosen partNSNScrape.webScrape()Opens NSNController.fxml or confirmation window depending on number of matching NSNsvoidprocessParsedTO()Removes empty rows fromTOParser.partsSeparates multiple part numbers matching a single indexstatic java.lang.String[]stringLines(java.lang.String str)Splits text with multiple lines into separate Strings
 
- 
- 
- 
Field Detail- 
tableViewjavafx.scene.control.TableView<Part> tableView fx id of TableView with row objects of type Part
 - 
figurejavafx.scene.text.Text figure fx id of Text displaying the parts' corresponding figure number
 - 
figureDescriptionjavafx.scene.text.Text figureDescription fx id of Text displaying the parts' corresponding figure description
 - 
orderHistoryjavafx.scene.control.Button orderHistory fx id of Button to open order history folder
 
- 
 - 
Method Detail- 
initializepublic void initialize(java.net.URL url, java.util.ResourceBundle rb)Initializes MainController.fxml window Sets figure number and figure description for parts list Creates rows with columns displaying index, part number, cage number, description, units of assembly, usable on code, SMR code, and Order Button for each part- Specified by:
- initializein interface- javafx.fxml.Initializable
- Parameters:
- url-
- rb-
 
 - 
getPartpublic javafx.collections.ObservableList<Part> getPart() Creates a displayable list of all parts in technical order PDF fromTOParser.getParts()- Returns:
- an ObservableList of type Part
 
 - 
partClickedpublic void partClicked(Part part, javafx.event.ActionEvent e) throws java.lang.Exception Stores user's chosen part inPartInfo.currentPartFinds all possible matching NSNs for chosen partNSNScrape.webScrape()Opens NSNController.fxml or confirmation window depending on number of matching NSNs- Parameters:
- part- user's chosen part
- e- button clicked
- Throws:
- java.lang.Exception- if- NSNScrape.webScrape()or- openUserWindow()is unable to load
 
 - 
openNSNWindowpublic void openNSNWindow(javafx.event.ActionEvent e) throws java.lang.ExceptionOpens NSNController.fxml- Parameters:
- e- button clicked and more than one matching NSN
- Throws:
- java.lang.Exception- if NSNController.fxml is unable to load
 
 - 
openUserWindowpublic void openUserWindow(javafx.event.ActionEvent e) throws java.lang.ExceptionOpens UserEntryController.fxml- Parameters:
- e- button clicked and one or less matching NSNs
- Throws:
- java.lang.Exception- if UserEntryController.fxml is unable to load
 
 - 
processParsedTOpublic void processParsedTO() Removes empty rows fromTOParser.partsSeparates multiple part numbers matching a single index
 - 
stringLinespublic static java.lang.String[] stringLines(java.lang.String str) Splits text with multiple lines into separate Strings- Parameters:
- str- String to be split
- Returns:
- array of split Strings
 
 - 
orderHistoryClickedpublic void orderHistoryClicked(javafx.event.ActionEvent e) throws java.io.IOExceptionOpens order history folder- Parameters:
- e- button clicked
- Throws:
- java.io.IOException- if folder is unable to load
 
 
- 
 
-