| 711 | } |
| 712 | |
| 713 | @Override |
| 714 | public void setBackgroundTexture(Object backgroundTexture, int imageWidth, int imageHeight) { |
| 715 | this.backgroundTexture = backgroundTexture; |
| 716 | |
| 717 | if (backgroundTexture != null) { |
| 718 | double w = imageWidth; |
| 719 | double h = imageHeight; |
| 720 | int listWidth = getRight() - getLeft(); |
| 721 | int listHeight = getBottom() - getTop(); |
| 722 | |
| 723 | while (w > listWidth && h > listHeight) { |
| 724 | w -= 1; |
| 725 | h -= h / w; |
| 726 | } |
| 727 | while (w < listWidth || h < listHeight) { |
| 728 | w += 1; |
| 729 | h += h / w; |
| 730 | } |
| 731 | this.backgroundWidth = (int) w; |
| 732 | this.backgroundHeight = (int) h; |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | @Override |
| 737 | public List<E> getRows() { |