Class FWImageFormComponent

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, net.simplace.core.FWBusyIndicator, net.simplace.core.FWObserver

public class FWImageFormComponent extends FWAbstractFormComponent
Form component displaying an image, scaled down to the component width. The image is given by the attribute imageid (file name or image id of the ImageProvider, with parameter tokens; reloaded when a used parameter changes) or by the form filler (image id, BufferedImage or ImageIcon). The component has no value.
Author:
Andreas Enders
See Also:
  • Constructor Details

    • FWImageFormComponent

      public FWImageFormComponent(String aFormID, String aFieldID, boolean aShowLabel, org.jdom2.Element aFormElement, net.simplace.core.FWObservable aObservable)
      Parameters:
      aFormID - id of the form the component is placed in
      aFieldID - id of the component
      aShowLabel - true to show a caption label
      aFormElement - the form element (attribute imageid)
      aObservable - parameters of the functionality
  • Method Details

    • getValue

      public String getValue()
      Specified by:
      getValue in class FWAbstractFormComponent
      Returns:
      always null; the component has no value
    • setValue

      public void setValue(Object aValue)
      Does nothing; the component has no value.
      Specified by:
      setValue in class FWAbstractFormComponent
      Parameters:
      aValue - not used
    • update

      public void update(net.simplace.core.FWObservable aObservabal, Object aKeyOfParameterChanged)
      In addition to the base behaviour, reloads the image when a parameter used in imageid changes.
      Specified by:
      update in interface net.simplace.core.FWObserver
      Overrides:
      update in class FWAbstractFormComponent
      Parameters:
      aObservabal - the parameters
      aKeyOfParameterChanged - key of the changed parameter
    • processFormFiller

      public void processFormFiller()
      Takes the image from the form filler: an image id or file name, a BufferedImage or an ImageIcon.
      Specified by:
      processFormFiller in class FWAbstractFormComponent
    • getValueCell

      protected com.lowagie.text.Rectangle getValueCell(int aType)
      Description copied from class: FWAbstractFormComponent
      Returns the value cell used for generating the RTF, PDF or HTML version of the form.
      Specified by:
      getValueCell in class FWAbstractFormComponent
      Parameters:
      aType - output type, e.g. PrintHelper.TYPE_PDF
      Returns:
      an iText cell (PdfPCell for PDF, Cell otherwise)
    • updateImageFromMap

      protected void updateImageFromMap()
      Loads the image given by the attribute imageid (tokens replaced) from a file or the ImageProvider.