From: Roland Haeder Date: Fri, 24 Jul 2015 10:33:10 +0000 (+0200) Subject: Implemented getRowCount() + centered table and added exception in unfinished method X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a4a058d9585f786ca66c0f00f151755fc338cfb3;p=jaddressbook-share-lib.git Implemented getRowCount() + centered table and added exception in unfinished method Signed-off-by:Roland Häder --- diff --git a/Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java b/Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java index b403bf7..35d9496 100644 --- a/Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java +++ b/Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java @@ -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); } /** diff --git a/Addressbook/src/org/mxchange/addressbook/model/address/AddressTableModel.java b/Addressbook/src/org/mxchange/addressbook/model/address/AddressTableModel.java index d386b95..c3fcbc6 100644 --- a/Addressbook/src/org/mxchange/addressbook/model/address/AddressTableModel.java +++ b/Addressbook/src/org/mxchange/addressbook/model/address/AddressTableModel.java @@ -1,77 +1,77 @@ -/* - * 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 . - */ -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 () { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @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. - } -} +/* + * 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 . + */ +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. + } +}