LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingToolBar

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingToolBar
All Implemented Interfaces:
java.awt.event.ActionListener, java.beans.PropertyChangeListener, java.util.EventListener, LyActionListener, LyEventTransmitter, LyGetLockInterface, LyGraphicalComponent, LyGraphicalToolBar, LyViewComponent, LyFreeInterface, LySetColorInterface, LySetImageInterface, LySwingComponent

public class LySwingToolBar
extends LySwingObject
implements LySwingComponent, LySetColorInterface, LySetImageInterface, java.beans.PropertyChangeListener, LyGraphicalToolBar, java.awt.event.ActionListener, LyActionListener, LyEventTransmitter, LyGetLockInterface

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

A tool bar allows to display a set of action buttons. A tool bar can contain other tool bars, which allows to group together the action buttons into logical groups and sub-groups.

See Also:
LySwingTool, LyToolBar

Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LySwingToolBar(LyToolBar toolBar)
          Class constructor of a Tool bar object for the Swing target.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          (non-Javadoc).
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
 void addComponent(LyComponent component, int pos)
          This method is not implemented yet.
 void addItemToMenu(java.lang.Object item, java.lang.Object menu)
          Adds a menu item at the end of the specified menu.
 void addPopupToComponent(java.lang.Object popup, java.awt.Component comp)
          Adds a popup menu to the specified toolBar.
 void addSeparator()
          Add a separator at the end of the toolBar.
 void addTool(LySwingComponent tool)
          Adds a tool at the end of the toolBar.
 java.lang.Object createMenuItem(java.lang.String label, java.awt.Font font)
          Creates a menu item (used if toolBar has menu style).
 java.lang.Object createPopupMenu(java.lang.String label, java.awt.Font font)
          Creates a popup menu (used if toolBar has menu style).
 java.awt.Component createToolBar()
          Creates and initializes a new empty toolBar.
 LyActionTransmitter getActionTransmitter()
          (non-Javadoc).
 java.awt.Component getComponent()
          (non-Javadoc).
 java.lang.Object getLock()
          Get a lock on the table to prevent concurrent access on rows
 LySelectionTransmitter getSelectionTransmitter()
          This tool bar doesn't need to handle selections.
 void initialize()
          Creates the default toolbar component.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Called when the orientation of the toolBar component has changed.
 void registerActionEvents(java.lang.Object item, java.awt.event.ActionListener listener)
          Registers action events for the specified item.
 void removeComponent(LyComponent component)
          This method is not implemented yet.
 void setColor(java.lang.String color)
          Sets the background color of this toolbar component and refreshes it after the setting.
 void setContent()
          Fills the toolBar with its tools if it is not a toolbar menu.
 void setImage(java.lang.String imageName)
          Sets the _logo label icon to the specified image.
 void setOpen(boolean open)
          This method is not implemented yet.
 void showPopup(java.lang.Object popup, java.awt.Component comp, int x, int y)
          Shows the popupmenu at the specified position on the given component.
 
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

LySwingToolBar

public LySwingToolBar(LyToolBar toolBar)
Class constructor of a Tool bar object for the Swing target.

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

initialize

public void initialize()
Creates the default toolbar component.


setContent

public void setContent()
Fills the toolBar with its tools if it is not a toolbar menu.


createToolBar

public java.awt.Component createToolBar()
Creates and initializes a new empty toolBar.

Returns:
the new tool bar

setImage

public void setImage(java.lang.String imageName)
Sets the _logo label icon to the specified image.

Specified by:
setImage in interface LyGraphicalToolBar
Specified by:
setImage in interface LySetImageInterface
Parameters:
imageName - the name of the image in the environment
See Also:
LySetImageInterface.setImage(java.lang.String)

setColor

public void setColor(java.lang.String color)
Sets the background color of this toolbar component and refreshes it after the setting.

Specified by:
setColor in interface LyGraphicalToolBar
Specified by:
setColor in interface LySetColorInterface
Parameters:
color - the new background color
See Also:
LySetColorInterface.setColor(java.lang.String)

addSeparator

public void addSeparator()
Add a separator at the end of the toolBar.


addTool

public void addTool(LySwingComponent tool)
Adds a tool at the end of the toolBar.

Parameters:
tool - the tool to add

createPopupMenu

public java.lang.Object createPopupMenu(java.lang.String label,
                                        java.awt.Font font)
Creates a popup menu (used if toolBar has menu style).

Parameters:
label - the label of the menu
font - the font used to render the menu
Returns:
the popup menu for this tool bar

createMenuItem

public java.lang.Object createMenuItem(java.lang.String label,
                                       java.awt.Font font)
Creates a menu item (used if toolBar has menu style).

Parameters:
label - the label of the item
font - the font used to render the item
Returns:
the menu item for this tool bar

addItemToMenu

public void addItemToMenu(java.lang.Object item,
                          java.lang.Object menu)
Adds a menu item at the end of the specified menu.

Parameters:
item - the item to add
menu - the menu where the item is added

registerActionEvents

public void registerActionEvents(java.lang.Object item,
                                 java.awt.event.ActionListener listener)
Registers action events for the specified item.

Parameters:
item - the item where the listeners are registered
listener - the listener to add

addPopupToComponent

public void addPopupToComponent(java.lang.Object popup,
                                java.awt.Component comp)
Adds a popup menu to the specified toolBar.

Parameters:
popup - the popup menu to add
comp - the toolbar component where the popup is attached

showPopup

public void showPopup(java.lang.Object popup,
                      java.awt.Component comp,
                      int x,
                      int y)
Shows the popupmenu at the specified position on the given component.

Parameters:
popup - the popup menu to show
comp - the invoker component
x - the x coordinate in the comp space
y - the y coordinate in the comp space
See Also:
JPopupMenu.show(java.awt.Component, int, int)

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Called when the orientation of the toolBar component has changed. Resizes the parent window if needed.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

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

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)

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 tool bar doesn't need to handle selections. This method doesn't do anything.

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

setOpen

public void setOpen(boolean open)
This method is not implemented yet.

Specified by:
setOpen in interface LyGraphicalToolBar
Parameters:
open - not used here
See Also:
LyGraphicalToolBar.setOpen(boolean)

addComponent

public void addComponent(LyComponent component,
                         int pos)
This method is not implemented yet.

Specified by:
addComponent in interface LyGraphicalToolBar
Parameters:
component - not used here
pos - not used here
See Also:
LyGraphicalToolBar.addComponent(leon.view.LyComponent, int)

removeComponent

public void removeComponent(LyComponent component)
This method is not implemented yet.

Specified by:
removeComponent in interface LyGraphicalToolBar
Parameters:
component - not used here
See Also:
LyGraphicalToolBar.removeComponent(leon.view.LyComponent)

getLock

public java.lang.Object getLock()
Get a lock on the table to prevent concurrent access on rows

Specified by:
getLock in interface LyGetLockInterface
Returns:
a valid lock for synchronized()

(c) January 2013 - W4 S.A.

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