1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package autogui;
-
- import commands.CommandInvoker;
- import controller.C_MenuListener;
- import controller.C_MenuListener_undo;
- import java.util.prefs.Preferences;
- import javax.swing.UIManager;
- import model.model;
- import view.gui;
-
- /**
- * AutoGUI
- * enthält alle wichtigen Parameter wie View, Model, CommandInvoker, Controller
- * @author matthias
- */
- public class AutoGUI {
-
- /**
- * @param args the command line arguments
- */
- private gui frm;
- //C_FileDialogOpen cfdo;
- //C_SaveFile csf;
- private Preferences prf;
- private final String PathID = "LastUsedPath";
- private final String FILE_ID = "LastUsedFile";
- private C_MenuListener cml;
- private C_MenuListener_undo cmlu;
- private model mdl;
- private CommandInvoker invoker;
-
- /**
- * Konstruktor initialisiert alle Parameter und registriert die Events und Commands
- */
- public AutoGUI()
- {
- this.prf = Preferences.userRoot().node(this.getClass().getName());
- //String test = this.prf.get(this.PathID, "abc"); // Leerer String falls get leer.
- this.frm = new gui();
- this.frm.setVisible(true);
- String lastPath = "Last used path: " + this.prf.get(this.PathID, "/");
- this.frm.getLblFilePath().setText(lastPath);
-
- this.mdl = new model();
- this.invoker = new CommandInvoker();
-
- this.cml = new C_MenuListener(this.frm, this.PathID, this.FILE_ID, this.prf, this.mdl, this.invoker);
- this.cml.registerEvents();
- this.cml.registerCommands(); /**INVOKER einfügen!!!!*/
-
- this.cmlu = new C_MenuListener_undo(this.frm, this.PathID, this.FILE_ID, this.prf, this.mdl, this.invoker);
- this.cmlu.registerEvents();
- }
-
- /**
- * Main erstellt AutoGUI und setzt LookAndFeel
- * @param args (String[])
- */
- public static void main(String[] args) {
- // TODO code application logic here
- new AutoGUI();
- try
- {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- }
- catch(Exception ex){}
- }
-
- }
|