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.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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.ImmutableLiveObject;
  8. import org.openzen.drawablegui.live.LiveObject;
  9. import org.openzen.drawablegui.style.DStylePath;
  10. /**
  11. *
  12. * @author Hoofdgebruiker
  13. */
  14. public class DEmptyView implements DComponent {
  15. public static final DEmptyView INSTANCE = new DEmptyView();
  16. private static final LiveObject<DDimensionPreferences> DIMENSION = new ImmutableLiveObject(new DDimensionPreferences(0, 0));
  17. private static final DIRectangle NO_BOUNDS = new DIRectangle(0, 0, 0, 0);
  18. private DEmptyView() {}
  19. @Override
  20. public void setContext(DStylePath parent, DUIContext context) {
  21. }
  22. @Override
  23. public LiveObject<DDimensionPreferences> getDimensionPreferences() {
  24. return DIMENSION;
  25. }
  26. @Override
  27. public DIRectangle getBounds() {
  28. return NO_BOUNDS;
  29. }
  30. @Override
  31. public void setBounds(DIRectangle bounds) {
  32. }
  33. @Override
  34. public void paint(DCanvas canvas) {
  35. }
  36. @Override
  37. public void close() {
  38. // nothing to clean up
  39. }
  40. }