|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.view.graphic.LyGraphicalObject
leon.view.win.swing.LySwingObject
leon.view.win.swing.LySwingFieldItem
leon.view.win.swing.LySwingPanel
leon.view.win.swing.LySwingTable
public class LySwingTable
This class implements the Table object (as described in the dtd) for swing viewer.
A table allows to display a set of rows and columns containing a set of cells. It can contain a header providing information about the content of the cells of the list. It is possible to define its selection modes (simple, extended, multiple or none) and finally to indicate if horizontal and/or vertical separation lines should be drawn.
LyTable
Nested Class Summary | |
---|---|
class |
LySwingTable._TablePrinter
This class manages the print processus of the table. |
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
static int |
ARRAY_MIN_WIDTH
Min. width for arrays. |
static int |
MAX_COMPUTED_WIDTH_COUNT
Maximum limit of the width computation. |
static int |
MIN_ROW_HEIGHT
Minimum row height of the table, in pixels. |
java.lang.String |
STATUS_COLUMN_NAME
The name used for the status column. |
Constructor Summary | |
---|---|
LySwingTable(LyTable table)
Class constructor of a Table object for the Swing target. |
Method Summary | |
---|---|
void |
actionPerformed(LyActionEvent actionEvent)
(non-Javadoc). |
void |
addRow(LyRow row)
(non-Javadoc). |
void |
addRow(LyRow row,
int idx)
Adds the specified row at the given index in this table. |
void |
addRowCursor(int row,
int offset)
Sets the row of given index to have a pointing cursor. |
boolean |
areAllHeadersHidden()
Return the visibility of headers. |
void |
checkEditionStatus(LyComponent removedComponent)
|
int |
computeColumnPreferredWidth(LyJTableComponent tableComp,
int indexColumn,
java.awt.Font font,
int currentRow,
boolean useColWidth)
Computes the minimum width of a column used to display entirely its data. |
int |
computeRowHeight(LyRow row)
Compute the height of a given row. |
void |
configureColumnModel(LyJTableComponent tableComp)
Configures the TableColumnModel of the table. |
java.awt.Component |
createLyJTableComponent()
Creates the graphical table using models and renderers. |
void |
ensureColumnsWidth(int idx)
Checks if the columns are wide enough for the row specified by its index. |
void |
ensureColumnsWidth(int rowIndex,
int colIndex)
Checks if a column is wide enough for the row and column specified by their index. |
void |
free()
(non-Javadoc). |
void |
freezeColumn(int idx)
Don't do anything. |
void |
generatePdf(java.lang.String fileName)
Nothing is done in this method. |
java.awt.Component |
getComponent()
(non-Javadoc). |
java.lang.String |
getController()
(non-Javadoc). |
int |
getDataRowCount()
Gets the number of rows. |
LySwingFooter |
getFooter(int i)
Returns the footer of the column at the specified position. |
java.util.Vector<LySwingFooter> |
getFooters()
Gets the list of footers for this table. |
LySwingHeader |
getHeader(int i)
Returns the header of the column at the specified position. |
java.util.Vector<LySwingHeader> |
getHeaders()
Gets the list of headers for this table. |
int |
getIndex(LyRow row)
Gets the index of the specified row. |
java.lang.String |
getLabel()
(non-Javadoc). |
java.lang.Object |
getLock()
Get a lock on the table to prevent concurrent access on rows. |
java.awt.Dimension |
getPreferredSize()
Gets the preferred size of this table depending on its columns and rows as well as its status column and footer row, if any. |
LySwingRow |
getRow(int i)
Gets the row at the specified position. |
java.util.Hashtable<java.lang.Integer,java.lang.Integer> |
getRowCursors()
Returns the list of row indexes that have a cursor. |
LyTable.SelectionMode |
getSelectionMode()
Gets this table selection mode. |
LySelectionTransmitter |
getSelectionTransmitter()
(non-Javadoc). |
java.awt.Image |
getSortImage(boolean ascending)
Returns the header image for the ascending or descending properties. |
LyJTableStatusColumn |
getStatusColumn()
Gets the swing component for the status column. |
LyJTableStatusHeader |
getStatusHeader()
Gets the swing component for the status column header. |
LyJTableComponent |
getTableComponent()
Gets the swing table component. |
java.awt.Dimension |
getTableComponentOffset()
Returns the offset of the headers component relative to this table component. |
LyJTableFooter |
getTableFooter()
Gets the swing table footer. |
LyJTableModel |
getTableModel()
Gets the table model. |
java.lang.String |
getValue()
(non-Javadoc). |
boolean |
hasFooters()
Indicates if this table has footers. |
boolean |
hasHeaders()
Indicates if this table has headers. |
boolean |
hasStatusColumn()
Checks if this table has a status column. |
void |
hideRow(int idx,
boolean hide)
(non-Javadoc). |
void |
initialize()
Creates the table component by initializing the table model and its cell renderers, then registers the event listeners. |
void |
initRenderers()
Initialize the cell and header renderers. |
boolean |
isHierarchical()
Indicates if the table is hierarchical. |
boolean |
isHLines()
Indicates if the horizontal lines are drawn or not. |
boolean |
isIdle()
(non-Javadoc). |
boolean |
isStatusColumn(int columnIndex)
Checks if the column at the specified index is the table status column. |
boolean |
isVLines()
Indicates if the vertical lines are drawn or not. |
void |
print(LyPrintListenerInterface listener)
Invokes a print dialog. |
void |
removeRow(int idx)
Removes the row specified by its index in the table. |
void |
removeRow(LyRow row)
Removes the specified row in the table. |
void |
resetRowCursors()
Resets the list of row containing cursors. |
void |
selectAll(boolean select,
boolean updateView)
Selects or deselects all rows, columns and cells in this table without triggering selection events. |
void |
selectionPerformed(LySelectionEvent selectionEvent)
Triggers events when table cells are selected. |
void |
selectRow(int idx,
boolean select)
Selects or deselects the row specified by its index. |
void |
selectRow(LyRow row,
boolean select)
Selects or deselects the specified row in the table. |
void |
setContent()
Sets the content of the table. |
void |
setEnabled(boolean status)
Updates attribute enabled to the given value. |
void |
setFooters(LyFooters footers)
Sets sub-component footers. |
void |
setHeaders(LyHeaders headers)
Sets sub-component headers. |
void |
setIdle(boolean status)
(non-Javadoc). |
void |
setNeedResizeColumns(boolean needResizeColumns)
|
void |
setNRows(int nRows)
Updates attribute nRows to the given value. |
void |
setWaiting(boolean status)
Nothing is done in this method. |
void |
showRow(int idx)
(non-Javadoc). |
void |
swapRows(int idx1,
int idx2)
Swaps the rows at the specified indexes. |
void |
updateColumnWidth()
Computes the column width based on the first elements in columns. |
void |
updateRow(LyRow row)
Updates the specified row. |
void |
updateSelection(int index1,
int index2)
Updates the selection state of the rows from index1 to index2. |
Methods inherited from class leon.view.win.swing.LySwingPanel |
---|
setPopupMenu |
Methods inherited from class leon.view.win.swing.LySwingFieldItem |
---|
getActionTransmitter |
Methods inherited from class leon.view.win.swing.LySwingObject |
---|
getBounds, getChildrenBounds, getDefaultFrame |
Methods inherited from class leon.view.graphic.LyGraphicalObject |
---|
expand, 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 |
---|
public static final java.lang.String __VERSION
public static int MIN_ROW_HEIGHT
public static int MAX_COMPUTED_WIDTH_COUNT
public static int ARRAY_MIN_WIDTH
public java.lang.String STATUS_COLUMN_NAME
Constructor Detail |
---|
public LySwingTable(LyTable table)
table
- a TABLE component defined for every type of view targets. This table is
initialized for the swing view and filled with the default table values.Method Detail |
---|
public void initialize()
public void setContent()
public void setNeedResizeColumns(boolean needResizeColumns)
public void initRenderers()
public boolean isHierarchical()
public LyJTableComponent getTableComponent()
public LyJTableModel getTableModel()
public LyJTableFooter getTableFooter()
public LyJTableStatusColumn getStatusColumn()
public LyJTableStatusHeader getStatusHeader()
public java.awt.Dimension getTableComponentOffset()
public boolean areAllHeadersHidden()
public java.awt.Component createLyJTableComponent()
public void resetRowCursors()
public void addRowCursor(int row, int offset)
row
- the index of the rowoffset
- the offset for current rowpublic java.util.Hashtable<java.lang.Integer,java.lang.Integer> getRowCursors()
public int computeRowHeight(LyRow row)
row
- the row whose height must be computed.
public java.awt.Dimension getPreferredSize()
public boolean isStatusColumn(int columnIndex)
columnIndex
- index of the column to test
public boolean hasStatusColumn()
public void configureColumnModel(LyJTableComponent tableComp)
tableComp
- the table component to configurepublic int computeColumnPreferredWidth(LyJTableComponent tableComp, int indexColumn, java.awt.Font font, int currentRow, boolean useColWidth)
tableComp
- the table componentindexColumn
- index of the columnfont
- the font used in the given columncurrentRow
- current columnuseColWidth
- indicates whether columnWidth must be taken into account
public LySwingRow getRow(int i)
i
- the row position
public int getDataRowCount()
public LySwingHeader getHeader(int i)
i
- the position of the column
public java.util.Vector<LySwingHeader> getHeaders()
public LySwingFooter getFooter(int i)
i
- the position of the column
public java.util.Vector<LySwingFooter> getFooters()
public boolean hasHeaders()
public boolean hasFooters()
public java.awt.Image getSortImage(boolean ascending)
ascending
- the ascending property if true, else the descending property
public LyTable.SelectionMode getSelectionMode()
LyTable#SelectionMode.NONE
LyTable#SelectionMode.SINGLE
LyTable#SelectionMode.MULTIPLE
public java.lang.String getLabel()
getLabel
in interface LyGetLabelInterface
LyGetLabelInterface.getLabel()
public java.lang.String getValue()
getValue
in interface LyGetValueInterface
LyGetValueInterface.getValue()
public boolean isHLines()
LyTable.isHLines()
public boolean isVLines()
LyTable.isVLines()
public java.lang.String getController()
getController
in class LyGraphicalObject
LyGraphicalObject.getController()
public java.awt.Component getComponent()
getComponent
in interface LySwingComponent
getComponent
in class LySwingObject
LySwingComponent.getComponent()
public int getIndex(LyRow row)
row
- the row
public final boolean isIdle()
isIdle
in interface LyIsIdleInterface
LyIsIdleInterface.isIdle()
public void setIdle(boolean status)
setIdle
in interface LySetIdleInterface
status
- new idle status (LySetIdleInterface interface)LySetIdleInterface.setIdle(boolean)
public void checkEditionStatus(LyComponent removedComponent)
public void setEnabled(boolean status)
LyGraphicalTable
setEnabled
in interface LyGraphicalTable
setEnabled
in interface LySetEnabledInterface
status
- Boolean indicating if attribute enabled is set or unset.LySetEnabledInterface.setEnabled(boolean)
public void setNRows(int nRows)
LyGraphicalTable
setNRows
in interface LyGraphicalTable
nRows
- New value of nRows.LyGraphicalTable.setNRows(int)
public void setHeaders(LyHeaders headers)
LyGraphicalTable
setHeaders
in interface LyGraphicalTable
headers
- New value of headersleon.view.setinterface.LySetTableInterface#setHeaders(LyHeaders)
public void setFooters(LyFooters footers)
LyGraphicalTable
setFooters
in interface LyGraphicalTable
footers
- New value of footersleon.view.setinterface.LySetTableInterface#LyFooters(LyFooters)
public void addRow(LyRow row)
addRow
in interface LySetTableInterface
row
- the row to addLySetTableInterface.addRow(leon.view.LyRow)
public void addRow(LyRow row, int idx)
addRow
in interface LySetTableInterface
row
- the row to addidx
- the position where the row must be inserted. If this position is -1, the row is
added at the end of the rows in the table.LySetTableInterface.addRow(leon.view.LyRow, int)
public void updateColumnWidth()
public void ensureColumnsWidth(int idx)
idx
- of the row we checkpublic void ensureColumnsWidth(int rowIndex, int colIndex)
rowIndex
- index of the row we checkcolIndex
- index of the column we checkpublic void freezeColumn(int idx)
freezeColumn
in interface LySetTableInterface
idx
- this attribute is not used in this implementationLySetTableInterface.freezeColumn(int)
public void updateRow(LyRow row)
updateRow
in interface LySetTableInterface
row
- the row to updateLySetTableInterface.updateRow(leon.view.LyRow)
public void removeRow(int idx)
removeRow
in interface LySetTableInterface
idx
- the position of the row in this tableLySetTableInterface.removeRow(int)
public void removeRow(LyRow row)
removeRow
in interface LySetTableInterface
row
- the row to removeremoveRow(int)
,
LySetTableInterface.removeRow(leon.view.LyRow)
public void selectionPerformed(LySelectionEvent selectionEvent)
_skipSelectionDemand
is set.
selectionPerformed
in interface LySelectionListener
selectionEvent
- description of the selection which has occuredLySelectionListener.selectionPerformed(leon.view.event.LySelectionEvent)
public void actionPerformed(LyActionEvent actionEvent)
actionPerformed
in interface LyActionListener
LyActionListener.actionPerformed(leon.view.event.LyActionEvent)
public LySelectionTransmitter getSelectionTransmitter()
getSelectionTransmitter
in interface LyEventTransmitter
getSelectionTransmitter
in class LySwingFieldItem
null
LyEventTransmitter.getSelectionTransmitter()
public void selectAll(boolean select, boolean updateView)
selectAll
in interface LySetTableInterface
select
- new selection statusupdateView
- indicates if the view must be updated. This attribute is not used in this
implementation.JTable.selectAll()
,
JTable.clearSelection()
public void selectRow(int idx, boolean select)
selectRow
in interface LySetTableInterface
idx
- the position of the row in this tableselect
- the selection statusLySetTableInterface.selectRow(int, boolean)
public void selectRow(LyRow row, boolean select)
selectRow
in interface LySetTableInterface
row
- the row in this tableselect
- the selection statusselectRow(int, boolean)
,
LySetTableInterface.selectRow(LyRow, boolean)
public void showRow(int idx)
showRow
in interface LySetTableInterface
idx
- the index of the row to showLySetTableInterface.showRow(int)
public void hideRow(int idx, boolean hide)
hideRow
in interface LySetTableInterface
idx
- the index of the row to show or hidehide
- indicates if the row has to be shown or hidedLySetTableInterface.hideRow(int, boolean)
public void swapRows(int idx1, int idx2)
swapRows
in interface LySetTableInterface
idx1
- the position of the first row to swapidx2
- the position of the second row to swapLySetTableInterface.swapRows(int, int)
public void updateSelection(int index1, int index2)
index1
- the beginning of the selectionindex2
- the end of the selectionpublic void setWaiting(boolean status)
setWaiting
in interface LySetWaitingInterface
status
- is not used in this implementationLySetWaitingInterface.setWaiting(boolean)
public void free()
free
in interface LyGraphicalComponent
free
in interface LyFreeInterface
free
in class LyGraphicalObject
LyFreeInterface.free()
public void generatePdf(java.lang.String fileName) throws java.io.IOException
generatePdf
in interface LyPdfInterface
java.io.IOException
LyPdfInterface.generatePdf(java.lang.String)
public void print(LyPrintListenerInterface listener)
print
in interface LyPrintInterface
listener
- this attribut is not used in this implementationLySwingTable._TablePrinter
,
LyPrintInterface.print(leon.view.getinterface.LyPrintListenerInterface)
public java.lang.Object getLock()
getLock
in interface LyGetLockInterface
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |