svn-gvsig-desktop / trunk / libraries / libUIComponent / src-test / org / gvsig / gui / beans / graphic / TestGraphic.java @ 10741
History | View | Annotate | Download (1.27 KB)
1 |
package org.gvsig.gui.beans.graphic; |
---|---|
2 |
|
3 |
import java.awt.event.ComponentEvent; |
4 |
import java.awt.event.ComponentListener; |
5 |
import java.awt.event.MouseEvent; |
6 |
import java.awt.event.MouseListener; |
7 |
|
8 |
import javax.swing.JFrame; |
9 |
|
10 |
import org.gvsig.gui.beans.table.exceptions.NotInitializeException; |
11 |
|
12 |
public class TestGraphic implements ComponentListener{ |
13 |
private int w = 500, h = 300; |
14 |
private JFrame frame=new JFrame(); |
15 |
private GraphicContainer graphic = null; |
16 |
|
17 |
public TestGraphic() throws NotInitializeException{ |
18 |
graphic = new GraphicContainer(w - 12, h - 30, false); |
19 |
|
20 |
frame.addComponentListener(this);
|
21 |
|
22 |
frame.getContentPane().add(graphic); |
23 |
frame.setSize(w, h); |
24 |
frame.setVisible(true);
|
25 |
} |
26 |
|
27 |
public static void main(String[] args) { |
28 |
try{
|
29 |
TestGraphic tabla = new TestGraphic();
|
30 |
}catch(NotInitializeException ex){
|
31 |
System.out.println("Tabla no inicializada"); |
32 |
} |
33 |
} |
34 |
|
35 |
public void componentHidden(ComponentEvent e) { |
36 |
// TODO Auto-generated method stub
|
37 |
|
38 |
} |
39 |
|
40 |
public void componentMoved(ComponentEvent e) { |
41 |
// TODO Auto-generated method stub
|
42 |
|
43 |
} |
44 |
|
45 |
public void componentResized(ComponentEvent e) { |
46 |
graphic.setComponentSize(frame.getWidth() - 12, frame.getHeight() - 30); |
47 |
} |
48 |
|
49 |
public void componentShown(ComponentEvent e) { |
50 |
// TODO Auto-generated method stub
|
51 |
|
52 |
} |
53 |
|
54 |
} |