ObjectInstance.java 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package audio;
  2. import java.awt.Color;
  3. import control.button.Button;
  4. import control.button.ButtonHandler;
  5. public class ObjectInstance {
  6. private long time;
  7. private int direction;
  8. private int buttonID;
  9. private Button button;
  10. private boolean hold;
  11. private long length;
  12. public ObjectInstance()
  13. {
  14. time = 0;
  15. direction = 0;
  16. buttonID = 0;
  17. button = null;
  18. hold = false;
  19. length = 0;
  20. }
  21. public long getTime() {
  22. return time;
  23. }
  24. public void setTime(long time) {
  25. this.time = time;
  26. }
  27. public int getDirection() {
  28. return direction;
  29. }
  30. public void setDirection(int direction) {
  31. this.direction = direction;
  32. }
  33. public int getButtonID() {
  34. return buttonID;
  35. }
  36. public void setButtonID(int buttonID) {
  37. if(buttonID < ButtonHandler.getButtons().size() - 1)
  38. {
  39. this.buttonID = buttonID;
  40. this.button = ButtonHandler.getButton(buttonID);
  41. }
  42. }
  43. public Color getColor()
  44. {
  45. return button.getColor();
  46. }
  47. public Button getButton() {
  48. return button;
  49. }
  50. public boolean isHold() {
  51. return hold;
  52. }
  53. public void setHold(boolean hold) {
  54. this.hold = hold;
  55. }
  56. public long getLength() {
  57. if(hold)
  58. return length;
  59. else
  60. return 1;
  61. }
  62. public void setLength(long length) {
  63. this.length = length;
  64. }
  65. }