コード例 #1
0
  /** @return Position rectangle with the max layer size */
  private Rectangle getMaximumLayerSize() {
    final int width = gridLayer.getWidth();
    final int height = gridLayer.getHeight();

    int lastRowPosition = gridLayer.getColumnPositionByX(width - 1);
    int lastColPosition = gridLayer.getRowPositionByY(height - 1);
    return new Rectangle(0, 0, lastRowPosition, lastColPosition);
  }
コード例 #2
0
  private void setClientAreaToMaximum() {
    final Rectangle maxClientArea =
        new Rectangle(0, 0, gridLayer.getWidth(), gridLayer.getHeight());

    gridLayer.setClientAreaProvider(
        new IClientAreaProvider() {
          public Rectangle getClientArea() {
            return maxClientArea;
          }
        });

    gridLayer.doCommand(new PrintEntireGridCommand());
  }