public class ColumnReorderLayer extends AbstractLayerTransform implements IUniqueIndexLayer
Modifier and Type | Field and Description |
---|---|
static String |
PERSISTENCE_KEY_COLUMN_INDEX_ORDER |
layerPainter
DOT, VALUE_SEPARATOR
Constructor and Description |
---|
ColumnReorderLayer(IUniqueIndexLayer underlyingLayer) |
ColumnReorderLayer(IUniqueIndexLayer underlyingLayer,
boolean useDefaultConfiguration) |
Modifier and Type | Method and Description |
---|---|
int |
getColumnIndexByPosition(int columnPosition)
Gets the underlying non-transformed column index for the given column position.
|
List<Integer> |
getColumnIndexOrder() |
int |
getColumnPositionByIndex(int columnIndex) |
int |
getColumnPositionByX(int x)
Returns the column position that contains the given x coordinate.
|
int |
getReorderFromColumnPosition() |
int |
getRowPositionByIndex(int rowIndex) |
int |
getStartXOfColumnPosition(int targetColumnPosition)
Returns the x offset in pixels of the given column.
|
void |
handleLayerEvent(ILayerEvent event)
Handle layer event notification.
|
protected boolean |
isRestoredStateValid(List<Integer> newColumnIndexOrder)
Ensure that columns haven't changed in the underlying data source
|
void |
loadState(String prefix,
Properties properties)
Underlying layers must load state first.
|
int |
localToUnderlyingColumnPosition(int localColumnPosition)
Convert a column position to the coordinates of the underlying layer.
|
protected void |
registerCommandHandlers()
Layers should use this method to register their command handlers
and call it from their constructor.
|
void |
reorderColumnPosition(int fromColumnPosition,
int toColumnPosition) |
void |
reorderColumnPosition(int fromColumnPosition,
int toColumnPosition,
boolean reorderToLeftEdge) |
void |
reorderMultipleColumnPositions(List<Integer> fromColumnPositions,
int toColumnPosition) |
void |
reorderMultipleColumnPositions(List<Integer> fromColumnPositions,
int toColumnPosition,
boolean reorderToLeftEdge) |
void |
saveState(String prefix,
Properties properties)
Saves the state to the given Properties using the specified prefix.
|
void |
setReorderFromColumnPosition(int fromColumnPosition) |
int |
underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer,
int underlyingColumnPosition) |
Collection<Range> |
underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingColumnPositionRanges) |
configure, dispose, doCommand, getCellByPosition, getCellPainter, getColumnCount, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getHeight, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getRegionLabelsByXY, getRowCount, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByY, getStartYOfRowPosition, getUnderlyingLayer, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, isColumnPositionResizable, isRowPositionResizable, localToUnderlyingRowPosition, setClientAreaProvider, setUnderlyingLayer, underlyingToLocalRowPosition, underlyingToLocalRowPositions
addConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, getConfigLabelAccumulator, getRegionName, hasLayerListener, registerCommandHandler, registerEventHandler, registerPersistable, removeLayerListener, setConfigLabelAccumulator, setLayerPainter, setRegionName, toString, unregisterCommandHandler, unregisterPersistable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addLayerListener, configure, dispose, doCommand, fireLayerEvent, getBoundsByPosition, getCellByPosition, getCellPainter, getClientAreaProvider, getColumnCount, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getHeight, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getRegionLabelsByXY, getRowCount, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByY, getStartYOfRowPosition, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, hasLayerListener, isColumnPositionResizable, isRowPositionResizable, localToUnderlyingRowPosition, registerCommandHandler, registerPersistable, removeLayerListener, setClientAreaProvider, underlyingToLocalRowPosition, underlyingToLocalRowPositions, unregisterCommandHandler, unregisterPersistable
public static final String PERSISTENCE_KEY_COLUMN_INDEX_ORDER
public ColumnReorderLayer(IUniqueIndexLayer underlyingLayer)
public ColumnReorderLayer(IUniqueIndexLayer underlyingLayer, boolean useDefaultConfiguration)
public void handleLayerEvent(ILayerEvent event)
AbstractLayer
super.fireLayerEvent(event)
- unless you plan to eat the event yourself.handleLayerEvent
in interface ILayerListener
handleLayerEvent
in class AbstractLayer
event
- the eventprotected void registerCommandHandlers()
AbstractLayer
registerCommandHandlers
in class AbstractLayer
public void saveState(String prefix, Properties properties)
IPersistable
saveState
in interface IPersistable
saveState
in class AbstractLayerTransform
prefix
- 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)
AbstractLayerTransform
IStructuralChangeEvent
from underlying
layers will reset caches after state has been loadedloadState
in interface IPersistable
loadState
in class AbstractLayerTransform
prefix
- 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.protected boolean isRestoredStateValid(List<Integer> newColumnIndexOrder)
newColumnIndexOrder
- restored from the properties file.public int getColumnIndexByPosition(int columnPosition)
ILayer
getColumnIndexByPosition
in interface ILayer
getColumnIndexByPosition
in class AbstractLayerTransform
columnPosition
- a column position relative to this coordinate modelpublic int getColumnPositionByIndex(int columnIndex)
getColumnPositionByIndex
in interface IUniqueIndexLayer
public int localToUnderlyingColumnPosition(int localColumnPosition)
ILayer
localToUnderlyingColumnPosition
in interface ILayer
localToUnderlyingColumnPosition
in class AbstractLayerTransform
localColumnPosition
- column position in local (the layer's own) coordinatespublic int underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer, int underlyingColumnPosition)
underlyingToLocalColumnPosition
in interface ILayer
underlyingToLocalColumnPosition
in class AbstractLayerTransform
public Collection<Range> underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer, Collection<Range> underlyingColumnPositionRanges)
underlyingToLocalColumnPositions
in interface ILayer
underlyingToLocalColumnPositions
in class AbstractLayerTransform
public int getColumnPositionByX(int x)
ILayer
getColumnPositionByX
in interface ILayer
getColumnPositionByX
in class AbstractLayerTransform
x
- a horizontal pixel location relative to the pixel boundary of this layerpublic int getStartXOfColumnPosition(int targetColumnPosition)
ILayer
getStartXOfColumnPosition
in interface ILayer
getStartXOfColumnPosition
in class AbstractLayerTransform
targetColumnPosition
- the column position in this layerpublic int getRowPositionByIndex(int rowIndex)
getRowPositionByIndex
in interface IUniqueIndexLayer
public void reorderColumnPosition(int fromColumnPosition, int toColumnPosition)
public void reorderColumnPosition(int fromColumnPosition, int toColumnPosition, boolean reorderToLeftEdge)
public void reorderMultipleColumnPositions(List<Integer> fromColumnPositions, int toColumnPosition)
public void reorderMultipleColumnPositions(List<Integer> fromColumnPositions, int toColumnPosition, boolean reorderToLeftEdge)
public int getReorderFromColumnPosition()
public void setReorderFromColumnPosition(int fromColumnPosition)
Copyright © 2013. All Rights Reserved.