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.

DEmptyView.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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.draw.DDrawSurface;
  8. import org.openzen.drawablegui.live.ImmutableLiveObject;
  9. import org.openzen.drawablegui.live.LiveObject;
  10. import org.openzen.drawablegui.style.DStylePath;
  11. /**
  12. *
  13. * @author Hoofdgebruiker
  14. */
  15. public class DEmptyView implements DComponent {
  16. public static final DEmptyView INSTANCE = new DEmptyView();
  17. private static final LiveObject<DSizing> DIMENSION = new ImmutableLiveObject(DSizing.EMPTY);
  18. private DEmptyView() {}
  19. @Override
  20. public void mount(DStylePath parent, int z, DDrawSurface surface) {
  21. }
  22. @Override
  23. public void unmount() {
  24. }
  25. @Override
  26. public LiveObject<DSizing> getSizing() {
  27. return DIMENSION;
  28. }
  29. @Override
  30. public DIRectangle getBounds() {
  31. return DIRectangle.EMPTY;
  32. }
  33. @Override
  34. public int getBaselineY() {
  35. return -1;
  36. }
  37. @Override
  38. public void setBounds(DIRectangle bounds) {
  39. }
  40. @Override
  41. public void close() {
  42. // nothing to clean up
  43. }
  44. }