Statistics
| Revision:

root / trunk / libraries / libCq_CMS_praster / src-test / org / cresques / ui / PalettePanelTest.java @ 8026

History | View | Annotate | Download (3.35 KB)

1
/*
2
 * Created on 03-ago-2006
3
 *
4
 * To change the template for this generated file go to
5
 * Window>Preferences>Java>Code Generation>Code and Comments
6
 */
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 */
25
package org.cresques.ui;
26

    
27
import java.awt.event.ComponentEvent;
28
import java.awt.event.ComponentListener;
29
import java.awt.event.WindowEvent;
30
import java.awt.event.WindowListener;
31
import java.io.File;
32
import java.net.MalformedURLException;
33
import java.util.Locale;
34

    
35
import javax.swing.JFrame;
36

    
37
import org.cresques.ui.raster.HistogramPanel;
38
import org.cresques.ui.raster.PalettePanel;
39
import org.gvsig.gui.beans.graphic.GraphicChartPanel;
40
import org.gvsig.i18n.Messages;
41

    
42
/**
43
 * C?digo de prueba para la interfaz de usuario de representaci?n de
44
 * histogramas.
45
 * 
46
 * @author Diego Guerrero (diego.guerrero@uclm.es)
47
 *
48
 */
49

    
50
public class PalettePanelTest implements ComponentListener, WindowListener {
51
        
52
        private int                         w = 400, h = 500;
53
        private JFrame                         frame=new JFrame();
54
        private PalettePanel        hp = null;
55
        
56
        public PalettePanelTest(){
57
                hp = new PalettePanel(w - 12, h - 45, frame);
58
                                
59
                frame.addComponentListener(this);
60
                frame.addWindowListener(this);
61
                frame.getContentPane().add(hp);
62
                frame.setSize(w,h);
63
                frame.setResizable(true);
64
                frame.setTitle("Histogramas");
65
                frame.setVisible(true);
66
        }
67
        
68
        public static void main(String[] args){
69
                try {
70
                        Messages.addLocale(new Locale("es"));
71
                        Messages.addResourceFamily("text", new File("bin/org/cresques/translations"));
72
                } catch (MalformedURLException e) {
73
                        e.printStackTrace();
74
                }
75
                PalettePanelTest hpt = new PalettePanelTest();
76
        }
77

    
78
        public void componentHidden(ComponentEvent e) {
79
                // TODO Auto-generated method stub
80

    
81
        }
82

    
83
        public void componentMoved(ComponentEvent e) {
84
                // TODO Auto-generated method stub
85

    
86
        }
87

    
88
        public void componentResized(ComponentEvent e) {
89
                hp.setComponentSize(frame.getWidth() - 12, frame.getHeight() - 45);
90

    
91
        }
92

    
93
        public void componentShown(ComponentEvent e) {
94
                // TODO Auto-generated method stub
95

    
96
        }
97

    
98
        public void windowActivated(WindowEvent e) {
99
                // TODO Auto-generated method stub
100
                
101
        }
102

    
103
        public void windowClosed(WindowEvent e) {
104
                // TODO Auto-generated method stub
105
                
106
        }
107

    
108
        public void windowClosing(WindowEvent e) {
109
                System.exit(0);
110
                
111
        }
112

    
113
        public void windowDeactivated(WindowEvent e) {
114
                // TODO Auto-generated method stub
115
                
116
        }
117

    
118
        public void windowDeiconified(WindowEvent e) {
119
                // TODO Auto-generated method stub
120
                
121
        }
122

    
123
        public void windowIconified(WindowEvent e) {
124
                // TODO Auto-generated method stub
125
                
126
        }
127

    
128
        public void windowOpened(WindowEvent e) {
129
                // TODO Auto-generated method stub
130
                
131
        }
132

    
133
}