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