GuiSettings.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package holeg.ui.model;
  2. import java.io.File;
  3. import java.util.*;
  4. import holeg.model.AbstractCanvasObject;
  5. import holeg.model.Edge;
  6. import holeg.ui.view.category.Category;
  7. import holeg.utility.math.vector.Vec2i;
  8. import javax.swing.text.html.Option;
  9. public class GuiSettings {
  10. private static int pictureScale = 50; // Picture Scale
  11. private static int halfPictureScale = pictureScale / 2;
  12. public static Vec2i canvasSize = new Vec2i(3000,3000);
  13. public static int timerSpeed = 1000;
  14. public static float maxCapacityForNewCreatedEdges = 10000;
  15. private static final Set<Edge> selectedEdges = new HashSet<>();
  16. private static final Set<Category> categories = new HashSet<>();
  17. private static final Set<AbstractCanvasObject> clipboardObjects = new HashSet<>();
  18. private static final Set<Edge> clipboardEdges = new HashSet<>();
  19. private static final Set<AbstractCanvasObject> selectedObjects = new HashSet<>();
  20. public static float dragThresholdDistance = 5;
  21. private static File actualSaveFile = null;
  22. public static Optional<File> getActualSaveFile(){
  23. return Optional.ofNullable(actualSaveFile);
  24. }
  25. public static void setActualSaveFile(File file){
  26. actualSaveFile = file;
  27. }
  28. public static int getPictureScale() {
  29. return pictureScale;
  30. }
  31. public static int getPictureScaleDiv2() {
  32. return halfPictureScale;
  33. }
  34. public static void setPictureScale(int value) {
  35. pictureScale = value;
  36. halfPictureScale = (value + 1) / 2;
  37. }
  38. public static Set<Edge> getSelectedEdges() {
  39. return selectedEdges;
  40. }
  41. public static Set<Category> getCategories() {
  42. return categories;
  43. }
  44. public static Set<AbstractCanvasObject> getClipboardObjects() {
  45. return clipboardObjects;
  46. }
  47. public static Set<Edge> getClipboardEdges() {
  48. return clipboardEdges;
  49. }
  50. public static Set<AbstractCanvasObject> getSelectedObjects() {
  51. return selectedObjects;
  52. }
  53. }