LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingArea

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.LySwingPanel
                  extended by leon.view.win.swing.LySwingContainer
                      extended by leon.view.win.swing.LySwingArea
All Implemented Interfaces:
LyActionListener, LyEventTransmitter, LyGraphicalArea, LyGraphicalComponent, LyGraphicalContainer, LyGraphicalFieldItem, LyGraphicalPanel, LyViewComponent, LyFreeInterface, LySetBorderPanelInterface, LySetPopupMenuInterface, LySetVisibleInterface, LySetWaitingInterface, LySwingComponent

public class LySwingArea
extends LySwingContainer
implements LySwingComponent, LyGraphicalArea, LySetWaitingInterface, LySetBorderPanelInterface, LySetVisibleInterface

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

An area allows the positioning of various graphical components inside a main window or a dialog window. It can contains any type of panel as well as a title bar, a tool bar and a command bar.

See Also:
LyArea

Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LySwingArea(LyArea area)
          Class constructor of an Area object for the Swing target.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
 void addCommands(LyCommands commands)
          Initializes the commands in this area.
 void addPanel(LyPanel panel, int pos)
          (non-Javadoc).
 void addSelectBar(LySelectBar selectBar)
          Creates and adds the select bar in this area.
 void addTip()
          Creates and adds the tip label in this area if it has a title or a tool panel and if this area has a tip.
 void addTitleBar(LyTitleBar titleBar)
          Creates and adds the titlebar in this area.
 void addToolBars(java.util.Vector<LyToolBar> toolbars)
          Creates and adds the toolbars in this area.
 java.awt.GridBagConstraints buildActionConstraint(LyToolBar actions)
          Builds a contraint object for the specified toolbar.
 java.awt.GridBagConstraints buildActionConstraint(LyToolBar actions, boolean remainder)
          Builds a contraint object for the specified toolbar.
static LyDemand buildActionDemand(LyActionEvent actionEvent)
          Creates the action demand object for the specified action event.
 java.awt.GridBagConstraints buildCommandConstraint(LyCommands commands)
          Builds a contraint object for the command bar.
 java.awt.GridBagConstraints buildConstraint(LyComponent comp, LyConstraint requestedConstraint)
          Builds a contraint object for the layout of the specified label or component.
 java.awt.GridBagConstraints buildDefaultConstraint(LyComponent comp)
          Builds a contraint object for the layout of the specified label or component.
 java.awt.GridBagConstraints buildSelectBarConstraint(LySelectBar selectBar)
          Builds a contraint object for the select bar.
 java.awt.GridBagConstraints buildTitleBarConstraint(LyTitleBar titleBar)
          Builds a contraint object for a title bar.
 void checkScrollPane()
          Checks that there aren't a scrolling area alone in another scrolling area.
 java.awt.Container createInternalPanel()
          Creates and configures the internal panel.
 java.awt.Container createRootPanel()
          Creates and configures the root panel.
 java.awt.Container createScrollingArea()
          Creates and configures the scrolling area.
 void free()
          (non-Javadoc).
 java.awt.Component getComponent()
          (non-Javadoc).
 void initialize()
          Initializes the Area object and prepares all its panels.
 void insertPanel(LyPanel panel, int pos)
          Appends the specified panel at the position given inside this area.
 boolean isClientPanelScrollable()
          Determines if this area needs scrollbars.
 void removePanel(LyPanel panel)
          (non-Javadoc).
 void setBorderPanel(LyPanel panel, short position)
          Set a border panel at the given position.
 void setContent()
          Fills all the panels with the right values, if needed.
 void setLayoutInfo(java.lang.String layoutInfo)
          Updates attribute layoutInfo to the given value.
 void setOpen(boolean open)
          Updates attribute open to the given value.
 void setRedirect(java.lang.String redirect)
          (non-Javadoc)
 void setRefresh(int duration)
          Do not update the refresh value.
 void setScrollingEnabled(boolean enabled)
          Sets the scrolling property of the different panels composing this area.
 void setVisible(boolean visible)
          Sets the visibility status of this component.
 void setWaiting(boolean status)
          (non-Javadoc).
 
Methods inherited from class leon.view.win.swing.LySwingContainer
updateMinimumSize
 
Methods inherited from class leon.view.win.swing.LySwingPanel
setPopupMenu
 
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, 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
Constructor Detail

LySwingArea

public LySwingArea(LyArea area)
Class constructor of an Area object for the Swing target.

Parameters:
area - an AREA defined for every type of view targets. This area is initialized specificaly for the Swing view.
Method Detail

buildActionDemand

public static LyDemand buildActionDemand(LyActionEvent actionEvent)
Creates the action demand object for the specified action event. This action demand will be the link between the View and Controller layers.

Parameters:
actionEvent - the action event
Returns:
the action demand associated with the actionEvent

initialize

public void initialize()
Initializes the Area object and prepares all its panels.


setContent

public void setContent()
Fills all the panels with the right values, if needed.


createInternalPanel

public java.awt.Container createInternalPanel()
Creates and configures the internal panel. Initializes its display properties as well as the layout to use.

Returns:
the configured internal panel

createScrollingArea

public java.awt.Container createScrollingArea()
Creates and configures the scrolling area. Depending on the scrollable property of this area, the scrolling will be automaticaly, always or never activated. This method takes care of disabling the scrolling borders if scrolling area imbrications can be avoided.

Returns:
a scrolling area

createRootPanel

public java.awt.Container createRootPanel()
Creates and configures the root panel. This panel is composed by the _internalPanel and can be scollable. It is also composed by a titlebar, toolbars and an help tip represented as a String.

Returns:
the root panel with its sub-areas.
See Also:
LyAreaBase.getTip()

isClientPanelScrollable

public boolean isClientPanelScrollable()
Determines if this area needs scrollbars. It is not necessary to have scrollbars if there is only one panel in the area, or if it is a notice element.

Returns:
true if the area needs scrollbars

checkScrollPane

public void checkScrollPane()
Checks that there aren't a scrolling area alone in another scrolling area. Called when a panel is added or removed.


addTitleBar

public void addTitleBar(LyTitleBar titleBar)
Creates and adds the titlebar in this area.

Parameters:
titleBar - the LyComponent to add

addToolBars

public void addToolBars(java.util.Vector<LyToolBar> toolbars)
Creates and adds the toolbars in this area. The _toolBars field is null if the toolbars parameter is null, else it is a vector of all the toolbars around this area.

Parameters:
toolbars - the LyComponent to add

addTip

public void addTip()
Creates and adds the tip label in this area if it has a title or a tool panel and if this area has a tip.


addSelectBar

public void addSelectBar(LySelectBar selectBar)
Creates and adds the select bar in this area. If this area also have a command bar, the both of them are added in a new panel.

Parameters:
selectBar - the select bar to add

addCommands

public void addCommands(LyCommands commands)
Initializes the commands in this area. If this area has no toolbars in its bottom, the command bar, and the select bar if any, are added.

Parameters:
commands - the LyComponent to add

addPanel

public void addPanel(LyPanel panel,
                     int pos)
(non-Javadoc).

Specified by:
addPanel in interface LyGraphicalArea
Parameters:
panel - The panels to add to panels list.
pos - Position where the sub-component is inserted.
See Also:
LyGraphicalArea.addPanel(leon.view.LyPanel, int)

insertPanel

public void insertPanel(LyPanel panel,
                        int pos)
Appends the specified panel at the position given inside this area.

Parameters:
panel - the panel to insert
pos - position of the panel inside this container
See Also:
addPanel(leon.view.LyPanel, int)

removePanel

public void removePanel(LyPanel panel)
(non-Javadoc).

Specified by:
removePanel in interface LyGraphicalArea
Parameters:
panel - The panels to remove to panels list.
See Also:
LyGraphicalArea.removePanel(leon.view.LyPanel)

setScrollingEnabled

public void setScrollingEnabled(boolean enabled)
Sets the scrolling property of the different panels composing this area. The scrolling is enabled when the scrolling area is not already used. The same applies when it is disabled. In both cases, the _subRootPanel is modified to use the _scrollingArea or not.

Parameters:
enabled - true to enable the scrolling property, false to disable

setWaiting

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

Specified by:
setWaiting in interface LySetWaitingInterface
Parameters:
status - the new status
See Also:
LySetWaitingInterface.setWaiting(boolean)

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

buildActionConstraint

public java.awt.GridBagConstraints buildActionConstraint(LyToolBar actions)
Builds a contraint object for the specified toolbar. This constraint force the toolbar to be added at the end of this area.

Parameters:
actions - Specifies the toolbar that its constrains are built.
Returns:
the constraints of the specified toolbar
See Also:
buildActionConstraint(LyToolBar, boolean)

buildActionConstraint

public java.awt.GridBagConstraints buildActionConstraint(LyToolBar actions,
                                                         boolean remainder)
Builds a contraint object for the specified toolbar. If the toolbar actions is null, the constraint object is also null. Else, the constraint object that is returned is a GridBagConstraints that follows the toolbar properties for its filling and alignment.

Parameters:
actions - Specifies the toolbar that its constrains are built.
remainder - Specifies if the toolbar is the last component of its row or column.
Returns:
the constraints of the specified toolbar

buildTitleBarConstraint

public java.awt.GridBagConstraints buildTitleBarConstraint(LyTitleBar titleBar)
Builds a contraint object for a title bar. The titleBar object is not used, as the constraints are the same from one titlebar to another.

Parameters:
titleBar - a title bar, may be null
Returns:
the constraints of a generic title bar
See Also:
buildDefaultConstraint(LyComponent)

buildSelectBarConstraint

public java.awt.GridBagConstraints buildSelectBarConstraint(LySelectBar selectBar)
Builds a contraint object for the select bar. If the select bar is null, the returned GridBagConstraints is null. The final constraint for the specified select bar is based on its current constraints that are extended with a generic GridBagConstraints.

Parameters:
selectBar - the select bar to build its constraints
Returns:
the constraints of the specified select bar
See Also:
buildCommandConstraint(LyCommands)

buildCommandConstraint

public java.awt.GridBagConstraints buildCommandConstraint(LyCommands commands)
Builds a contraint object for the command bar. If the command bar is null, the returned GridBagConstraints is null. The final constraint for the specified command bar is based on its current constraints that are extended with a generic GridBagConstraints.

Parameters:
commands - the command bar to build its constraints
Returns:
the constraints of the specified command bar
See Also:
buildSelectBarConstraint(LySelectBar)

buildDefaultConstraint

public java.awt.GridBagConstraints buildDefaultConstraint(LyComponent comp)
Builds a contraint object for the layout of the specified label or component. The component object is not used, thus the constraints are generic from one component to another.

Parameters:
comp - a component, not used in this implementation
Returns:
the constraints of a generic component

buildConstraint

public java.awt.GridBagConstraints buildConstraint(LyComponent comp,
                                                   LyConstraint requestedConstraint)
Builds a contraint object for the layout of the specified label or component. The requested constraint is applied to the default constraint generated for every component (see buildDefaultConstraint(LyComponent)).

Parameters:
comp - the component to build its constraints
requestedConstraint - the constraints to apply on the given component
Returns:
the constraints of the specified component

actionPerformed

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

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

free

public void free()
(non-Javadoc).

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

setRefresh

public void setRefresh(int duration)
Do not update the refresh value.

Specified by:
setRefresh in interface LyGraphicalArea
Parameters:
duration - this parameter is not read
See Also:
LyGraphicalArea.setRefresh(int)

setOpen

public void setOpen(boolean open)
Description copied from interface: LyGraphicalArea
Updates attribute open to the given value.

Specified by:
setOpen in interface LyGraphicalArea
Parameters:
open - Boolean indicating if attribute open is set or unset.

setBorderPanel

public void setBorderPanel(LyPanel panel,
                           short position)
Set a border panel at the given position.

Specified by:
setBorderPanel in interface LySetBorderPanelInterface
Parameters:
panel - the border panel.
position - Either NORTH, SOUTH, EAST or WEST position.

setVisible

public void setVisible(boolean visible)
Sets the visibility status of this component.

Specified by:
setVisible in interface LySetVisibleInterface
Parameters:
status - New visibility status.

setRedirect

public void setRedirect(java.lang.String redirect)
(non-Javadoc)

Specified by:
setRedirect in interface LyGraphicalArea
Parameters:
redirect - New value of redirect.
See Also:
LyGraphicalArea.setRedirect(java.lang.String)

setLayoutInfo

public void setLayoutInfo(java.lang.String layoutInfo)
Description copied from interface: LyGraphicalArea
Updates attribute layoutInfo to the given value.

Specified by:
setLayoutInfo in interface LyGraphicalArea
Parameters:
layoutInfo - New value of layoutInfo.

(c) January 2013 - W4 S.A.

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