ZenScript main repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DSizing.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package org.openzen.drawablegui;
  7. import org.openzen.drawablegui.live.MutableLiveObject;
  8. import org.openzen.drawablegui.live.SimpleLiveObject;
  9. /**
  10. *
  11. * @author Hoofdgebruiker
  12. */
  13. public class DSizing {
  14. public static MutableLiveObject<DSizing> create() {
  15. return new SimpleLiveObject<>(DSizing.EMPTY);
  16. }
  17. public static final DSizing EMPTY = new DSizing(0, 0);
  18. public final int minimumWidth;
  19. public final int minimumHeight;
  20. public final int preferredWidth;
  21. public final int preferredHeight;
  22. public final int maximumWidth;
  23. public final int maximumHeight;
  24. public DSizing(int preferredWidth, int preferredHeight) {
  25. this.minimumWidth = 0;
  26. this.minimumHeight = 0;
  27. this.preferredWidth = preferredWidth;
  28. this.preferredHeight = preferredHeight;
  29. this.maximumWidth = 1000000;
  30. this.maximumHeight = 1000000;
  31. }
  32. public DSizing(int minimumWidth, int minimumHeight, int preferredWidth, int preferredHeight, int maximumWidth, int maximumHeight) {
  33. this.minimumWidth = minimumWidth;
  34. this.minimumHeight = minimumHeight;
  35. this.preferredWidth = preferredWidth;
  36. this.preferredHeight = preferredHeight;
  37. this.maximumWidth = maximumWidth;
  38. this.maximumHeight = maximumHeight;
  39. }
  40. }