Statistics
| Revision:

root / trunk / libraries / libUIComponent_praster / src-test / org / gvsig / gui / beans / coordDataInput / TestCoordDataInput.java @ 8026

History | View | Annotate | Download (1.66 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
import org.gvsig.gui.beans.openFile.TestOpenFile;
10

    
11
public class TestCoordDataInput implements ComponentListener{
12
        private int                                                        w = 438, h = 130;
13
        private JFrame                                                frame = new JFrame();
14
        private CoordDataInputContainer                coord = null;
15
        
16
        public TestCoordDataInput(){
17
                coord = new CoordDataInputContainer(w - 10, h - 30);
18
                coord.addComponentListener(this);
19
                //coord.setComponentSize(w - 10, h - 30);
20
                coord.setParameters("Coordenadas pixel", "Sup.Izq", "X","Y","Inf.Der","X","Y");
21
                coord.setDecimalValues(true);
22
                coord.setCaracterValues(false);
23
                frame.getContentPane().add(coord);
24
                frame.setSize(w, h);
25
                frame.setVisible(true);
26
                
27
        }
28
        
29
        public static void main(String[] args){
30
                try {
31
                          UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
32
                          //UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
33
                          //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
34
            } catch( Exception e ) {
35
                  System.err.println( "No se puede cambiar al LookAndFeel");
36
            }
37
                TestCoordDataInput tof = new TestCoordDataInput();
38
        }
39

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

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

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

    
55
        public void componentShown(ComponentEvent e) {
56
                // TODO Auto-generated method stub
57
                
58
        }
59
}