LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingCell

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingCell
All Implemented Interfaces:
LyGetIdInterface, LyGetLabelInterface, LyGraphicalCell, LyGraphicalComponent, LyViewComponent, LyFreeInterface, LySetColorInterface, LySetEditableInterface, LySetImageInterface, LySetLabelInterface, LySetSelectedInterface, LySwingComponent

public class LySwingCell
extends LySwingObject
implements LySetLabelInterface, LySetImageInterface, LyGetLabelInterface, LyGetIdInterface, LyGraphicalCell

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

See Also:
LyCell

Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LySwingCell(LyCell cell)
          Class constructor of a cell object for the Swing target.
 
Method Summary
 void addCell(LyCell cell, int pos)
          This cell cannot have sub-cells, thus this method does not do anything.
 java.awt.Color getColor()
          Gets the background color of this cell.
 java.awt.Component getComponent()
          (non-Javadoc).
 java.awt.Image getEditionImage()
          Returns the image for an editable cell.
 java.awt.Font getFont()
          Gets the font used for this cell.
 java.awt.Color getFontColor()
          Gets the background color of this cell.
 java.lang.String getId()
          Return current component identification (LyGetIdInterface interface).
 java.awt.Image getImage()
          Returns the image of this cell.
 java.lang.String getLabel()
          Accessor to the label (LyGetLabelInterface interface).
 LyRow getParentRow()
          Returns the parent row component.
 LyTable getParentTable()
          Returns the parent table component.
 java.lang.String getTooltip()
          Returns the tooltip of this cell.
 int getWidth(java.awt.FontMetrics fm)
          Returns the width of this cell.
 void initialize()
          Initializes this object.
 void removeCell(LyCell cell)
          This cell cannot have sub-cells, thus this method does not do anything.
 void setBottomBorderColor(java.lang.String bottomBorderColor)
          Updates attribute bottomBorderColor to the given value.
 void setBottomLeftImage(java.lang.String bottomLeftImage)
          Updates attribute bottomLeftImage to the given value.
 void setBottomRightImage(java.lang.String bottomRightImage)
          Updates attribute bottomRightImage to the given value.
 void setColor(java.lang.String color)
          Updates attribute color to the given value.
 void setComponent(java.awt.Component c)
          (non-Javadoc).
 void setContent()
          Sets the content of this object.
 void setEditable(boolean editable)
          Updates attribute editable to the given value.
 void setFont(java.lang.String font)
           
 void setImage(java.lang.String image)
          (Modification) Accessor (LySetLabelInterface interface).
 void setLabel(java.lang.String label)
          Sets the label of the component.
 void setLeftBorderColor(java.lang.String leftBorderColor)
          Updates attribute leftBorderColor to the given value.
 void setObjectId(java.lang.String objectId)
          The objectId of this object cannot change.
 void setRightBorderColor(java.lang.String rightBorderColor)
          Updates attribute rightBorderColor to the given value.
 void setSelected(boolean selected)
          Updates attribute selected to the given value.
 void setTooltip(java.lang.String tooltip)
          Updates attribute tooltip to the given value.
 void setTopBorderColor(java.lang.String topBorderColor)
          Updates attribute topBorderColor to the given value.
 void setTopLeftImage(java.lang.String topLeftImage)
          Updates attribute topLeftImage to the given value.
 void setTopRightImage(java.lang.String topRightImage)
          Updates attribute topRightImage to the given value.
 
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

LySwingCell

public LySwingCell(LyCell cell)
Class constructor of a cell object for the Swing target.

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

initialize

public void initialize()
Initializes this object. Sets its images, fonts, tooltip and color.


setContent

public void setContent()
Sets the content of this object. The cell is empty by default, so nothing is done here.


setLabel

public void setLabel(java.lang.String label)
Description copied from interface: LySetLabelInterface
Sets the label of the component.

Specified by:
setLabel in interface LyGraphicalCell
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - new label

setObjectId

public void setObjectId(java.lang.String objectId)
The objectId of this object cannot change. The specified objectId parameter is not used.

Specified by:
setObjectId in interface LyGraphicalCell
Parameters:
objectId - New value of objectId.

getLabel

public java.lang.String getLabel()
Description copied from interface: LyGetLabelInterface
Accessor to the label (LyGetLabelInterface interface).

Specified by:
getLabel in interface LyGetLabelInterface

getWidth

public int getWidth(java.awt.FontMetrics fm)
Returns the width of this cell.

Parameters:
fm - the font metrics used to compute text width.
Returns:
the preferred width of the cell.

setTooltip

public void setTooltip(java.lang.String tooltip)
Description copied from interface: LyGraphicalCell
Updates attribute tooltip to the given value.

Specified by:
setTooltip in interface LyGraphicalCell
Parameters:
tooltip - New value of tooltip.

getTooltip

public java.lang.String getTooltip()
Returns the tooltip of this cell.

Returns:
the tooltip associated with this cell
See Also:
setTooltip(String)

setImage

public void setImage(java.lang.String image)
Description copied from interface: LySetImageInterface
(Modification) Accessor (LySetLabelInterface interface).

Specified by:
setImage in interface LyGraphicalCell
Specified by:
setImage in interface LySetImageInterface
Parameters:
image - of the image in the properties or image path

getImage

public java.awt.Image getImage()
Returns the image of this cell.

Returns:
the image displayed by this cell
See Also:
setImage(String)

getEditionImage

public java.awt.Image getEditionImage()
Returns the image for an editable cell.

Returns:
the edition image

getId

public java.lang.String getId()
Description copied from interface: LyGetIdInterface
Return current component identification (LyGetIdInterface interface).

Specified by:
getId in interface LyGetIdInterface

getColor

public java.awt.Color getColor()
Gets the background color of this cell.

Returns:
the color used for the background of the cell
See Also:
setColor(String)

getFontColor

public java.awt.Color getFontColor()
Gets the background color of this cell.

Returns:
the color used for the background of the cell
See Also:
setColor(String)

setColor

public void setColor(java.lang.String color)
Description copied from interface: LyGraphicalCell
Updates attribute color to the given value.

Specified by:
setColor in interface LyGraphicalCell
Specified by:
setColor in interface LySetColorInterface
Parameters:
color - New value of color.

setBottomBorderColor

public void setBottomBorderColor(java.lang.String bottomBorderColor)
Description copied from interface: LyGraphicalCell
Updates attribute bottomBorderColor to the given value.

Specified by:
setBottomBorderColor in interface LyGraphicalCell
Parameters:
bottomBorderColor - New value of bottomBorderColor.

setLeftBorderColor

public void setLeftBorderColor(java.lang.String leftBorderColor)
Description copied from interface: LyGraphicalCell
Updates attribute leftBorderColor to the given value.

Specified by:
setLeftBorderColor in interface LyGraphicalCell
Parameters:
leftBorderColor - New value of leftBorderColor.

setRightBorderColor

public void setRightBorderColor(java.lang.String rightBorderColor)
Description copied from interface: LyGraphicalCell
Updates attribute rightBorderColor to the given value.

Specified by:
setRightBorderColor in interface LyGraphicalCell
Parameters:
rightBorderColor - New value of rightBorderColor.

setTopBorderColor

public void setTopBorderColor(java.lang.String topBorderColor)
Description copied from interface: LyGraphicalCell
Updates attribute topBorderColor to the given value.

Specified by:
setTopBorderColor in interface LyGraphicalCell
Parameters:
topBorderColor - New value of topBorderColor.

setBottomLeftImage

public void setBottomLeftImage(java.lang.String bottomLeftImage)
Description copied from interface: LyGraphicalCell
Updates attribute bottomLeftImage to the given value.

Specified by:
setBottomLeftImage in interface LyGraphicalCell
Parameters:
bottomLeftImage - New value of bottomLeftImage.

setBottomRightImage

public void setBottomRightImage(java.lang.String bottomRightImage)
Description copied from interface: LyGraphicalCell
Updates attribute bottomRightImage to the given value.

Specified by:
setBottomRightImage in interface LyGraphicalCell
Parameters:
bottomRightImage - New value of bottomRightImage.

setTopLeftImage

public void setTopLeftImage(java.lang.String topLeftImage)
Description copied from interface: LyGraphicalCell
Updates attribute topLeftImage to the given value.

Specified by:
setTopLeftImage in interface LyGraphicalCell
Parameters:
topLeftImage - New value of topLeftImage.

setTopRightImage

public void setTopRightImage(java.lang.String topRightImage)
Description copied from interface: LyGraphicalCell
Updates attribute topRightImage to the given value.

Specified by:
setTopRightImage in interface LyGraphicalCell
Parameters:
topRightImage - New value of topRightImage.

setEditable

public void setEditable(boolean editable)
Description copied from interface: LyGraphicalCell
Updates attribute editable to the given value.

Specified by:
setEditable in interface LyGraphicalCell
Specified by:
setEditable in interface LySetEditableInterface
Parameters:
editable - Boolean indicating if attribute editable is set or unset.

setSelected

public void setSelected(boolean selected)
Description copied from interface: LyGraphicalCell
Updates attribute selected to the given value.

Specified by:
setSelected in interface LyGraphicalCell
Specified by:
setSelected in interface LySetSelectedInterface
Parameters:
selected - Boolean indicating if attribute selected is set or unset.

setFont

public void setFont(java.lang.String font)

getFont

public java.awt.Font getFont()
Gets the font used for this cell.

Returns:
the cell font
See Also:
setFont(String)

addCell

public void addCell(LyCell cell,
                    int pos)
This cell cannot have sub-cells, thus this method does not do anything.

Specified by:
addCell in interface LyGraphicalCell
Parameters:
cell - The cells to add to cells list.
pos - Position where the sub-component is inserted.
See Also:
removeCell(LyCell), LyGraphicalCell.addCell(LyCell, int)

removeCell

public void removeCell(LyCell cell)
This cell cannot have sub-cells, thus this method does not do anything.

Specified by:
removeCell in interface LyGraphicalCell
Parameters:
cell - The cells to remove to cells list.
See Also:
addCell(LyCell, int), LyGraphicalCell.removeCell(LyCell)

getParentRow

public LyRow getParentRow()
Returns the parent row component.

Returns:
the parent row component

getParentTable

public LyTable getParentTable()
Returns the parent table component.

Returns:
the parent table component

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

setComponent

public void setComponent(java.awt.Component c)
(non-Javadoc).

See Also:
LySwingComponent.getComponent()

(c) January 2013 - W4 S.A.

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