Guest User

Untitled

a guest
Jun 12th, 2013
51
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. import java.util.logging.Level;
  3. import java.util.logging.Logger;
  4. import javax.swing.ImageIcon;
  5.  
  6. interface Command {
  7. void execute();
  8. }
  9.  
  10. interface IMediator {
  11. public void done();
  12. public void waiting();
  13. public void clickDone(BtnDone v, String id);
  14. public void clickWaiting(BtnWaiting s, String id);
  15. public void change(LblDisplay d);
  16. }
  17.  
  18. class Mediator implements IMediator {
  19. BtnDone btnDone;
  20. BtnWaiting btnWaiting;
  21. LblDisplay show;
  22. String id;
  23. Database db = new Database();
  24.  
  25. @Override
  26. public void done() {
  27. show.setText(" Hotovo");
  28. try {
  29. db.setDone(id);
  30. } catch (Exception ex) {
  31. Logger.getLogger(Mediator.class.getName()).log(Level.SEVERE, null, ex);
  32. }
  33. }
  34.  
  35. @Override
  36. public void waiting() {
  37. ImageIcon blue = new ImageIcon("/Users/NetBeansProjects/GTD/src/gtd/View/blue.png");
  38.  
  39. show.setIcon(blue);
  40. String s = show.getText();
  41. show.setText(s);
  42. try {
  43. db.setWaiting(id);
  44. } catch (Exception ex) {
  45. Logger.getLogger(Mediator.class.getName()).log(Level.SEVERE, null, ex);
  46. }
  47. }
  48.  
  49. @Override
  50. public void clickDone(BtnDone v, String id) {btnDone = v; this.id = id;}
  51. @Override
  52. public void clickWaiting(BtnWaiting s, String id) {btnWaiting = s; this.id = id;}
  53. @Override
  54. public void change(LblDisplay d) {show = d;}
  55. }
RAW Paste Data