root / trunk / libraries / libUIComponent / src-test-ui / org / gvsig / gui / beans / swing / textBoxWithCalendar / TestJCalendarDatePanel.java @ 13136
History | View | Annotate | Download (3.34 KB)
1 |
package org.gvsig.gui.beans.swing.textBoxWithCalendar; |
---|---|
2 |
|
3 |
import java.awt.Dimension; |
4 |
import java.io.Serializable; |
5 |
|
6 |
import javax.swing.JFrame; |
7 |
|
8 |
import org.gvsig.gui.beans.swing.textBoxWithCalendar.JCalendarDatePanel; |
9 |
|
10 |
|
11 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
12 |
*
|
13 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
14 |
*
|
15 |
* This program is free software; you can redistribute it and/or
|
16 |
* modify it under the terms of the GNU General Public License
|
17 |
* as published by the Free Software Foundation; either version 2
|
18 |
* of the License, or (at your option) any later version.
|
19 |
*
|
20 |
* This program is distributed in the hope that it will be useful,
|
21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
* GNU General Public License for more details.
|
24 |
*
|
25 |
* You should have received a copy of the GNU General Public License
|
26 |
* along with this program; if not, write to the Free Software
|
27 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
28 |
*
|
29 |
* For more information, contact:
|
30 |
*
|
31 |
* Generalitat Valenciana
|
32 |
* Conselleria d'Infraestructures i Transport
|
33 |
* Av. Blasco Ib??ez, 50
|
34 |
* 46010 VALENCIA
|
35 |
* SPAIN
|
36 |
*
|
37 |
* +34 963862235
|
38 |
* gvsig@gva.es
|
39 |
* www.gvsig.gva.es
|
40 |
*
|
41 |
* or
|
42 |
*
|
43 |
* IVER T.I. S.A
|
44 |
* Salamanca 50
|
45 |
* 46005 Valencia
|
46 |
* Spain
|
47 |
*
|
48 |
* +34 963163400
|
49 |
* dac@iver.es
|
50 |
*/
|
51 |
|
52 |
/**
|
53 |
* Tests the JCalendarCDatePanel -> creates a JFrame that allows use a JCalendarCDatePanel object
|
54 |
*
|
55 |
* @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
|
56 |
*/
|
57 |
public class TestJCalendarDatePanel extends JFrame implements Serializable { |
58 |
private static final long serialVersionUID = 6214293384150864091L; |
59 |
|
60 |
/**
|
61 |
* Test method for the TestJCalendarCDatePanel class
|
62 |
* @param args
|
63 |
*/
|
64 |
public static void main(String[] args) |
65 |
{ |
66 |
int old_width = 200; |
67 |
int old_height = 50; |
68 |
int new_width = 445; |
69 |
int new_height = 370; |
70 |
|
71 |
// Objects creation
|
72 |
JFrame jF = new JFrame(); |
73 |
JCalendarDatePanel t = new JCalendarDatePanel();
|
74 |
|
75 |
// Set properties
|
76 |
jF.setTitle("Test JCalendarDatePanel");
|
77 |
jF.setSize(new Dimension(old_width, old_height)); |
78 |
jF.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
79 |
jF.getContentPane().add(t); |
80 |
|
81 |
jF.setVisible(true);
|
82 |
|
83 |
// Test Modal
|
84 |
t.setModal(true);
|
85 |
|
86 |
// Test resize the panel (and its button)
|
87 |
jF.setSize(new Dimension(new_width, new_height)); // For see all panel with the new size |
88 |
t.setPreferredSize(new Dimension (355, 325)); |
89 |
t.setSize(new Dimension (360, 320)); |
90 |
t.setSize(365, 325); |
91 |
t.revalidate(); |
92 |
|
93 |
// Test Disable Calendar Selection
|
94 |
//t.disableCalendar();
|
95 |
|
96 |
// Tests resizing the Calendar dialog
|
97 |
// Test set minimum dimension
|
98 |
t.getJCalendarDateDialog().setMinimumWidth(350);
|
99 |
t.getJCalendarDateDialog().setMinimumHeight(170);
|
100 |
// t.getJCalendarDateDialog().setMinimumWidthScreenResolutionPercentage(0.30);
|
101 |
// t.getJCalendarDateDialog().setMinimumHeightScreenResolutionPercentage(0.20);
|
102 |
|
103 |
// Test set maximum dimension
|
104 |
t.getJCalendarDateDialog().setMaximumWidth(500);
|
105 |
t.getJCalendarDateDialog().setMaximumHeight(400);
|
106 |
// t.getJCalendarDateDialog().setMaximumWidthScreenResolutionPercentage(0.60);
|
107 |
// t.getJCalendarDateDialog().setMaximumHeightScreenResolutionPercentage(0.40);
|
108 |
|
109 |
// Test Resize the component:
|
110 |
// t.getJCalendarDateDialog().setSizeResize(350, 300);
|
111 |
} |
112 |
} |