QueuedTooltip.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package me.shedaniel.rei.gui.widget;
  2. import com.google.common.collect.Lists;
  3. import me.shedaniel.cloth.api.ClientUtils;
  4. import java.awt.*;
  5. import java.util.Collections;
  6. import java.util.List;
  7. public class QueuedTooltip {
  8. private Point location;
  9. private List<String> text;
  10. private QueuedTooltip(Point location, List<String> text) {
  11. this.location = location;
  12. this.text = Collections.unmodifiableList(text);
  13. }
  14. public static QueuedTooltip create(Point location, List<String> text) {
  15. return new QueuedTooltip(location, text);
  16. }
  17. public static QueuedTooltip create(Point location, String... text) {
  18. return QueuedTooltip.create(location, Lists.newArrayList(text));
  19. }
  20. public static QueuedTooltip create(List<String> text) {
  21. return QueuedTooltip.create(ClientUtils.getMouseLocation(), text);
  22. }
  23. public static QueuedTooltip create(String... text) {
  24. return QueuedTooltip.create(ClientUtils.getMouseLocation(), text);
  25. }
  26. public Point getLocation() {
  27. return location;
  28. }
  29. public int getX() {
  30. return getLocation().x;
  31. }
  32. public int getY() {
  33. return getLocation().y;
  34. }
  35. public List<String> getText() {
  36. return text;
  37. }
  38. }