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.Initializable
This 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.Text
figure
fx id of Text displaying the parts' corresponding figure number(package private) javafx.scene.text.Text
figureDescription
fx id of Text displaying the parts' corresponding figure description(package private) javafx.scene.control.Button
orderHistory
fx id of Button to open order history folder(package private) javafx.scene.control.TableView<Part>
tableView
fx 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()
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 partvoid
openNSNWindow(javafx.event.ActionEvent e)
Opens NSNController.fxmlvoid
openUserWindow(javafx.event.ActionEvent e)
Opens UserEntryController.fxmlvoid
orderHistoryClicked(javafx.event.ActionEvent e)
Opens order history foldervoid
partClicked(Part part, javafx.event.ActionEvent e)
Stores user's chosen part inPartInfo.currentPart
Finds all possible matching NSNs for chosen partNSNScrape.webScrape()
Opens NSNController.fxml or confirmation window depending on number of matching NSNsvoid
processParsedTO()
Removes empty rows fromTOParser.parts
Separates 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:
initialize
in 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.currentPart
Finds 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.Exception
Opens 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.Exception
Opens 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.parts
Separates 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.IOException
Opens order history folder- Parameters:
e
- button clicked- Throws:
java.io.IOException
- if folder is unable to load
-
-