Search in sources :

Example 1 with FreezeEvent

use of net.sourceforge.nattable.freeze.event.FreezeEvent in project translationstudio8 by heartsome.

the class FreezeCommandHandler method handleFreezeCommand.

protected void handleFreezeCommand(IFreezeCoordinatesProvider coordinatesProvider) {
    // if not already frozen
    if (freezeLayer.getColumnCount() == 0 && freezeLayer.getRowCount() == 0) {
        final PositionCoordinate topLeftPosition = coordinatesProvider.getTopLeftPosition();
        final PositionCoordinate bottomRightPosition = coordinatesProvider.getBottomRightPosition();
        freezeLayer.setTopLeftPosition(topLeftPosition.columnPosition, topLeftPosition.rowPosition);
        freezeLayer.setBottomRightPosition(bottomRightPosition.columnPosition, bottomRightPosition.rowPosition);
        viewportLayer.setMinimumOriginPosition(bottomRightPosition.columnPosition + 1, bottomRightPosition.rowPosition + 1);
        viewportLayer.fireLayerEvent(new FreezeEvent(viewportLayer));
    }
}
Also used : PositionCoordinate(net.sourceforge.nattable.coordinate.PositionCoordinate) FreezeEvent(net.sourceforge.nattable.freeze.event.FreezeEvent)

Aggregations

PositionCoordinate (net.sourceforge.nattable.coordinate.PositionCoordinate)1 FreezeEvent (net.sourceforge.nattable.freeze.event.FreezeEvent)1