public class RowReorderLayer extends AbstractLayerTransform implements IUniqueIndexLayer
DefaultRowReorderLayerConfiguration
Modifier and Type | Field and Description |
---|---|
static String |
PERSISTENCE_KEY_ROW_INDEX_ORDER |
layerPainter
DOT, VALUE_SEPARATOR
Constructor and Description |
---|
RowReorderLayer(IUniqueIndexLayer underlyingLayer) |
RowReorderLayer(IUniqueIndexLayer underlyingLayer,
boolean useDefaultConfiguration) |
Modifier and Type | Method and Description |
---|---|
int |
getColumnPositionByIndex(int columnIndex) |
int |
getReorderFromRowPosition() |
int |
getRowIndexByPosition(int rowPosition)
Gets the underlying non-transformed row index for the given row position.
|
List<Integer> |
getRowIndexOrder() |
int |
getRowPositionByIndex(int rowIndex) |
int |
getRowPositionByY(int y)
Returns the row position that contains the given y coordinate.
|
int |
getStartYOfRowPosition(int targetRowPosition)
Returns the y offset in pixels of the given row.
|
void |
handleLayerEvent(ILayerEvent event)
Handle layer event notification.
|
protected boolean |
isRestoredStateValid(List<Integer> newRowIndexOrder)
Ensure that rows haven't changed in the underlying data source
|
void |
loadState(String prefix,
Properties properties)
Underlying layers must load state first.
|
int |
localToUnderlyingRowPosition(int localRowPosition) |
protected void |
registerCommandHandlers()
Layers should use this method to register their command handlers
and call it from their constructor.
|
void |
reorderMultipleRowPositions(List<Integer> fromRowPositions,
int toRowPosition)
Reorders the rows at the given from positions to the TOP of the of the given to position.
|
void |
reorderMultipleRowPositions(List<Integer> fromRowPositions,
int toRowPosition,
boolean reorderToTopEdge)
Reorders the rows at the given from positions to the TOP of the of the given to position.
|
void |
reorderRowPosition(int fromRowPosition,
int toRowPosition)
Reorders the row at the given from position to the TOP of the of the given to position.
|
void |
reorderRowPosition(int fromRowPosition,
int toRowPosition,
boolean reorderToTopEdge)
Reorders the row at the given from position to the TOP of the of the given to position.
|
void |
saveState(String prefix,
Properties properties)
Saves the state to the given Properties using the specified prefix.
|
void |
setReorderFromRowPosition(int fromRowPosition)
Locally cache the position of the row that is currently reordered.
|
int |
underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer,
int underlyingRowPosition) |
Collection<Range> |
underlyingToLocalRowPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingRowPositionRanges) |
configure, dispose, doCommand, getCellByPosition, getCellPainter, getColumnCount, getColumnIndexByPosition, getColumnPositionByX, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getHeight, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getRegionLabelsByXY, getRowCount, getRowHeightByPosition, getStartXOfColumnPosition, getUnderlyingLayer, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, isColumnPositionResizable, isRowPositionResizable, localToUnderlyingColumnPosition, setClientAreaProvider, setUnderlyingLayer, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions
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, getColumnIndexByPosition, getColumnPositionByX, getColumnWidthByPosition, getConfigLabelsByPosition, getDataValueByPosition, getDisplayModeByPosition, getHeight, getLayerPainter, getPreferredColumnCount, getPreferredHeight, getPreferredRowCount, getPreferredWidth, getRegionLabelsByXY, getRowCount, getRowHeightByPosition, getStartXOfColumnPosition, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, getWidth, hasLayerListener, isColumnPositionResizable, isRowPositionResizable, localToUnderlyingColumnPosition, registerCommandHandler, registerPersistable, removeLayerListener, setClientAreaProvider, underlyingToLocalColumnPosition, underlyingToLocalColumnPositions, unregisterCommandHandler, unregisterPersistable
public static final String PERSISTENCE_KEY_ROW_INDEX_ORDER
public RowReorderLayer(IUniqueIndexLayer underlyingLayer)
public RowReorderLayer(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> newRowIndexOrder)
newRowIndexOrder
- restored from the properties file.public int getColumnPositionByIndex(int columnIndex)
getColumnPositionByIndex
in interface IUniqueIndexLayer
public int getRowPositionByY(int y)
ILayer
getRowPositionByY
in interface ILayer
getRowPositionByY
in class AbstractLayerTransform
y
- a vertical pixel location relative to the pixel boundary of this layerpublic int getStartYOfRowPosition(int targetRowPosition)
ILayer
getStartYOfRowPosition
in interface ILayer
getStartYOfRowPosition
in class AbstractLayerTransform
targetRowPosition
- the row position in this layerpublic List<Integer> getRowIndexOrder()
public int getRowIndexByPosition(int rowPosition)
ILayer
getRowIndexByPosition
in interface ILayer
getRowIndexByPosition
in class AbstractLayerTransform
rowPosition
- a row position relative to this coordinate modelpublic int getRowPositionByIndex(int rowIndex)
getRowPositionByIndex
in interface IUniqueIndexLayer
public int localToUnderlyingRowPosition(int localRowPosition)
localToUnderlyingRowPosition
in interface ILayer
localToUnderlyingRowPosition
in class AbstractLayerTransform
public int underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer, int underlyingRowPosition)
underlyingToLocalRowPosition
in interface ILayer
underlyingToLocalRowPosition
in class AbstractLayerTransform
public Collection<Range> underlyingToLocalRowPositions(ILayer sourceUnderlyingLayer, Collection<Range> underlyingRowPositionRanges)
underlyingToLocalRowPositions
in interface ILayer
underlyingToLocalRowPositions
in class AbstractLayerTransform
public void reorderRowPosition(int fromRowPosition, int toRowPosition)
fromRowPosition
- row position to movetoRowPosition
- position to move the row topublic void reorderRowPosition(int fromRowPosition, int toRowPosition, boolean reorderToTopEdge)
fromRowPosition
- row position to movetoRowPosition
- position to move the row toreorderToTopEdge
- whether the move should be done above the given to position or notpublic void reorderMultipleRowPositions(List<Integer> fromRowPositions, int toRowPosition)
fromRowPositions
- row positions to movetoRowPosition
- position to move the rows topublic void reorderMultipleRowPositions(List<Integer> fromRowPositions, int toRowPosition, boolean reorderToTopEdge)
fromRowPositions
- row positions to movetoRowPosition
- position to move the rows toreorderToTopEdge
- whether the move should be done above the given to position or notpublic int getReorderFromRowPosition()
public void setReorderFromRowPosition(int fromRowPosition)
fromRowPosition
- Position of the row that is currently reordered.Copyright © 2013. All Rights Reserved.