Package loggerForms
Class FormDescription
java.lang.Object
loggerForms.FormDescription
- All Implemented Interfaces:
Cloneable
,Comparable<FormDescription>
- Author:
- Graham Weatherup - SMRU Holds a description of the Form to be created
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Constructor Summary
ConstructorDescriptionFormDescription
(FormDescription existingDescription, ArrayList<ItemInformation> itemInfos) Constructor for building a demo form during the design phase.FormDescription
(FormsControl formsControl, String udfName) Main constructor used when reading data from a UDF table -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
compareTo
(FormDescription otherForm) void
Called when data are added to or removed from the datablock.boolean
deleteDataUnit
(FormsDataUnit dataUnit) Delete a data unit from memory and from database.void
Destroy any open forms.void
Edit the form.int
findInputControlByName
(String name) Find an input control by name and return it's indexfindProperty
(PropertyTypes propertyType) void
formPopupMenu
(MouseEvent evt) Object[]
fromJSONString
(String jsonString) Create logger form data from JASON data.int
getControlIndex
(ControlDescription controlDescription) Get the index of the control in the list of input controls, this will help find it's data.char
getFONT()
Get the order property for the formvoid
getFormSettingsData
(FormSettings formSettings) Called from FormSettingsControl just before PAMGuard exits (or settings are saved for some other reason).void
getJSONData
(Object[] formData) Create a JSON string from a forms data unitgetJSONData
(FormsDataUnit formsDataUnit) Create a JSON string from a forms data unitgetOriginLatLong
(FormsDataUnit formsDataUnit) getStringData
(FormsDataUnit formsDataUnit, int stringStyle) int
Get a count of open sub tab forms.getSubtab
(LoggerForm loggerForm) Get a component to go into the main tab panel for the Logger forms If it's a POPUP form, return null since these don't go into the tab panel.Set an appropriate tool tip for the tab panel.long
getXMLData
(FormsDataUnit formsDataUnit) Get the contents of the data unit as xml.boolean
void
void
Run some code when a hotkey is pressed.void
processTabMouseEvent
(LoggerTabbedPane loggerTabbedPane, MouseEvent evt) Process an event created by a mouse action on the tab associated with this form.void
removeForm
(Window parentFrame) Remove the form.void
setFormErrors
(UDFErrors formErrors) void
setFormOrderProperty
(Integer order) Set the form order property.void
setFormPlotOptions
(FormPlotOptions formPlotOptions) void
setFormWarnings
(UDFErrors formWarnings) void
setNeedsUDFSave
(boolean needsUDFSave) void
toString()
void
viewDataUnit
(FormsDataUnit formsDataUnit) Called only in viewer mode when the selection of a row in the summary table changes.boolean
boolean
writeUDFTable
(ArrayList<ItemInformation> newFormItems) Write a totally new set of form data from the from design dialog back down into the UDF table.
-
Field Details
-
LOGGER_FORMS_JSON
public static final int LOGGER_FORMS_JSON- See Also:
-
LOGGER_FORMS_COMMA
public static final int LOGGER_FORMS_COMMA- See Also:
-
LOGGER_FORMS_XML
public static final int LOGGER_FORMS_XML- See Also:
-
-
Constructor Details
-
FormDescription
Constructor for building a demo form during the design phase.- Parameters:
existingDescription
-itemInfos
-
-
FormDescription
Main constructor used when reading data from a UDF table- Parameters:
formsControl
-udfName
-
-
-
Method Details
-
getFormErrors
- Returns:
- the formErrors
-
setFormErrors
- Parameters:
formErrors
- the formErrors to set
-
getFormWarnings
- Returns:
- the formWarnings
-
setFormWarnings
- Parameters:
formWarnings
- the formWarnings to set
-
writeCompleteUDFTable
public boolean writeCompleteUDFTable() -
writeUDFTable
Write a totally new set of form data from the from design dialog back down into the UDF table. To do this, the UDF table must be cleared first.- Parameters:
newFormItems
- array list of new form properties and controls.- Returns:
- true if the operation was successful.
-
getPropertyDescriptions
- Returns:
- the propertyDescriptions
-
toString
-
getControlDescriptions
- Returns:
- the controlDescriptions
-
findProperty
-
findInputControlByName
Find an input control by name and return it's index- Parameters:
name
- Input control name- Returns:
- index in table, or -1 if nothing found.
-
getControlIndex
Get the index of the control in the list of input controls, this will help find it's data.- Parameters:
controlDescription
-- Returns:
- control index, or -1 if not found.
-
getFormName
-
getAUTOALERT
-
getFONT
-
getDBTABLENAME
-
findBEARINGInfo
- Returns:
- BEARINGinfo
-
findRANGEInfo
- Returns:
- RANGEinfo
-
findHEADINGInfo
- Returns:
- HEADINGinfo
-
getHIDDEN
public void getHIDDEN() -
getHOTKEY
-
getUdfName
-
getTabComponent
Get a component to go into the main tab panel for the Logger forms If it's a POPUP form, return null since these don't go into the tab panel. If it's SUBTABS, then return an empty tab panel, but be prepared to add stuff to it IF it's a normal form, then return a normal form.- Returns:
-
createForm
-
getUdfTableDefinition
- Returns:
- the udfTableDefinition
-
getFormsDataBlock
- Returns:
- the formsDataBlock
-
getInputControlDescriptions
- Returns:
- the inputControlDescriptions
-
getOutputTableDef
- Returns:
- the outputTableDef
-
processTabMouseEvent
Process an event created by a mouse action on the tab associated with this form.This will include all button presses and mouse enter / exit. Does not capture mousemove.
- Parameters:
evt
-
-
processHotkeyPress
public void processHotkeyPress()Run some code when a hotkey is pressed. For a normal form this should switch the focus to the form. For a subtab form, this should create a new subtab and switch focus to it For a popup, this should create a new popup -- though not sure that popups are actually implemented... -
formPopupMenu
-
deleteDataUnit
Delete a data unit from memory and from database.- Parameters:
dataUnit
-- Returns:
-
editForm
Edit the form. Will eventually pop up a large dialog with a whole load of options for adding and altering controls. -
removeForm
Remove the form. Will involve dropping the UDF table from the database, which is a pretty serious thing to want to do ! Warn first and suggest hiding or just renaming the udf. -
getSubtab
- Parameters:
loggerForm
-- Returns:
-
getTabToolTip
Set an appropriate tool tip for the tab panel.- Parameters:
loggerTabbedPane
-
-
canDrawOnMap
public boolean canDrawOnMap()- Returns:
- true if the form data can be plotted on the PAMGUARD map. May adapt this later on so it can draw on other projections as well.
-
setFormPlotOptions
- Parameters:
formPlotOptions
- the formPlotOptions to set
-
getFormPlotOptions
- Returns:
- the formPlotOptions
-
getTimeOfNextSave
public long getTimeOfNextSave()- Returns:
- the timeOfNextSave
-
setTimeOfNextSave
public void setTimeOfNextSave() -
getFormsControl
- Returns:
- the formsControl
-
getCounterSuffix
public char getCounterSuffix()- Returns:
- the counterSuffix
-
getBearingType
- Returns:
- the bearingType
This can be one of RELATIVE1, RELATIVE2, TRUE, MAGNETIC;
-
getRangeType
- Returns:
- the rangeType
This can be one of nmi, km, m, FIXED;
-
getFixedRange
- Returns:
- the range value to be used when getRangeType returns FIXED
-
getHeadingLength
- Returns:
- the length of the heading arrow in units given in getHEadingRangeUnit()
-
getHeadingType
- Returns:
- the headingType This can be one of RELATIVE1, RELATIVE2, TRUE, MAGNETIC;
-
getHeadingRangeUnit
- Returns:
- the headingRangeUnit
This can be one of nmi, km, m, pix;
-
destroyForms
public void destroyForms()Destroy any open forms. This includes disconnecting any observer of NMEA data. -
dataBlockChanged
public void dataBlockChanged()Called when data are added to or removed from the datablock.goes on to notify the history table that things have changed.
-
getFormSettingsData
Called from FormSettingsControl just before PAMGuard exits (or settings are saved for some other reason).Populate appropriate data into the formSettings as provided.
- Parameters:
formSettings
-
-
viewDataUnit
Called only in viewer mode when the selection of a row in the summary table changes. The contents of the data unit will be displayed in the form (which cannot be edited !), or the form will be cleared if the data unit is null- Parameters:
formsDataUnit
- Data unit to display.
-
optionsChange
public void optionsChange() -
getSubformCount
public int getSubformCount()Get a count of open sub tab forms.- Returns:
- the number of open sub tab forms.
-
getBearingInfo
-
getRangeInfo
-
getHeadingInfo
-
getControlsInformationCopy
- Returns:
- cloned copies of ItemInformation in all controls.
-
createDataFromXML
-
getStringData
-
getXMLData
Get the contents of the data unit as xml.- Returns:
- an XML String summarising the form data.
-
fromJSONString
Create logger form data from JASON data.- Parameters:
jsonString
-- Returns:
- array of data objects matching those in the form definition
-
getJSONData
Create a JSON string from a forms data unit- Parameters:
formsDataUnit
- forms data unit- Returns:
- JSON string
-
getJSONData
Create a JSON string from a forms data unit- Parameters:
formsDataUnit
- forms data- Returns:
- JSON string
-
compareTo
- Specified by:
compareTo
in interfaceComparable<FormDescription>
-
getFormOrderProperty
Get the order property for the form- Returns:
- order property or null if it isn't set.
-
setFormOrderProperty
Set the form order property.- Parameters:
order
- order in list of forms.
-
isNeedsUDFSave
public boolean isNeedsUDFSave()- Returns:
- true if the forms UDF table needs rewriting.
-
setNeedsUDFSave
public void setNeedsUDFSave(boolean needsUDFSave) - Parameters:
needsUDFSave
- Set true if the forms UDF is going to need re-saving
-
getOriginLatLong
-