|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.nebula.widgets.nattable.layer.AbstractLayer org.eclipse.nebula.widgets.nattable.layer.AbstractIndexLayerTransform org.eclipse.nebula.widgets.nattable.grid.layer.DimensionallyDependentIndexLayer
public class DimensionallyDependentIndexLayer
A DimensionallyDependentIndexLayer is a layer whose horizontal and vertical dimensions are dependent on the horizontal and vertical dimensions of other layers. A DimensionallyDependentIndexLayer takes three constructor parameters: the horizontal layer that the DimensionallyDependentIndexLayer's horizontal dimension is linked to, the vertical layer that the DimensionallyDependentIndexLayer is linked to, and a base layer to which all non-dimensionally related ILayer method calls will be delegated to (e.g. command, event methods)
Prime examples of dimensionally dependent layers are the column header and row header layers. For example, the column header layer's horizontal dimension is linked to the body layer's horizontal dimension. This means that whatever columns are shown in the body area will also be shown in the column header area, and vice versa. Note that the column header layer maintains its own vertical dimension, however, so it's vertical layer dependency would be a separate data layer. The same is true for the row header layer, only with the vertical instead of the horizontal dimension. The constructors for the column header and row header layers would therefore look something like this:
ILayer columnHeaderLayer = new DimensionallyDependentIndexLayer( columnHeaderRowDataLayer, bodyLayer, columnHeaderRowDataLayer); ILayer rowHeaderLayer = new DimensionallyDependentIndexLayer( rowHeaderColumnDataLayer, bodyLayer, rowHeaderColumnDataLayer);
In contrast to DimensionallyDependentLayer
, this class:
IUniqueIndexLayer
;AbstractIndexLayerTransform.getCellByPosition(int, int)
which
e.g. fully supports spanned cells;IUniqueIndexLayer
too.
Field Summary |
---|
Fields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer |
---|
commandHandlers, eventHandlers, layerPainter |
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable |
---|
DOT, VALUE_SEPARATOR |
Constructor Summary | |
---|---|
protected |
DimensionallyDependentIndexLayer(IUniqueIndexLayer baseLayer)
Creates a new DimensionallyDependentIndexLayer. |
|
DimensionallyDependentIndexLayer(IUniqueIndexLayer baseLayer,
IUniqueIndexLayer horizontalLayerDependency,
IUniqueIndexLayer verticalLayerDependency)
Creates a new DimensionallyDependentIndexLayer. |
Method Summary | |
---|---|
boolean |
doCommand(ILayerCommand command)
Opportunity to respond to a command as it flows down the stack. |
IUniqueIndexLayer |
getBaseLayer()
|
int |
getColumnCount()
|
int |
getColumnIndexByPosition(int columnPosition)
Gets the underlying non-transformed column index for the given column position. |
int |
getColumnPositionByIndex(int columnIndex)
|
int |
getColumnPositionByX(int x)
Returns the column position that contains the given x coordinate. |
int |
getColumnWidthByPosition(int columnPosition)
Returns the width in pixels of the given column. |
int |
getHeight()
Returns the total height in pixels of this layer. |
ILayer |
getHorizontalLayerDependency()
|
int |
getPreferredColumnCount()
|
int |
getPreferredHeight()
|
int |
getPreferredRowCount()
|
int |
getPreferredWidth()
|
int |
getRowCount()
|
int |
getRowHeightByPosition(int rowPosition)
Returns the height in pixels of the given row. |
int |
getRowIndexByPosition(int rowPosition)
Gets the underlying non-transformed row index for the given row position. |
int |
getRowPositionByIndex(int rowIndex)
|
int |
getRowPositionByY(int y)
Returns the row position that contains the given y coordinate. |
int |
getStartXOfColumnPosition(int columnPosition)
Returns the x offset in pixels of the given column. |
int |
getStartYOfRowPosition(int rowPosition)
Returns the y offset in pixels of the given row. |
ILayer |
getVerticalLayerDependency()
|
int |
getWidth()
Returns the total width in pixels of this layer. |
boolean |
isColumnPositionResizable(int columnPosition)
|
boolean |
isRowPositionResizable(int rowPosition)
|
int |
localToUnderlyingColumnPosition(int localColumnPosition)
Convert a column position to the coordinates of the underlying layer. |
int |
localToUnderlyingRowPosition(int localRowPosition)
|
protected void |
setHorizontalLayerDependency(IUniqueIndexLayer horizontalLayerDependency)
|
protected void |
setVerticalLayerDependency(IUniqueIndexLayer verticalLayerDependency)
|
int |
underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer,
int underlyingColumnPosition)
|
int |
underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer,
int underlyingRowPosition)
|
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractIndexLayerTransform |
---|
configure, dispose, getCellByPosition, getCellPainter, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getLayerPainter, getRegionLabelsByXY, getUnderlyingLayer, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, loadState, saveState, setClientAreaProvider, setUnderlyingLayer, underlyingToLocalColumnPositions, underlyingToLocalRowPositions |
Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer |
---|
addConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, getConfigLabelAccumulator, getRegionName, handleLayerEvent, hasLayerListener, registerCommandHandler, registerCommandHandlers, registerEventHandler, registerPersistable, removeLayerListener, setConfigLabelAccumulator, setLayerPainter, setRegionName, toString, unregisterCommandHandler, unregisterEventHandler, unregisterPersistable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayer |
---|
addLayerListener, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, hasLayerListener, registerCommandHandler, registerPersistable, removeLayerListener, unregisterCommandHandler, unregisterPersistable |
Methods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayerListener |
---|
handleLayerEvent |
Constructor Detail |
---|
public DimensionallyDependentIndexLayer(IUniqueIndexLayer baseLayer, IUniqueIndexLayer horizontalLayerDependency, IUniqueIndexLayer verticalLayerDependency)
baseLayer
- the underlying base layerhorizontalLayerDependency
- the layer, the horizontal dimension is linked toverticalLayerDependency
- the layer, the vertical dimension is linked toprotected DimensionallyDependentIndexLayer(IUniqueIndexLayer baseLayer)
baseLayer
- the underlying base layerMethod Detail |
---|
protected void setHorizontalLayerDependency(IUniqueIndexLayer horizontalLayerDependency)
protected void setVerticalLayerDependency(IUniqueIndexLayer verticalLayerDependency)
public ILayer getHorizontalLayerDependency()
public ILayer getVerticalLayerDependency()
public IUniqueIndexLayer getBaseLayer()
public boolean doCommand(ILayerCommand command)
ILayer
ILayerCommand.convertToTargetLayer(ILayer)
doCommand
in interface ILayer
doCommand
in class AbstractIndexLayerTransform
command
- the command to perform
public int getColumnCount()
getColumnCount
in interface ILayer
getColumnCount
in class AbstractIndexLayerTransform
public int getPreferredColumnCount()
getPreferredColumnCount
in interface ILayer
getPreferredColumnCount
in class AbstractIndexLayerTransform
public int getColumnIndexByPosition(int columnPosition)
ILayer
getColumnIndexByPosition
in interface ILayer
getColumnIndexByPosition
in class AbstractIndexLayerTransform
columnPosition
- a column position relative to this coordinate model
public int getColumnPositionByIndex(int columnIndex)
getColumnPositionByIndex
in interface IUniqueIndexLayer
getColumnPositionByIndex
in class AbstractIndexLayerTransform
public int localToUnderlyingColumnPosition(int localColumnPosition)
ILayer
localToUnderlyingColumnPosition
in interface ILayer
localToUnderlyingColumnPosition
in class AbstractIndexLayerTransform
localColumnPosition
- column position in local (the layer's own) coordinates
public int underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer, int underlyingColumnPosition)
underlyingToLocalColumnPosition
in interface ILayer
underlyingToLocalColumnPosition
in class AbstractIndexLayerTransform
public int getWidth()
ILayer
getWidth
in interface ILayer
getWidth
in class AbstractIndexLayerTransform
public int getPreferredWidth()
getPreferredWidth
in interface ILayer
getPreferredWidth
in class AbstractIndexLayerTransform
public int getColumnWidthByPosition(int columnPosition)
ILayer
getColumnWidthByPosition
in interface ILayer
getColumnWidthByPosition
in class AbstractIndexLayerTransform
columnPosition
- the column position in this layer
public boolean isColumnPositionResizable(int columnPosition)
isColumnPositionResizable
in interface ILayer
isColumnPositionResizable
in class AbstractIndexLayerTransform
public int getColumnPositionByX(int x)
ILayer
getColumnPositionByX
in interface ILayer
getColumnPositionByX
in class AbstractIndexLayerTransform
x
- a horizontal pixel location relative to the pixel boundary of
this layer
public int getStartXOfColumnPosition(int columnPosition)
ILayer
getStartXOfColumnPosition
in interface ILayer
getStartXOfColumnPosition
in class AbstractIndexLayerTransform
columnPosition
- the column position in this layer
public int getRowCount()
getRowCount
in interface ILayer
getRowCount
in class AbstractIndexLayerTransform
public int getPreferredRowCount()
getPreferredRowCount
in interface ILayer
getPreferredRowCount
in class AbstractIndexLayerTransform
public int getRowIndexByPosition(int rowPosition)
ILayer
getRowIndexByPosition
in interface ILayer
getRowIndexByPosition
in class AbstractIndexLayerTransform
rowPosition
- a row position relative to this coordinate model
public int getRowPositionByIndex(int rowIndex)
getRowPositionByIndex
in interface IUniqueIndexLayer
getRowPositionByIndex
in class AbstractIndexLayerTransform
public int localToUnderlyingRowPosition(int localRowPosition)
localToUnderlyingRowPosition
in interface ILayer
localToUnderlyingRowPosition
in class AbstractIndexLayerTransform
public int underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer, int underlyingRowPosition)
underlyingToLocalRowPosition
in interface ILayer
underlyingToLocalRowPosition
in class AbstractIndexLayerTransform
public int getHeight()
ILayer
getHeight
in interface ILayer
getHeight
in class AbstractIndexLayerTransform
public int getPreferredHeight()
getPreferredHeight
in interface ILayer
getPreferredHeight
in class AbstractIndexLayerTransform
public int getRowHeightByPosition(int rowPosition)
ILayer
getRowHeightByPosition
in interface ILayer
getRowHeightByPosition
in class AbstractIndexLayerTransform
rowPosition
- the row position in this layer
public boolean isRowPositionResizable(int rowPosition)
isRowPositionResizable
in interface ILayer
isRowPositionResizable
in class AbstractIndexLayerTransform
public int getRowPositionByY(int y)
ILayer
getRowPositionByY
in interface ILayer
getRowPositionByY
in class AbstractIndexLayerTransform
y
- a vertical pixel location relative to the pixel boundary of
this layer
public int getStartYOfRowPosition(int rowPosition)
ILayer
getStartYOfRowPosition
in interface ILayer
getStartYOfRowPosition
in class AbstractIndexLayerTransform
rowPosition
- the row position in this layer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |