Specifications.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. package model;
  2. import java.util.Arrays;
  3. import java.util.List;
  4. /**
  5. * Lists the specification. Used for the Android app. Template:
  6. * Name:[Object name, shown on top of the app]
  7. * Shape:[object's shape and position][...]...
  8. * Contact:[shape and position of the conductive part]
  9. * ButtonTrue:[message that appears below the object on the app if the object did change its state]
  10. * ButtonFalse:[initial message that stays if the object didn't change its state]
  11. *
  12. * Shape information: rectangle: [R; x position from the object's middle; y position; width; height;]
  13. * circle: [C; x position; y position; diameter]
  14. * position and size in millimeter. E.g.: [R;5;5;20;20]
  15. * @author Martin Herbers
  16. *
  17. */
  18. public class Specifications {
  19. public static List<String> getSqueezeSpecs() {
  20. List<String> squeeze = Arrays.asList(
  21. "Name:Squeeze",
  22. "Shape:[C;0;0;26][R;0;" + (Settings.getSettings().getSizeScreen() + 12) + ";" + (Settings.getSettings().getSizeScreen() + 4) + ";" + (Settings.getSettings().getSizeScreen() + 4) + "]",
  23. "Contact:[R;0;" + (Settings.getSettings().getSizeScreen() + 12) + ";" + Settings.getSettings().getSizeScreen() + ";" + Settings.getSettings().getSizeScreen() + "]",
  24. "ButtonTrue:The object got squeezed!",
  25. "ButtonFalse:The object didn't get squeezed."
  26. );
  27. return squeeze;
  28. }
  29. public static List<String> getWeightSpecs() {
  30. List<String> weight = Arrays.asList(
  31. "Name:Weight " + (Settings.getSettings().getWeight()/10.0f) + "kg",
  32. "Shape:[R;0;0;20;61]",
  33. "Contact:[C;0;1;" + Settings.getSettings().getSizeScreen() + "]",
  34. "ButtonTrue:A weight of more than " + (Settings.getSettings().getWeight()/10.0f) + " Kg was applied!",
  35. "ButtonFalse:A weight of less than " + (Settings.getSettings().getWeight()/10.0f) + " Kg was applied."
  36. );
  37. return weight;
  38. }
  39. public static List<String> getTemperatureMeltSpecs() {
  40. List<String> temperatureMelt = Arrays.asList(
  41. "Name:Melt",
  42. "Shape:[R;0;0;20;42][R;0;-20;10;2]",
  43. "Contact:[C;0;3;" + Settings.getSettings().getSizeScreen() + "]",
  44. "ButtonTrue:The object was stored above 0°C!",
  45. "ButtonFalse:The object was cooled the whole time."
  46. );
  47. return temperatureMelt;
  48. }
  49. public static List<String> getTemperatureFreezeSpecs() {
  50. List<String> temperatureFreeze = Arrays.asList(
  51. "Name:Freeze",
  52. "Shape:[R;0;0;20;43][C;10;-8;6]",
  53. "Contact:[C;0;7;" + Settings.getSettings().getSizeScreen() + "]",
  54. "ButtonTrue:The object was stored below 0°C!",
  55. "ButtonFalse:The object was above 0°C the whole time."
  56. );
  57. return temperatureFreeze;
  58. }
  59. public static List<String> getAccelerationSpecs() {
  60. List<String> acceleration = Arrays.asList(
  61. "Name:Acceleration " + Settings.getSettings().getAcceleration() + "m/s²",
  62. "Shape:[R;0;0;20;40][C;0;-10;6][C;0;10;6]",
  63. "Contact:[C;0;10;" + Settings.getSettings().getSizeScreen() + "]",
  64. "ButtonTrue:The object was accelerated with " + Settings.getSettings().getAcceleration() + "m/s²!",
  65. "ButtonFalse:The object was accelerated with less than " + Settings.getSettings().getAcceleration() + "m/s²."
  66. );
  67. return acceleration;
  68. }
  69. public static List<String> getFlipSpecs() {
  70. List<String> flip = Arrays.asList(
  71. "Name:Flip",
  72. "Shape:[C;0;0;34]",
  73. "Contact:[C;0;0;" + Settings.getSettings().getSizeScreen() + "]",
  74. "ButtonTrue:The object got flipped!",
  75. "ButtonFalse:The object didn't get flipped."
  76. );
  77. return flip;
  78. }
  79. public static List<String> getTiltSpecs() {
  80. List<String> tilt = Arrays.asList(
  81. "Name:Tilt",
  82. "Shape:[R;0;0;18;30]",
  83. "Contact:[C;0;8;" + Settings.getSettings().getSizeScreen() + "]",
  84. "ButtonTrue:The object got tilted!",
  85. "ButtonFalse:The object didn't get tilted."
  86. );
  87. return tilt;
  88. }
  89. //ADD CODE HERE FOR ADDITIONAL INTERACTION
  90. //New function that returns the specification as listed in the top comment in a List of Stings
  91. }