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 Summary
Fields 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 Summary
Constructors Constructor Description MainController()
-
Method Summary
All 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
-
tableView
javafx.scene.control.TableView<Part> tableView
fx id of TableView with row objects of type Part
-
figure
javafx.scene.text.Text figure
fx id of Text displaying the parts' corresponding figure number
-
figureDescription
javafx.scene.text.Text figureDescription
fx id of Text displaying the parts' corresponding figure description
-
orderHistory
javafx.scene.control.Button orderHistory
fx id of Button to open order history folder
-
-
Method Detail
-
initialize
public 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 interfacejavafx.fxml.Initializable- Parameters:
url-rb-
-
getPart
public javafx.collections.ObservableList<Part> getPart()
Creates a displayable list of all parts in technical order PDF fromTOParser.getParts()- Returns:
- an ObservableList of type Part
-
partClicked
public 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 parte- button clicked- Throws:
java.lang.Exception- ifNSNScrape.webScrape()oropenUserWindow()is unable to load
-
openNSNWindow
public 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
-
openUserWindow
public 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
-
processParsedTO
public void processParsedTO()
Removes empty rows fromTOParser.partsSeparates multiple part numbers matching a single index
-
stringLines
public 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
-
orderHistoryClicked
public 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
-
-