Class ControlDescription

java.lang.Object
loggerForms.ItemDescription
loggerForms.controlDescriptions.ControlDescription
Direct Known Subclasses:
CdNMEAInt, CdSubForm, CdxHSpace, CdxNewline, CdxStatic, CdxVSpace, InputControlDescription

public abstract class ControlDescription extends ItemDescription
Author:
GrahamWeatherup
  • Method Details

    • getFormsTableItems

      public FormsTableItem[] getFormsTableItems()
      needs overridden for 1-many/many-many/many-a relationship
      Returns:
    • getEType

      public ControlTypes getEType()
      Returns:
      the eType
    • makeCd

      public static ControlDescription makeCd(FormDescription formDescription, ItemInformation itemInformation)
      Returns:
      FormsTableItems related to this controlDescription
    • makeControl

      public abstract LoggerControl makeControl(LoggerForm loggerForm)
    • makeComponent

      public JPanel makeComponent(LoggerForm loggerForm)
      can now be incorporated in make control if control descriptions hold Class/data arrays of 0 size
      Parameters:
      loggerForm -
      Returns:
    • getHint

      public String getHint()
      Overrides:
      getHint in class ItemDescription
      Returns:
      the hint
    • moveDataToTableItems

      public void moveDataToTableItems(Object data)
      Move data into the database table items
      Parameters:
      data - object of data - must be of a suitable type for this control
    • moveDataFromTableItems

      public Object moveDataFromTableItems()
      Get data from a database table item.
      Returns:
      data object - will be in a type suitable for that control.
    • createXMLDataElement

      public final Element createXMLDataElement(Document doc, FormsDataUnit formsDataUnit, Object data)
      Create an XML element containging the control information and data for network communication.
      These need a fixed format so this is final, however, you can override fillXMLDataElement for controls which have > 1 data value (e.g. a LatLong)
      Parameters:
      doc - Parent XML document
      Returns:
      XML element
    • fillXMLDataElement

      public void fillXMLDataElement(Document doc, Element el, Object data)
      Write an xml element with an actual data value.
      Parameters:
      doc -
      el -
      data -
    • createXMLDataItem

      public final Element createXMLDataItem(Document doc, String name, Object value)
      Create an xml element with a single data value.
      Parameters:
      doc -
      name -
      value -
      Returns:
    • extractXMLElementData

      public Object extractXMLElementData(Element el, String value)
      Extract data values from an XML Element. Unlike the function that writes the elements using toString() this will have to be more complicated to create the correct type of data.
      Controls with non standard data types will have to override this.
      Parameters:
      el - XML Element
      value - Value - quicker and easier for basic controls. Others may have to do a more complex extraction from the Element.
      Returns:
      Extracted object or null if data were null of there was a mismatch.
    • formatDataItem

      public Object formatDataItem(Object data)
      format the data item, primarily used for the table of data.
      Parameters:
      data -
      Returns:
    • getItemWarning

      public String getItemWarning()
      Description copied from class: ItemDescription
      To be used by control Description for to check necessary fields exist
      Overrides:
      getItemWarning in class ItemDescription
      Returns:
      null if ok otherwise warning string