Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.ui / src / test / java / controls / dnd / JDnDTableTest.java @ 40561

History | View | Annotate | Download (2.68 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
/* CVS MESSAGES:
25
*
26
* $Id: JDnDTableTest.java 15818 2007-11-05 07:28:30Z bsanchez $
27
* $Log$
28
* Revision 1.2  2007-08-21 09:58:04  bsanchez
29
* - Quitados imports innecesarios
30
* - Quitado codigo no usado
31
* - Cambio de deprecated show por setVisible(true)
32
*
33
* Revision 1.1  2007/08/20 08:34:46  evercher
34
* He fusionado LibUI con LibUIComponents
35
*
36
* Revision 1.1  2006/09/27 13:34:57  jaume
37
* *** empty log message ***
38
*
39
*
40
*/
41
package controls.dnd;
42

    
43
import java.awt.Dimension;
44

    
45
import javax.swing.JFrame;
46
import javax.swing.JPanel;
47

    
48
import org.gvsig.gui.beans.TestUI;
49
import org.gvsig.gui.beans.controls.dnd.JDnDList;
50
import org.gvsig.gui.beans.controls.dnd.JDnDListModel;
51
import org.gvsig.gui.beans.controls.dnd.JDnDTable;
52
import org.gvsig.gui.beans.controls.dnd.JDnDTableModel;
53
/**
54
 * El model que ha de suportar les funcions d'una JDnDTable. Encara est? en
55
 * proves.
56
 *
57
 * @author jaume
58
 */
59
public class JDnDTableTest {
60
        static String[] colNames = new String[] {"1234", "abcd", "qwerty"};
61
        static String[][] values = new String[][] {new String[] {"a1", "a2", "a3"},
62
                                                                                new String[] {"b1", "b2", "b3"},
63
                                                                                new String[] {"c1", "c2", "c3"}};
64

    
65
        public static void main(String args[]) {
66
                JFrame f = new TestUI("JDnDTableTest");
67
                JPanel content = new JPanel();
68
                content.setPreferredSize(new Dimension(500,400));
69

    
70
                JDnDTableModel model = new JDnDTableModel(values, colNames);
71
                JDnDListModel listModel = new JDnDListModel();
72
                listModel.addElement("a");
73
                listModel.addElement("b");
74
                listModel.addElement("c");
75

    
76
                JDnDTable tbl = new JDnDTable();
77

    
78
                tbl.setModel(model);
79
                tbl.setSize(new Dimension(450, 350));
80
                JDnDList list = new JDnDList();
81
                list.setModel(listModel);
82
                content.add(tbl);
83
                content.add(list);
84
                f.setContentPane(content);
85
                f.pack();
86
                f.setVisible(true);
87
        }
88
}