Class FWAbstractFormComponent

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
net.simplace.pipe.formcomponents.FWAbstractFormComponent
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, FWObserver
Direct Known Subclasses:
FWAbstractExtendedFormComponent, FWChartFormComponent, FWCheckValueFormComponent, FWChoiceFormComponent, FWDatabaseAccessFormComponent, FWDateFormComponent, FWDoubleFormComponent, FWFileChooserFormComponent, FWGroupFormComponent, FWHeaderFormComponent, FWImageFormComponent, FWIntegerFormComponent, FWLabelFormComponent, FWMemoryMonitorFormComponent, FWPasswordFormComponent, FWProcessorButtonFormComponent, FWProgressFormComponent, FWResultFormComponent, FWTableFormComponent, FWTextFormComponent, FWTreeFormComponent

public abstract class FWAbstractFormComponent extends JPanel implements FWObserver
This panel is supposed to be overwritten by component implementing classes that should be used to be shown in FWFormPanel. It implements Observer to be updated while one other component changes his value. It offers the notifyDependentComponents-function to update the observable with the current value of this component. The observable will then inform all other components about this change. It is up to the implementations of this abstract class to call notifyDependentComponents whenever necessary! Implementations can use own configurations via XML. Feel free to use them as you need, but call the superconstructor before beginning.
Author:
Andreas Enders, Christoph Kunze
See Also:
  • Field Details

    • iObservable

      protected FWObservable iObservable
    • iDetachContentPanel

      protected JPanel iDetachContentPanel
    • DETACH_TRUE

      public static final int DETACH_TRUE
      Component is to be detachable
      See Also:
    • DETACH_FALSE

      public static final int DETACH_FALSE
      Default! Component looks and behaves as any other component
      See Also:
    • DETACH_AUTO

      public static final int DETACH_AUTO
      Component detaches automatically while opening the form
      See Also:
    • DETACH_BUTTON

      public static final int DETACH_BUTTON
      Component shows only a frame - while klicking the frame is extended and outpoped.
      See Also:
    • DETACH_LINKED

      public static final int DETACH_LINKED
      Component detaches automatically while opening the form, but stays linked
      See Also:
    • DETATCH_BORDER_WIDTH

      protected static final int DETATCH_BORDER_WIDTH
      See Also:
    • DETATCH_BORDER_DEFAULT_COLOR

      protected static final Color DETATCH_BORDER_DEFAULT_COLOR
    • DETATCH_BORDER_HIGHLIGHT_COLOR

      protected static final Color DETATCH_BORDER_HIGHLIGHT_COLOR
    • DETATCH_BUTTON_DEFAULT_IMAGE

      protected static final ImageIcon DETATCH_BUTTON_DEFAULT_IMAGE
    • DETATCH_BUTTON_HIGHLIGHT_IMAGE

      protected static final ImageIcon DETATCH_BUTTON_HIGHLIGHT_IMAGE
    • DETATCH_BUTTON_DISABLED_IMAGE

      protected static final ImageIcon DETATCH_BUTTON_DISABLED_IMAGE
    • COPY_BUTTON_DEFAULT_IMAGE

      protected static final ImageIcon COPY_BUTTON_DEFAULT_IMAGE
    • COPY_BUTTON_HIGHLIGHT_IMAGE

      protected static final ImageIcon COPY_BUTTON_HIGHLIGHT_IMAGE
    • COPY_BUTTON_DISABLED_IMAGE

      protected static final ImageIcon COPY_BUTTON_DISABLED_IMAGE
    • EXPORT_BUTTON_DEFAULT_IMAGE

      protected static final ImageIcon EXPORT_BUTTON_DEFAULT_IMAGE
    • EXPORT_BUTTON_HIGHLIGHT_IMAGE

      protected static final ImageIcon EXPORT_BUTTON_HIGHLIGHT_IMAGE
    • EXPORT_BUTTON_DISABLED_IMAGE

      protected static final ImageIcon EXPORT_BUTTON_DISABLED_IMAGE
  • Constructor Details

    • FWAbstractFormComponent

      protected FWAbstractFormComponent()
      Parameters:
      aFormID - of form, this component is placed in
      aFieldID - making this compontent unique
      aShowLabel - if label should be shown. For Use in table use false, otherwise true
    • FWAbstractFormComponent

      protected FWAbstractFormComponent(String aFormID, String aFieldID, boolean aShowLabel, org.jdom2.Element aFormElement, FWObservable aObservable)
      Parameters:
      aFormID - of form, this component is placed in
      aFieldID - making this compontent unique
      aShowLabel - if label should be shown. For Use in table use false, otherwise true
      aFormElement -
      aObservable -
    • FWAbstractFormComponent

      protected FWAbstractFormComponent(String aFormID, String aFieldID, boolean aShowLabel, int aDetachable, org.jdom2.Element aFormElement, FWObservable aObservable)
      Parameters:
      aFormID - of form, this component is placed in
      aFieldID - making this compontent unique
      aShowLabel - if label should be shown. For Use in table use false, otherwise true
      aDetachable -
      aFormElement -
      aObservable -
  • Method Details

    • init

      protected void init(String aFormID, String aFieldID, boolean aShowLabel, int aDetachable, org.jdom2.Element aFormElement, FWObservable aObservable)
      Parameters:
      aFormID -
      aFieldID -
      aShowLabel -
      aDetachable -
      aFormElement -
      aObservable -
    • setUpDetachControl

      protected void setUpDetachControl(int aDetachability)
      Parameters:
      aDetachability -
    • getValue

      public abstract Object getValue()
      Returns:
      value of the implemented component
    • setValue

      public abstract void setValue(Object aValue)
      Parameters:
      aValue - of the implemented component
    • processFormFiller

      public abstract void processFormFiller()
      Parameters:
      value - of the implemented component
    • getFieldID

      public String getFieldID()
      Returns:
      field id of the implemented component
    • setFormID

      public void setFormID(String aFormID)
      Parameters:
      aFormID -
    • getFormID

      public String getFormID()
      Returns:
      form id of the implemented component
    • setFieldID

      public void setFieldID(String aFieldID)
      Parameters:
      aFieldID -
    • getFormElement

      public org.jdom2.Element getFormElement()
      Returns:
      the formElement
    • getOriginalComponentParameteterValue

      protected String getOriginalComponentParameteterValue(String aKey)
      Parameters:
      aKey -
      Returns:
      the Value of the given parameterkey in FormElement parameters
    • getComponentParameteterValue

      protected String getComponentParameteterValue(String aKey)
      Parameters:
      aKey -
      Returns:
      the Value of the given parameterkey in FormElement parameters
    • isRequired

      public boolean isRequired()
      Returns:
      if form is required
    • setRequired

      public void setRequired(boolean aRequiredness)
      Parameters:
      aRequiredness -
    • isEnabled

      public boolean isEnabled()
      Overrides:
      isEnabled in class Component
      Returns:
      if formcomponent is enabled
    • notifyDependentComponents

      protected void notifyDependentComponents()
      Updates the functionalities' parameter map with the current value of this control so other form components that observe the parameter map get notified. Implementations MUST call this function, whenever their value changes.
    • getConfiguration

      protected org.jdom2.Element getConfiguration()
      gets the detailed configuration of the Processor.
      Returns:
      the configuration Element
    • setConfiguration

      protected void setConfiguration(String aClassname, org.jdom2.Element aConfigurationElement)
      sets the detailed configuration of a Processor.
      Parameters:
      aClassname -
      aConfigurationElement -
    • hasConfiguration

      protected boolean hasConfiguration()
      gets the detailed configuration of the Processor.
      Returns:
      if component has a special configuration
    • getLocaleValue

      protected String getLocaleValue(String aKey, String aDefault)
      This method limits the coding for reading values from the locale.
      Parameters:
      aKey -
      aDefault -
      Returns:
    • getLocaleValue

      protected String getLocaleValue(String aKey)
      This method limits the coding for reading values from the locale.
      Parameters:
      aKey -
      Returns:
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • getMaximumSize

      public Dimension getMaximumSize()
      Overrides:
      getMaximumSize in class JComponent
    • exportData

      protected void exportData()
      updates different functions like enabling of the Component
    • update

      public void update(FWObservable aObservable, Object aKeyOfParameterChanged)
      updates different functions like enableing of the Component
      Specified by:
      update in interface FWObserver
      Parameters:
      aObservable - the observable object.
      aKeyOfParameterChanged - an argument passed to the notifyObservers method.
      See Also:
    • hasFormFiller

      protected boolean hasFormFiller()
      Returns:
      if the formFiller was initialized
    • getFormFiller

      protected FWAbstractFormComponentFiller getFormFiller()
      Returns:
      the formFiller
    • getJumper

      protected String getJumper()
      Returns:
      the jumper
    • getJumperRule

      protected String getJumperRule()
      Returns:
      the jumperRule
    • getObservable

      public FWObservable getObservable()
      Returns:
      the observable
    • setObservable

      public void setObservable(FWObservable aObservable)
      Parameters:
      aObservable - the observable to set
    • setFormElement

      public void setFormElement(org.jdom2.Element aFormElement)
      Parameters:
      aFormElement - the formElement to set
    • getDetachability

      public int getDetachability()
      Returns:
      s if component is detachable
    • createDetachControls

      protected void createDetachControls(JPanel aContentPanel)
    • attachPanel

      public void attachPanel(FWDetachFrame aDetachFrame)
      detaches the detachpanel im possible
      Parameters:
      aDetachFrame -
    • disposePanel

      public void disposePanel(FWDetachFrame aDetachFrame)
      detaches the detachpanel im possible
      Parameters:
      aDetachFrame -
    • detachPanel

      public void detachPanel(boolean aUpdateContent)
      detaches the detachpanel im possible
      Parameters:
      aUpdateContent -
    • setDetachControlsHighlighted

      protected void setDetachControlsHighlighted(boolean aHighlighted)
      Makes the detach button and related controls appear highlighted or not according to aHighlighted
      Parameters:
      aHighlighted -
    • setDetachControlsEnabled

      protected void setDetachControlsEnabled(boolean aEnabled)
      Sets the enabled state of the detach button to aEnabled and clears the highlighted state if aEnabled is false. To query the enabled state, use the isEnabled method of iDetachButton!
      Parameters:
      aEnabled -
    • remove

      public void remove(Component aComp)
      Overrides:
      remove in class Container
    • add

      public void add(Component aComp, Object aConstraints)
      Overrides:
      add in class Container
    • add

      public void add(Component aComp, Object aConstraints, boolean aUseScrollbar)
      Parameters:
      aComp -
      aConstraints -
      aUseScrollbar -
    • isClosingRequired

      public boolean isClosingRequired()
      Manages all things that have to be done while closing a Form. For exaple closing the detached frames if user wants them to be closed
      Returns:
    • closeFormComponent

      public void closeFormComponent()
      Manages all things that have to be done while closing a Form. For exaple closing the detached frames if user wants them to be closed
    • getTitle

      public String getTitle()
      Returns:
      the Title of Component
    • getSystemID

      public String getSystemID()
      Returns:
      the SystemID of Component
    • setTitle

      public void setTitle(String aTitle)
      setting Title of Component
      Parameters:
      aTitle -
    • setDefault

      public void setDefault()
    • toString

      public String toString()
      Overrides:
      toString in class Component
    • getRequiredWarning

      public String getRequiredWarning()
      Returns:
      s the Value from RequiredWarning. If empty returning a default value
    • getCells

      public com.lowagie.text.Rectangle[] getCells(int aType)
      Parameters:
      aType -
      Returns:
      s the Value from RequiredWarning. If empty returning a default value
    • getValueCell

      protected abstract com.lowagie.text.Rectangle getValueCell(int aType)
      returns the value label to use for generating rtf, pdf or html version of the form
      Parameters:
      aType -
      Returns:
      iText Cell