2 * Copyright (C) 2015 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.addressbook.client.gui;
19 import org.apache.logging.log4j.LogManager;
20 import org.apache.logging.log4j.Logger;
21 import org.mxchange.addressbook.application.Application;
22 import org.mxchange.addressbook.client.Client;
23 import org.mxchange.addressbook.manager.contact.ManageableContact;
27 * @author Roland Haeder
29 public class AddressbookFrame extends javax.swing.JFrame implements ClientFrame {
33 private final Logger LOG;
38 private final Client client;
44 LOG = LogManager.getLogger(this);
48 * Creates an instance of this frame with a client instance
51 public AddressbookFrame (final Client client) {
53 this.getLogger().debug("Initializing Swing frame ...");
63 public Application getApplication () {
64 throw new UnsupportedOperationException("Not implemented.");
68 public final Client getClient () {
73 public ManageableContact getContactManager () {
74 throw new UnsupportedOperationException("Not implemented.");
78 * This method is called from within the constructor to initialize the form.
79 * WARNING: Do NOT modify this code. The content of this method is always
80 * regenerated by the Form Editor.
82 @SuppressWarnings ("unchecked")
83 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
84 private void initComponents() {
86 setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
88 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
89 getContentPane().setLayout(layout);
90 layout.setHorizontalGroup(
91 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
92 .addGap(0, 400, Short.MAX_VALUE)
94 layout.setVerticalGroup(
95 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
96 .addGap(0, 300, Short.MAX_VALUE)
100 }// </editor-fold>//GEN-END:initComponents
103 * Initializes the frame
106 public void initFrame (final Client client) {
108 * Set the Nimbus look and feel
110 //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
112 * If Nimbus (introduced in Java SE 6) is not available, stay with the
113 * default look and feel. For details see
114 * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
117 for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
118 if ("Nimbus".equals(info.getName())) {
119 javax.swing.UIManager.setLookAndFeel(info.getClassName());
123 } catch (final ClassNotFoundException ex) {
124 this.getLogger().catching(ex);
125 } catch (final InstantiationException ex) {
126 this.getLogger().catching(ex);
127 } catch (final IllegalAccessException ex) {
128 this.getLogger().catching(ex);
129 } catch (final javax.swing.UnsupportedLookAndFeelException ex) {
130 this.getLogger().catching(ex);
135 this.getLogger().debug("Displaying form ...");
138 * Create and display the form
140 java.awt.EventQueue.invokeLater(new Runnable() {
143 new AddressbookFrame(client).setVisible(true);
153 protected final Logger getLogger () {
157 // Variables declaration - do not modify//GEN-BEGIN:variables
158 // End of variables declaration//GEN-END:variables