Package loggerForms

Class LoggerForm

java.lang.Object
loggerForms.LoggerForm

public class LoggerForm extends Object
A LoggerForm is the central component of all form types, inclucing normal forms popup forms and subtab forms. Therefore the form itself is capable of providing a single JComponent (a JPanel). some other part of the software will either place this into the main tab panel, a sub tab panel or it's own dialog frame (for a pop-up).
Author:
Graham Weatherup
  • Field Details

  • Constructor Details

    • LoggerForm

      public LoggerForm(FormDescription formDescription, int NewOrEdit)
      called when creating a form for new data input(normal/subtabs/popup), or to edit old data JComponent component that the form is put in should maybe be included to say whether it will go in window/frame to rename/remove as necessary
      Parameters:
      formDescription -
  • Method Details

    • getInputControls

      public ArrayList<LoggerControl> getInputControls()
      Returns:
      the inputControls
    • hasCounter

      public boolean hasCounter()
      Returns:
      the hasCounter
    • getCounter

      public CounterControl getCounter()
      Returns:
      the CounterControl
    • setHasCounter

      public void setHasCounter(CounterControl cc)
      sets hasCounter to true
    • getNewOrEdit

      public int getNewOrEdit()
      Returns:
      the NewOrEdit
    • getSqlTypes

      public SQLTypes getSqlTypes()
    • readOnGps

      public void readOnGps()
    • getFormDescription

      public FormDescription getFormDescription()
      Returns:
      the formDescription
    • enableControls

      public void enableControls()
      Enable / disable buttons

      for now this is basically just disabling buttons if we're in viewer mode. A More sophisticated function might consider enabling / disabling depending on whether or not a form can be saved.

    • displayMessage

      public void displayMessage(String message)
    • getFormWarnings

      public String getFormWarnings()
    • getFormErrors

      public String getFormErrors()
    • transferControlDataToArray

      public Object[] transferControlDataToArray(SQLTypes sqlTypes)
      Transfers data from the from controls to the data array which will get saved in the data unit.
      Returns:
      array of data objects
    • transferDataArrayToForm

      public boolean transferDataArrayToForm(Object[] dataArray)
      Transfers data from the array within a data unit back into the form controls.
      Parameters:
      dataArray -
      Returns:
      true
    • extractFormData

      public Object[] extractFormData()
      Extract the data from the from into an Object array, one object per active control. These match up with a list in the SQL logging
      Returns:
      list of data objects extracted from the form.
    • printErrors

      public boolean printErrors(ArrayList<String> errors)
    • getComponent

      public PamPanel getComponent()
    • setHintAndMessage

      public void setHintAndMessage(LoggerControl loggerControlComponent)
    • focusGained

      public void focusGained(FocusEvent fe, LoggerControl loggerControlComponent)
    • destroyForm

      public void destroyForm()
      Destroy the form - which for now means killing any NMEA observer.
    • getLastRow

      public PamPanel getLastRow()
      Returns:
      the lastRow
    • getSaveButton

      public JButton getSaveButton()
      Returns:
      the saveButton
    • optionsChange

      public void optionsChange()