]> git.mxchange.org Git - addressbook-lib.git/commitdiff
Implemented getRowCount() + centered table and added exception in unfinished method
authorRoland Haeder <roland@mxchange.org>
Fri, 24 Jul 2015 10:33:10 +0000 (12:33 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 24 Jul 2015 10:33:10 +0000 (12:33 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java
Addressbook/src/org/mxchange/addressbook/model/address/AddressTableModel.java

index b403bf745dad36d6a09a342143a84101210a031f..35d94965e7b1452405a54f7135bc5a5a76b832ee 100644 (file)
@@ -381,11 +381,12 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame
             */
            @Override
            public void mouseClicked(final MouseEvent e) {
+               throw new UnsupportedOperationException("Unfinished.");
            }
        });
 
        // Add table to frame
-       this.frame.add(this.dataTable);
+       this.frame.add(this.dataTable, BorderLayout.CENTER);
     }
 
     /**
index d386b95131117352d126670c6ee80a8806e8d12d..c3fcbc680a92e0baf476786964922b4d50dce415 100644 (file)
@@ -1,77 +1,77 @@
-/*\r
- * Copyright (C) 2015 Roland Haeder\r
- *\r
- * This program is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 3 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-package org.mxchange.addressbook.model.address;\r
-\r
-import javax.swing.table.TableModel;\r
-import org.mxchange.addressbook.client.Client;\r
-import org.mxchange.addressbook.model.BaseModel;\r
-\r
-/**\r
- *\r
- * @author Roland Haeder\r
- */\r
-public class AddressTableModel extends BaseModel implements TableModel {\r
-\r
-    /**\r
-     * Constructor with Client instance which holds the contact manager\r
-     *\r
-     * @param client Client instance\r
-     */\r
-    public AddressTableModel (final Client client) {\r
-       // Parent super constructor\r
-       super();\r
-\r
-       // Set client\r
-       this.setClient(client);\r
-    }\r
-\r
-    @Override\r
-    public Class<?> getColumnClass (final int columnIndex) {\r
-       throw new UnsupportedOperationException("Not supported yet. columnIndex=" + columnIndex); //To change body of generated methods, choose Tools | Templates.\r
-    }\r
-\r
-    @Override\r
-    public int getColumnCount () {\r
-       // Deligate this call to the contact manager\r
-       return this.getClient().getContactManager().getColumnCount();\r
-    }\r
-\r
-    @Override\r
-    public String getColumnName (final int columnIndex) {\r
-       throw new UnsupportedOperationException("Not supported yet. columnIndex=" + columnIndex); //To change body of generated methods, choose Tools | Templates.\r
-    }\r
-\r
-    @Override\r
-    public int getRowCount () {\r
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
-    }\r
-\r
-    @Override\r
-    public Object getValueAt (final int rowIndex, final int columnIndex) {\r
-       throw new UnsupportedOperationException("Not supported yet. rowIndex=" + rowIndex + ",columnIndex=" + columnIndex); //To change body of generated methods, choose Tools | Templates.\r
-    }\r
-\r
-    @Override\r
-    public boolean isCellEditable (final int rowIndex, final int columnIndex) {\r
-       throw new UnsupportedOperationException("Not supported yet. rowIndex=" + rowIndex + ",columnIndex=" + columnIndex); //To change body of generated methods, choose Tools | Templates.\r
-    }\r
-\r
-    @Override\r
-    public void setValueAt (final Object value, final int rowIndex, final int columnIndex) {\r
-       throw new UnsupportedOperationException("Not supported yet. value=" + value + ",rowIndex=" + rowIndex + ",columnIndex=" + columnIndex); //To change body of generated methods, choose Tools | Templates.\r
-    }\r
-}\r
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.addressbook.model.address;
+
+import javax.swing.table.TableModel;
+import org.mxchange.addressbook.client.Client;
+import org.mxchange.addressbook.model.BaseModel;
+
+/**
+ *
+ * @author Roland Haeder
+ */
+public class AddressTableModel extends BaseModel implements TableModel {
+
+    /**
+     * Constructor with Client instance which holds the contact manager
+     *
+     * @param client Client instance
+     */
+    public AddressTableModel (final Client client) {
+       // Parent super constructor
+       super();
+
+       // Set client
+       this.setClient(client);
+    }
+
+    @Override
+    public Class<?> getColumnClass (final int columnIndex) {
+       throw new UnsupportedOperationException("Not supported yet. columnIndex=" + columnIndex); //To change body of generated methods, choose Tools | Templates.
+    }
+
+    @Override
+    public int getColumnCount () {
+       // Deligate this call to the contact manager
+       return this.getClient().getContactManager().getColumnCount();
+    }
+
+    @Override
+    public String getColumnName (final int columnIndex) {
+       throw new UnsupportedOperationException("Not supported yet. columnIndex=" + columnIndex); //To change body of generated methods, choose Tools | Templates.
+    }
+
+    @Override
+    public int getRowCount () {
+       return this.getClient().getContactManager().size();
+    }
+
+    @Override
+    public Object getValueAt (final int rowIndex, final int columnIndex) {
+       throw new UnsupportedOperationException("Not supported yet. rowIndex=" + rowIndex + ",columnIndex=" + columnIndex); //To change body of generated methods, choose Tools | Templates.
+    }
+
+    @Override
+    public boolean isCellEditable (final int rowIndex, final int columnIndex) {
+       throw new UnsupportedOperationException("Not supported yet. rowIndex=" + rowIndex + ",columnIndex=" + columnIndex); //To change body of generated methods, choose Tools | Templates.
+    }
+
+    @Override
+    public void setValueAt (final Object value, final int rowIndex, final int columnIndex) {
+       throw new UnsupportedOperationException("Not supported yet. value=" + value + ",rowIndex=" + rowIndex + ",columnIndex=" + columnIndex); //To change body of generated methods, choose Tools | Templates.
+    }
+}