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