LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingCommand

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingCommand
All Implemented Interfaces:
LyActionListener, LyEventTransmitter, LyGraphicalCommand, LyGraphicalComponent, LyGraphicalFieldItem, LyGraphicalPanel, LyViewComponent, LyFreeInterface, LySetEnabledInterface, LySetLabelInterface, LySwingComponent

public class LySwingCommand
extends LySwingObject
implements LySwingComponent, LyGraphicalCommand, LyActionListener, LyEventTransmitter

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

A command button allows to execute an action. There are predefined types of command giving information about the nature of the action to execute (closing, cancellation, help, etc.).

See Also:
LyCommand

Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LySwingCommand(LyCommand command)
          Class constructor of a command object for the Swing target.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
 java.awt.Component createButton(java.lang.String label, java.awt.Image image, java.awt.Font font)
          Creates and configures a button for the triggering of this object's command.
 LyActionTransmitter getActionTransmitter()
          (non-Javadoc).
 java.awt.Component getComponent()
          (non-Javadoc).
 LySelectionTransmitter getSelectionTransmitter()
          This button doesn't handle selection events, so it has no selection transmitter.
 void initialize()
          Initializes this object.
 void registerEvents()
          Register the events for this command.
 void setEnabled(boolean status)
          (non-Javadoc).
 void setLabel(java.lang.String label)
          (non-Javadoc).
 
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

LySwingCommand

public LySwingCommand(LyCommand command)
Class constructor of a command object for the Swing target.

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

initialize

public void initialize()
Initializes this object. Builds the button and registers events.


setEnabled

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

Specified by:
setEnabled in interface LyGraphicalCommand
Specified by:
setEnabled in interface LySetEnabledInterface
Parameters:
status - Boolean indicating if attribute enabled is set or unset.
See Also:
LySetEnabledInterface.setEnabled(boolean)

actionPerformed

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

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

getActionTransmitter

public LyActionTransmitter getActionTransmitter()
(non-Javadoc).

Specified by:
getActionTransmitter in interface LyEventTransmitter
Returns:
the action transmitter of this component
See Also:
LyEventTransmitter.getActionTransmitter()

getSelectionTransmitter

public LySelectionTransmitter getSelectionTransmitter()
This button doesn't handle selection events, so it has no selection transmitter.

Specified by:
getSelectionTransmitter in interface LyEventTransmitter
Returns:
null
See Also:
LyEventTransmitter.getSelectionTransmitter()

createButton

public java.awt.Component createButton(java.lang.String label,
                                       java.awt.Image image,
                                       java.awt.Font font)
Creates and configures a button for the triggering of this object's command.

Parameters:
label - the label to display on the button
image - the image to display on the button
font - the font to used to draw the label
Returns:
the new button

setLabel

public void setLabel(java.lang.String label)
(non-Javadoc).

Specified by:
setLabel in interface LyGraphicalCommand
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - New value of label.
See Also:
LySetLabelInterface.setLabel(java.lang.String)

registerEvents

public void registerEvents()
Register the events for this command.


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