LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingRow

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingRow
All Implemented Interfaces:
LyGetIdInterface, LyGraphicalComponent, LyGraphicalRow, LyViewComponent, LyFreeInterface, LySetColorInterface, LySetHiddenInterface, LySetImageInterface, LySetLabelInterface, LySwingComponent

public class LySwingRow
extends LySwingObject
implements LyGetIdInterface, LySetColorInterface, LySetImageInterface, LyGraphicalRow

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

A row of a list is a set of non-empty cells (or input fields). It is possible to indicate if the row is selected, if an image is assigned to it and if a tooltip is associated to it.

See Also:
LyRow

Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LySwingRow(LyRow row)
          Class constructor of a Row object for the Swing target.
 
Method Summary
 void addComponent(LyComponent component, int pos)
          Inserts a sub-component component at given position.
 java.lang.Object getCell(int i)
          Gets the cell element at the specified index.
 java.util.Vector<java.lang.Object> getCells()
          Gets the vector of the LySwingCell objects.
 java.util.Vector<java.lang.Object> getCells(boolean reset)
          Gets the vector of the LySwingCell objects.
 java.awt.Image getClosedRowImage()
          Returns the image for a closed row.
 java.awt.Color getColor()
          Gets the row color.
 int getDepth()
          Returns the depth of the row in the table when hierarchical.
 java.lang.String getId()
          Return current component identification (LyGetIdInterface interface).
 java.awt.Image getImage()
          Gets the row image.
 java.awt.Image getOpenRowImage()
          Returns the image for an open row.
 LyTable getParentTable()
          Returns the parent table component.
 java.lang.String getToolTip()
          Gets the translated tooltip of this row.
 void initialize()
          Sets the initial image and color parameters for this row.
 boolean isSelected()
          Gets the selected state of this row.
 boolean isSensitive()
          Indicates whether this row is sensitive or not.
 void removeComponent(LyComponent component)
          Removes a sub-component component.
 void setBorderColor(java.lang.String color)
          (non-Javadoc)
 void setBorderHeight(int height)
          (non-Javadoc)
 void setColor(java.lang.String color)
          Sets the color of this row.
 void setColor(java.lang.String color, boolean update)
          Sets the color of this row.
 void setContent()
          Sets the content of this row.
 void setHidden(boolean hidden)
          (non-Javadoc).
 void setImage(java.lang.String image)
          Sets the image displayed by this row.
 void setIndex(java.lang.String index)
          Updates attribute index to the given value.
 void setLabel(java.lang.String label)
          Updates the label for current row.
 void setOpen(boolean open)
          The open property is already set when this method is called and only the swing table is updated.
 void setResetRowComponents(boolean reset)
          Indicates if a reset of the row may be performed.
 void setTooltip(java.lang.String tooltip)
          The tooltip is already set when this method is called and only the swing component of the row is updated.
 
Methods inherited from class leon.view.win.swing.LySwingObject
getBounds, getChildrenBounds, getComponent, 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

LySwingRow

public LySwingRow(LyRow row)
Class constructor of a Row object for the Swing target.

Parameters:
row - a ROW component defined for every type of view targets. This row is initialized for the swing view and filled with its default values.
Method Detail

initialize

public void initialize()
Sets the initial image and color parameters for this row.


setContent

public void setContent()
Sets the content of this row. By default, a row is empty and this method doesn't do anything.


getColor

public java.awt.Color getColor()
Gets the row color.

Returns:
the color of the row
See Also:
setColor(String)

getImage

public java.awt.Image getImage()
Gets the row image.

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

setImage

public void setImage(java.lang.String image)
Sets the image displayed by this row. The row is updated after the image is set.

Specified by:
setImage in interface LyGraphicalRow
Specified by:
setImage in interface LySetImageInterface
Parameters:
image - a string that identifies the image (a key or a path)
See Also:
getImage(), setImage(String, boolean), LySetImageInterface.setImage(java.lang.String)

setLabel

public void setLabel(java.lang.String label)
Updates the label for current row.

Specified by:
setLabel in interface LyGraphicalRow
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - the label for this row
See Also:
LyGraphicalRow.setTooltip(java.lang.String)

setIndex

public void setIndex(java.lang.String index)
Description copied from interface: LyGraphicalRow
Updates attribute index to the given value.

Specified by:
setIndex in interface LyGraphicalRow
Parameters:
index - New value of index.
See Also:
leon.view.setinterface.LyGraphicalRow#setIndex(java.lang.String)

setTooltip

public void setTooltip(java.lang.String tooltip)
The tooltip is already set when this method is called and only the swing component of the row is updated.

Specified by:
setTooltip in interface LyGraphicalRow
Parameters:
tooltip - the tooltip for this row, not used in this implementation
See Also:
LyGraphicalRow.setTooltip(java.lang.String)

isSensitive

public boolean isSensitive()
Indicates whether this row is sensitive or not.


getToolTip

public java.lang.String getToolTip()
Gets the translated tooltip of this row.

Returns:
the tooltip of this row

setColor

public void setColor(java.lang.String color)
Sets the color of this row.

Specified by:
setColor in interface LyGraphicalRow
Specified by:
setColor in interface LySetColorInterface
Parameters:
color - a string that identifies the color (a key or a path)
See Also:
getColor(), LySetColorInterface.setColor(String)

setColor

public void setColor(java.lang.String color,
                     boolean update)
Sets the color of this row.

Parameters:
color - a string that identifies the color (a key or a path)
update - indicates if the table must be updated (by calling the updateTable method)
See Also:
getColor(), LySetColorInterface.setColor(String)

setOpen

public void setOpen(boolean open)
The open property is already set when this method is called and only the swing table is updated.

Specified by:
setOpen in interface LyGraphicalRow
Parameters:
open - the open property, not used in this implementation
See Also:
LyGraphicalRow.setOpen(boolean)

setHidden

public void setHidden(boolean hidden)
(non-Javadoc).

Specified by:
setHidden in interface LyGraphicalRow
Specified by:
setHidden in interface LySetHiddenInterface
Parameters:
hidden - Boolean indicating if attribute hidden is set or unset.
See Also:
LySetHiddenInterface.setHidden(boolean)

setBorderHeight

public void setBorderHeight(int height)
(non-Javadoc)

Specified by:
setBorderHeight in interface LyGraphicalRow
Parameters:
height - New value of borderHeight.
See Also:
LyGraphicalRow.setBorderHeight(int)

setBorderColor

public void setBorderColor(java.lang.String color)
(non-Javadoc)

Specified by:
setBorderColor in interface LyGraphicalRow
Parameters:
color - New value of borderColor.
See Also:
LyGraphicalRow.setBorderColor(String)

addComponent

public void addComponent(LyComponent component,
                         int pos)
Inserts a sub-component component at given position.

Specified by:
addComponent in interface LyGraphicalRow
Parameters:
component - The component to add to components list.
pos - Position where the sub-component is inserted.

removeComponent

public void removeComponent(LyComponent component)
Removes a sub-component component.

Specified by:
removeComponent in interface LyGraphicalRow
Parameters:
component - The component to remove to components list.

setResetRowComponents

public void setResetRowComponents(boolean reset)
Indicates if a reset of the row may be performed.

Parameters:
reset - true if a reset may be performed, false otherwise.

getId

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

Specified by:
getId in interface LyGetIdInterface

isSelected

public boolean isSelected()
Gets the selected state of this row.

Returns:
true if the row is selected, false otherwise

getCell

public java.lang.Object getCell(int i)
Gets the cell element at the specified index.

Parameters:
i - the position of the cell in this row
Returns:
the cell at position i. Builds the vector cells if needed. The content is usually a LySwingCell but might be a LySwingFormField for editable tables.

getCells

public java.util.Vector<java.lang.Object> getCells()
Gets the vector of the LySwingCell objects. Builds the vector if needed.

Returns:
the list of cells of this row

getCells

public java.util.Vector<java.lang.Object> getCells(boolean reset)
Gets the vector of the LySwingCell objects. Builds the vector if needed.

Parameters:
reset - indicates if the list of cells must be rebuilt.
Returns:
the list of cells of this row

getDepth

public int getDepth()
Returns the depth of the row in the table when hierarchical.

Returns:
the depth of the row

getOpenRowImage

public java.awt.Image getOpenRowImage()
Returns the image for an open row.

Returns:
the open row image

getClosedRowImage

public java.awt.Image getClosedRowImage()
Returns the image for a closed row.

Returns:
the closed row image

getParentTable

public LyTable getParentTable()
Returns the parent table component.

Returns:
the parent table component

(c) January 2013 - W4 S.A.

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