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.

C_MenuListener_undo.java 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 controller;
  7. import commands.CommandInvoker;
  8. import java.awt.event.ActionEvent;
  9. import java.awt.event.ActionListener;
  10. import java.util.prefs.Preferences;
  11. import model.model;
  12. import view.gui;
  13. /**
  14. * Command Controller undo
  15. * @author matthias
  16. */
  17. public class C_MenuListener_undo implements ActionListener{
  18. private gui view;
  19. private CommandInvoker invoker;
  20. private String PathID;
  21. private String FildID;
  22. private Preferences prfs;
  23. private model mdl;
  24. public C_MenuListener_undo(gui g, String pid, String fid, Preferences p, model m, CommandInvoker inv)
  25. {
  26. this.view = g;
  27. this.invoker = inv;
  28. this.PathID = pid;
  29. this.FildID = fid;
  30. this.prfs = p;
  31. this.mdl = m;
  32. this.view.getContentTable1().getjTable().setModel(this.mdl);
  33. }
  34. /**
  35. * registriert undo event
  36. */
  37. public void registerEvents()
  38. {
  39. this.view.getBtnUndo().addActionListener(this);
  40. }
  41. public void registerCommands()
  42. {
  43. //this.invoker.addCommand(this.view.getBtnUndo(), );
  44. }
  45. /**
  46. * führt undoCommand vom Invoker aus
  47. * @param ae (AktionEvent)
  48. */
  49. @Override
  50. public void actionPerformed(ActionEvent ae) {
  51. this.invoker.undoCommand();
  52. }
  53. }