| 680 | } |
| 681 | |
| 682 | @Override |
| 683 | public void setBackgroundTexture(Object backgroundTexture, int imageWidth, int imageHeight) { |
| 684 | this.backgroundTexture = backgroundTexture; |
| 685 | |
| 686 | if (backgroundTexture != null) { |
| 687 | double w = imageWidth; |
| 688 | double h = imageHeight; |
| 689 | int listWidth = getRight() - getLeft(); |
| 690 | int listHeight = getBottom() - getTop(); |
| 691 | |
| 692 | while (w > listWidth && h > listHeight) { |
| 693 | w -= 1; |
| 694 | h -= h / w; |
| 695 | } |
| 696 | while (w < listWidth || h < listHeight) { |
| 697 | w += 1; |
| 698 | h += h / w; |
| 699 | } |
| 700 | this.backgroundWidth = (int) w; |
| 701 | this.backgroundHeight = (int) h; |
| 702 | } |
| 703 | } |
| 704 | |
| 705 | @Override |
| 706 | public List<E> getRows() { |