diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2019-12-09 19:55:26 +0200 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2019-12-09 19:55:41 +0200 |
commit | bf35bef5b7aefeb2979bf24ad327fe1dca838db0 (patch) | |
tree | d78b5d6fb7076e9e96b7b6da4d26015354120fc8 /src/main/java | |
parent | 6b40020b11fb6568c69699885f2836b552c40dc1 (diff) | |
download | LibGui-bf35bef5b7aefeb2979bf24ad327fe1dca838db0.tar.gz LibGui-bf35bef5b7aefeb2979bf24ad327fe1dca838db0.tar.bz2 LibGui-bf35bef5b7aefeb2979bf24ad327fe1dca838db0.zip |
Add a WListPanel constructor without the widget class parameter
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java index e86e1da..fe2cc1b 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WListPanel.java @@ -18,7 +18,6 @@ import io.github.cottonmc.cotton.gui.widget.data.Axis; */ public class WListPanel<D, W extends WWidget> extends WClippedPanel { protected List<D> data; - protected Class<W> listItemClass; protected Supplier<W> supplier; protected BiConsumer<D, W> configurator; @@ -31,14 +30,21 @@ public class WListPanel<D, W extends WWidget> extends WClippedPanel { protected WScrollBar scrollBar = new WScrollBar(Axis.VERTICAL); int lastScroll = -1; - - public WListPanel(List<D> data, Class<W> listItemClass, Supplier<W> supplier, BiConsumer<D, W> configurator) { + + public WListPanel(List<D> data, Supplier<W> supplier, BiConsumer<D, W> configurator) { this.data = data; - this.listItemClass = listItemClass; this.supplier = supplier; this.configurator = configurator; scrollBar.setMaxValue(data.size()); } + + /** + * @deprecated Use {@link #WListPanel(List, Supplier, BiConsumer)} instead. + */ + @Deprecated + public WListPanel(List<D> data, Class<W> listItemClass, Supplier<W> supplier, BiConsumer<D, W> configurator) { + this(data, supplier, configurator); + } @Override public void paintBackground(int x, int y, int mouseX, int mouseY) { |