LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingTool

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

public class LySwingTool
extends LySwingObject
implements LySwingComponent, LyFreeInterface, LyGraphicalTool, LyActionListener, LyEventTransmitter

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

An action button allows to execute an action. In the case where the button contains an area (AREA), this area is displayed in a new window when launching the action.

See Also:
LySwingToolBar, LyTool

Field Summary
static java.lang.String __VERSION
           
static int LY_LABELED_TOOL_WIDTH
          Width of the label tool.
 
Constructor Summary
LySwingTool(LyTool tool)
          Class constructor of a Tool object for the Swing target.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
 java.awt.Component createTool()
          Creates the new tool components: button, menu item or panel.
 void fillToolComponent()
          Fills the tool area.
 void free()
          (non-Javadoc).
 LyActionTransmitter getActionTransmitter()
          (non-Javadoc).
 java.awt.Component getAuxComponent()
          Gets the auxiliary component of this component.
 java.awt.Component getComponent()
          (non-Javadoc).
 LySelectionTransmitter getSelectionTransmitter()
          This action button doesn't handle selection events, so it has no selection transmitter.
 void initialize()
          Builds the tool component and registers its events.
 void setContent()
          Fills the area if this tool has one.
 void setEnabled(boolean enabled)
          Sets the status of the menu.
 void setImage(java.lang.String image)
          Sets the new button image.
 void setLabel(java.lang.String label)
          Sets the new button label.
 void setPressed(boolean pressed)
          Updates attribute pressed to the given value.
 void setTooltip(java.lang.String tooltip)
          Sets the new tooltip.
 
Methods inherited from class leon.view.win.swing.LySwingObject
getBounds, getChildrenBounds, getDefaultFrame
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, 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
getViewComponent
 

Field Detail

__VERSION

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

LY_LABELED_TOOL_WIDTH

public static int LY_LABELED_TOOL_WIDTH
Width of the label tool.

Constructor Detail

LySwingTool

public LySwingTool(LyTool tool)
Class constructor of a Tool object for the Swing target.

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

initialize

public void initialize()
Builds the tool component and registers its events.


setContent

public void setContent()
Fills the area if this tool has one.


createTool

public java.awt.Component createTool()
Creates the new tool components: button, menu item or panel.

Returns:
the new tool component

fillToolComponent

public void fillToolComponent()
Fills the tool area.


setImage

public void setImage(java.lang.String image)
Sets the new button image.

Specified by:
setImage in interface LyGraphicalTool
Specified by:
setImage in interface LySetImageInterface
Parameters:
image - the new image name
See Also:
LySetImageInterface.setImage(String)

getAuxComponent

public java.awt.Component getAuxComponent()
Gets the auxiliary component of this component.

Returns:
the auxiliary button

setLabel

public void setLabel(java.lang.String label)
Sets the new button label.

Specified by:
setLabel in interface LyGraphicalTool
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - the new label
See Also:
LySetLabelInterface.setLabel(String)

setPressed

public void setPressed(boolean pressed)
Updates attribute pressed to the given value.

Specified by:
setPressed in interface LyGraphicalTool
Parameters:
pressed - Boolean indicating if attribute pressed is set or unset.

setEnabled

public void setEnabled(boolean enabled)
Sets the status of the menu. If disabled, the menu is grayed and inactive.

Specified by:
setEnabled in interface LyGraphicalTool
Specified by:
setEnabled in interface LySetEnabledInterface
Parameters:
enabled - the new status
See Also:
LySetEnabledInterface.setEnabled(boolean)

setTooltip

public void setTooltip(java.lang.String tooltip)
Sets the new tooltip.

Specified by:
setTooltip in interface LyGraphicalTool
Parameters:
tooltip - the new tooltip

free

public void free()
(non-Javadoc).

Specified by:
free in interface LyGraphicalComponent
Specified by:
free in interface LyFreeInterface
Overrides:
free in class LyGraphicalObject
See Also:
LyFreeInterface.free()

actionPerformed

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

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

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

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 action button doesn't handle selection events, so it has no selection transmitter.

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

(c) January 2013 - W4 S.A.

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