svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.exportto / org.gvsig.exportto.swing / org.gvsig.exportto.swing.prov / org.gvsig.exportto.swing.prov.shape / src / main / java / org / gvsig / export / shape / swing / panels / SelectSimplifiedExport.java @ 44044
History | View | Annotate | Download (3.57 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.export.shape.swing.panels; |
25 |
|
26 |
import javax.swing.JComponent; |
27 |
|
28 |
|
29 |
import org.gvsig.tools.ToolsLocator; |
30 |
import org.gvsig.tools.i18n.I18nManager; |
31 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
32 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
33 |
import org.gvsig.export.ExportParameters; |
34 |
import org.gvsig.export.shape.service.ExportShapeParameters; |
35 |
import org.gvsig.export.swing.JExportProcessPanel; |
36 |
import org.gvsig.export.swing.spi.ExportPanel; |
37 |
import org.gvsig.export.swing.spi.ExportPanelValidationException; |
38 |
import org.slf4j.Logger; |
39 |
import org.slf4j.LoggerFactory; |
40 |
|
41 |
/**
|
42 |
* @author gvSIG Team
|
43 |
* @version $Id$
|
44 |
*
|
45 |
*/
|
46 |
public class SelectSimplifiedExport |
47 |
extends SelectSimplifiedExportView
|
48 |
implements ExportPanel
|
49 |
{ |
50 |
|
51 |
private static final Logger LOG = LoggerFactory.getLogger(SelectSimplifiedExport.class); |
52 |
|
53 |
private final ExportShapeParameters parameters; |
54 |
private final JExportProcessPanel processPanel; |
55 |
|
56 |
public SelectSimplifiedExport(JExportProcessPanel processPanel, ExportParameters parameters) {
|
57 |
super();
|
58 |
this.processPanel = processPanel;
|
59 |
this.parameters = (ExportShapeParameters) parameters;
|
60 |
this.initComponents();
|
61 |
} |
62 |
|
63 |
private void initComponents() { |
64 |
this.chkUseSimplifiedExport.setSelected(parameters.getUseSimplifiedExport());
|
65 |
|
66 |
this.translate();
|
67 |
} |
68 |
|
69 |
private void translate() { |
70 |
ToolsSwingManager i18nc = ToolsSwingLocator.getToolsSwingManager(); |
71 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
72 |
|
73 |
i18nc.translate(this.lblUseSimplifiedExport);
|
74 |
String s = i18n.getTranslation(this.lblUseSimplifiedExportDescription.getText()); |
75 |
s = "<html>" + s.replace("\n","<br>\n") + "</html>"; |
76 |
this.lblUseSimplifiedExportDescription.setText(s);
|
77 |
} |
78 |
|
79 |
public boolean getUseSimplifiedExport() { |
80 |
return this.chkUseSimplifiedExport.isSelected(); |
81 |
} |
82 |
|
83 |
@Override
|
84 |
public JComponent asJComponent() { |
85 |
return this; |
86 |
} |
87 |
|
88 |
@Override
|
89 |
public String getIdPanel() { |
90 |
return this.getClass().getSimpleName(); |
91 |
} |
92 |
|
93 |
@Override
|
94 |
public String getTitlePanel() { |
95 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
96 |
return i18nManager.getTranslation("_Select_simplified_export"); |
97 |
} |
98 |
|
99 |
@Override
|
100 |
public boolean validatePanel() throws ExportPanelValidationException { |
101 |
return true; |
102 |
} |
103 |
|
104 |
@Override
|
105 |
public void enterPanel() { |
106 |
// Do nothing
|
107 |
} |
108 |
|
109 |
@Override
|
110 |
public void previousPanel() { |
111 |
|
112 |
} |
113 |
|
114 |
@Override
|
115 |
public void nextPanel() { |
116 |
this.parameters.setUseSimplifiedExport(this.getUseSimplifiedExport()); |
117 |
} |
118 |
} |