Author: chatellier Date: 2009-10-26 15:02:52 +0000 (Mon, 26 Oct 2009) New Revision: 2692 Removed: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/ConfigUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/IsisConfigTableModel.java Log: Replaced by jaxx configuration editor. Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/ConfigUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/ConfigUI.jaxx 2009-10-26 15:02:11 UTC (rev 2691) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/ConfigUI.jaxx 2009-10-26 15:02:52 UTC (rev 2692) @@ -1,36 +0,0 @@ -<!-- -/* *##% - * Copyright (C) 2005 - 2009 Ifremer, Code Lutin - * - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - --> -<JFrame title='isisfish.welcome.menu.configuration'> - <JPanel layout='{new BorderLayout()}'> - <JScrollPane constraints="BorderLayout.CENTER"> - <JTable id='propertiesTable' model='{new IsisConfigTableModel()}' /> - </JScrollPane> - <Table constraints="BorderLayout.SOUTH"> - <row> - <cell fill="none" weightx="1"> - <JButton id='cancelButton' text='isisfish.common.cancel' onActionPerformed='' visible='false' /> - </cell> - <cell fill='none' anchor='east' weightx="1"> - <JButton id='okButton' text='isisfish.common.ok' onActionPerformed='dispose()' /> - </cell> - </row> - </Table> - </JPanel> -</JFrame> \ No newline at end of file Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/IsisConfigTableModel.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/IsisConfigTableModel.java 2009-10-26 15:02:11 UTC (rev 2691) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/IsisConfigTableModel.java 2009-10-26 15:02:52 UTC (rev 2692) @@ -1,154 +0,0 @@ -/* *##% - * Copyright (C) 2009 Code Lutin - * - * 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 2 - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -package fr.ifremer.isisfish.ui.config; - -import static org.nuiton.i18n.I18n._; - -import javax.swing.table.AbstractTableModel; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import fr.ifremer.isisfish.IsisConfig; -import fr.ifremer.isisfish.IsisFish; - -/** - * Model pour l'edition des proprietes de IsisConfig. - * - * Columns : - * <li>Property name</li> - * <li>Property value</li> - * - * @author chatellier - * @version $Revision: 2418 $ - * - * Last update : $Date: 2009-06-22 14:52:27 +0200 (lun. 22 juin 2009) $ - * By : $Author: chatellier $ - */ -public class IsisConfigTableModel extends AbstractTableModel { - - /** Log. */ - private static Log log = LogFactory - .getLog(IsisConfigTableModel.class); - - /** serialVersionUID. */ - private static final long serialVersionUID = 4593731087704399810L; - - /** Columns names. */ - public final static String[] COLUMN_NAMES = { _("isisfish.common.name"), - _("isisfish.common.value") }; - - /* - * @see javax.swing.table.TableModel#getColumnCount() - */ - @Override - public int getColumnCount() { - return COLUMN_NAMES.length; - } - - /* - * @see javax.swing.table.TableModel#getRowCount() - */ - @Override - public int getRowCount() { - return IsisConfig.Option.values().length; - } - - /* - * @see javax.swing.table.TableModel#getValueAt(int, int) - */ - @Override - public Object getValueAt(int rowIndex, int columnIndex) { - - Object result = null; - - String name = IsisConfig.Option.values()[rowIndex].key; - switch (columnIndex) { - case 0: - result = name; - break; - case 1: - result = IsisFish.config.getOption(name); - break; - default: - throw new IndexOutOfBoundsException("No such column " + columnIndex); - } - - return result; - } - - /* - * @see javax.swing.table.TableModel#getColumnClass(int) - */ - @Override - public Class<?> getColumnClass(int columnIndex) { - - Class<?> result = null; - - switch (columnIndex) { - case 0: - result = String.class; - break; - case 1: - result = String.class; - break; - default: - throw new IndexOutOfBoundsException("No such column " + columnIndex); - } - - return result; - } - - /* - * @see javax.swing.table.TableModel#getColumnName(int) - */ - @Override - public String getColumnName(int columnIndex) { - return COLUMN_NAMES[columnIndex]; - } - - /* - * @see javax.swing.table.TableModel#isCellEditable(int, int) - */ - @Override - public boolean isCellEditable(int rowIndex, int columnIndex) { - return columnIndex > 0; - } - - /* - * @see javax.swing.table.TableModel#setValueAt(java.lang.Object, int, int) - */ - @Override - public void setValueAt(Object value, int rowIndex, int columnIndex) { - - if (log.isDebugEnabled()) { - log.debug("Cell edition (column " + columnIndex + ") = " + value); - } - - String name = IsisConfig.Option.values()[rowIndex].key; - switch (columnIndex) { - case 1: - IsisFish.config.setOption(name, (String)value); - break; - default: - throw new IndexOutOfBoundsException("No such column " + columnIndex); - } - - } -}