Package loggerForms

Class FormDescription

java.lang.Object
loggerForms.FormDescription
All Implemented Interfaces:
Cloneable, Comparable<FormDescription>

public class FormDescription extends Object implements Cloneable, Comparable<FormDescription>
Author:
Graham Weatherup - SMRU Holds a description of the Form to be created
  • Field Details Link icon

  • Constructor Details Link icon

    • FormDescription Link icon

      public FormDescription(FormDescription existingDescription, ArrayList<ItemInformation> itemInfos)
      Constructor for building a demo form during the design phase.
      Parameters:
      existingDescription -
      itemInfos -
    • FormDescription Link icon

      public FormDescription(FormsControl formsControl, String udfName)
      Main constructor used when reading data from a UDF table
      Parameters:
      formsControl -
      udfName -
  • Method Details Link icon

    • getFormErrors Link icon

      public UDFErrors getFormErrors()
      Returns:
      the formErrors
    • setFormErrors Link icon

      public void setFormErrors(UDFErrors formErrors)
      Parameters:
      formErrors - the formErrors to set
    • getFormWarnings Link icon

      public UDFErrors getFormWarnings()
      Returns:
      the formWarnings
    • setFormWarnings Link icon

      public void setFormWarnings(UDFErrors formWarnings)
      Parameters:
      formWarnings - the formWarnings to set
    • writeCompleteUDFTable Link icon

      public boolean writeCompleteUDFTable()
    • writeUDFTable Link icon

      public boolean writeUDFTable(ArrayList<ItemInformation> newFormItems)
      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 Link icon

      public ArrayList<PropertyDescription> getPropertyDescriptions()
      Returns:
      the propertyDescriptions
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • getControlDescriptions Link icon

      public FormList<ControlDescription> getControlDescriptions()
      Returns:
      the controlDescriptions
    • findProperty Link icon

      public PropertyDescription findProperty(PropertyTypes propertyType)
    • findInputControlByName Link icon

      public int findInputControlByName(String name)
      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 Link icon

      public int getControlIndex(ControlDescription controlDescription)
      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 Link icon

      public String getFormName()
    • getAUTOALERT Link icon

      public Integer getAUTOALERT()
    • getFONT Link icon

      public Font getFONT()
    • getDBTABLENAME Link icon

      public String getDBTABLENAME()
    • findBEARINGInfo Link icon

      public BEARINGinfo findBEARINGInfo()
      Returns:
      BEARINGinfo
    • findRANGEInfo Link icon

      public RANGEinfo findRANGEInfo()
      Returns:
      RANGEinfo
    • findHEADINGInfo Link icon

      public HEADINGinfo findHEADINGInfo()
      Returns:
      HEADINGinfo
    • getHIDDEN Link icon

      public void getHIDDEN()
    • getHOTKEY Link icon

      public String getHOTKEY()
    • getUdfName Link icon

      public String getUdfName()
    • getTabComponent Link icon

      public JComponent 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 Link icon

      public LoggerForm createForm()
    • getUdfTableDefinition Link icon

      public UDFTableDefinition getUdfTableDefinition()
      Returns:
      the udfTableDefinition
    • getFormsDataBlock Link icon

      public FormsDataBlock getFormsDataBlock()
      Returns:
      the formsDataBlock
    • getInputControlDescriptions Link icon

      public ArrayList<InputControlDescription> getInputControlDescriptions()
      Returns:
      the inputControlDescriptions
    • getOutputTableDef Link icon

      public PamTableDefinition getOutputTableDef()
      Returns:
      the outputTableDef
    • processTabMouseEvent Link icon

      public void processTabMouseEvent(LoggerTabbedPane loggerTabbedPane, MouseEvent evt)
      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 Link icon

      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 Link icon

      public void formPopupMenu(MouseEvent evt)
    • deleteDataUnit Link icon

      public boolean deleteDataUnit(FormsDataUnit dataUnit)
      Delete a data unit from memory and from database.
      Parameters:
      dataUnit -
      Returns:
    • editForm Link icon

      public void editForm(Window parentFrame)
      Edit the form. Will eventually pop up a large dialog with a whole load of options for adding and altering controls.
    • removeForm Link icon

      public void removeForm(Window parentFrame)
      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 Link icon

      public Component getSubtab(LoggerForm loggerForm)
      Parameters:
      loggerForm -
      Returns:
    • getTabToolTip Link icon

      public String getTabToolTip()
      Set an appropriate tool tip for the tab panel.
      Parameters:
      loggerTabbedPane -
    • canDrawOnMap Link icon

      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 Link icon

      public void setFormPlotOptions(FormPlotOptions formPlotOptions)
      Parameters:
      formPlotOptions - the formPlotOptions to set
    • getFormPlotOptions Link icon

      public FormPlotOptions getFormPlotOptions()
      Returns:
      the formPlotOptions
    • getTimeOfNextSave Link icon

      public long getTimeOfNextSave()
      Returns:
      the timeOfNextSave
    • setTimeOfNextSave Link icon

      public void setTimeOfNextSave()
    • getFormsControl Link icon

      public FormsControl getFormsControl()
      Returns:
      the formsControl
    • getCounterSuffix Link icon

      public char getCounterSuffix()
      Returns:
      the counterSuffix
    • getBearingType Link icon

      public BearingTypes getBearingType()
      Returns:
      the bearingType

      This can be one of RELATIVE1, RELATIVE2, TRUE, MAGNETIC;

    • getRangeType Link icon

      public RangeUnitTypes getRangeType()
      Returns:
      the rangeType

      This can be one of nmi, km, m, FIXED;

    • getFixedRange Link icon

      public Integer getFixedRange()
      Returns:
      the range value to be used when getRangeType returns FIXED
    • getHeadingLength Link icon

      public Integer getHeadingLength()
      Returns:
      the length of the heading arrow in units given in getHEadingRangeUnit()
    • getHeadingType Link icon

      public BearingTypes getHeadingType()
      Returns:
      the headingType This can be one of RELATIVE1, RELATIVE2, TRUE, MAGNETIC;
    • getHeadingRangeUnit Link icon

      public RangeUnitTypes getHeadingRangeUnit()
      Returns:
      the headingRangeUnit

      This can be one of nmi, km, m, pix;

    • destroyForms Link icon

      public void destroyForms()
      Destroy any open forms. This includes disconnecting any observer of NMEA data.
    • dataBlockChanged Link icon

      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 Link icon

      public void getFormSettingsData(FormSettings formSettings)
      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 Link icon

      public void viewDataUnit(FormsDataUnit formsDataUnit)
      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 Link icon

      public void optionsChange()
    • getSubformCount Link icon

      public int getSubformCount()
      Get a count of open sub tab forms.
      Returns:
      the number of open sub tab forms.
    • getBearingInfo Link icon

      public BEARINGinfo getBearingInfo()
    • getRangeInfo Link icon

      public RANGEinfo getRangeInfo()
    • getHeadingInfo Link icon

      public HEADINGinfo getHeadingInfo()
    • getControlsInformationCopy Link icon

      public ArrayList<ItemInformation> getControlsInformationCopy()
      Returns:
      cloned copies of ItemInformation in all controls.
    • createDataFromXML Link icon

      public PamDataUnit createDataFromXML(Document doc)
    • getStringData Link icon

      public String getStringData(FormsDataUnit formsDataUnit, int stringStyle)
    • getXMLData Link icon

      public String getXMLData(FormsDataUnit formsDataUnit)
      Get the contents of the data unit as xml.
      Returns:
      an XML String summarising the form data.
    • fromJSONString Link icon

      public Object[] fromJSONString(String jsonString)
      Create logger form data from JASON data.
      Parameters:
      jsonString -
      Returns:
      array of data objects matching those in the form definition
    • getJSONData Link icon

      public String getJSONData(FormsDataUnit formsDataUnit)
      Create a JSON string from a forms data unit
      Parameters:
      formsDataUnit - forms data unit
      Returns:
      JSON string
    • getJSONData Link icon

      public String getJSONData(Object[] formData)
      Create a JSON string from a forms data unit
      Parameters:
      formsDataUnit - forms data
      Returns:
      JSON string
    • compareTo Link icon

      public int compareTo(FormDescription otherForm)
      Specified by:
      compareTo in interface Comparable<FormDescription>
    • getFormOrderProperty Link icon

      public Integer getFormOrderProperty()
      Get the order property for the form
      Returns:
      order property or null if it isn't set.
    • setFormOrderProperty Link icon

      public void setFormOrderProperty(Integer order)
      Set the form order property.
      Parameters:
      order - order in list of forms.
    • isNeedsUDFSave Link icon

      public boolean isNeedsUDFSave()
      Returns:
      true if the forms UDF table needs rewriting.
    • setNeedsUDFSave Link icon

      public void setNeedsUDFSave(boolean needsUDFSave)
      Parameters:
      needsUDFSave - Set true if the forms UDF is going to need re-saving
    • getOriginLatLong Link icon

      public GpsData getOriginLatLong(FormsDataUnit formsDataUnit)