|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.nebula.widgets.nattable.layer.AbstractLayer
org.eclipse.nebula.widgets.nattable.layer.CompositeLayer
public class CompositeLayer
A composite layer is a layer that is made up of a number of underlying child layers. This class assumes that the child layers are laid out in a regular grid pattern where the child layers in each composite row all have the same number of rows and the same height, and the child layers in each composite column each have the same number of columns and the same width.
| Nested Class Summary | |
|---|---|
protected class |
CompositeLayer.CompositeLayerPainter
|
| 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 | |
|---|---|
CompositeLayer(int layoutXCount,
int layoutYCount)
|
|
| Method Summary | |
|---|---|
void |
addConfigLabelAccumulatorForRegion(String regionName,
IConfigLabelAccumulator configLabelAccumulator)
Adds the configLabelAccumulator to the existing label accumulators. |
void |
configure(ConfigRegistry configRegistry,
UiBindingRegistry uiBindingRegistry)
Every layer gets this call back, starting at the top of the stack. |
void |
dispose()
|
boolean |
doCommand(ILayerCommand command)
Opportunity to respond to a command as it flows down the stack. |
protected boolean |
doCommandOnChildLayers(ILayerCommand command)
|
org.eclipse.swt.graphics.Rectangle |
getBoundsByPosition(int compositeColumnPosition,
int compositeRowPosition)
Calculates the bounds in pixel for the given cell position. |
ILayerCell |
getCellByPosition(int compositeColumnPosition,
int compositeRowPosition)
|
ICellPainter |
getCellPainter(int compositeColumnPosition,
int compositeRowPosition,
ILayerCell cell,
IConfigRegistry configRegistry)
|
ILayer |
getChildLayerByLayoutCoordinate(int layoutX,
int layoutY)
|
ILayer |
getChildLayerByRegionName(String regionName)
|
int |
getColumnCount()
|
int |
getColumnIndexByPosition(int compositeColumnPosition)
Gets the underlying non-transformed column index for the given column position. |
int |
getColumnPositionByX(int x)
Returns the column position that contains the given x coordinate. |
protected int |
getColumnPositionOffset(int layoutX)
|
int |
getColumnWidthByPosition(int column)
Returns the width in pixels of the given column. |
IConfigLabelAccumulator |
getConfigLabelAccumulatorByRegionName(String regionName)
|
LabelStack |
getConfigLabelsByPosition(int compositeColumnPosition,
int compositeRowPosition)
|
Object |
getDataValueByPosition(int compositeColumnPosition,
int compositeRowPosition)
|
String |
getDisplayModeByPosition(int compositeColumnPosition,
int compositeRowPosition)
|
int |
getHeight()
Returns the total height in pixels of this layer. |
protected int |
getHeightOffset(int layoutY)
|
protected int |
getLayoutXByColumnPosition(int compositeColumnPosition)
|
protected int |
getLayoutXByPixelX(int x)
|
int |
getLayoutXCount()
|
protected org.eclipse.swt.graphics.Point |
getLayoutXYByChildLayer(ILayer childLayer)
|
protected org.eclipse.swt.graphics.Point |
getLayoutXYByPixelXY(int x,
int y)
|
protected org.eclipse.swt.graphics.Point |
getLayoutXYByPosition(int compositeColumnPosition,
int compositeRowPosition)
|
protected int |
getLayoutYByPixelY(int y)
|
protected int |
getLayoutYByRowPosition(int compositeRowPosition)
|
int |
getLayoutYCount()
|
int |
getPreferredColumnCount()
|
int |
getPreferredHeight()
|
int |
getPreferredRowCount()
|
int |
getPreferredWidth()
|
LabelStack |
getRegionLabelsByXY(int x,
int y)
Layer can apply its own labels to any cell it wishes. |
int |
getRowCount()
|
int |
getRowHeightByPosition(int row)
Returns the height in pixels of the given row. |
int |
getRowIndexByPosition(int compositeRowPosition)
Gets the underlying non-transformed row index for the given row position. |
int |
getRowPositionByY(int y)
Get the row position relative to the layer the containing coordinate y. |
protected int |
getRowPositionOffset(int layoutY)
|
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 |
getUnderlyingLayerByPosition(int columnPosition,
int rowPosition)
|
Collection<ILayer> |
getUnderlyingLayersByColumnPosition(int columnPosition)
|
Collection<ILayer> |
getUnderlyingLayersByRowPosition(int rowPosition)
|
int |
getWidth()
Returns the total width in pixels of this layer. |
protected int |
getWidthOffset(int layoutX)
|
boolean |
isColumnPositionResizable(int compositeColumnPosition)
|
boolean |
isRowPositionResizable(int compositeRowPosition)
|
void |
loadState(String prefix,
Properties properties)
Restore the state out of the given Properties identified by the specified prefix. |
int |
localToUnderlyingColumnPosition(int localColumnPosition)
Convert a column position to the coordinates of the underlying layer. |
int |
localToUnderlyingRowPosition(int localRowPosition)
|
void |
saveState(String prefix,
Properties properties)
Saves the state to the given Properties using the specified prefix. |
void |
setChildLayer(String regionName,
ILayer childLayer,
int layoutX,
int layoutY)
|
void |
setConfigLabelAccumulatorForRegion(String regionName,
IConfigLabelAccumulator configLabelAccumulator)
Sets the IConfigLabelAccumulator for the given named region. |
int |
underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer,
int underlyingColumnPosition)
|
Collection<Range> |
underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingColumnPositionRanges)
|
int |
underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer,
int underlyingRowPosition)
|
Collection<Range> |
underlyingToLocalRowPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingRowPositionRanges)
|
| Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer |
|---|
addConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getClientAreaProvider, getConfigLabelAccumulator, getLayerPainter, getRegionName, handleLayerEvent, hasLayerListener, registerCommandHandler, registerCommandHandlers, registerEventHandler, registerPersistable, removeLayerListener, setClientAreaProvider, setConfigLabelAccumulator, setLayerPainter, setRegionName, toString, unregisterCommandHandler, unregisterEventHandler, unregisterPersistable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeLayer(int layoutXCount,
int layoutYCount)
| Method Detail |
|---|
public void dispose()
dispose in interface ILayerdispose in class AbstractLayer
public void saveState(String prefix,
Properties properties)
IPersistable
saveState in interface IPersistablesaveState in class AbstractLayerprefix - The prefix to use for the state keys. Is also used as the
state configuration name.properties - The Properties instance to save the state to.
public void loadState(String prefix,
Properties properties)
IPersistable
loadState in interface IPersistableloadState in class AbstractLayerprefix - The prefix to use for the state keys. Is also used as the
state configuration name.properties - The Properties instance to load the state from.
public void configure(ConfigRegistry configRegistry,
UiBindingRegistry uiBindingRegistry)
ILayerNatTable.configure() method. This is an
opportunity to add any key/mouse bindings and other general
configuration.
configure in interface ILayerconfigure in class AbstractLayerconfigRegistry - instance owned by NatTableuiBindingRegistry - instance owned by NatTablepublic boolean doCommand(ILayerCommand command)
ILayerCommand.convertToTargetLayer(ILayer) Handle commands
doCommand in interface ILayerdoCommand in class AbstractLayercommand - the command to perform
protected boolean doCommandOnChildLayers(ILayerCommand command)
public int getColumnCount()
public int getPreferredColumnCount()
public int getColumnIndexByPosition(int compositeColumnPosition)
ILayer
compositeColumnPosition - Column position in the CompositeLayer
public int localToUnderlyingColumnPosition(int localColumnPosition)
ILayer
localColumnPosition - column position in local (the layer's own) coordinates
public int underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer,
int underlyingColumnPosition)
public Collection<Range> underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingColumnPositionRanges)
public int getWidth()
ILayer
public int getPreferredWidth()
public int getColumnWidthByPosition(int column)
ILayer
column - the column position in this layer
public boolean isColumnPositionResizable(int compositeColumnPosition)
public int getColumnPositionByX(int x)
ILayer
x - pixel position - starts from 0
public int getStartXOfColumnPosition(int columnPosition)
ILayer
columnPosition - the column position in this layer
public Collection<ILayer> getUnderlyingLayersByColumnPosition(int columnPosition)
public int getRowCount()
public int getPreferredRowCount()
public int getRowIndexByPosition(int compositeRowPosition)
ILayer
compositeRowPosition - a row position relative to this coordinate model
public int localToUnderlyingRowPosition(int localRowPosition)
public int underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer,
int underlyingRowPosition)
public Collection<Range> underlyingToLocalRowPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingRowPositionRanges)
public int getHeight()
ILayer
public int getPreferredHeight()
public int getRowHeightByPosition(int row)
ILayer
row - the row position in this layer
public boolean isRowPositionResizable(int compositeRowPosition)
public int getRowPositionByY(int y)
y - Mouse event Y position.
public int getStartYOfRowPosition(int rowPosition)
ILayer
rowPosition - the row position in this layer
public Collection<ILayer> getUnderlyingLayersByRowPosition(int rowPosition)
public ILayerCell getCellByPosition(int compositeColumnPosition,
int compositeRowPosition)
getCellByPosition in interface ILayergetCellByPosition in class AbstractLayer
public org.eclipse.swt.graphics.Rectangle getBoundsByPosition(int compositeColumnPosition,
int compositeRowPosition)
ILayer
getBoundsByPosition in interface ILayergetBoundsByPosition in class AbstractLayercompositeColumnPosition - the column position of the cellcompositeRowPosition - the row position of the cell
null if there are no valid bounds
public String getDisplayModeByPosition(int compositeColumnPosition,
int compositeRowPosition)
getDisplayModeByPosition in interface ILayergetDisplayModeByPosition in class AbstractLayercompositeColumnPosition - the column position of the cellcompositeRowPosition - the row position of the cell
DisplayMode for the cell at the given position. The
DisplayMode affects the settings out of the
ConfigRegistry. Display mode is NORMAL by default.
Example: SelectionLayer overrides this to return
the SELECT label for cells which are selected.
public LabelStack getConfigLabelsByPosition(int compositeColumnPosition,
int compositeRowPosition)
getConfigLabelsByPosition in interface ILayergetConfigLabelsByPosition in class AbstractLayer
public Object getDataValueByPosition(int compositeColumnPosition,
int compositeRowPosition)
public ICellPainter getCellPainter(int compositeColumnPosition,
int compositeRowPosition,
ILayerCell cell,
IConfigRegistry configRegistry)
getCellPainter in interface ILayergetCellPainter in class AbstractLayer
public void setChildLayer(String regionName,
ILayer childLayer,
int layoutX,
int layoutY)
public IConfigLabelAccumulator getConfigLabelAccumulatorByRegionName(String regionName)
public void setConfigLabelAccumulatorForRegion(String regionName,
IConfigLabelAccumulator configLabelAccumulator)
public void addConfigLabelAccumulatorForRegion(String regionName,
IConfigLabelAccumulator configLabelAccumulator)
public ILayer getChildLayerByLayoutCoordinate(int layoutX,
int layoutY)
layoutX - col position in the CompositeLayerlayoutY - row position in the CompositeLayer
public ILayer getChildLayerByRegionName(String regionName)
regionName - The region name for which the child layer is requested.
public LabelStack getRegionLabelsByXY(int x,
int y)
ILayer
getRegionLabelsByXY in interface ILayergetRegionLabelsByXY in class AbstractLayerx - pixel positiony - pixel position
public ILayer getUnderlyingLayerByPosition(int columnPosition,
int rowPosition)
protected org.eclipse.swt.graphics.Point getLayoutXYByChildLayer(ILayer childLayer)
protected int getLayoutXByPixelX(int x)
protected int getLayoutYByPixelY(int y)
protected org.eclipse.swt.graphics.Point getLayoutXYByPixelXY(int x,
int y)
protected int getLayoutXByColumnPosition(int compositeColumnPosition)
protected int getLayoutYByRowPosition(int compositeRowPosition)
protected org.eclipse.swt.graphics.Point getLayoutXYByPosition(int compositeColumnPosition,
int compositeRowPosition)
protected int getColumnPositionOffset(int layoutX)
protected int getWidthOffset(int layoutX)
protected int getRowPositionOffset(int layoutY)
protected int getHeightOffset(int layoutY)
public int getLayoutXCount()
public int getLayoutYCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||