Index: topia/src/java/org/codelutin/topia/ui/ButtonsPanel.java diff -u topia/src/java/org/codelutin/topia/ui/ButtonsPanel.java:1.1 topia/src/java/org/codelutin/topia/ui/ButtonsPanel.java:1.2 --- topia/src/java/org/codelutin/topia/ui/ButtonsPanel.java:1.1 Tue Jul 6 15:55:55 2004 +++ topia/src/java/org/codelutin/topia/ui/ButtonsPanel.java Tue Jul 13 08:23:22 2004 @@ -1,44 +1,90 @@ /* *##% - * Copyright (C) 2002, 2003 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. - *##%*/ +* Copyright (C) 2002, 2003 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. +*##%*/ /* * - * ButtonsPanel.java - * - * Created: Jun 1, 2004 - * - * @author Benjamin Poussin - * Copyright Code Lutin - * @version $Revision: 1.1 $ - * - * Mise a jour: $Date: 2004/07/06 15:55:55 $ - * par : $Author: mazelier $ - */ +* ButtonsPanel.java +* +* Created: Jun 1, 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.2 $ +* +* Mise a jour: $Date: 2004/07/13 08:23:22 $ +* par : $Author: mazelier $ +*/ package org.codelutin.topia.ui; +import javax.swing.JPanel; +import javax.swing.JButton; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; + /** * Panel constitue de 4 boutons Save, Cancel, Delete, Search utils * a la manipulation des entites. */ -public class ButtonsPanel{ // ButtonsPanel +public class ButtonsPanel extends JPanel{ // ButtonsPanel + + JButton buttonSave = new JButton("Save"); + JButton buttonCancel = new JButton("Cancel"); + JButton buttonDelete = new JButton("Delete"); + JButton buttonSearch = new JButton("Search"); public ButtonsPanel(){ + super(); + init(); } -} // ButtonsPanel + protected void addButton(JButton button, GridBagLayout layout, + GridBagConstraints constraint) { + layout.setConstraints(button, constraint); + add(button); + } + public void init() { + GridBagLayout layout = new GridBagLayout(); + GridBagConstraints constraint = new GridBagConstraints(); + + setLayout(layout); + + //Bouton Save + constraint.gridx=0; + constraint.gridy=0; + constraint.fill=GridBagConstraints.HORIZONTAL; + addButton(buttonSave, layout, constraint); + + //Bouton Cancel + constraint.gridx=0; + constraint.gridy=1; + addButton(buttonCancel, layout, constraint); + + //Bouton Delete + constraint.gridx=0; + constraint.gridy=2; + addButton(buttonDelete, layout, constraint); + + //Bouton Search + constraint.gridx=0; + constraint.gridy=3; + addButton(buttonSearch, layout, constraint); + } + + +} // ButtonsPanel