LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingTitleBar

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingTitleBar
All Implemented Interfaces:
LyActionListener, LyGraphicalComponent, LyGraphicalTitleBar, LyViewComponent, LyFreeInterface, LySetImageInterface, LySetPopupMenuInterface, LySwingComponent

public class LySwingTitleBar
extends LySwingObject
implements LySwingComponent, LyGraphicalTitleBar, LyActionListener, LySetPopupMenuInterface

This class implements the internal description of an Icon object as described in the dtd.

A title bar allows to display a colored horizontal bar containing images and texts. The text comprises three independent parts and each one of them is optional: a left, a central and a right part. The color of the title bar is defined in the resources of the application.

See Also:
LyComponent

Nested Class Summary
 class LySwingTitleBar.TitleBarBorder
          This class describes special borders for Titlebar.
 
Field Summary
static java.lang.String __VERSION
           
 javax.swing.JPopupMenu _popupMenu
          Popup menu associated to the title bar.
 
Constructor Summary
LySwingTitleBar(LyTitleBar titleBar)
          Class constructor of a Title Bar object for the Swing target.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
 java.awt.Component createTitleBar(java.awt.Image bgImage, java.awt.Image img, java.lang.String imgToolTip, java.awt.Image rightImg, java.lang.String rightImgToolTip, java.lang.String leftLabel, java.lang.String centerLabel, java.lang.String rightLabel, LyActionListener listener)
          Creates the title bar.
 java.awt.Component getComponent()
          (non-Javadoc).
 void initialize()
          Initializes this swing component.
 void setCenterLabel(java.lang.String centerLabel)
          Sets the center label text.
 void setImage(java.lang.String image)
          Sets the image of this title bar and refreshes it.
 void setImageToolTip(java.lang.String toolTip)
          Sets the tooltip of this title bar image.
 void setLeftLabel(java.lang.String leftLabel)
          Sets the left label text.
 void setPopupMenu(LyPopupMenu menu)
          Sets the title bar popup menu then shows it.
 void setRightImage(java.lang.String image)
          Sets the right image of this title bar.
 void setRightImageToolTip(java.lang.String toolTip)
          Sets the tooltip of the right image.
 void setRightLabel(java.lang.String rightLabel)
          Sets the right label text.
 
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

_popupMenu

public javax.swing.JPopupMenu _popupMenu
Popup menu associated to the title bar.

Constructor Detail

LySwingTitleBar

public LySwingTitleBar(LyTitleBar titleBar)
Class constructor of a Title Bar object for the Swing target.

Parameters:
titleBar - a TITLEBAR component defined for every type of view targets. This title bar is initialized specificaly for the Swing view.
Method Detail

createTitleBar

public java.awt.Component createTitleBar(java.awt.Image bgImage,
                                         java.awt.Image img,
                                         java.lang.String imgToolTip,
                                         java.awt.Image rightImg,
                                         java.lang.String rightImgToolTip,
                                         java.lang.String leftLabel,
                                         java.lang.String centerLabel,
                                         java.lang.String rightLabel,
                                         LyActionListener listener)
Creates the title bar.

Parameters:
bgImage - the background image
img - the main image
imgToolTip - the main image tooltip
rightImg - the right image
rightImgToolTip - the right image tooltip
leftLabel - the left label
centerLabel - the center label
rightLabel - the right label
listener - the action listener
Returns:
the new title bar with the specified properties and listeners

initialize

public void initialize()
Initializes this swing component. Sets its font and colors.


setPopupMenu

public void setPopupMenu(LyPopupMenu menu)
Sets the title bar popup menu then shows it.

Specified by:
setPopupMenu in interface LySetPopupMenuInterface
Parameters:
menu - the new popup menu of this title bar

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

setImage

public void setImage(java.lang.String image)
Sets the image of this title bar and refreshes it.

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

setImageToolTip

public void setImageToolTip(java.lang.String toolTip)
Sets the tooltip of this title bar image.

Specified by:
setImageToolTip in interface LyGraphicalTitleBar
Parameters:
toolTip - the new ToolTip
See Also:
LyGraphicalTitleBar.setImageToolTip(java.lang.String)

setRightImage

public void setRightImage(java.lang.String image)
Sets the right image of this title bar.

Specified by:
setRightImage in interface LyGraphicalTitleBar
Parameters:
image - the new image
See Also:
LyGraphicalTitleBar.setRightImage(java.lang.String)

setRightImageToolTip

public void setRightImageToolTip(java.lang.String toolTip)
Sets the tooltip of the right image.

Specified by:
setRightImageToolTip in interface LyGraphicalTitleBar
Parameters:
toolTip - new ToolTip
See Also:
LyGraphicalTitleBar.setRightImageToolTip(java.lang.String)

setLeftLabel

public void setLeftLabel(java.lang.String leftLabel)
Sets the left label text.

Specified by:
setLeftLabel in interface LyGraphicalTitleBar
Parameters:
leftLabel - the new label
See Also:
LyGraphicalTitleBar.setLeftLabel(java.lang.String)

setCenterLabel

public void setCenterLabel(java.lang.String centerLabel)
Sets the center label text.

Specified by:
setCenterLabel in interface LyGraphicalTitleBar
Parameters:
centerLabel - the new label
See Also:
LyGraphicalTitleBar.setCenterLabel(java.lang.String)

setRightLabel

public void setRightLabel(java.lang.String rightLabel)
Sets the right label text.

Specified by:
setRightLabel in interface LyGraphicalTitleBar
Parameters:
rightLabel - the new label
See Also:
LyGraphicalTitleBar.setRightLabel(java.lang.String)

actionPerformed

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

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

(c) January 2013 - W4 S.A.

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