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