| 700 | } |
| 701 | |
| 702 | @Override |
| 703 | public void setBackgroundTexture(Object backgroundTexture, int imageWidth, int imageHeight) { |
| 704 | this.backgroundTexture = backgroundTexture; |
| 705 | |
| 706 | if (backgroundTexture != null) { |
| 707 | double w = imageWidth; |
| 708 | double h = imageHeight; |
| 709 | int listWidth = getRight() - getLeft(); |
| 710 | int listHeight = getBottom() - getTop(); |
| 711 | |
| 712 | while (w > listWidth && h > listHeight) { |
| 713 | w -= 1; |
| 714 | h -= h / w; |
| 715 | } |
| 716 | while (w < listWidth || h < listHeight) { |
| 717 | w += 1; |
| 718 | h += h / w; |
| 719 | } |
| 720 | this.backgroundWidth = (int) w; |
| 721 | this.backgroundHeight = (int) h; |
| 722 | } |
| 723 | } |
| 724 | |
| 725 | @Override |
| 726 | public List<E> getRows() { |