gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.swing / org.gvsig.tools.swing.impl / src / main / java / org / gvsig / tools / swing / impl / DefaultToolsSwingManager.java @ 1947
History | View | Annotate | Download (20.5 KB)
1 |
|
---|---|
2 |
package org.gvsig.tools.swing.impl; |
3 |
|
4 |
import java.awt.BorderLayout; |
5 |
import java.awt.Color; |
6 |
import java.awt.Cursor; |
7 |
import java.awt.Dimension; |
8 |
import java.awt.event.ActionEvent; |
9 |
import java.awt.event.ActionListener; |
10 |
import java.awt.image.BufferedImage; |
11 |
import java.awt.image.WritableRaster; |
12 |
import java.beans.PropertyChangeEvent; |
13 |
import java.beans.PropertyChangeListener; |
14 |
import java.io.File; |
15 |
import java.lang.reflect.InvocationTargetException; |
16 |
import java.lang.reflect.Method; |
17 |
import javax.swing.AbstractAction; |
18 |
import javax.swing.AbstractButton; |
19 |
import javax.swing.Action; |
20 |
import javax.swing.ComboBoxModel; |
21 |
import javax.swing.Icon; |
22 |
import javax.swing.ImageIcon; |
23 |
import javax.swing.JButton; |
24 |
import javax.swing.JComboBox; |
25 |
import javax.swing.JComponent; |
26 |
import javax.swing.JLabel; |
27 |
import javax.swing.JList; |
28 |
import javax.swing.JMenuItem; |
29 |
import javax.swing.JPopupMenu; |
30 |
import javax.swing.JScrollPane; |
31 |
import javax.swing.JSlider; |
32 |
import javax.swing.JTabbedPane; |
33 |
import javax.swing.JTextField; |
34 |
import javax.swing.JViewport; |
35 |
import javax.swing.SwingConstants; |
36 |
import javax.swing.text.DefaultEditorKit; |
37 |
import javax.swing.text.JTextComponent; |
38 |
import javax.swing.tree.TreeModel; |
39 |
import org.apache.commons.lang3.StringUtils; |
40 |
import org.gvsig.tools.ToolsLocator; |
41 |
import org.gvsig.tools.i18n.I18nManager; |
42 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
43 |
import org.gvsig.tools.swing.api.ChangeListenerHelper; |
44 |
import org.gvsig.tools.swing.api.ColorChooserController; |
45 |
import org.gvsig.tools.swing.api.CompoundIcon; |
46 |
import org.gvsig.tools.swing.api.DropDown; |
47 |
import org.gvsig.tools.swing.api.JListWithCheckbox; |
48 |
import org.gvsig.tools.swing.api.SimpleImage; |
49 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
50 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
51 |
import org.gvsig.tools.swing.api.pickercontroller.ColorPickerController; |
52 |
import org.gvsig.tools.swing.api.pickercontroller.DatePickerController; |
53 |
import org.gvsig.tools.swing.api.pickercontroller.FilePickerController; |
54 |
import org.gvsig.tools.swing.api.pickercontroller.FolderPickerController; |
55 |
import org.gvsig.tools.swing.api.pickercontroller.PickerController; |
56 |
import org.gvsig.tools.swing.icontheme.IconTheme; |
57 |
import org.gvsig.tools.swing.icontheme.IconThemeManager; |
58 |
import org.gvsig.tools.swing.impl.bufferedImage.VirtualBufferedImageHelper; |
59 |
import org.gvsig.tools.swing.impl.bufferedImage.VirtualBufferedImageHelper.VirtualDataBuffer; |
60 |
import org.gvsig.tools.swing.impl.pickercontroller.BytearrayPickerControllerImpl; |
61 |
import org.gvsig.tools.swing.impl.pickercontroller.ColorPickerControllerImpl; |
62 |
import org.gvsig.tools.swing.impl.pickercontroller.DatePickerControllerImpl; |
63 |
import org.gvsig.tools.swing.impl.pickercontroller.FilePickerControllerImpl; |
64 |
import org.gvsig.tools.swing.impl.pickercontroller.FolderPickerControllerImpl; |
65 |
|
66 |
|
67 |
public class DefaultToolsSwingManager implements ToolsSwingManager { |
68 |
|
69 |
private Dimension maxPhysicalSizeOfBufferedImage; |
70 |
|
71 |
@Override
|
72 |
public ActionListenerSupport createActionListenerSupport() {
|
73 |
return new DefaultActionListenerSupport(); |
74 |
} |
75 |
|
76 |
@Override
|
77 |
public JListWithCheckbox createJListWithCheckbox(JList wrappedList) { |
78 |
return new DefaultJListWithCheckbox(wrappedList); |
79 |
} |
80 |
|
81 |
@Override
|
82 |
public void setTreeModel(JComboBox comboBox, TreeModel aTreeModel) { |
83 |
TreeComboUtils.setTreeModel(comboBox, aTreeModel); |
84 |
} |
85 |
|
86 |
@Override
|
87 |
public ComboBoxModel createComboBoxModel(TreeModel treeModel) { |
88 |
return TreeComboUtils.createComboBoxModel(treeModel);
|
89 |
} |
90 |
|
91 |
|
92 |
@Override
|
93 |
public BufferedImage createBufferedImage(int w, int h, int type) { |
94 |
if(getMaxPhysicalSizeOfBufferedImage().getWidth() < w || getMaxPhysicalSizeOfBufferedImage().getHeight() < h){
|
95 |
return createVirtualBufferedImage(w,h,type);
|
96 |
} |
97 |
return new BufferedImage(w,h,type); |
98 |
} |
99 |
|
100 |
@Override
|
101 |
public BufferedImage createVirtualBufferedImage(int w, int h, int type) { |
102 |
return VirtualBufferedImageHelper.createVirtualBufferedImage(w, h, type);
|
103 |
} |
104 |
|
105 |
@Override
|
106 |
public BufferedImage copyBufferedImage(BufferedImage img) { |
107 |
WritableRaster sourceRaster = img.getRaster();
|
108 |
|
109 |
BufferedImage newImage;
|
110 |
if(sourceRaster.getDataBuffer() instanceof VirtualDataBuffer ){ |
111 |
newImage = VirtualBufferedImageHelper.createVirtualBufferedImage( |
112 |
img.getWidth(), |
113 |
img.getHeight(), |
114 |
img.getSampleModel(), |
115 |
img.getColorModel() |
116 |
); |
117 |
} else {
|
118 |
newImage = createBufferedImage(img.getWidth(), img.getHeight(), img.getType()); |
119 |
} |
120 |
|
121 |
WritableRaster raster = newImage.getRaster();
|
122 |
img.copyData(raster); |
123 |
return newImage;
|
124 |
} |
125 |
|
126 |
@Override
|
127 |
public void setMaxPhysicalSizeOfBufferedImage(Dimension dimension) { |
128 |
this.maxPhysicalSizeOfBufferedImage = dimension;
|
129 |
} |
130 |
|
131 |
@Override
|
132 |
public Dimension getMaxPhysicalSizeOfBufferedImage() { |
133 |
if(this.maxPhysicalSizeOfBufferedImage == null){ |
134 |
this.maxPhysicalSizeOfBufferedImage = new Dimension(2000, 2000); |
135 |
} |
136 |
return this.maxPhysicalSizeOfBufferedImage; |
137 |
} |
138 |
|
139 |
@Override
|
140 |
public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha, boolean allowNull) { |
141 |
return new DefaultColorChooserController(txtLabel, btnShowDialog, sldAlpha, allowNull); |
142 |
} |
143 |
|
144 |
@Override
|
145 |
public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog) { |
146 |
return new DefaultColorChooserController(txtLabel, btnShowDialog); |
147 |
} |
148 |
|
149 |
@Override
|
150 |
public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha) { |
151 |
return new DefaultColorChooserController(txtLabel, btnShowDialog, sldAlpha); |
152 |
} |
153 |
|
154 |
@Override
|
155 |
public Color alphaBlendingWithOpaqueBackground(Color bgColor, Color fgColor) { |
156 |
// https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending
|
157 |
Color src = fgColor;
|
158 |
Color dst = bgColor;
|
159 |
|
160 |
// double outa = 1;
|
161 |
double srca = src.getAlpha() / 255.0; |
162 |
double srca_1 = (1 - srca); |
163 |
|
164 |
Color color = new Color( |
165 |
(int)(src.getRed() * srca + dst.getRed() * srca_1) & 0xff, |
166 |
(int)(src.getGreen()* srca + dst.getGreen()* srca_1) & 0xff, |
167 |
(int)(src.getBlue() * srca + dst.getBlue() * srca_1) & 0xff |
168 |
); |
169 |
return color;
|
170 |
} |
171 |
|
172 |
@Override
|
173 |
public Color opaqueColor(Color src) { |
174 |
// https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending
|
175 |
double srca = src.getAlpha() / 255.0; |
176 |
double srca_1 = (1 - srca); |
177 |
|
178 |
Color color = new Color( |
179 |
(int)(src.getRed() * srca + 255 * srca_1) & 0xff, |
180 |
(int)(src.getGreen()* srca + 255 * srca_1) & 0xff, |
181 |
(int)(src.getBlue() * srca + 255 * srca_1) & 0xff |
182 |
); |
183 |
return color;
|
184 |
} |
185 |
|
186 |
private Object call(Object obj, String name, Object... params) { |
187 |
Class[] types = null; |
188 |
if( params != null ) { |
189 |
types = new Class[params.length]; |
190 |
for (int i = 0; i < params.length; i++) { |
191 |
types[i] = params[i].getClass(); |
192 |
} |
193 |
} |
194 |
Method method;
|
195 |
try {
|
196 |
method = obj.getClass().getMethod(name, types); |
197 |
Object r = method.invoke(obj, params);
|
198 |
return r;
|
199 |
} catch (NoSuchMethodException | |
200 |
SecurityException |
|
201 |
IllegalAccessException |
|
202 |
IllegalArgumentException |
|
203 |
InvocationTargetException ex) {
|
204 |
} |
205 |
return null; |
206 |
} |
207 |
|
208 |
@Override
|
209 |
public void translate(JComponent component) { |
210 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
211 |
String s = (String) call(component, "getText", (Object[]) null); |
212 |
if( !StringUtils.isEmpty(s) ) {
|
213 |
call(component,"setText",i18n.getTranslation(s));
|
214 |
} |
215 |
s = (String) call(component, "getToolTipText", (Object[]) null); |
216 |
if( !StringUtils.isEmpty(s) ) {
|
217 |
call(component,"setToolTipText",i18n.getTranslation(s));
|
218 |
} |
219 |
} |
220 |
|
221 |
@Override
|
222 |
public void translate(AbstractButton component) { |
223 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
224 |
String s = component.getText();
|
225 |
if( !StringUtils.isEmpty(s) ) {
|
226 |
component.setText(i18n.getTranslation(s)); |
227 |
} |
228 |
s = component.getToolTipText(); |
229 |
if( !StringUtils.isEmpty(s) ) {
|
230 |
component.setToolTipText(i18n.getTranslation(s)); |
231 |
} |
232 |
} |
233 |
|
234 |
@Override
|
235 |
public void translate(JLabel component) { |
236 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
237 |
String s = component.getText();
|
238 |
if( !StringUtils.isEmpty(s) ) {
|
239 |
component.setText(i18n.getTranslation(s)); |
240 |
} |
241 |
s = component.getToolTipText(); |
242 |
if( !StringUtils.isEmpty(s) ) {
|
243 |
component.setToolTipText(i18n.getTranslation(s)); |
244 |
} |
245 |
} |
246 |
|
247 |
@Override
|
248 |
public void translate(JTabbedPane component) { |
249 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
250 |
|
251 |
for( int i=0; i<component.getTabCount(); i++) { |
252 |
String text = component.getTitleAt(i);
|
253 |
if( !StringUtils.isEmpty(text) ) {
|
254 |
component.setTitleAt(i, i18n.getTranslation(text)); |
255 |
} |
256 |
text = component.getToolTipTextAt(i); |
257 |
if( !StringUtils.isEmpty(text) ) {
|
258 |
component.setToolTipTextAt(i, i18n.getTranslation(text)); |
259 |
} |
260 |
} |
261 |
} |
262 |
|
263 |
@Override
|
264 |
public void setDefaultPopupMenu(final JTextComponent component) { |
265 |
this.setDefaultPopupMenu(component, null); |
266 |
} |
267 |
|
268 |
@Override
|
269 |
public void setDefaultPopupMenu(final JTextComponent component, String title) { |
270 |
JPopupMenu popupMenu = new JPopupMenu(); |
271 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
272 |
|
273 |
Action copyAction = component.getActionMap().get(DefaultEditorKit.copyAction); |
274 |
Action cutAction = component.getActionMap().get(DefaultEditorKit.cutAction); |
275 |
Action pasteAction = component.getActionMap().get(DefaultEditorKit.pasteAction); |
276 |
Action selectAllAction = component.getActionMap().get(DefaultEditorKit.selectAllAction); |
277 |
|
278 |
if (copyAction == null |
279 |
&& cutAction == null
|
280 |
&& pasteAction == null
|
281 |
&& selectAllAction == null) {
|
282 |
copyAction = component.getActionMap().get(i18nManager.getTranslation("copy"));
|
283 |
cutAction = component.getActionMap().get(i18nManager.getTranslation("cut"));
|
284 |
pasteAction = component.getActionMap().get(i18nManager.getTranslation("paste"));
|
285 |
selectAllAction = component.getActionMap().get(i18nManager.getTranslation("SelectAll"));
|
286 |
} else {
|
287 |
copyAction.putValue(Action.NAME, i18nManager.getTranslation("copy")); |
288 |
cutAction.putValue(Action.NAME, i18nManager.getTranslation("cut")); |
289 |
pasteAction.putValue(Action.NAME, i18nManager.getTranslation("paste")); |
290 |
selectAllAction.putValue(Action.NAME, i18nManager.getTranslation("SelectAll")); |
291 |
} |
292 |
|
293 |
final String title2; |
294 |
if( title == null ) { |
295 |
title2 = i18nManager.getTranslation("text_editor");
|
296 |
} else {
|
297 |
title2 = title; |
298 |
} |
299 |
Action textEditorAction = new AbstractAction(i18nManager.getTranslation("text_editor")) { |
300 |
@Override
|
301 |
public void actionPerformed(ActionEvent e) { |
302 |
DefaultZoomDialog dialog = new DefaultZoomDialog(component, title2, component.getText());
|
303 |
dialog.setEditable(component.isEditable()); |
304 |
dialog.setAlwaysOnTop(true);
|
305 |
dialog.setVisible(true);
|
306 |
if (component.isEditable() && component.isEnabled()) {
|
307 |
component.setText(dialog.getText()); |
308 |
} |
309 |
} |
310 |
}; |
311 |
final JMenuItem menuCut = new JMenuItem(cutAction); |
312 |
final JMenuItem menuPaste = new JMenuItem(pasteAction); |
313 |
|
314 |
popupMenu.add(textEditorAction); |
315 |
popupMenu.addSeparator(); |
316 |
|
317 |
popupMenu.add(menuCut); |
318 |
popupMenu.add(copyAction); |
319 |
popupMenu.add(menuPaste); |
320 |
popupMenu.add(selectAllAction); |
321 |
|
322 |
if( component.isEnabled() && component.isEditable() ) {
|
323 |
menuCut.setEnabled(true);
|
324 |
menuPaste.setEnabled(true);
|
325 |
} else {
|
326 |
menuCut.setEnabled(false);
|
327 |
menuPaste.setEnabled(false);
|
328 |
} |
329 |
component.addPropertyChangeListener(new PropertyChangeListener() { |
330 |
@Override
|
331 |
public void propertyChange(PropertyChangeEvent evt) { |
332 |
if( evt==null ) { |
333 |
return;
|
334 |
} |
335 |
if( evt.getPropertyName().equalsIgnoreCase("enabled") ) { |
336 |
boolean enabled = component.isEnabled();
|
337 |
menuCut.setEnabled(enabled); |
338 |
menuPaste.setEnabled(enabled); |
339 |
} else if( evt.getPropertyName().equalsIgnoreCase("editable") ) { |
340 |
boolean editable = component.isEditable();
|
341 |
menuCut.setEnabled(editable); |
342 |
menuPaste.setEnabled(editable); |
343 |
} |
344 |
} |
345 |
}); |
346 |
component.setComponentPopupMenu(popupMenu); |
347 |
} |
348 |
|
349 |
@Override
|
350 |
public void setDefaultPopupMenu(JComboBox component) { |
351 |
this.setDefaultPopupMenu((JTextComponent) component.getEditor().getEditorComponent(), null); |
352 |
} |
353 |
|
354 |
|
355 |
@Override
|
356 |
public void setDefaultPopupMenu(JComboBox component, String title) { |
357 |
this.setDefaultPopupMenu((JTextComponent) component.getEditor().getEditorComponent(), title); |
358 |
} |
359 |
|
360 |
@Override
|
361 |
public ChangeListenerHelper createChangeListenerHelper() {
|
362 |
DefaultChangeListenerHelper x = new DefaultChangeListenerHelper();
|
363 |
return x;
|
364 |
} |
365 |
|
366 |
@Override
|
367 |
public ColorPickerController createColorPickerController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha, boolean allowNull) { |
368 |
return new ColorPickerControllerImpl(txtLabel, btnShowDialog, sldAlpha, allowNull); |
369 |
} |
370 |
|
371 |
@Override
|
372 |
public ColorPickerController createColorPickerController(JTextField txtLabel, JButton btnShowDialog) { |
373 |
return new ColorPickerControllerImpl(txtLabel, btnShowDialog); |
374 |
} |
375 |
|
376 |
@Override
|
377 |
public ColorPickerController createColorPickerController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha) { |
378 |
return new ColorPickerControllerImpl(txtLabel, btnShowDialog, sldAlpha); |
379 |
} |
380 |
|
381 |
@Override
|
382 |
public DatePickerController createDatePickerController(JTextField txtDate, JButton btnDate) { |
383 |
return new DatePickerControllerImpl(txtDate, btnDate); |
384 |
} |
385 |
|
386 |
@Override
|
387 |
public FilePickerController createFilePickerController(JTextField txtFile, JButton btnFile, String dialogTitle, String fileChooserID, File initialPath, boolean seticon) { |
388 |
return new FilePickerControllerImpl(txtFile, btnFile, dialogTitle, fileChooserID, initialPath, seticon); |
389 |
} |
390 |
|
391 |
@Override
|
392 |
public FilePickerController createFilePickerController(JTextField txtFile, JButton btnFile) { |
393 |
return new FilePickerControllerImpl(txtFile, btnFile); |
394 |
} |
395 |
|
396 |
@Override
|
397 |
public PickerController<byte[]> createByteArrayPickerController(JTextField txtText, JButton btnUpload, JButton btnDownload, String fileChooserID, File initialPath) { |
398 |
return new BytearrayPickerControllerImpl(txtText, btnUpload, btnDownload,fileChooserID, initialPath); |
399 |
} |
400 |
|
401 |
@Override
|
402 |
public PickerController<byte[]> createByteArrayPickerController(JTextField txtText, JButton btnUpload, JButton btnDownload) { |
403 |
return new BytearrayPickerControllerImpl(txtText, btnUpload, btnDownload, null, null); |
404 |
} |
405 |
|
406 |
@Override
|
407 |
public FilePickerController createFilePickerController(JTextField txtFile, JButton btnFile, String dialogTitle) { |
408 |
return new FilePickerControllerImpl(txtFile, btnFile, dialogTitle); |
409 |
} |
410 |
|
411 |
@Override
|
412 |
public FolderPickerController createFolderPickerController(JTextField txtFile, JButton btnFile, String dialogTitle, String fileChooserID, File initialPath, boolean seticon) { |
413 |
return new FolderPickerControllerImpl(txtFile, btnFile, dialogTitle, fileChooserID, initialPath, seticon); |
414 |
} |
415 |
|
416 |
@Override
|
417 |
public FolderPickerController createFolderPickerController(JTextField txtFile, JButton btnFile) { |
418 |
return new FolderPickerControllerImpl(txtFile, btnFile); |
419 |
} |
420 |
|
421 |
@Override
|
422 |
public FolderPickerController createFolderPickerController(JTextField txtFile, JButton btnFile, String dialogTitle) { |
423 |
return new FolderPickerControllerImpl(txtFile, btnFile,dialogTitle); |
424 |
} |
425 |
|
426 |
@Override
|
427 |
public void removeBorder(JComponent component) { |
428 |
try {
|
429 |
component.setBorder(null);
|
430 |
JComponent p1 = (JComponent) component.getParent(); |
431 |
if( p1 instanceof JViewport ) { |
432 |
p1 = (JComponent) component.getParent();
|
433 |
} |
434 |
if( p1 instanceof JScrollPane ) { |
435 |
JScrollPane scrollPanel = (JScrollPane) component.getParent(); |
436 |
scrollPanel.setBorder(null);
|
437 |
} |
438 |
} catch(Exception ex) { |
439 |
|
440 |
} |
441 |
} |
442 |
|
443 |
protected ImageIcon getIcon(String name) { |
444 |
IconThemeManager iconThemeManager = ToolsSwingLocator.getIconThemeManager(); |
445 |
IconTheme theme = iconThemeManager.getCurrent(); |
446 |
ImageIcon icon = theme.get(name);
|
447 |
return icon;
|
448 |
} |
449 |
|
450 |
@Override
|
451 |
public void addClearButton(JTextComponent text) { |
452 |
this.addClearButton(text, null); |
453 |
} |
454 |
|
455 |
@Override
|
456 |
public void addClearButton(JComboBox combo) { |
457 |
try {
|
458 |
JTextComponent text = (JTextComponent) combo.getEditor().getEditorComponent(); |
459 |
this.addClearButton(text, null); |
460 |
} catch(Throwable th) { |
461 |
// Si no puede a?adir el boton no hace nada.
|
462 |
} |
463 |
} |
464 |
|
465 |
@Override
|
466 |
public void addClearButton(final JTextComponent text, final ActionListener action) { |
467 |
final JButton btnClear = new JButton(getIcon("picker-cleartext")); |
468 |
btnClear.setBorderPainted( false );
|
469 |
btnClear.setFocusPainted( false );
|
470 |
btnClear.setContentAreaFilled( false );
|
471 |
btnClear.setOpaque(false);
|
472 |
btnClear.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); |
473 |
if( action == null ) { |
474 |
btnClear.addActionListener(new ActionListener() { |
475 |
@Override
|
476 |
public void actionPerformed(ActionEvent e) { |
477 |
text.setText("");
|
478 |
} |
479 |
}); |
480 |
} else {
|
481 |
btnClear.addActionListener(action); |
482 |
} |
483 |
text.setLayout(new BorderLayout()); |
484 |
text.add(btnClear, BorderLayout.EAST);
|
485 |
text.addPropertyChangeListener(new PropertyChangeListener() { |
486 |
@Override
|
487 |
public void propertyChange(PropertyChangeEvent evt) { |
488 |
if( evt==null ) { |
489 |
return;
|
490 |
} |
491 |
if( evt.getPropertyName().equalsIgnoreCase("enabled") ) { |
492 |
boolean enabled = text.isEnabled();
|
493 |
btnClear.setEnabled(enabled); |
494 |
} else if( evt.getPropertyName().equalsIgnoreCase("editable") ) { |
495 |
boolean editable = text.isEditable();
|
496 |
btnClear.setEnabled(editable); |
497 |
} |
498 |
} |
499 |
}); |
500 |
} |
501 |
|
502 |
@Override
|
503 |
public SimpleImage createSimpleImage() {
|
504 |
SimpleImage x = new DefaultSimpleImage();
|
505 |
return x;
|
506 |
} |
507 |
|
508 |
@Override
|
509 |
public SimpleImage createSimpleImage(Object source) { |
510 |
SimpleImage x = new DefaultSimpleImage(source);
|
511 |
return x;
|
512 |
} |
513 |
|
514 |
@Override
|
515 |
public DropDown createDropDown(JComboBox combo) { |
516 |
DropDown c = new DropDownComboBox(combo);
|
517 |
return c;
|
518 |
} |
519 |
|
520 |
@Override
|
521 |
public DropDown createDropDown(JLabel label) { |
522 |
DropDown c = new DropDownLabel(label);
|
523 |
return c;
|
524 |
} |
525 |
|
526 |
@Override
|
527 |
public CompoundIcon createCompoundIcon(Icon... icons) { |
528 |
DefaultCompoundIcon i = new DefaultCompoundIcon(icons);
|
529 |
return i;
|
530 |
} |
531 |
|
532 |
@Override
|
533 |
public CompoundIcon createCompoundIcon(int orientation, Icon... icons) { |
534 |
DefaultCompoundIcon i = new DefaultCompoundIcon(orientation, icons);
|
535 |
return i;
|
536 |
} |
537 |
|
538 |
@Override
|
539 |
public CompoundIcon createCompoundIcon(int orientation, int gap, Icon... icons) { |
540 |
DefaultCompoundIcon i = new DefaultCompoundIcon(orientation, gap, icons);
|
541 |
return i;
|
542 |
} |
543 |
|
544 |
@Override
|
545 |
public CompoundIcon createCompoundIcon(int orientation, int gap, int alignmentX, int alignmentY, Icon... icons) { |
546 |
DefaultCompoundIcon i = new DefaultCompoundIcon(orientation, gap, alignmentX, alignmentY, icons);
|
547 |
return i;
|
548 |
} |
549 |
|
550 |
} |