gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.swing / org.gvsig.tools.swing.api / src / main / java / org / gvsig / tools / swing / api / usability / UsabilitySwingManager.java @ 624
History | View | Annotate | Download (4.41 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
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 2
|
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 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2010 {} {{Task}}
|
26 |
*/
|
27 |
package org.gvsig.tools.swing.api.usability; |
28 |
|
29 |
import java.awt.Component; |
30 |
import java.awt.event.FocusListener; |
31 |
import java.util.Locale; |
32 |
|
33 |
import javax.swing.Action; |
34 |
import javax.swing.Icon; |
35 |
import javax.swing.JButton; |
36 |
import javax.swing.JSpinner; |
37 |
import javax.swing.JTextArea; |
38 |
|
39 |
import org.gvsig.tools.dynobject.DynField; |
40 |
|
41 |
/**
|
42 |
* Creates common Swing components which take into account usability guides
|
43 |
* defined for the gvSIG project.
|
44 |
*
|
45 |
* @author 2010- C?sar Ordi?ana - gvSIG team
|
46 |
*/
|
47 |
public interface UsabilitySwingManager { |
48 |
|
49 |
/**
|
50 |
* Creates a button with no set text or icon.
|
51 |
*
|
52 |
* @return a button.
|
53 |
*/
|
54 |
JButton createJButton();
|
55 |
|
56 |
/**
|
57 |
* Creates a button where properties are taken from the {@link Action}
|
58 |
* supplied.
|
59 |
*
|
60 |
* @param action
|
61 |
* the {@link Action} used to specify the new button.
|
62 |
*
|
63 |
*/
|
64 |
JButton createJButton(Action action); |
65 |
|
66 |
/**
|
67 |
* Creates a button with an icon.
|
68 |
*
|
69 |
* @param icon
|
70 |
* the Icon image to display on the button.
|
71 |
*
|
72 |
* @return a button.
|
73 |
*/
|
74 |
JButton createJButton(Icon icon); |
75 |
|
76 |
/**
|
77 |
* Creates a button with text.
|
78 |
*
|
79 |
* @param text
|
80 |
* the text of the button.
|
81 |
*
|
82 |
* @return a button.
|
83 |
*/
|
84 |
JButton createJButton(String text); |
85 |
|
86 |
/**
|
87 |
* Creates a button with initial text and icon.
|
88 |
*
|
89 |
* @param text
|
90 |
* the text of the button.
|
91 |
* @param icon
|
92 |
* the Icon image to display on the button.
|
93 |
*
|
94 |
* @return a button.
|
95 |
*/
|
96 |
JButton createJButton(String text, Icon icon); |
97 |
|
98 |
/**
|
99 |
* Creates a tool button with text.
|
100 |
*
|
101 |
* @param text
|
102 |
* the text of the tool button.
|
103 |
*
|
104 |
* @return a tool button.
|
105 |
*/
|
106 |
JButton createJToolButton(String text); |
107 |
|
108 |
/**
|
109 |
* Creates a text area.
|
110 |
*
|
111 |
* @param text
|
112 |
* the text component
|
113 |
*
|
114 |
* @return a tool button.
|
115 |
*/
|
116 |
JTextArea createJTextArea(String text); |
117 |
|
118 |
/**
|
119 |
* Creates a text area with a default maximum width.
|
120 |
*
|
121 |
* @param text
|
122 |
* the text component
|
123 |
* @param text
|
124 |
* the text component
|
125 |
*
|
126 |
* @return a tool button.
|
127 |
*/
|
128 |
JTextArea createJTextArea(String text, int filledMaximumWidth); |
129 |
|
130 |
/**
|
131 |
* Creates a spinner component that allows null values. It distinguishes between
|
132 |
* number, date and floating point models based on their dataType.
|
133 |
*
|
134 |
* @param text
|
135 |
* the text component
|
136 |
* @param value
|
137 |
* the initial value
|
138 |
*
|
139 |
* @param value
|
140 |
* the maximum filling size
|
141 |
*
|
142 |
* @return a spinner GUI component.
|
143 |
*/
|
144 |
JSpinner createJNullSpinner(int dataType, Object value, int filledMaximumWidth); |
145 |
|
146 |
/**
|
147 |
* Creates a spinner component that allows null values. It distinguishes between
|
148 |
* number, date and floating point models based on their dataType.
|
149 |
*
|
150 |
* @param int
|
151 |
* the data type of dynobjectmanager.
|
152 |
* @param value
|
153 |
* the initial value
|
154 |
* @return a spinner GUI component.
|
155 |
*/
|
156 |
JSpinner createJNullSpinner(int dataType, Object value); |
157 |
|
158 |
|
159 |
DynFieldEditor createNullSpinnerEditor(FocusListener listener, DynField dynField, Locale locale); |
160 |
|
161 |
/**
|
162 |
* Creates a JBlank panel
|
163 |
*
|
164 |
* @param width
|
165 |
* @param height
|
166 |
* @return
|
167 |
*/
|
168 |
Component createJBlank(int width, int height); |
169 |
|
170 |
} |