Statistics
| Revision:

root / trunk / libraries / libUIComponent / src-test-ui / org / gvsig / gui / beans / coorddatainput / TestCoordDataInput.java @ 11625

History | View | Annotate | Download (1.65 KB)

1
package org.gvsig.gui.beans.coorddatainput;
2

    
3
import java.awt.event.ComponentEvent;
4
import java.awt.event.ComponentListener;
5

    
6
import javax.swing.JFrame;
7
import javax.swing.UIManager;
8

    
9
public class TestCoordDataInput implements ComponentListener{
10
        private int                                                        w = 438, h = 130;
11
        private JFrame                                                frame = new JFrame();
12
        private CoordDataInputContainer                coord = null;
13
        
14
        public TestCoordDataInput(){
15
                coord = new CoordDataInputContainer(w - 10, h - 30);
16
                coord.addComponentListener(this);
17
                //coord.setComponentSize(w - 10, h - 30);
18
                coord.setParameters("Coordenadas pixel", "Sup.Izq", "X","Y","Inf.Der","X","Y");
19
                coord.setDecimalValues(true);
20
                coord.setCaracterValues(false);
21
                frame.getContentPane().add(coord);
22
                frame.setSize(w, h);
23
                frame.setVisible(true);
24
                frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
25
        }
26

    
27
        public static void main(String[] args) {
28
                try {
29
                        UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
30
                } catch (Exception e) {
31
                        System.err.println("No se puede cambiar al LookAndFeel");
32
                }
33
                try {
34
                        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
35
                } catch( Exception e ) {
36
                        System.err.println( "No se puede cambiar al LookAndFeel");
37
                }
38
                new TestCoordDataInput();
39
        }
40

    
41
        public void componentHidden(ComponentEvent e) {
42
                // TODO Auto-generated method stub
43
        }
44

    
45
        public void componentMoved(ComponentEvent e) {
46
                // TODO Auto-generated method stub
47
        }
48

    
49
        public void componentResized(ComponentEvent e) {
50
                coord.setComponentSize(frame.getWidth() - 10, frame.getWidth() - 30);
51
        }
52

    
53
        public void componentShown(ComponentEvent e) {
54
                // TODO Auto-generated method stub
55
        }
56
}