Package loggerForms
Class LoggerForm
java.lang.Object
loggerForms.LoggerForm
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 Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Constructor Summary
ConstructorDescriptionLoggerForm
(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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
Destroy the form - which for now means killing any NMEA observer.void
displayMessage
(String message) void
Enable / disable buttonsObject[]
Extract the data from the from into an Object array, one object per active control.void
focusGained
(FocusEvent fe, LoggerControl loggerControlComponent) int
boolean
void
boolean
printErrors
(ArrayList<String> errors) void
void
sets hasCounter to truevoid
setHintAndMessage
(LoggerControl loggerControlComponent) Object[]
transferControlDataToArray
(SQLTypes sqlTypes) Transfers data from the from controls to the data array which will get saved in the data unit.boolean
transferDataArrayToForm
(Object[] dataArray) Transfers data from the array within a data unit back into the form controls.
-
Field Details
-
NewDataForm
public static final int NewDataForm- See Also:
-
EditDataForm
public static final int EditDataForm- See Also:
-
PreviewDataForm
public static final int PreviewDataForm- See Also:
-
-
Constructor Details
-
LoggerForm
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
- Returns:
- the inputControls
-
hasCounter
public boolean hasCounter()- Returns:
- the hasCounter
-
getCounter
- Returns:
- the CounterControl
-
setHasCounter
sets hasCounter to true -
getNewOrEdit
public int getNewOrEdit()- Returns:
- the NewOrEdit
-
getSqlTypes
-
readOnGps
public void readOnGps() -
getFormDescription
- Returns:
- the formDescription
-
enableControls
public void enableControls()Enable / disable buttonsfor 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
-
getFormWarnings
-
getFormErrors
-
transferControlDataToArray
Transfers data from the from controls to the data array which will get saved in the data unit.- Returns:
- array of data objects
-
transferDataArrayToForm
Transfers data from the array within a data unit back into the form controls.- Parameters:
dataArray
-- Returns:
- true
-
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
-
getComponent
-
setHintAndMessage
-
focusGained
-
destroyForm
public void destroyForm()Destroy the form - which for now means killing any NMEA observer. -
getLastRow
- Returns:
- the lastRow
-
getSaveButton
- Returns:
- the saveButton
-
optionsChange
public void optionsChange()
-