Package FLOTF

Class 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 from TOParser.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 part
      void openNSNWindow​(javafx.event.ActionEvent e)
      Opens NSNController.fxml
      void openUserWindow​(javafx.event.ActionEvent e)
      Opens UserEntryController.fxml
      void orderHistoryClicked​(javafx.event.ActionEvent e)
      Opens order history folder
      void partClicked​(Part part, javafx.event.ActionEvent e)
      Stores user's chosen part in PartInfo.currentPart Finds all possible matching NSNs for chosen part NSNScrape.webScrape() Opens NSNController.fxml or confirmation window depending on number of matching NSNs
      void processParsedTO()
      Removes empty rows from TOParser.parts Separates multiple part numbers matching a single index
      static java.lang.String[] stringLines​(java.lang.String str)
      Splits text with multiple lines into separate Strings
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • MainController

        public MainController()
    • 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 interface javafx.fxml.Initializable
        Parameters:
        url -
        rb -
      • getPart

        public javafx.collections.ObservableList<Part> getPart()
        Creates a displayable list of all parts in technical order PDF from TOParser.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 in PartInfo.currentPart Finds all possible matching NSNs for chosen part NSNScrape.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
      • 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 from TOParser.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