svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.ui / src / test / java / org / gvsig / gui / beans / table / TestTableColorTable.java @ 40561
History | View | Annotate | Download (2.58 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 |
package org.gvsig.gui.beans.table; |
25 |
|
26 |
import java.awt.Color; |
27 |
import java.awt.event.ActionEvent; |
28 |
import java.awt.event.ActionListener; |
29 |
|
30 |
import org.gvsig.gui.beans.TestUI; |
31 |
import org.gvsig.gui.beans.table.exceptions.NotInitializeException; |
32 |
/**
|
33 |
* Test del TableContainer
|
34 |
*
|
35 |
* @version 27/05/2007
|
36 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
|
37 |
*/
|
38 |
public class TestTableColorTable implements ActionListener { |
39 |
private int w = 460; |
40 |
private int h = 200; |
41 |
private TestUI frame = new TestUI("TestTableColorTable"); |
42 |
private TableContainer table = null; |
43 |
|
44 |
public TestTableColorTable() throws NotInitializeException { |
45 |
String[] columnNames = { "selec", "clase", "RGB", "Valor", "Max", "Alpha" }; |
46 |
int[] columnWidths = { 54, 1104, 94, 114, 114, 60 }; |
47 |
table = new TableContainer(columnNames, columnWidths);
|
48 |
table.setModel("TableColorModel");
|
49 |
table.initialize(); |
50 |
|
51 |
Object[] row = { Color.GREEN, "", "0,255,0", new Double(2), new Double(2), "255" }; |
52 |
Object[] row1 = { Color.BLUE, "", "0,0,255", new Double(1), new Double(2), "255" }; |
53 |
Object[] row2 = { Color.RED , "", "255,0,0", new Double(0), new Double(1), "255" }; |
54 |
table.addRow(row); |
55 |
|
56 |
table.addRow(row1); |
57 |
table.addRow(row2); |
58 |
|
59 |
frame.getContentPane().add(table); |
60 |
frame.setSize(w, h); |
61 |
frame.setVisible(true);
|
62 |
frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
63 |
} |
64 |
|
65 |
public static void main(String[] args) { |
66 |
try {
|
67 |
new TestTableColorTable();
|
68 |
} catch(NotInitializeException ex){
|
69 |
System.out.println("Tabla no inicializada"); |
70 |
} |
71 |
} |
72 |
|
73 |
public void actionPerformed(ActionEvent e) { |
74 |
System.out.println("Evento de bot?n!!"); |
75 |
} |
76 |
} |