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