DESY ACOP Beans Home

de.desy.acop.displayers.table
Class AcopTableColumn

java.lang.Object
  extended by de.desy.acop.displayers.table.AcopTableColumn
All Implemented Interfaces:
DataConsumer
Direct Known Subclasses:
AcopBitTableColumn, AcopNumericTableColumn, AcopStringTableColumn

public abstract class AcopTableColumn
extends java.lang.Object
implements DataConsumer

AcopTableColumn is a DataConsumer which uses TableCells for displaying values. AcopTableColumn can be used in combination with AcopTable and can represent a single column in the table.

Author:
Jaka Bobnar, Cosylab
See Also:
AcopTable

Field Summary
protected  TableCell[] cells
           
protected  java.util.HashMap<java.lang.String,java.lang.Object> characteristics
           
protected  DataState dataState
           
protected  AcopTableParameters displayerParameters
           
protected  int rowCount
           
protected  AcopTable table
           
 
Constructor Summary
AcopTableColumn()
          Constructs a new AcopTableColumn
AcopTableColumn(AcopTable table, java.lang.String uniqueName, java.lang.String shortName)
          Constructs a new AcopTableColumn.
 
Method Summary
 void addTableColumnListener(TableColumnListener l)
          Adds a TableColumnListener which receives notifications when certain column values changed.
 void destroy()
          Destroys this column and releases any resource associated with it.
protected  void fireColumnChanged()
           
 java.lang.Class<?> getColumnClass()
          Returns the class of the objects that this column presents.
 DataConsumer getDataConsumer(java.lang.Class type)
           Returns data consumer for requested data consumer type.
 DataState getDataState()
          Returns the current data state of this column.
 DataConsumer getDefaultDataConsumer()
          Returns the implementation of default consumer type supported by this data consumer.
 AcopTableParameters getDisplayerParameters()
          Returns the displayer parameters associated with this column.
 java.lang.String getHeaderName()
          Returns the name that is printed in the table header.
 java.lang.String getName()
          Returns name of this data consumer.
 int getRowCount()
          Returns the number of rows.
abstract  java.lang.Object getValue(int rowIndex)
          Returns the value at specified row.
 void removeTableColumnListener(TableColumnListener l)
          Removes a TableColumnListener.
 void setCharacteristics(java.util.Map characteristics)
          Sets new dynamic value characteristics to this data consumer.
protected  void setCharacteristicsOnCell(TableCell cell)
           
protected  void setDataStateOnCell(TableCell cell)
           
 void setDisplayerParameters(AcopTableParameters displayerParameters)
          Sets the displayer parameters that specify the connection point and look of the column.
 void setRowCount(int rowCount)
          Sets the number of rows.
 void updateDataState(DataState state)
          Push data state (quality) update change for dynamic value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cosylab.gui.displayers.DataConsumer
getSupportedCharacteristics, getSupportedConsumerTypes
 

Field Detail

table

protected AcopTable table

displayerParameters

protected AcopTableParameters displayerParameters

dataState

protected DataState dataState

cells

protected TableCell[] cells

rowCount

protected int rowCount

characteristics

protected java.util.HashMap<java.lang.String,java.lang.Object> characteristics
Constructor Detail

AcopTableColumn

public AcopTableColumn()
Constructs a new AcopTableColumn


AcopTableColumn

public AcopTableColumn(AcopTable table,
                       java.lang.String uniqueName,
                       java.lang.String shortName)
Constructs a new AcopTableColumn.

Parameters:
table - parent table
uniqueName - unique name of the column
shortName - short name of the column
Method Detail

getName

public java.lang.String getName()
Description copied from interface: DataConsumer
Returns name of this data consumer.

Specified by:
getName in interface DataConsumer
Returns:
the name of this data consumer

getHeaderName

public java.lang.String getHeaderName()
Returns the name that is printed in the table header. This is the short name of the column.

Returns:
the header name

getColumnClass

public java.lang.Class<?> getColumnClass()
Returns the class of the objects that this column presents.

Returns:
column class

getValue

public abstract java.lang.Object getValue(int rowIndex)
Returns the value at specified row.

Parameters:
rowIndex -
Returns:

setRowCount

public void setRowCount(int rowCount)
Sets the number of rows. When update is received only the as many rows as specified here will be updated to avoid to avoid unnecessary overload. Counting starts at the first (most top) row.

Parameters:
rowCount - new number of rows

getRowCount

public int getRowCount()
Returns the number of rows.

Returns:
number of rows in the column

getDataConsumer

public DataConsumer getDataConsumer(java.lang.Class type)
Description copied from interface: DataConsumer

Returns data consumer for requested data consumer type. If this data consumer does not support required data consumer, null is returned.

If this data cosnumer does not support specific data consumer type, then it means, that it is not desirable to cast data of that type to any by this consumer supported data consumer types.

Specified by:
getDataConsumer in interface DataConsumer
Parameters:
type - Class of specific data consumer (e.g. DoubleConsumer)
Returns:
implementation of required data consumer or null if not supported

getDefaultDataConsumer

public DataConsumer getDefaultDataConsumer()
Description copied from interface: DataConsumer
Returns the implementation of default consumer type supported by this data consumer.

Specified by:
getDefaultDataConsumer in interface DataConsumer
Returns:
the implementation of default consumer type supported by this data consumer

updateDataState

public void updateDataState(DataState state)
Description copied from interface: DataConsumer
Push data state (quality) update change for dynamic value. Usually called by data source.

Specified by:
updateDataState in interface DataConsumer
Parameters:
state - new data state(quality) descriptor

setCharacteristics

public void setCharacteristics(java.util.Map characteristics)
Description copied from interface: DataConsumer
Sets new dynamic value characteristics to this data consumer. This is usually called only at initializaation, before first data state or value is updated. Usually carries characteristics such as value minimum or maximum. Name and meaning of atributes is defined with contract betwean data consumer and source implementation.

Specified by:
setCharacteristics in interface DataConsumer
Parameters:
characteristics - the Map with attri

destroy

public void destroy()
Destroys this column and releases any resource associated with it.


addTableColumnListener

public void addTableColumnListener(TableColumnListener l)
Adds a TableColumnListener which receives notifications when certain column values changed.

Parameters:
l -

removeTableColumnListener

public void removeTableColumnListener(TableColumnListener l)
Removes a TableColumnListener.

Parameters:
l -

fireColumnChanged

protected void fireColumnChanged()

getDataState

public DataState getDataState()
Returns the current data state of this column.

Returns:
the data state

setCharacteristicsOnCell

protected void setCharacteristicsOnCell(TableCell cell)

setDataStateOnCell

protected void setDataStateOnCell(TableCell cell)

getDisplayerParameters

public AcopTableParameters getDisplayerParameters()
Returns the displayer parameters associated with this column.

Returns:
the parameters

setDisplayerParameters

public void setDisplayerParameters(AcopTableParameters displayerParameters)
Sets the displayer parameters that specify the connection point and look of the column.

Parameters:
displayerParameters - the parameters


Copyright © 2010. All Rights Reserved.