LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingBoolean

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.LySwingBoolean
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, LyEventTransmitter, LyGetValueInterface, LyGraphicalBoolean, LyGraphicalComponent, LyGraphicalFieldItem, LyViewComponent, LyFreeInterface, LySetEditableInterface, LySetEnabledInterface, LySetOptionalInterface, LySetStatusInterface, LySwingComponent

public class LySwingBoolean
extends LySwingFieldItem
implements LyGraphicalBoolean, LySetEditableInterface, LySetEnabledInterface, LySetOptionalInterface, LyGetValueInterface, java.awt.event.ActionListener

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

An input field of boolean type allows to display a graphical component with a three status checkbox : not specified (empty), true (checked with a green sign), false (with a red cross). It is possible to specify a label for each of these statuss and to make a negation of the boolean value.

See Also:
LyBoolean

Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LySwingBoolean(LyBoolean booleanViewComp)
          Class constructor of a Boolean object for the Swing target.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          (non-Javadoc).
 java.lang.Boolean computeBooleanValue()
          Computes the value of this boolean component.
 java.awt.Component createBooleanComponent()
          Returns a new Swing boolean component.
 LyAbstractBooleanPanelManager getBooleanManager()
          Returns the boolean manager.
 java.lang.Boolean getBooleanValue()
          Returns the boolean value.
 java.awt.Component getComponent()
          (non-Javadoc).
 java.lang.String getValue()
          Returns the boolean internal status as a string.
 void initialize()
          Initializes the Boolean object by creating the associated Swing boolean component.
 void setBooleanValue(java.lang.Boolean value)
          Sets the new boolean value of this component.
 void setContent()
          Sets the content of this component.
 void setEditable(boolean status)
          (non-Javadoc).
 void setEnabled(boolean status)
          (non-Javadoc).
 void setImages(java.awt.Image back, java.awt.Image hoover, java.awt.Image empty, java.awt.Image falseV, java.awt.Image trueV)
          Sets the images of this component.
 void setLabels(java.lang.String labelEmpty, java.lang.String labelChecked, java.lang.String labelUnchecked)
          Sets the labels of this component.
 void setOptional(boolean optional)
          (non-Javadoc).
 void setStatus(LyBoolean.Status status)
          (non-Javadoc).
 void setValue(java.lang.Boolean value)
          Sets the value of this swing boolean component.
 
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

LySwingBoolean

public LySwingBoolean(LyBoolean booleanViewComp)
Class constructor of a Boolean object for the Swing target.

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

initialize

public void initialize()
Initializes the Boolean object by creating the associated Swing boolean component.


getBooleanManager

public LyAbstractBooleanPanelManager getBooleanManager()
Returns the boolean manager.

Returns:
the boolean manager

createBooleanComponent

public java.awt.Component createBooleanComponent()
Returns a new Swing boolean component.

Returns:
a new boolean component

setOptional

public void setOptional(boolean optional)
(non-Javadoc).

Specified by:
setOptional in interface LySetOptionalInterface
Parameters:
optional - the new status of the optional attribute
See Also:
LySetOptionalInterface.setOptional(boolean)

getBooleanValue

public java.lang.Boolean getBooleanValue()
Returns the boolean value. The value may be Boolean.TRUE, Boolean.FALSE or null if this component is empty.

Returns:
the boolean value
See Also:
setBooleanValue(Boolean)

setBooleanValue

public void setBooleanValue(java.lang.Boolean value)
Sets the new boolean value of this component. The value may be Boolean.TURE, Boolean.FALSE or null if the value is empty.

Parameters:
value - the new boolean value
See Also:
getBooleanValue()

setImages

public void setImages(java.awt.Image back,
                      java.awt.Image hoover,
                      java.awt.Image empty,
                      java.awt.Image falseV,
                      java.awt.Image trueV)
Sets the images of this component.

Parameters:
back - the background image
hoover - the hoover image
empty - the image used when BOOLEAN_EMPTY status is selected
falseV - the image used when BOOLEAN_FALSE status is selected
trueV - the image used when BOOLEAN_TRUE status is selected
See Also:
LyAbstractBooleanPanelManager.setImages(Image, Image, Image, Image, Image)

setLabels

public void setLabels(java.lang.String labelEmpty,
                      java.lang.String labelChecked,
                      java.lang.String labelUnchecked)
Sets the labels of this component.

Parameters:
labelEmpty - label displayed when the selection is empty
labelChecked - label displayed when the selection is checked
labelUnchecked - label displayed when the selection is unchecked
See Also:
LyAbstractBooleanPanelManager.setLabels(String, String, String)

setContent

public void setContent()
Sets the content of this component. The images are retrieved as well as the labels and the font this component uses then these resources are applied on this boolean component.


setEditable

public void setEditable(boolean status)
(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)

setStatus

public void setStatus(LyBoolean.Status status)
(non-Javadoc).

Specified by:
setStatus in interface LyGraphicalBoolean
Specified by:
setStatus in interface LySetStatusInterface
Parameters:
status - New value of status.
See Also:
leon.view.setinterface.LySetstatusInterface#setstatus(short)

computeBooleanValue

public java.lang.Boolean computeBooleanValue()
Computes the value of this boolean component. This is done by retreiving the boolean component value and reversing the value if the property LyBoolean.isNot() is set. If there is no value, null is returned.

Returns:
the current value. It may be Boolean.TRUE, Boolean.FALSE or null if there is no value for this component.

getValue

public java.lang.String getValue()
Returns the boolean internal status as a string.

Specified by:
getValue in interface LyGetValueInterface
See Also:
setValue(Boolean), LyGetValueInterface.getValue()

setValue

public void setValue(java.lang.Boolean value)
Sets the value of this swing boolean component. The values are:

Parameters:
value - the new boolean value
See Also:
getValue()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
(non-Javadoc).

Specified by:
actionPerformed in interface java.awt.event.ActionListener
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

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