LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingDate

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.LySwingDate
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.util.EventListener, LyActionListener, LyEventTransmitter, LyGetLabelInterface, LyGraphicalComponent, LyGraphicalDate, LyGraphicalFieldItem, LyViewComponent, LyFreeInterface, LySetEditableInterface, LySetEnabledInterface, LySetLabelInterface, LySwingComponent

public class LySwingDate
extends LySwingFieldItem
implements LySwingComponent, LySetLabelInterface, java.awt.event.FocusListener, LyGraphicalDate, LyActionListener, LyGetLabelInterface, LySetEnabledInterface, LySetEditableInterface, java.awt.event.KeyListener, java.awt.event.ItemListener

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

An input field of Date type allows to display a graphical component allowing to input or to consult date and/or hour. It does not comprise any element. It is possible to specify the type of the date as well as the display format.

See Also:
LyRelation

Nested Class Summary
 class LySwingDate._LyJSpecialSelector
          Special Swing selector for the date elements.
 
Field Summary
static java.lang.String __VERSION
           
static int IMAGE_H_OFFSET
          Height of the selector's button image.
static int IMAGE_W_OFFSET
          Width of the selector's button image.
 
Constructor Summary
LySwingDate(LyDate date)
          Class constructor of a Date object for the Swing target.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          Checks the values and corrects them if an event is generated.
 void focusGained(java.awt.event.FocusEvent e)
          Don't do anything if the focus is gained.
 void focusLost(java.awt.event.FocusEvent e)
          If the focus is lost, a notify event must be sent.
 java.awt.Component getComponent()
          (non-Javadoc).
 java.lang.String getLabel()
          Gets the label for the time and date this object represents, without validations.
 void initialize()
          Initializes the current date component.
 void itemStateChanged(java.awt.event.ItemEvent e)
          When AM or PM is selected, a notify event must be sent.
 void keyPressed(java.awt.event.KeyEvent evt)
          (non-Javadoc).
 void keyReleased(java.awt.event.KeyEvent evt)
          (non-Javadoc).
 void keyTyped(java.awt.event.KeyEvent evt)
          (non-Javadoc).
 void setEditable(boolean editable)
          (non-Javadoc).
 void setEnabled(boolean status)
          (non-Javadoc).
 void setLabel(java.lang.String label)
          Sets the time and date components from the specified label.
 void setLabel(java.lang.String label, boolean notify)
          Sets the time and date components from the specified label.
 
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

IMAGE_W_OFFSET

public static int IMAGE_W_OFFSET
Width of the selector's button image.


IMAGE_H_OFFSET

public static int IMAGE_H_OFFSET
Height of the selector's button image.

Constructor Detail

LySwingDate

public LySwingDate(LyDate date)
Class constructor of a Date object for the Swing target.

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

initialize

public void initialize()
Initializes the current date component. Depending on the type of the _date description, the component will be initialized to let the choice only of date, time or both, with different formats.


setEditable

public void setEditable(boolean editable)
(non-Javadoc).

Specified by:
setEditable in interface LySetEditableInterface
See Also:
LySetEditableInterface.setEditable(boolean)

setEnabled

public void setEnabled(boolean status)
(non-Javadoc).

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

actionPerformed

public void actionPerformed(LyActionEvent actionEvent)
Checks the values and corrects them if an event is generated.

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

getLabel

public java.lang.String getLabel()
Gets the label for the time and date this object represents, without validations.

Specified by:
getLabel in interface LyGetLabelInterface
See Also:
LyGetLabelInterface.getLabel(), setLabel(String)

setLabel

public void setLabel(java.lang.String label)
Sets the time and date components from the specified label.

Specified by:
setLabel in interface LyGraphicalDate
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
notify - indicates if new label must be notified to control layer.
See Also:
LySetLabelInterface.setLabel(java.lang.String), getLabel()

setLabel

public void setLabel(java.lang.String label,
                     boolean notify)
Sets the time and date components from the specified label.

Parameters:
label - the new label for date and time.
notify - indicates if new label must be notified to control layer.
See Also:
getLabel()

keyTyped

public void keyTyped(java.awt.event.KeyEvent evt)
(non-Javadoc).

Specified by:
keyTyped in interface java.awt.event.KeyListener
See Also:
KeyListener.keyTyped(java.awt.event.KeyEvent)

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
(non-Javadoc).

Specified by:
keyPressed in interface java.awt.event.KeyListener
See Also:
KeyListener.keyPressed(java.awt.event.KeyEvent)

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
(non-Javadoc).

Specified by:
keyReleased in interface java.awt.event.KeyListener
See Also:
KeyListener.keyReleased(java.awt.event.KeyEvent)

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Don't do anything if the focus is gained.

Specified by:
focusGained in interface java.awt.event.FocusListener
See Also:
FocusListener.focusGained(java.awt.event.FocusEvent)

focusLost

public void focusLost(java.awt.event.FocusEvent e)
If the focus is lost, a notify event must be sent.

Specified by:
focusLost in interface java.awt.event.FocusListener
See Also:
FocusListener.focusLost(java.awt.event.FocusEvent), LySwingDate._LyJSpecialSelector.notifyController()

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
When AM or PM is selected, a notify event must be sent.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener

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()

(c) January 2013 - W4 S.A.

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