LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingForm

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingFieldItem
              extended by leon.view.win.swing.LySwingPanel
                  extended by leon.view.win.swing.LySwingForm
All Implemented Interfaces:
LyActionListener, LyEventTransmitter, LyGraphicalComponent, LyGraphicalFieldItem, LyGraphicalForm, LyGraphicalPanel, LyViewComponent, LyFreeInterface, LyResetContentInterface, LySetEditableInterface, LySetEnabledInterface, LySetPopupMenuInterface, LySwingComponent

public class LySwingForm
extends LySwingPanel
implements LySwingComponent, LyGraphicalForm, LyActionListener, LySetEnabledInterface, LyResetContentInterface

This class implements the Form object (as described in the dtd) for swing viewer.

A form allows to show a set of fields. This type of component is used to allow a user of an application to consult application data (non editable form) or else to input data (editable form).

The default arrangement of the fields inside a form is based on a grid of two columns comprising as many lines as there are fields. The first column contains the labels of the fields and the second one contains the input fields.

See Also:
LyForm

Nested Class Summary
 class LySwingForm._LyJFormComponentAdapter
          Handles component resize and checks if minimum sizes are valid.
 
Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LySwingForm(LyForm form)
          Class constructor of a Footer object for the Swing target.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
 void addField(LyFormField field, java.util.Vector<leon.view.win.swing.LySwingForm._LyFormContent> content)
          Adds the label/item couple to the layout and sets its display contraints.
 java.awt.GridBagConstraints buildConstraint(LyComponent comp, LyConstraint requestedConstraint, boolean isCaption)
          Builds a contraint object for the layout for the specified label or component.
 java.awt.GridBagConstraints buildDefaultConstraint(LyComponent comp, boolean isCaption)
          Builds a contraint object for the layout of the specified label or component.
 java.awt.Container createFormPanel(java.awt.LayoutManager layout)
          Creates the panel that contains the form fields.
 java.awt.Container createToolBarPanel()
          Creates the panel for this form's toolbar.
 java.awt.Color getColor()
          Gets the background color of this component.
 java.awt.Component getComponent()
          (non-Javadoc).
 void initialize()
          Initializes the current component with the default values.
 void resetContent()
          (non-Javadoc).
 void resetContent(boolean full)
          (non-Javadoc).
 void setContent()
          Sets the content of this component.
 void setEditable(boolean editable)
          Sets the editable status of this form.
 void setEditable(boolean editable, boolean init)
          Sets the editable status of this form.
 void setEnabled(boolean enabled)
          Sets the enabled status of this form.
 void setEnabled(boolean enabled, boolean init)
          Sets the enabled status of this form.
 
Methods inherited from class leon.view.win.swing.LySwingPanel
setPopupMenu
 
Methods inherited from class leon.view.win.swing.LySwingFieldItem
getActionTransmitter, getSelectionTransmitter
 
Methods inherited from class leon.view.win.swing.LySwingObject
getBounds, getChildrenBounds, getDefaultFrame
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, free, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
free, getViewComponent
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LySwingForm

public LySwingForm(LyForm form)
Class constructor of a Footer object for the Swing target.

Parameters:
form - a FORM component defined for every type of view targets. This component is initialized specificaly for the Swing view.
Method Detail

createFormPanel

public java.awt.Container createFormPanel(java.awt.LayoutManager layout)
Creates the panel that contains the form fields.

Parameters:
layout - the layoutManager of the returned panel
Returns:
the new panel with the given layout

createToolBarPanel

public java.awt.Container createToolBarPanel()
Creates the panel for this form's toolbar.

Returns:
a new default toolbar panel

initialize

public void initialize()
Initializes the current component with the default values.


buildDefaultConstraint

public java.awt.GridBagConstraints buildDefaultConstraint(LyComponent comp,
                                                          boolean isCaption)
Builds a contraint object for the layout of the specified label or component. The component object is not used, thus the constraints are generic from one component to another.

Parameters:
comp - a component, not used in this implementation
isCaption - Applies constraints specific to the captions.
Returns:
the constraints of a generic component

buildConstraint

public java.awt.GridBagConstraints buildConstraint(LyComponent comp,
                                                   LyConstraint requestedConstraint,
                                                   boolean isCaption)
Builds a contraint object for the layout for the specified label or component.

Parameters:
comp - component to build the constraints
requestedConstraint - constraint object to apply on the component
isCaption - Applies constraints specific to the captions.
Returns:
the new constraints for the given component

addField

public void addField(LyFormField field,
                     java.util.Vector<leon.view.win.swing.LySwingForm._LyFormContent> content)
Adds the label/item couple to the layout and sets its display contraints.

Parameters:
field - label to add
content - component list

setContent

public void setContent()
Sets the content of this component.


resetContent

public void resetContent()
(non-Javadoc).

Specified by:
resetContent in interface LyResetContentInterface
See Also:
LyResetContentInterface.resetContent()

resetContent

public void resetContent(boolean full)
(non-Javadoc).

Specified by:
resetContent in interface LyResetContentInterface
Parameters:
full - indicates whether old components must be removed from graphical view.
See Also:
LyResetContentInterface.resetContent(boolean)

actionPerformed

public void actionPerformed(LyActionEvent actionEvent)
(non-Javadoc).

Specified by:
actionPerformed in interface LyActionListener
See Also:
LyActionListener.actionPerformed(leon.view.event.LyActionEvent)

setEditable

public void setEditable(boolean editable)
Sets the editable status of this form.

Specified by:
setEditable in interface LyGraphicalForm
Specified by:
setEditable in interface LySetEditableInterface
Parameters:
editable - Boolean indicating if attribute editable is set or unset.
See Also:
setEditable(boolean, boolean), LySetEditableInterface.setEditable(boolean)

setEditable

public void setEditable(boolean editable,
                        boolean init)
Sets the editable status of this form.

Parameters:
editable - new status
init - indicates if called by initialisation of the component

setEnabled

public void setEnabled(boolean enabled)
Sets the enabled status of this form.

Specified by:
setEnabled in interface LySetEnabledInterface
See Also:
setEnabled(boolean, boolean), LySetEnabledInterface.setEnabled(boolean)

setEnabled

public void setEnabled(boolean enabled,
                       boolean init)
Sets the enabled status of this form.

Parameters:
enabled - new status
init - indicates if called by initialisation of the component

getComponent

public java.awt.Component getComponent()
(non-Javadoc).

Specified by:
getComponent in interface LySwingComponent
Overrides:
getComponent in class LySwingObject
Returns:
this Swing view component
See Also:
LySwingComponent.getComponent()

getColor

public java.awt.Color getColor()
Gets the background color of this component.

Returns:
the component's color

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com