diff --git a/.gitignore b/.gitignore index f53fb92..187bdfe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /nbproject/private/ +/build/ +/dist/ diff --git a/nbproject/project.properties b/nbproject/project.properties index fc3d214..823da8b 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -73,7 +73,7 @@ jlink.additionalmodules= jlink.additionalparam= jlink.launcher=true jlink.launcher.name=Aufgabe10_ChatProgramm -main.class=Aufgabe10_ChatProgramm.Start +main.class=ChatProgramm.Start manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false diff --git a/src/Aufgabe10_ChatProgramm/Start.java b/src/Aufgabe10_ChatProgramm/Start.java deleted file mode 100644 index 6bb7c2e..0000000 --- a/src/Aufgabe10_ChatProgramm/Start.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template - */ - -package Aufgabe10_ChatProgramm; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; - -/** - * Builder Class - * @author le - */ -public class Start -{ - public Start(String host, String dateiname) throws MalformedURLException, IOException - { - URL oURL = new URL(host + "/" + dateiname); - InputStream inS = oURL.openStream(); - BufferedInputStream in = new BufferedInputStream(inS); - - String tmpVerzeichnis = System.getProperty("java.io.tmpdir"); - String ausgabeDatei = tmpVerzeichnis + File.separator + dateiname; - - FileOutputStream fos = new FileOutputStream(ausgabeDatei); - BufferedOutputStream out = new BufferedOutputStream(fos); - - int wert = 0; - - while ( (wert = in.read()) >= 0) - { - out.write(wert); - } - out.flush(); - out.close(); - in.close(); - System.out.println("Datei " + dateiname + - " im Verzeichnis " + tmpVerzeichnis + - " gespeichert"); - } - - /** - * @param args the command line arguments - */ - public static void main(String[] args) - { - if (args.length != 2) - { - System.err.println("2 Aufrufparameter nötig: Host und Dateiname"); - } - else - { - try - { - new Start(args[0], args[1]); - } - catch (Exception ex) - { - System.err.println(ex); - } - } - } -} diff --git a/src/Aufgabe10_ChatProgramm/Client.java b/src/ChatProgramm/Client.java similarity index 98% rename from src/Aufgabe10_ChatProgramm/Client.java rename to src/ChatProgramm/Client.java index d5c104a..8924c80 100644 --- a/src/Aufgabe10_ChatProgramm/Client.java +++ b/src/ChatProgramm/Client.java @@ -3,7 +3,7 @@ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template */ -package Aufgabe10_ChatProgramm; +package ChatProgramm; import java.io.BufferedReader; import java.io.IOException; diff --git a/src/Aufgabe10_ChatProgramm/Server.java b/src/ChatProgramm/Server.java similarity index 98% rename from src/Aufgabe10_ChatProgramm/Server.java rename to src/ChatProgramm/Server.java index cb8b6c1..b54b012 100644 --- a/src/Aufgabe10_ChatProgramm/Server.java +++ b/src/ChatProgramm/Server.java @@ -3,7 +3,7 @@ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template */ -package Aufgabe10_ChatProgramm; +package ChatProgramm; import java.io.BufferedReader; import java.io.IOException; diff --git a/src/ChatProgramm/Start.java b/src/ChatProgramm/Start.java new file mode 100644 index 0000000..92d759b --- /dev/null +++ b/src/ChatProgramm/Start.java @@ -0,0 +1,45 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template + */ + +package ChatProgramm; + +import ChatProgramm.controller.CommandController; +import ChatProgramm.model.Transmitter; +import ChatProgramm.view.ChatView; +import javax.swing.JOptionPane; +import javax.swing.UIManager; + +/** + * Builder Class + * @author le + */ +public class Start +{ + public Start() + { + Transmitter transmitter = new Transmitter(); + ChatView view = new ChatView(); + CommandController controller_commands = new CommandController(view, transmitter); + controller_commands.registerEvents(); + controller_commands.registerCommands(); + view.setVisible(true); + } + + /** + * @param args the command line arguments + */ + public static void main(String[] args) + { + try + { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } + catch (Exception ex) + { + JOptionPane.showMessageDialog(null, ex.toString()); + } + new Start(); + } +} \ No newline at end of file diff --git a/src/ChatProgramm/controller/CommandController.java b/src/ChatProgramm/controller/CommandController.java new file mode 100644 index 0000000..6d4c856 --- /dev/null +++ b/src/ChatProgramm/controller/CommandController.java @@ -0,0 +1,58 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ + +package ChatProgramm.controller; + +import ChatProgramm.controller.commands.CommandConnect; +import ChatProgramm.controller.commands.CommandInvoker; +import ChatProgramm.controller.commands.CommandSend; +import ChatProgramm.model.Transmitter; +import ChatProgramm.view.ChatView; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * + * @author ahren + */ +public class CommandController implements ActionListener{ + + private ChatView view; + private Transmitter transmitter; + private CommandInvoker invoker; + + public CommandController(ChatView view, Transmitter transmitter){ + this.view = view; + this.transmitter = transmitter; + this.invoker = new CommandInvoker(); + } + + public void registerEvents(){ + view.getBtnConnect().addActionListener(this); + view.getTfNachricht().addActionListener(this); + } + + public void registerCommands(){ + invoker.addCommand(view.getBtnConnect(), new CommandConnect()); + invoker.addCommand(view.getTfNachricht(), new CommandSend()); + } + + /** + * Ausführen des jeweiligen Kommandos + * @param e Referenz auf das Event + */ + @Override + public void actionPerformed(ActionEvent e) { + Component key = (Component)e.getSource(); + invoker.executeCommand(key); +// if(key == view.getBtnOpen()|| key==view.getMiOpen()) +// invoker.deleteStack(); +// } + } + +} + + diff --git a/src/ChatProgramm/controller/Nachricht.java b/src/ChatProgramm/controller/Nachricht.java new file mode 100644 index 0000000..55590e4 --- /dev/null +++ b/src/ChatProgramm/controller/Nachricht.java @@ -0,0 +1,18 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ + +package ChatProgramm.controller; + +/** + * + * @author ahren + */ +class Nachricht +{ + public Nachricht() + { + + } +} diff --git a/src/ChatProgramm/controller/ReceiveAdapter.java b/src/ChatProgramm/controller/ReceiveAdapter.java new file mode 100644 index 0000000..6d4d83a --- /dev/null +++ b/src/ChatProgramm/controller/ReceiveAdapter.java @@ -0,0 +1,41 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ + +package ChatProgramm.controller; + +import java.util.concurrent.Flow; +import java.util.concurrent.Flow.Subscriber; + +/** + * + * @author ahren + */ +public class ReceiveAdapter implements Subscriber +{ + public ReceiveAdapter() + { + + } + + @Override + public void onSubscribe(Flow.Subscription subscription) + { + } + + @Override + public void onNext(Nachricht item) + { + } + + @Override + public void onError(Throwable throwable) + { + } + + @Override + public void onComplete() + { + } +} diff --git a/src/ChatProgramm/controller/commands/CommandConnect.java b/src/ChatProgramm/controller/commands/CommandConnect.java new file mode 100644 index 0000000..d1055a3 --- /dev/null +++ b/src/ChatProgramm/controller/commands/CommandConnect.java @@ -0,0 +1,34 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ + +package ChatProgramm.controller.commands; + +/** + * + * @author ahren + */ +public class CommandConnect implements CommandInterface +{ + public CommandConnect() + { + + } + + @Override + public void execute() + { + } + + @Override + public boolean isUndoable() + { + return false; + } + + @Override + public void undo() + { + } +} diff --git a/src/ChatProgramm/controller/commands/CommandInterface.java b/src/ChatProgramm/controller/commands/CommandInterface.java new file mode 100644 index 0000000..7f34a72 --- /dev/null +++ b/src/ChatProgramm/controller/commands/CommandInterface.java @@ -0,0 +1,18 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ + +package ChatProgramm.controller.commands; + +/** + * + * @author ahren + */ +public interface CommandInterface +{ + public void execute(); + public void undo(); +// public void redo(); + public boolean isUndoable(); +} diff --git a/src/ChatProgramm/controller/commands/CommandInvoker.java b/src/ChatProgramm/controller/commands/CommandInvoker.java new file mode 100644 index 0000000..5162f05 --- /dev/null +++ b/src/ChatProgramm/controller/commands/CommandInvoker.java @@ -0,0 +1,69 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ + +package ChatProgramm.controller.commands; + +import java.awt.Component; +import java.util.HashMap; +import java.util.Stack; + +/** + * + * @author ahren + */ +public class CommandInvoker { + + private HashMap commands; + private Stack undoStack; + + public CommandInvoker(){ + commands = new HashMap<>(); + undoStack = new Stack(); + } + + /** + * Fügt ein Kommando zur Kommando-"Datenbank" = HashMap hinzu + * @param key Quelle des Events + * @param value Referenz auf das zugehörige Kommando-Objekt + */ + public void addCommand(Component key, CommandInterface value){ + commands.put(key, value); + } + + /** + * Führt Kommando der Eventquelle "key" aus und legt die Referenz + * des Kommando in den Undo-Stack + * @param key Referenz auf die Eventquelle + */ + public void executeCommand(Component key){ + CommandInterface command = commands.get(key); + command.execute(); + if (command.isUndoable()) + { + undoStack.push(command); + } + } + /** + * Falls der Stack Elemente enthält, wird das oberste Element geholt + * und die Methode "undo" des Commands aufgerufen + */ + public void undoCommand() + { + if (!undoStack.isEmpty()) + { + undoStack.pop().undo(); + } + } + + /** + * Löscht bei Öffnen einer neuen Datei den Stack + */ + public void deleteStack() + { + while(!undoStack.isEmpty()) + undoStack.pop(); + } + +} diff --git a/src/ChatProgramm/controller/commands/CommandSend.java b/src/ChatProgramm/controller/commands/CommandSend.java new file mode 100644 index 0000000..d5a4593 --- /dev/null +++ b/src/ChatProgramm/controller/commands/CommandSend.java @@ -0,0 +1,34 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ + +package ChatProgramm.controller.commands; + +/** + * + * @author ahren + */ +public class CommandSend implements CommandInterface +{ + public CommandSend() + { + + } + + @Override + public void execute() + { + } + + @Override + public boolean isUndoable() + { + return false; + } + + @Override + public void undo() + { + } +} diff --git a/src/ChatProgramm/model/Transmitter.java b/src/ChatProgramm/model/Transmitter.java new file mode 100644 index 0000000..497265a --- /dev/null +++ b/src/ChatProgramm/model/Transmitter.java @@ -0,0 +1,23 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ + +package ChatProgramm.model; + +/** + * + * @author ahren + */ +public class Transmitter implements Runnable +{ + public Transmitter() + { + + } + + @Override + public void run() + { + } +} diff --git a/src/ChatProgramm/util/OhmLogger.java b/src/ChatProgramm/util/OhmLogger.java new file mode 100644 index 0000000..f0e32da --- /dev/null +++ b/src/ChatProgramm/util/OhmLogger.java @@ -0,0 +1,111 @@ +package ChatProgramm.util; + +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ + + + +import java.io.IOException; +import java.io.InputStream; +import java.time.LocalDateTime; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +//import java.util.Properties; +import java.util.logging.*; + +/** + * Klasse zur eigens konfigurierten Log-Ausgabe in der Console + * @author ahrens + */ +public class OhmLogger +{ + private static final String LOGGER_NAME = "OhmLogger"; + private static Logger lg = null; + + /** + * privater Konstrukter -> Singleton + */ + private OhmLogger() + { + } + + /** + * Public Method zum Erstellen des Loggers und zum Aufruf der Methode + * zum Initialisieren + * @return Referenz auf Logger + */ + public static Logger getLogger() + { + if (lg == null) + { + lg = Logger.getLogger(LOGGER_NAME); + initLogger(); + } + return lg; + } + + /** + * Methode zum Initialisieren, Suchen der Konfigurationsdatei, Anlegen eines + * neuen Console Handlers, Löschen der bisherigen Standard Handler und + * Einfügen des eigenen Handler, Setzen des Levels, je nach Properties + */ + private static void initLogger() + { + try (InputStream configFile = OhmLogger.class.getClassLoader().getResourceAsStream("config.properties")) { + if (configFile != null) { + Properties properties = new Properties(); + properties.load(configFile); + java.util.logging.Level classLogLevel = java.util.logging.Level.parse(properties.getProperty("log.level")); + + + ConsoleHandler ch = new ConsoleHandler(); + ch.setFormatter(new OhmFormatter()); + lg.setUseParentHandlers(false); + lg.getHandlers(); + lg.addHandler(ch); + + + lg.setLevel(classLogLevel); + + String logDirectory = properties.getProperty("log.directory"); + String logFileName = properties.getProperty("log.filename"); + + FileHandler fileHandler = new FileHandler(logDirectory + "/" + logFileName, true); + fileHandler.setFormatter(new OhmFormatter()); + lg.addHandler(fileHandler); + + + } else { + System.err.println("Unable to find config.properties file. OhmLogger will use default settings."); + } + } catch (IOException | SecurityException e) { + System.err.println("Error configuring OhmLogger: " + e.getMessage()); + } + + } +} + +/** + * Klasse zum Setzen des Formates des Auszugebenden Log-Strings + * @author ahren + */ +class OhmFormatter extends Formatter +{ + @Override + public String format(LogRecord record) + { + String logline = "| "; + + LocalDateTime ldt = LocalDateTime.now(); + logline += ldt.toString(); + logline += " | " + record.getLevel(); + logline += " | " + record.getSourceClassName(); + logline += " | " + record.getMessage(); + logline += " |\n"; + + return logline; + } +} \ No newline at end of file diff --git a/src/ChatProgramm/view/ChatView.form b/src/ChatProgramm/view/ChatView.form new file mode 100644 index 0000000..6ad137b --- /dev/null +++ b/src/ChatProgramm/view/ChatView.form @@ -0,0 +1,151 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ChatProgramm/view/ChatView.java b/src/ChatProgramm/view/ChatView.java new file mode 100644 index 0000000..08ad619 --- /dev/null +++ b/src/ChatProgramm/view/ChatView.java @@ -0,0 +1,285 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template + */ +package ChatProgramm.view; + +/** + * + * @author ahren + */ +public class ChatView extends javax.swing.JFrame +{ + + /** + * Creates new form ChatView + */ + public ChatView() + { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() + { + + dialogChooseMode = new javax.swing.JDialog(); + lblMode = new javax.swing.JLabel(); + BtnServer = new javax.swing.JRadioButton(); + BtnClient = new javax.swing.JRadioButton(); + jPanel1 = new javax.swing.JPanel(); + BtnConnect = new javax.swing.JButton(); + BtnGrpMode = new javax.swing.ButtonGroup(); + tfNachricht = new javax.swing.JTextField(); + jScrollPane2 = new javax.swing.JScrollPane(); + txtChat = new javax.swing.JTextArea(); + + dialogChooseMode.setMinimumSize(new java.awt.Dimension(278, 208)); + dialogChooseMode.getContentPane().setLayout(new java.awt.GridLayout(0, 1)); + + lblMode.setText(" Choose your mode:"); + dialogChooseMode.getContentPane().add(lblMode); + + BtnGrpMode.add(BtnServer); + BtnServer.setText("Server"); + BtnServer.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + BtnServerActionPerformed(evt); + } + }); + dialogChooseMode.getContentPane().add(BtnServer); + + BtnGrpMode.add(BtnClient); + BtnClient.setText("Client"); + BtnClient.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + BtnClientActionPerformed(evt); + } + }); + dialogChooseMode.getContentPane().add(BtnClient); + + BtnConnect.setText("Connect"); + BtnConnect.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + BtnConnectActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap(65, Short.MAX_VALUE) + .addComponent(BtnConnect) + .addContainerGap(76, Short.MAX_VALUE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(BtnConnect) + .addContainerGap(57, Short.MAX_VALUE)) + ); + + dialogChooseMode.getContentPane().add(jPanel1); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setMinimumSize(new java.awt.Dimension(568, 548)); + addWindowListener(new java.awt.event.WindowAdapter() + { + public void windowOpened(java.awt.event.WindowEvent evt) + { + formWindowOpened(evt); + } + }); + + tfNachricht.setToolTipText(""); + tfNachricht.addMouseListener(new java.awt.event.MouseAdapter() + { + public void mouseClicked(java.awt.event.MouseEvent evt) + { + tfNachrichtMouseClicked(evt); + } + }); + tfNachricht.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + tfNachrichtActionPerformed(evt); + } + }); + getContentPane().add(tfNachricht, java.awt.BorderLayout.PAGE_END); + + jScrollPane2.setPreferredSize(new java.awt.Dimension(238, 150)); + + txtChat.setColumns(20); + txtChat.setRows(5); + txtChat.setText("Chat:"); + jScrollPane2.setViewportView(txtChat); + + getContentPane().add(jScrollPane2, java.awt.BorderLayout.CENTER); + + pack(); + }// //GEN-END:initComponents + + private void BtnClientActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BtnClientActionPerformed + {//GEN-HEADEREND:event_BtnClientActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_BtnClientActionPerformed + + private void BtnServerActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BtnServerActionPerformed + {//GEN-HEADEREND:event_BtnServerActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_BtnServerActionPerformed + + private void tfNachrichtActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_tfNachrichtActionPerformed + {//GEN-HEADEREND:event_tfNachrichtActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_tfNachrichtActionPerformed + + private void formWindowOpened(java.awt.event.WindowEvent evt)//GEN-FIRST:event_formWindowOpened + {//GEN-HEADEREND:event_formWindowOpened + dialogChooseMode.show(); + }//GEN-LAST:event_formWindowOpened + + private void tfNachrichtMouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_tfNachrichtMouseClicked + {//GEN-HEADEREND:event_tfNachrichtMouseClicked + + }//GEN-LAST:event_tfNachrichtMouseClicked + + private void BtnConnectActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BtnConnectActionPerformed + {//GEN-HEADEREND:event_BtnConnectActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_BtnConnectActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) + { + /* Set the Nimbus look and feel */ + // + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try + { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) + { + if ("Nimbus".equals(info.getName())) + { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } + catch (ClassNotFoundException ex) + { + java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + catch (InstantiationException ex) + { + java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + catch (IllegalAccessException ex) + { + java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + catch (javax.swing.UnsupportedLookAndFeelException ex) + { + java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + // + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() + { + public void run() + { + new ChatView().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JRadioButton BtnClient; + private javax.swing.JButton BtnConnect; + private javax.swing.ButtonGroup BtnGrpMode; + private javax.swing.JRadioButton BtnServer; + private javax.swing.JDialog dialogChooseMode; + private javax.swing.JPanel jPanel1; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JLabel lblMode; + private javax.swing.JTextField tfNachricht; + private javax.swing.JTextArea txtChat; + // End of variables declaration//GEN-END:variables + + /** + * @return the BtnClient + */ + public javax.swing.JRadioButton getBtnClient() + { + return BtnClient; + } + + /** + * @return the BtnConnect + */ + public javax.swing.JButton getBtnConnect() + { + return BtnConnect; + } + + /** + * @return the BtnGrpMode + */ + public javax.swing.ButtonGroup getBtnGrpMode() + { + return BtnGrpMode; + } + + /** + * @return the BtnServer + */ + public javax.swing.JRadioButton getBtnServer() + { + return BtnServer; + } + + /** + * @return the jDialog1 + */ + public javax.swing.JDialog getjDialog1() + { + return dialogChooseMode; + } + + /** + * @return the tfNachricht + */ + public javax.swing.JTextField getTfNachricht() + { + return tfNachricht; + } + + /** + * @return the txtChat + */ + public javax.swing.JTextArea getTxtChat() + { + return txtChat; + } +} diff --git a/src/config.properties b/src/config.properties new file mode 100644 index 0000000..b96e11a --- /dev/null +++ b/src/config.properties @@ -0,0 +1,8 @@ +log.level=INFO + +log.directory=../Aufgabe7_bandit +log.filename=ohmLog + +# Beispiel f\u00fcr verschiedene Level f\u00fcr unterschiedliche Pakete +# log.level.bandit.Zahlengenerator=FINE +# log.level.bandit.Model.Wuerfel=WARNING