LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingTabs

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.LySwingTabs
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, javax.swing.event.ChangeListener, LyActionListener, LyEventTransmitter, LyGraphicalComponent, LyGraphicalContainer, LyGraphicalFieldItem, LyGraphicalPanel, LyGraphicalTabs, LyViewComponent, LyFreeInterface, LySetPopupMenuInterface, LySetTabInterface, LySwingComponent

public class LySwingTabs
extends LySwingContainer
implements LySwingComponent, javax.swing.event.ChangeListener, LyGraphicalTabs, LySetTabInterface, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

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

A container of tab type allows to display different panels in the same graphical area, only one panel being visible at once. Each panel is actually contained in a tab, the container being made up of a set of tabs. The displaying that corresponds to a container of tab type must present two areas: a first one showing the names of the different tabs and a second one allowing to display the panels.

See Also:
LyTabs

Field Summary
static java.lang.String __VERSION
           
static float DARKER_FACTOR
          Default darkening factor for uneselected tabs.
 
Constructor Summary
LySwingTabs(LyTabs tabs)
          Class constructor of a Tabs object for the Swing target.
 
Method Summary
 void addPanel(LySwingComponent component, int pos, java.lang.String label, java.awt.Color bgcol, java.awt.Color fgcol)
          Associates a panel to the specified tab.
 void addPanel(LySwingComponent component, int pos, java.lang.String label, java.lang.String image, java.awt.Color bgcol, java.awt.Color fgcol)
          Associates a panel to the specified tab.
 void addPanel(LySwingComponent component, java.lang.String label, java.awt.Color bgcol, java.awt.Color fgcol)
          Associates a panel to the specified tab.
 void addTab(LyTab tab, int pos)
          (non-Javadoc).
 LyJTabbedPane createTabPanel(java.awt.Color color)
          Creates the tabbed panel.
 int[] getChildrenBounds(LyComponent children)
          (non-Javadoc)
 java.awt.Component getComponent()
          (non-Javadoc).
 void initialize()
          Initializes the tab panel component with the default colors.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void removePanel(LySwingComponent component)
          Removes a panel from the tabbed panel.
 void removeTab(LyTab tab)
          (non-Javadoc).
 void setContent()
          Fills this tabs with their associated panels and registers their event listeners.
 void setEnabled(java.lang.String tabId, boolean enabled)
          (non-Javadoc).
 void setLabel(java.lang.String tabId, java.lang.String newLabel)
          This method allows to change the label of a specific tab.
 void setSelectedTab(java.lang.String tabId)
          Selects the specified tab in this component.
 void stateChanged(javax.swing.event.ChangeEvent e)
          (non-Javadoc).
 
Methods inherited from class leon.view.win.swing.LySwingContainer
actionPerformed, free, 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, 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
free, getViewComponent
 

Field Detail

__VERSION

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

DARKER_FACTOR

public static float DARKER_FACTOR
Default darkening factor for uneselected tabs.

Constructor Detail

LySwingTabs

public LySwingTabs(LyTabs tabs)
Class constructor of a Tabs object for the Swing target.

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

initialize

public void initialize()
Initializes the tab panel component with the default colors.


setContent

public void setContent()
Fills this tabs with their associated panels and registers their event listeners.


createTabPanel

public LyJTabbedPane createTabPanel(java.awt.Color color)
Creates the tabbed panel.

Parameters:
color - the background color
Returns:
the new tab panel

setSelectedTab

public void setSelectedTab(java.lang.String tabId)
Selects the specified tab in this component.

Specified by:
setSelectedTab in interface LyGraphicalTabs
Parameters:
tabId - the id or label of the tab that must be selected
See Also:
selectTab(String), LyGraphicalTabs.setSelectedTab(java.lang.String)

addTab

public void addTab(LyTab tab,
                   int pos)
(non-Javadoc).

Specified by:
addTab in interface LyGraphicalTabs
Parameters:
tab - The tabs to add to tabs list.
pos - Position where the sub-component is inserted.
See Also:
LyGraphicalTabs.addTab(leon.view.LyTab, int)

removeTab

public void removeTab(LyTab tab)
(non-Javadoc).

Specified by:
removeTab in interface LyGraphicalTabs
Parameters:
tab - The tabs to remove to tabs list.
See Also:
LyGraphicalTabs.removeTab(leon.view.LyTab)

addPanel

public void addPanel(LySwingComponent component,
                     java.lang.String label,
                     java.awt.Color bgcol,
                     java.awt.Color fgcol)
Associates a panel to the specified tab.

Parameters:
component - the panel to add
label - the name of the panel tab
bgcol - the background color of the panel
fgcol - the foreground color of the panel

addPanel

public void addPanel(LySwingComponent component,
                     int pos,
                     java.lang.String label,
                     java.awt.Color bgcol,
                     java.awt.Color fgcol)
Associates a panel to the specified tab.

Parameters:
component - the panel to add
label - the name of the panel tab
bgcol - the background color of the panel
fgcol - the foreground color of the panel

addPanel

public void addPanel(LySwingComponent component,
                     int pos,
                     java.lang.String label,
                     java.lang.String image,
                     java.awt.Color bgcol,
                     java.awt.Color fgcol)
Associates a panel to the specified tab.

Parameters:
component - the panel to add
label - the name of the panel tab
bgcol - the background color of the panel
fgcol - the foreground color of the panel

removePanel

public void removePanel(LySwingComponent component)
Removes a panel from the tabbed panel.

Parameters:
component - the panel to remove

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
(non-Javadoc).

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
See Also:
ChangeListener.stateChanged(javax.swing.event.ChangeEvent)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

setEnabled

public void setEnabled(java.lang.String tabId,
                       boolean enabled)
(non-Javadoc).

Specified by:
setEnabled in interface LySetTabInterface
enabled - true if the tab is enabled, false otherwise
See Also:
LySetTabInterface.setEnabled(java.lang.String, boolean)

setLabel

public void setLabel(java.lang.String tabId,
                     java.lang.String newLabel)
This method allows to change the label of a specific tab.

Specified by:
setLabel in interface LySetTabInterface
Parameters:
tabId - the label or identifier of the tab to be changed
newLabel - the new label of the tab to be changed

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

getChildrenBounds

public int[] getChildrenBounds(LyComponent children)
(non-Javadoc)

Overrides:
getChildrenBounds in class LySwingObject
Returns:
an array of 4 integers (x position, y position, width, height) representing the position and size of given sub component.
See Also:
LySwingObject.getChildrenBounds(leon.view.LyComponent)

(c) January 2013 - W4 S.A.

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