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
  • Field Details Link icon

    • primarySQLType Link icon

      protected int primarySQLType
    • formsTableItems Link icon

      protected FormsTableItem[] formsTableItems
  • Constructor Details Link icon

  • Method Details Link icon

    • getFormsTableItems Link icon

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

      public ControlTypes getEType()
      Returns:
      the eType
    • makeCd Link icon

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

      public abstract LoggerControl makeControl(LoggerForm loggerForm)
    • makeComponent Link icon

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

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

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

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

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

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

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

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

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

      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