LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingCaption

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingCaption
All Implemented Interfaces:
java.awt.event.ItemListener, java.awt.event.MouseListener, java.util.EventListener, LyGraphicalCaption, LyGraphicalComponent, LyViewComponent, LyFreeInterface, LySetEnabledInterface, LySetLabelInterface, LySwingComponent

public class LySwingCaption
extends LySwingObject
implements LySwingComponent, LyGraphicalCaption, java.awt.event.ItemListener, java.awt.event.MouseListener

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

An input field of label type allows to display a simple, non-editable label inside a form. It is used in the consultation forms to show different types of fields (date, number, choice,...). It can be made up of one or several lines. It does not comprise any element.

See Also:
LyLabel

Field Summary
static java.lang.String __VERSION
           
 int LABEL_BORDER
          Number of pixels of the border.
 
Constructor Summary
LySwingCaption(LyCaption caption)
          Class constructor of a caption object for the Swing target.
 
Method Summary
 java.awt.Component createCaption(java.lang.String label)
          Creates and initializes a caption.
 java.awt.Component createCheckCaption(java.lang.String label, boolean checked)
          Creates and configures a captionned check box.
 java.awt.Container createPanelForTippedCaption()
          Creates and configures a new panel used to display a tooltip.
 java.awt.Component getCaptionLabel()
          Returns the label of this caption.
 java.awt.Component getComponent()
          (non-Javadoc).
 java.awt.Component getTipCaptionBlank()
          Returns a new blank JPanel for spaces on tooltips.
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void setContent()
          Sets the content of this caption.
 void setEnabled(boolean status)
          Updates attribute enabled to the given value.
 void setLabel(java.lang.String label)
          Updates attribute label to the given value.
 
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

LABEL_BORDER

public int LABEL_BORDER
Number of pixels of the border.

Constructor Detail

LySwingCaption

public LySwingCaption(LyCaption caption)
Class constructor of a caption object for the Swing target.

Parameters:
caption - a CAPTION component defined for every type of view targets. The caption border is initialized if its value is negative, then the content of the caption is filled.
Method Detail

createCaption

public java.awt.Component createCaption(java.lang.String label)
Creates and initializes a caption. The constraints are computed and applied on the new Swing component for this caption. If an help tip is defined, it is used as a tooltip with the associated mouse cursor.

Parameters:
label - the text displayed by the caption
Returns:
a new caption with the specified label

createCheckCaption

public java.awt.Component createCheckCaption(java.lang.String label,
                                             boolean checked)
Creates and configures a captionned check box.

Parameters:
label - the text displayed around the check box
checked - indicates if check box is checked or not.
Returns:
a new labeled checkbox

createPanelForTippedCaption

public java.awt.Container createPanelForTippedCaption()
Creates and configures a new panel used to display a tooltip.

Returns:
a panel with the layout tuned to display a tip

getTipCaptionBlank

public java.awt.Component getTipCaptionBlank()
Returns a new blank JPanel for spaces on tooltips.

Returns:
a blank panel
See Also:
getComponent()

setLabel

public void setLabel(java.lang.String label)
Description copied from interface: LyGraphicalCaption
Updates attribute label to the given value.

Specified by:
setLabel in interface LyGraphicalCaption
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - New value of label.

setEnabled

public void setEnabled(boolean status)
Description copied from interface: LyGraphicalCaption
Updates attribute enabled to the given value.

Specified by:
setEnabled in interface LyGraphicalCaption
Specified by:
setEnabled in interface LySetEnabledInterface
Parameters:
status - Boolean indicating if attribute enabled is set or unset.

setContent

public void setContent()
Sets the content of this caption. If this caption has a label, it is used. Its specialized Swing component is created (as a default caption or as a checkbox if the property is set)


getCaptionLabel

public java.awt.Component getCaptionLabel()
Returns the label of this caption.

Returns:
the label of this caption

getComponent

public java.awt.Component getComponent()
Description copied from class: LySwingObject
(non-Javadoc).

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

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

(c) January 2013 - W4 S.A.

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