Revision 38782
branches/v2_0_0_prep/extensions/org.gvsig.symbology.app/org.gvsig.symbology.app.importsymbols/src/main/java/org/gvsig/symbology/app/importsymbols/ImportSymbolsExtension.java | ||
---|---|---|
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 |
package org.gvsig.symbology.app.importsymbols; |
|
24 |
|
|
25 |
import org.gvsig.andami.plugins.Extension; |
|
26 |
import org.gvsig.andami.ui.ToolsWindowManager; |
|
27 |
import org.gvsig.i18n.Messages; |
|
28 |
import org.gvsig.symbology.app.importsymbols.wizard.ImportSymbolsWizard; |
|
29 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
30 |
|
|
31 |
public class ImportSymbolsExtension extends Extension { |
|
32 |
|
|
33 |
public void initialize() { |
|
34 |
|
|
35 |
} |
|
36 |
|
|
37 |
@Override |
|
38 |
public void postInitialize() { |
|
39 |
|
|
40 |
} |
|
41 |
|
|
42 |
public boolean isEnabled() { |
|
43 |
return true; |
|
44 |
} |
|
45 |
|
|
46 |
public boolean isVisible() { |
|
47 |
return true; |
|
48 |
} |
|
49 |
|
|
50 |
public void execute(String actionCommand) { |
|
51 |
if (actionCommand.equalsIgnoreCase("Import_symbols")) { |
|
52 |
|
|
53 |
ImportSymbolsWizard wizard = new ImportSymbolsWizard(); |
|
54 |
|
|
55 |
WindowManager windowManager = new ToolsWindowManager(); |
|
56 |
windowManager.showWindow(wizard, |
|
57 |
Messages.getText("_Import_wizard"), WindowManager.MODE.DIALOG); |
|
58 |
|
|
59 |
} |
|
60 |
} |
|
61 |
|
|
62 |
} |
branches/v2_0_0_prep/extensions/org.gvsig.symbology.app/org.gvsig.symbology.app.importsymbols/src/main/java/org/gvsig/symbology/app/importsymbols/ImportPictureMarkerSymbolsPanelLayout.java | ||
---|---|---|
1 |
package org.gvsig.symbology.app.importsymbols; |
|
2 |
|
|
3 |
import java.awt.BorderLayout; |
|
4 |
import java.awt.ComponentOrientation; |
|
5 |
import java.awt.Container; |
|
6 |
import java.awt.Dimension; |
|
7 |
|
|
8 |
import javax.swing.Box; |
|
9 |
import javax.swing.ImageIcon; |
|
10 |
import javax.swing.JButton; |
|
11 |
import javax.swing.JComboBox; |
|
12 |
import javax.swing.JLabel; |
|
13 |
import javax.swing.JList; |
|
14 |
import javax.swing.JPanel; |
|
15 |
import javax.swing.JScrollPane; |
|
16 |
import javax.swing.JSpinner; |
|
17 |
import javax.swing.JTextField; |
|
18 |
|
|
19 |
import com.jgoodies.forms.layout.CellConstraints; |
|
20 |
import com.jgoodies.forms.layout.FormLayout; |
|
21 |
|
|
22 |
|
|
23 |
public class ImportPictureMarkerSymbolsPanelLayout extends JPanel |
|
24 |
{ |
|
25 |
/** |
|
26 |
* |
|
27 |
*/ |
|
28 |
private static final long serialVersionUID = -5315759500182797864L; |
|
29 |
JLabel labelTitle = new JLabel(); |
|
30 |
JLabel labelImagesToImport = new JLabel(); |
|
31 |
JLabel labelFolderName = new JLabel(); |
|
32 |
JTextField ctrltFolderName = new JTextField(); |
|
33 |
JList ctrlExistingFolders = new JList(); |
|
34 |
JLabel labelSize = new JLabel(); |
|
35 |
JSpinner ctrlDefaultSize = new JSpinner(); |
|
36 |
JButton ctrlCancel = new JButton(); |
|
37 |
JButton ctrlImport = new JButton(); |
|
38 |
JLabel labelOverwriteOptions = new JLabel(); |
|
39 |
JComboBox ctrlOverwriteOptions = new JComboBox(); |
|
40 |
JList ctrlImagesToImport = new JList(); |
|
41 |
JButton ctrlBrowseImagesToImport = new JButton(); |
|
42 |
|
|
43 |
/** |
|
44 |
* Default constructor |
|
45 |
*/ |
|
46 |
public ImportPictureMarkerSymbolsPanelLayout() |
|
47 |
{ |
|
48 |
initializePanel(); |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* Adds fill components to empty cells in the first row and first column of the grid. |
|
53 |
* This ensures that the grid spacing will be the same as shown in the designer. |
|
54 |
* @param cols an array of column indices in the first row where fill components should be added. |
|
55 |
* @param rows an array of row indices in the first column where fill components should be added. |
|
56 |
*/ |
|
57 |
void addFillComponents( Container panel, int[] cols, int[] rows ) |
|
58 |
{ |
|
59 |
Dimension filler = new Dimension(10,10); |
|
60 |
|
|
61 |
boolean filled_cell_11 = false; |
|
62 |
CellConstraints cc = new CellConstraints(); |
|
63 |
if ( cols.length > 0 && rows.length > 0 ) |
|
64 |
{ |
|
65 |
if ( cols[0] == 1 && rows[0] == 1 ) |
|
66 |
{ |
|
67 |
/** add a rigid area */ |
|
68 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) ); |
|
69 |
filled_cell_11 = true; |
|
70 |
} |
|
71 |
} |
|
72 |
|
|
73 |
for( int index = 0; index < cols.length; index++ ) |
|
74 |
{ |
|
75 |
if ( cols[index] == 1 && filled_cell_11 ) |
|
76 |
{ |
|
77 |
continue; |
|
78 |
} |
|
79 |
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) ); |
|
80 |
} |
|
81 |
|
|
82 |
for( int index = 0; index < rows.length; index++ ) |
|
83 |
{ |
|
84 |
if ( rows[index] == 1 && filled_cell_11 ) |
|
85 |
{ |
|
86 |
continue; |
|
87 |
} |
|
88 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) ); |
|
89 |
} |
|
90 |
|
|
91 |
} |
|
92 |
|
|
93 |
/** |
|
94 |
* Helper method to load an image file from the CLASSPATH |
|
95 |
* @param imageName the package and name of the file to load relative to the CLASSPATH |
|
96 |
* @return an ImageIcon instance with the specified image file |
|
97 |
* @throws IllegalArgumentException if the image resource cannot be loaded. |
|
98 |
*/ |
|
99 |
public ImageIcon loadImage( String imageName ) |
|
100 |
{ |
|
101 |
try |
|
102 |
{ |
|
103 |
ClassLoader classloader = getClass().getClassLoader(); |
|
104 |
java.net.URL url = classloader.getResource( imageName ); |
|
105 |
if ( url != null ) |
|
106 |
{ |
|
107 |
ImageIcon icon = new ImageIcon( url ); |
|
108 |
return icon; |
|
109 |
} |
|
110 |
} |
|
111 |
catch( Exception e ) |
|
112 |
{ |
|
113 |
e.printStackTrace(); |
|
114 |
} |
|
115 |
throw new IllegalArgumentException( "Unable to load image: " + imageName ); |
|
116 |
} |
|
117 |
|
|
118 |
/** |
|
119 |
* Method for recalculating the component orientation for |
|
120 |
* right-to-left Locales. |
|
121 |
* @param orientation the component orientation to be applied |
|
122 |
*/ |
|
123 |
public void applyComponentOrientation( ComponentOrientation orientation ) |
|
124 |
{ |
|
125 |
// Not yet implemented... |
|
126 |
// I18NUtils.applyComponentOrientation(this, orientation); |
|
127 |
super.applyComponentOrientation(orientation); |
|
128 |
} |
|
129 |
|
|
130 |
public JPanel createPanel() |
|
131 |
{ |
|
132 |
JPanel jpanel1 = new JPanel(); |
|
133 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE"); |
|
134 |
CellConstraints cc = new CellConstraints(); |
|
135 |
jpanel1.setLayout(formlayout1); |
|
136 |
|
|
137 |
labelTitle.setName("labelTitle"); |
|
138 |
labelTitle.setText("_Import_images_as_point_symbols"); |
|
139 |
jpanel1.add(labelTitle,cc.xywh(2,2,6,1)); |
|
140 |
|
|
141 |
labelImagesToImport.setName("labelImagesToImport"); |
|
142 |
labelImagesToImport.setText("_Images_to_import"); |
|
143 |
jpanel1.add(labelImagesToImport,cc.xywh(2,4,6,1)); |
|
144 |
|
|
145 |
labelFolderName.setName("labelFolderName"); |
|
146 |
labelFolderName.setText("_Folder_name_for_import_the_images"); |
|
147 |
jpanel1.add(labelFolderName,cc.xywh(2,7,6,1)); |
|
148 |
|
|
149 |
ctrltFolderName.setName("ctrltFolderName"); |
|
150 |
jpanel1.add(ctrltFolderName,cc.xywh(3,8,5,1)); |
|
151 |
|
|
152 |
ctrlExistingFolders.setName("ctrlExistingFolders"); |
|
153 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
154 |
jscrollpane1.setViewportView(ctrlExistingFolders); |
|
155 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
156 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
157 |
jpanel1.add(jscrollpane1,cc.xywh(3,9,5,1)); |
|
158 |
|
|
159 |
labelSize.setName("labelSize"); |
|
160 |
labelSize.setText("_Default_size_to_use_in_symbols"); |
|
161 |
jpanel1.add(labelSize,cc.xywh(2,11,6,1)); |
|
162 |
|
|
163 |
ctrlDefaultSize.setName("ctrlDefaultSize"); |
|
164 |
jpanel1.add(ctrlDefaultSize,cc.xywh(3,12,5,1)); |
|
165 |
|
|
166 |
ctrlCancel.setActionCommand("_Cancel"); |
|
167 |
ctrlCancel.setName("ctrlCancel"); |
|
168 |
ctrlCancel.setText("_Cancel"); |
|
169 |
jpanel1.add(ctrlCancel,cc.xy(5,17)); |
|
170 |
|
|
171 |
ctrlImport.setActionCommand("_import"); |
|
172 |
ctrlImport.setName("ctrlImport"); |
|
173 |
ctrlImport.setText("_import"); |
|
174 |
jpanel1.add(ctrlImport,cc.xy(7,17)); |
|
175 |
|
|
176 |
labelOverwriteOptions.setName("labelOverwriteOptions"); |
|
177 |
labelOverwriteOptions.setText("_Overwrite_options"); |
|
178 |
jpanel1.add(labelOverwriteOptions,cc.xywh(2,14,6,1)); |
|
179 |
|
|
180 |
ctrlOverwriteOptions.setName("ctrlOverwriteOptions"); |
|
181 |
ctrlOverwriteOptions.addItem("_Ask_to_user"); |
|
182 |
ctrlOverwriteOptions.addItem("_Dont_overwrite"); |
|
183 |
ctrlOverwriteOptions.addItem("_Overwrite_always"); |
|
184 |
jpanel1.add(ctrlOverwriteOptions,cc.xywh(3,15,5,1)); |
|
185 |
|
|
186 |
ctrlImagesToImport.setName("ctrlImagesToImport"); |
|
187 |
JScrollPane jscrollpane2 = new JScrollPane(); |
|
188 |
jscrollpane2.setViewportView(ctrlImagesToImport); |
|
189 |
jscrollpane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
190 |
jscrollpane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
191 |
jpanel1.add(jscrollpane2,cc.xywh(3,5,5,1)); |
|
192 |
|
|
193 |
ctrlBrowseImagesToImport.setActionCommand("_Browse"); |
|
194 |
ctrlBrowseImagesToImport.setName("ctrlBrowseImagesToImport"); |
|
195 |
ctrlBrowseImagesToImport.setText("_Select_images"); |
|
196 |
jpanel1.add(ctrlBrowseImagesToImport,cc.xywh(5,6,3,1)); |
|
197 |
|
|
198 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7,8 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 }); |
|
199 |
return jpanel1; |
|
200 |
} |
|
201 |
|
|
202 |
/** |
|
203 |
* Initializer |
|
204 |
*/ |
|
205 |
protected void initializePanel() |
|
206 |
{ |
|
207 |
setLayout(new BorderLayout()); |
|
208 |
add(createPanel(), BorderLayout.CENTER); |
|
209 |
} |
|
210 |
|
|
211 |
|
|
212 |
} |
|
0 | 213 |
branches/v2_0_0_prep/extensions/org.gvsig.symbology.app/org.gvsig.symbology.app.importsymbols/src/main/java/org/gvsig/symbology/app/importsymbols/ImportPictureMarkerSymbolsProcess.java | ||
---|---|---|
1 |
package org.gvsig.symbology.app.importsymbols; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
import java.io.FileOutputStream; |
|
5 |
import java.io.IOException; |
|
6 |
import java.util.ArrayList; |
|
7 |
import java.util.HashSet; |
|
8 |
import java.util.List; |
|
9 |
import java.util.Set; |
|
10 |
|
|
11 |
import javax.swing.JOptionPane; |
|
12 |
|
|
13 |
import org.apache.commons.io.FileUtils; |
|
14 |
import org.apache.commons.io.FilenameUtils; |
|
15 |
import org.gvsig.app.ApplicationLocator; |
|
16 |
import org.gvsig.app.ApplicationManager; |
|
17 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
18 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager; |
|
19 |
import org.gvsig.symbology.SymbologyLocator; |
|
20 |
import org.gvsig.symbology.SymbologyManager; |
|
21 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IPictureMarkerSymbol; |
|
22 |
import org.gvsig.tools.ToolsLocator; |
|
23 |
import org.gvsig.tools.persistence.PersistenceManager; |
|
24 |
import org.gvsig.tools.persistence.PersistentState; |
|
25 |
import org.gvsig.tools.task.AbstractMonitorableTask; |
|
26 |
import org.gvsig.tools.task.SimpleTaskStatus; |
|
27 |
import org.gvsig.tools.util.FolderSet; |
|
28 |
import org.gvsig.tools.util.impl.DefaultFolderSet; |
|
29 |
import org.slf4j.Logger; |
|
30 |
import org.slf4j.LoggerFactory; |
|
31 |
|
|
32 |
public class ImportPictureMarkerSymbolsProcess extends AbstractMonitorableTask { |
|
33 |
private static Logger logger = LoggerFactory |
|
34 |
.getLogger(ImportPictureMarkerSymbolsProcess.class); |
|
35 |
|
|
36 |
public enum YesNoAsk { |
|
37 |
YES, NO, ASK |
|
38 |
}; |
|
39 |
|
|
40 |
private ApplicationManager application = null; |
|
41 |
private SymbolManager symbolManager = null; |
|
42 |
private SymbologyManager symbologyManager = null; |
|
43 |
|
|
44 |
private Set<String> allowedFileExtensions = null; |
|
45 |
private List<File> notCreatedSymbols = new ArrayList<File>(); |
|
46 |
|
|
47 |
private boolean quietMode = false; |
|
48 |
|
|
49 |
private YesNoAsk overwrite = YesNoAsk.ASK; |
|
50 |
private List<File> selectedImageFiles = new ArrayList<File>(); |
|
51 |
|
|
52 |
// Name of the folder in the symbols repository |
|
53 |
private String targetFolderName; |
|
54 |
private double symbolSize = 18; |
|
55 |
|
|
56 |
protected ImportPictureMarkerSymbolsProcess() { |
|
57 |
super("Import_point_symbols"); |
|
58 |
this.application = ApplicationLocator.getManager(); |
|
59 |
this.setName(application.translate(this.getName())); |
|
60 |
} |
|
61 |
|
|
62 |
public Set<String> getAllowedFileExtensions() { |
|
63 |
if (allowedFileExtensions == null) { |
|
64 |
allowedFileExtensions = new HashSet<String>(); |
|
65 |
allowedFileExtensions.add("png"); |
|
66 |
allowedFileExtensions.add("jpg"); |
|
67 |
allowedFileExtensions.add("jpeg"); |
|
68 |
allowedFileExtensions.add("gif"); |
|
69 |
allowedFileExtensions.add("bmp"); |
|
70 |
allowedFileExtensions.add("svg"); |
|
71 |
} |
|
72 |
return allowedFileExtensions; |
|
73 |
} |
|
74 |
|
|
75 |
public YesNoAsk getOverwrite() { |
|
76 |
return overwrite; |
|
77 |
} |
|
78 |
|
|
79 |
public void setOverwrite(YesNoAsk overwrite) { |
|
80 |
this.overwrite = overwrite; |
|
81 |
} |
|
82 |
|
|
83 |
public double getSymbolSize() { |
|
84 |
return symbolSize; |
|
85 |
} |
|
86 |
|
|
87 |
public void setSymbolSize(double symbolSize) { |
|
88 |
this.symbolSize = symbolSize; |
|
89 |
} |
|
90 |
|
|
91 |
public String getTargetFolderName() { |
|
92 |
return targetFolderName; |
|
93 |
} |
|
94 |
|
|
95 |
public void setTargetFolderName(String targetFolderName) { |
|
96 |
this.targetFolderName = targetFolderName; |
|
97 |
} |
|
98 |
|
|
99 |
public List<File> getSelectedImageFiles() { |
|
100 |
return selectedImageFiles; |
|
101 |
} |
|
102 |
|
|
103 |
public boolean isQuietMode() { |
|
104 |
return quietMode; |
|
105 |
} |
|
106 |
|
|
107 |
public void setQuietMode(boolean quietMode) { |
|
108 |
this.quietMode = quietMode; |
|
109 |
} |
|
110 |
|
|
111 |
public FolderSet getSymbolsRepository() { |
|
112 |
File symbolsFolder = new File(getSymbolManager().getSymbolPreferences() |
|
113 |
.getSymbolLibraryPath()); |
|
114 |
|
|
115 |
FolderSet repo = new DefaultFolderSet(); |
|
116 |
repo.add(symbolsFolder); |
|
117 |
return repo; |
|
118 |
} |
|
119 |
|
|
120 |
public List<File> getNotCreatedSymbols() { |
|
121 |
return notCreatedSymbols; |
|
122 |
} |
|
123 |
|
|
124 |
public void run() { |
|
125 |
SimpleTaskStatus status = null; |
|
126 |
try { |
|
127 |
status = (SimpleTaskStatus) this.getTaskStatus(); |
|
128 |
this.preProcess(); |
|
129 |
if (status.isCancellationRequested()) { |
|
130 |
status.cancel(); |
|
131 |
return; |
|
132 |
} |
|
133 |
status.setRangeOfValues(1, this.getSelectedImageFiles().size()); |
|
134 |
for (int i = 1; i < this.getSelectedImageFiles().size(); i++) { |
|
135 |
if (status.isCancellationRequested()) { |
|
136 |
status.cancel(); |
|
137 |
return; |
|
138 |
} |
|
139 |
status.setCurValue(i+1); |
|
140 |
this.processItem(this.getSelectedImageFiles().get(i)); |
|
141 |
} |
|
142 |
this.postPrecess(); |
|
143 |
if (status.isCancellationRequested()) { |
|
144 |
status.cancel(); |
|
145 |
return; |
|
146 |
} |
|
147 |
if (!this.isQuietMode()) { |
|
148 |
application.message("_import_of_symbols_completed", |
|
149 |
JOptionPane.INFORMATION_MESSAGE); |
|
150 |
} |
|
151 |
} catch (Exception e) { |
|
152 |
logger.info("Error in process", e); |
|
153 |
if (status != null) { |
|
154 |
status.abort(); |
|
155 |
} |
|
156 |
if (!this.isQuietMode()) { |
|
157 |
application.message( |
|
158 |
"_Import_of_symbols_aborted" + "\n\n" + e.getMessage(), |
|
159 |
JOptionPane.WARNING_MESSAGE); |
|
160 |
application.messageDialog( |
|
161 |
"_Error_in_the_process_of_import_point_symbols_Some_symbols_cant_be_imported" |
|
162 |
+ "\n\n" + e.getMessage(), this.getName(), |
|
163 |
JOptionPane.WARNING_MESSAGE); |
|
164 |
} |
|
165 |
} finally { |
|
166 |
if (status != null) { |
|
167 |
// Mark process as terminate if it is running. |
|
168 |
if (status.isRunning()) { |
|
169 |
status.terminate(); |
|
170 |
} |
|
171 |
} |
|
172 |
} |
|
173 |
} |
|
174 |
|
|
175 |
private void preProcess() { |
|
176 |
if (this.isQuietMode() && this.getOverwrite() == YesNoAsk.ASK) { |
|
177 |
this.setOverwrite(YesNoAsk.YES); |
|
178 |
// } else { |
|
179 |
// Component dlg = application.createComponent(ImportPointSymbolsPanel.class, this); |
|
180 |
// application.showDialog(dlg, this.getName()); |
|
181 |
} |
|
182 |
} |
|
183 |
|
|
184 |
private void processItem(File item) throws InterruptedException { |
|
185 |
File source_image; |
|
186 |
File source_image_sel; |
|
187 |
File target_image; |
|
188 |
File target_image_sel; |
|
189 |
File target_symbol; |
|
190 |
IPictureMarkerSymbol symbol; |
|
191 |
PersistenceManager persistenceManager = ToolsLocator |
|
192 |
.getPersistenceManager(); |
|
193 |
|
|
194 |
source_image = this.getSourceImage(item); |
|
195 |
source_image_sel = this.getSourceImageSelected(item); |
|
196 |
target_image = this.getTargetImage(item); |
|
197 |
target_image_sel = this.getTargetImageSelected(item); |
|
198 |
target_symbol = this.getTargetSymbol(item); |
|
199 |
|
|
200 |
if (!source_image_sel.exists()) { |
|
201 |
source_image_sel = source_image; |
|
202 |
} |
|
203 |
|
|
204 |
if (target_symbol.exists()) { |
|
205 |
switch (this.getOverwrite()) { |
|
206 |
case ASK: |
|
207 |
int resp = application |
|
208 |
.confirmDialog(application.translate( |
|
209 |
"_Symbol_{}_already_exists_Overwrite", |
|
210 |
target_symbol.getAbsolutePath()), this |
|
211 |
.getName(), JOptionPane.YES_NO_OPTION, |
|
212 |
JOptionPane.QUESTION_MESSAGE); |
|
213 |
if (resp == JOptionPane.NO_OPTION) { |
|
214 |
return; |
|
215 |
} |
|
216 |
break; |
|
217 |
case NO: |
|
218 |
return; |
|
219 |
case YES: |
|
220 |
break; |
|
221 |
} |
|
222 |
} |
|
223 |
try { |
|
224 |
if( !target_image.getParentFile().exists() ) { |
|
225 |
target_image.getParentFile().mkdirs(); |
|
226 |
} |
|
227 |
copyFile(source_image, target_image); |
|
228 |
copyFile(source_image_sel, target_image_sel); |
|
229 |
symbol = this.getSymbologyManager().createPictureMarkerSymbol( |
|
230 |
target_image.toURI().toURL(), |
|
231 |
target_image_sel.toURI().toURL()); |
|
232 |
symbol.setSize(this.getSymbolSize()); |
|
233 |
symbol.setDescription(FilenameUtils.getBaseName(target_image.getName())); |
|
234 |
|
|
235 |
PersistentState state = persistenceManager.getState(symbol); |
|
236 |
FileOutputStream out = new FileOutputStream(target_symbol); |
|
237 |
persistenceManager.saveState(state, out); |
|
238 |
} catch (Exception e) { |
|
239 |
logger.info("Can't create symbol from '" + item.getAbsolutePath() |
|
240 |
+ ".", e); |
|
241 |
this.notCreatedSymbols.add(item); |
|
242 |
} |
|
243 |
} |
|
244 |
|
|
245 |
private void postPrecess() { |
|
246 |
if (!this.isQuietMode()) { |
|
247 |
if (this.notCreatedSymbols.size() > 0) { |
|
248 |
StringBuffer listOfFiles = new StringBuffer(); |
|
249 |
listOfFiles.append("\n\n"); |
|
250 |
for (File file : this.notCreatedSymbols) { |
|
251 |
listOfFiles.append(file.getAbsolutePath()); |
|
252 |
listOfFiles.append("\n"); |
|
253 |
} |
|
254 |
application.message( |
|
255 |
application.translate("_many_symbols_can_be_createds") |
|
256 |
+ listOfFiles.toString(), |
|
257 |
JOptionPane.WARNING_MESSAGE); |
|
258 |
} |
|
259 |
} |
|
260 |
} |
|
261 |
|
|
262 |
private void copyFile(File source, File target) throws IOException { |
|
263 |
if (target.exists()) { |
|
264 |
switch (this.getOverwrite()) { |
|
265 |
case ASK: |
|
266 |
int resp = application |
|
267 |
.confirmDialog(application.translate( |
|
268 |
"_File_{}_already_exists_Overwrite", |
|
269 |
target.getAbsolutePath()), this.getName(), |
|
270 |
JOptionPane.YES_NO_OPTION, |
|
271 |
JOptionPane.QUESTION_MESSAGE); |
|
272 |
if (resp == JOptionPane.YES_OPTION) { |
|
273 |
FileUtils.copyFile(source, target); |
|
274 |
} |
|
275 |
break; |
|
276 |
case NO: |
|
277 |
break; |
|
278 |
case YES: |
|
279 |
FileUtils.copyFile(source, target); |
|
280 |
break; |
|
281 |
} |
|
282 |
} else { |
|
283 |
FileUtils.copyFile(source, target); |
|
284 |
} |
|
285 |
|
|
286 |
} |
|
287 |
|
|
288 |
private File getTargetSymbol(File item) { |
|
289 |
File target = FileUtils.getFile(getSymbolsRepository() |
|
290 |
.asFile(), this.getTargetFolderName(), |
|
291 |
FilenameUtils.getBaseName(item.getName()) |
|
292 |
+ this.getSymbolManager().getSymbolPreferences() |
|
293 |
.getSymbolFileExtension()); |
|
294 |
return target; |
|
295 |
} |
|
296 |
|
|
297 |
private File getSourceImage(File item) { |
|
298 |
return item; |
|
299 |
} |
|
300 |
|
|
301 |
private File getSourceImageSelected(File item) { |
|
302 |
String ext = FilenameUtils.getExtension(item.getName()); |
|
303 |
String name = FilenameUtils.getBaseName(item.getName()); |
|
304 |
File source = new File(item.getParentFile(), name + "_sel." + ext); |
|
305 |
return source; |
|
306 |
} |
|
307 |
|
|
308 |
private File getTargetImage(File item) { |
|
309 |
File target = FileUtils.getFile(getSymbolsRepository() |
|
310 |
.asFile(), this.getTargetFolderName(), item.getName()); |
|
311 |
return target; |
|
312 |
} |
|
313 |
|
|
314 |
private File getTargetImageSelected(File item) { |
|
315 |
String ext = FilenameUtils.getExtension(item.getName()); |
|
316 |
String name = FilenameUtils.getBaseName(item.getName()); |
|
317 |
File target = FileUtils.getFile(getSymbolsRepository() |
|
318 |
.asFile(), this.getTargetFolderName(), name + "_sel." + ext); |
|
319 |
return target; |
|
320 |
} |
|
321 |
|
|
322 |
private SymbolManager getSymbolManager() { |
|
323 |
if (symbolManager == null) { |
|
324 |
symbolManager = MapContextLocator.getSymbolManager(); |
|
325 |
} |
|
326 |
return symbolManager; |
|
327 |
} |
|
328 |
|
|
329 |
private SymbologyManager getSymbologyManager() { |
|
330 |
if (symbologyManager == null) { |
|
331 |
symbologyManager = SymbologyLocator.getSymbologyManager(); |
|
332 |
} |
|
333 |
return symbologyManager; |
|
334 |
} |
|
335 |
|
|
336 |
} |
|
0 | 337 |
branches/v2_0_0_prep/extensions/org.gvsig.symbology.app/org.gvsig.symbology.app.importsymbols/src/main/java/org/gvsig/symbology/app/importsymbols/ImportPictureMarkerSymbolsPanel.java | ||
---|---|---|
1 |
package org.gvsig.symbology.app.importsymbols; |
|
2 |
|
|
3 |
import java.awt.event.ActionEvent; |
|
4 |
import java.awt.event.ActionListener; |
|
5 |
import java.io.File; |
|
6 |
import java.io.FilenameFilter; |
|
7 |
import java.util.ArrayList; |
|
8 |
import java.util.Arrays; |
|
9 |
import java.util.List; |
|
10 |
|
|
11 |
import javax.swing.ComboBoxModel; |
|
12 |
import javax.swing.JFileChooser; |
|
13 |
import javax.swing.JOptionPane; |
|
14 |
import javax.swing.ListModel; |
|
15 |
import javax.swing.SpinnerNumberModel; |
|
16 |
import javax.swing.event.ListDataListener; |
|
17 |
import javax.swing.event.ListSelectionEvent; |
|
18 |
import javax.swing.event.ListSelectionListener; |
|
19 |
import javax.swing.filechooser.FileFilter; |
|
20 |
|
|
21 |
import org.apache.commons.io.FilenameUtils; |
|
22 |
import org.gvsig.app.ApplicationLocator; |
|
23 |
import org.gvsig.app.ApplicationManager; |
|
24 |
import org.gvsig.symbology.app.importsymbols.ImportPictureMarkerSymbolsProcess.YesNoAsk; |
|
25 |
import org.gvsig.tools.util.FolderSet; |
|
26 |
import org.slf4j.Logger; |
|
27 |
import org.slf4j.LoggerFactory; |
|
28 |
|
|
29 |
public class ImportPictureMarkerSymbolsPanel extends ImportPictureMarkerSymbolsPanelLayout { |
|
30 |
|
|
31 |
private static final long serialVersionUID = 1919826881234125305L; |
|
32 |
|
|
33 |
private static Logger logger = LoggerFactory.getLogger(ImportPictureMarkerSymbolsPanel.class); |
|
34 |
private ImportPictureMarkerSymbolsProcess process = null; |
|
35 |
private ApplicationManager application; |
|
36 |
private List<File> selectedFiles = null; |
|
37 |
|
|
38 |
public ImportPictureMarkerSymbolsPanel(ImportPictureMarkerSymbolsProcess process) { |
|
39 |
super(); |
|
40 |
this.process = process; |
|
41 |
this.application = ApplicationLocator.getManager(); |
|
42 |
initComponents(); |
|
43 |
} |
|
44 |
|
|
45 |
private void closeWindow() { |
|
46 |
this.setVisible(false); |
|
47 |
} |
|
48 |
|
|
49 |
private class OverwriteItem { |
|
50 |
private String label; |
|
51 |
private YesNoAsk value; |
|
52 |
|
|
53 |
OverwriteItem(String label, YesNoAsk value) { |
|
54 |
this.label = label; |
|
55 |
this.value = value; |
|
56 |
} |
|
57 |
public String toString() { |
|
58 |
return this.label; |
|
59 |
} |
|
60 |
public YesNoAsk getValue() { |
|
61 |
return value; |
|
62 |
} |
|
63 |
} |
|
64 |
|
|
65 |
private class FileItem { |
|
66 |
private File value; |
|
67 |
|
|
68 |
FileItem(File value) { |
|
69 |
this.value = value; |
|
70 |
} |
|
71 |
public String toString() { |
|
72 |
return this.value.getName(); |
|
73 |
} |
|
74 |
public File getValue() { |
|
75 |
return value; |
|
76 |
} |
|
77 |
} |
|
78 |
|
|
79 |
private void initComponents() { |
|
80 |
// ------------------------------------------------------------ |
|
81 |
// Image file names |
|
82 |
this.ctrlBrowseImagesToImport.addActionListener(new ActionListener() { |
|
83 |
public void actionPerformed(ActionEvent arg0) { |
|
84 |
doBrowseImagesToImport(); |
|
85 |
} |
|
86 |
|
|
87 |
}); |
|
88 |
|
|
89 |
// ------------------------------------------------------------ |
|
90 |
// Default symbol size |
|
91 |
this.ctrlDefaultSize.setValue(this.process.getSymbolSize()); |
|
92 |
|
|
93 |
// ------------------------------------------------------------ |
|
94 |
// Target folder name |
|
95 |
if( this.process.getTargetFolderName()!=null ) { |
|
96 |
this.ctrltFolderName.setText(this.process.getTargetFolderName()); |
|
97 |
} |
|
98 |
|
|
99 |
// ------------------------------------------------------------ |
|
100 |
// List of existing target folders |
|
101 |
FolderSet repo = this.process.getSymbolsRepository(); |
|
102 |
final File[] folders = repo.listFiles(new FilenameFilter() { |
|
103 |
public boolean accept(File arg0, String arg1) { |
|
104 |
return arg0.isDirectory(); |
|
105 |
} |
|
106 |
}); |
|
107 |
final List<FileItem> folderItems = new ArrayList<FileItem>(); |
|
108 |
for( int i=0; i<folders.length; i ++ ) { |
|
109 |
folderItems.add(new FileItem(folders[i])); |
|
110 |
} |
|
111 |
ctrlExistingFolders.setModel(new ListModel() { |
|
112 |
public void removeListDataListener(ListDataListener arg0) { |
|
113 |
// Do nothing |
|
114 |
} |
|
115 |
public int getSize() { |
|
116 |
return folderItems.size(); |
|
117 |
} |
|
118 |
public Object getElementAt(int arg0) { |
|
119 |
return folderItems.get(arg0); |
|
120 |
|
|
121 |
} |
|
122 |
public void addListDataListener(ListDataListener arg0) { |
|
123 |
// Do nothing |
|
124 |
} |
|
125 |
}); |
|
126 |
this.ctrlExistingFolders.addListSelectionListener(new ListSelectionListener() { |
|
127 |
public void valueChanged(ListSelectionEvent arg0) { |
|
128 |
if( !arg0.getValueIsAdjusting() ) { |
|
129 |
try { |
|
130 |
File file = ((FileItem)ctrlExistingFolders.getSelectedValue()).getValue(); |
|
131 |
ctrltFolderName.setText(file.getName()); |
|
132 |
} catch(Exception ex) { |
|
133 |
logger.info("Error getting selected filename",ex); |
|
134 |
} |
|
135 |
} |
|
136 |
} |
|
137 |
}); |
|
138 |
|
|
139 |
// ------------------------------------------------------------ |
|
140 |
// Overwrite options |
|
141 |
final OverwriteItem[] overwriteItems = new OverwriteItem[] { |
|
142 |
new OverwriteItem(application.translate("_Ask_to_the user"), YesNoAsk.ASK), |
|
143 |
new OverwriteItem(application.translate("_Dont_overwrite"), YesNoAsk.NO), |
|
144 |
new OverwriteItem(application.translate("_Overwrite_always"), YesNoAsk.YES) |
|
145 |
}; |
|
146 |
this.ctrlOverwriteOptions.setModel(new ComboBoxModel() { |
|
147 |
OverwriteItem selected = null; |
|
148 |
public void removeListDataListener(ListDataListener arg0) { |
|
149 |
// Do nothing |
|
150 |
} |
|
151 |
public int getSize() { |
|
152 |
return overwriteItems.length; |
|
153 |
} |
|
154 |
public Object getElementAt(int arg0) { |
|
155 |
return overwriteItems[arg0]; |
|
156 |
} |
|
157 |
public void addListDataListener(ListDataListener arg0) { |
|
158 |
// Do nothing |
|
159 |
} |
|
160 |
public void setSelectedItem(Object arg0) { |
|
161 |
this.selected = (OverwriteItem) arg0; |
|
162 |
} |
|
163 |
public Object getSelectedItem() { |
|
164 |
return this.selected; |
|
165 |
} |
|
166 |
}); |
|
167 |
this.ctrlOverwriteOptions.setSelectedIndex(0); |
|
168 |
|
|
169 |
// ------------------------------------------------------------ |
|
170 |
// Import button |
|
171 |
this.ctrlImport.addActionListener(new ActionListener() { |
|
172 |
public void actionPerformed(ActionEvent arg0) { |
|
173 |
doImport(); |
|
174 |
} |
|
175 |
}); |
|
176 |
|
|
177 |
// ------------------------------------------------------------ |
|
178 |
// Cancel button |
|
179 |
this.ctrlCancel.addActionListener(new ActionListener() { |
|
180 |
public void actionPerformed(ActionEvent arg0) { |
|
181 |
doCancel(); |
|
182 |
} |
|
183 |
}); |
|
184 |
|
|
185 |
|
|
186 |
} |
|
187 |
|
|
188 |
private void doImport() { |
|
189 |
if( this.ctrltFolderName.getText().trim().length()==0 ) { |
|
190 |
application.messageDialog( |
|
191 |
application.translate("_Select_a_folder_name"), |
|
192 |
this.process.getName(), |
|
193 |
JOptionPane.WARNING_MESSAGE); |
|
194 |
return; |
|
195 |
} |
|
196 |
if( this.selectedFiles==null || this.selectedFiles.size()==0 ) { |
|
197 |
application.messageDialog( |
|
198 |
application.translate("_Select_images"), |
|
199 |
this.process.getName(), |
|
200 |
JOptionPane.WARNING_MESSAGE); |
|
201 |
return; |
|
202 |
} |
|
203 |
this.process.setTargetFolderName(this.ctrltFolderName.getText()); |
|
204 |
this.process.setSymbolSize( (( SpinnerNumberModel)this.ctrlDefaultSize.getModel()).getNumber().doubleValue()); |
|
205 |
this.process.setOverwrite( ((OverwriteItem)this.ctrlOverwriteOptions.getSelectedItem()).getValue() ); |
|
206 |
this.process.getSelectedImageFiles().clear(); |
|
207 |
this.process.getSelectedImageFiles().addAll(selectedFiles); |
|
208 |
this.closeWindow(); |
|
209 |
} |
|
210 |
|
|
211 |
private void doCancel() { |
|
212 |
this.process.cancelRequest(); |
|
213 |
this.closeWindow(); |
|
214 |
} |
|
215 |
|
|
216 |
private List<File> fileChooser(String title, boolean multiselect, FileFilter filter) { |
|
217 |
JFileChooser fc = new JFileChooser(); |
|
218 |
fc.setFileFilter(filter); |
|
219 |
fc.setMultiSelectionEnabled(multiselect); |
|
220 |
int r = fc.showDialog(application.getRootComponent(), application.translate("_Select_symbols")); |
|
221 |
if( r == JFileChooser.APPROVE_OPTION ) { |
|
222 |
return Arrays.asList(fc.getSelectedFiles()); |
|
223 |
} |
|
224 |
return null; |
|
225 |
} |
|
226 |
|
|
227 |
private void doBrowseImagesToImport() { |
|
228 |
List<File> files = fileChooser(application.translate("_Select_symbols"), true, new FileFilter() { |
|
229 |
public String getDescription() { |
|
230 |
StringBuffer buffer = new StringBuffer(); |
|
231 |
List<String> extensions = new ArrayList<String>(); |
|
232 |
extensions.addAll(process.getAllowedFileExtensions()); |
|
233 |
int l=extensions.size(); |
|
234 |
if( l>=2 ) { |
|
235 |
for( int i=0; i<l-2; i++) { |
|
236 |
buffer.append(extensions.get(i)); |
|
237 |
buffer.append(", "); |
|
238 |
} |
|
239 |
buffer.append( extensions.get(l-2)); |
|
240 |
buffer.append(" & "); |
|
241 |
buffer.append( extensions.get(l-1)); |
|
242 |
} else { |
|
243 |
buffer.append( extensions.get(0)); |
|
244 |
} |
|
245 |
buffer.append(" "); |
|
246 |
buffer.append(application.translate("_Images")); |
|
247 |
return buffer.toString(); |
|
248 |
} |
|
249 |
|
|
250 |
public boolean accept(File f) { |
|
251 |
if (f.isDirectory()) { |
|
252 |
return true; |
|
253 |
} |
|
254 |
String extension = FilenameUtils.getExtension(f.getName()).toLowerCase(); |
|
255 |
return extension != null && process.getAllowedFileExtensions().contains(extension); |
|
256 |
} |
|
257 |
}); |
|
258 |
if( files != null ) { |
|
259 |
this.selectedFiles = files; |
|
260 |
final List<FileItem> folderItems = new ArrayList<FileItem>(); |
|
261 |
for( int i=0; i<files.size(); i ++ ) { |
|
262 |
folderItems.add(new FileItem(files.get(i))); |
|
263 |
} |
|
264 |
ctrlImagesToImport.setModel(new ListModel() { |
|
265 |
public void removeListDataListener(ListDataListener arg0) { |
|
266 |
// Do nothing |
|
267 |
} |
|
268 |
public int getSize() { |
|
269 |
return folderItems.size(); |
|
270 |
} |
|
271 |
public Object getElementAt(int arg0) { |
|
272 |
return folderItems.get(arg0); |
|
273 |
|
|
274 |
} |
|
275 |
public void addListDataListener(ListDataListener arg0) { |
|
276 |
// Do nothing |
|
277 |
} |
|
278 |
}); |
|
279 |
} |
|
280 |
} |
|
281 |
} |
|
0 | 282 |
branches/v2_0_0_prep/extensions/org.gvsig.symbology.app/org.gvsig.symbology.app.importsymbols/src/main/java/org/gvsig/symbology/app/importsymbols/ImportPictureMarkerSymbolsExtension.java | ||
---|---|---|
1 |
package org.gvsig.symbology.app.importsymbols; |
|
2 |
|
|
3 |
import java.awt.Component; |
|
4 |
|
|
5 |
import javax.swing.JOptionPane; |
|
6 |
|
|
7 |
import org.gvsig.andami.plugins.Extension; |
|
8 |
import org.gvsig.app.ApplicationLocator; |
|
9 |
import org.gvsig.app.ApplicationManager; |
|
10 |
import org.slf4j.Logger; |
|
11 |
import org.slf4j.LoggerFactory; |
|
12 |
|
|
13 |
public class ImportPictureMarkerSymbolsExtension extends Extension { |
|
14 |
|
|
15 |
@SuppressWarnings("unused") |
|
16 |
private static Logger logger = LoggerFactory.getLogger(ImportPictureMarkerSymbolsExtension.class); |
|
17 |
private ImportPictureMarkerSymbolsProcess process = null; |
|
18 |
|
|
19 |
public void initialize() { |
|
20 |
// Do nothing |
|
21 |
} |
|
22 |
public void execute(String actionCommand) { |
|
23 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
24 |
|
|
25 |
if ("tools-symbology-import-picture-marker-symbol".equalsIgnoreCase(actionCommand)) { |
|
26 |
if (process != null && process.isAlive()) { |
|
27 |
application.messageDialog( |
|
28 |
application.translate("_Import_process_already_running_Wait_to_terminate"), |
|
29 |
application.translate("_Import_point_symbols"), |
|
30 |
JOptionPane.WARNING_MESSAGE); |
|
31 |
return; |
|
32 |
} |
|
33 |
process = new ImportPictureMarkerSymbolsProcess(); |
|
34 |
Component dlg = application.createComponent(ImportPictureMarkerSymbolsPanel.class, process); |
|
35 |
application.showDialog(dlg, application.translate("_Import_point_symbols")); |
|
36 |
if( !process.isCancellationRequested() ) { |
|
37 |
process.start(); |
|
38 |
} |
|
39 |
} |
|
40 |
} |
|
41 |
public boolean isEnabled() { |
|
42 |
if (process != null && process.isAlive()) { |
|
43 |
return false; |
|
44 |
} |
|
45 |
return true; |
|
46 |
} |
|
47 |
public boolean isVisible() { |
|
48 |
return true; |
|
49 |
} |
|
50 |
|
|
51 |
} |
|
0 | 52 |
branches/v2_0_0_prep/extensions/org.gvsig.symbology.app/org.gvsig.symbology.app.importsymbols/src/main/java/org/gvsig/symbology/app/importsymbols/ImportPictureMarkerSymbolsPanelLayout.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<object classname="com.jeta.forms.store.memento.FormPackage"> |
|
4 |
<at name="fileversion"> |
|
5 |
<object classname="com.jeta.forms.store.memento.FormsVersion2"> |
|
6 |
<at name="major">2</at> |
|
7 |
<at name="minor">0</at> |
|
8 |
<at name="sub">0</at> |
|
9 |
</object> |
|
10 |
</at> |
|
11 |
<at name="form"> |
|
12 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
13 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
14 |
<at name="cellconstraints"> |
|
15 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
16 |
<at name="column">1</at> |
|
17 |
<at name="row">1</at> |
|
18 |
<at name="colspan">1</at> |
|
19 |
<at name="rowspan">1</at> |
|
20 |
<at name="halign">default</at> |
|
21 |
<at name="valign">default</at> |
|
22 |
<at name="insets" object="insets">0,0,0,0</at> |
|
23 |
</object> |
|
24 |
</at> |
|
25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
26 |
</super> |
|
27 |
<at name="id">/home/jjdelcerro/workspaces/gvsig-desktop-2.0.0-20120418/org.gvsig.symbology.app/org.gvsig.symbology.app.importsymbols/src/main/java/org/gvsig/symbology/app/importsymbols/ImportPictureMarkerSymbolsPanelLayout.xml</at> |
|
28 |
<at name="path">gvsig-desktop-2.0.0-20120418/org.gvsig.symbology.app/org.gvsig.symbology.app.importsymbols/src/main/java/org/gvsig/symbology/app/importsymbols/ImportPictureMarkerSymbolsPanelLayout.xml</at> |
|
29 |
<at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE</at> |
|
30 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE</at> |
|
31 |
<at name="components"> |
|
32 |
<object classname="java.util.LinkedList"> |
|
33 |
<item > |
|
34 |
<at name="value"> |
|
35 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
36 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
37 |
<at name="cellconstraints"> |
|
38 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
39 |
<at name="column">2</at> |
|
40 |
<at name="row">2</at> |
|
41 |
<at name="colspan">6</at> |
|
42 |
<at name="rowspan">1</at> |
|
43 |
<at name="halign">default</at> |
|
44 |
<at name="valign">default</at> |
|
45 |
<at name="insets" object="insets">0,0,0,0</at> |
|
46 |
</object> |
|
47 |
</at> |
|
48 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
49 |
</super> |
|
50 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
51 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
52 |
<at name="beanproperties"> |
|
53 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
54 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
55 |
<at name="properties"> |
|
56 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
57 |
<at name="text">_Import_images_as_point_symbols</at> |
|
58 |
<at name="height">17</at> |
|
59 |
<at name="width">751</at> |
|
60 |
<at name="name">labelTitle</at> |
|
61 |
<at name="fill"> |
|
62 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
63 |
<at name="name">fill</at> |
|
64 |
</object> |
|
65 |
</at> |
|
66 |
<at name="border"> |
|
67 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
68 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
69 |
<at name="name">border</at> |
|
70 |
</super> |
|
71 |
<at name="borders"> |
|
72 |
<object classname="java.util.LinkedList"> |
|
73 |
<item > |
|
74 |
<at name="value"> |
|
75 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
76 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
77 |
<at name="name">border</at> |
|
78 |
</super> |
|
79 |
</object> |
|
80 |
</at> |
|
81 |
</item> |
|
82 |
</object> |
|
83 |
</at> |
|
84 |
</object> |
|
85 |
</at> |
|
86 |
</object> |
|
87 |
</at> |
|
88 |
</object> |
|
89 |
</at> |
|
90 |
</object> |
|
91 |
</at> |
|
92 |
</item> |
|
93 |
<item > |
|
94 |
<at name="value"> |
|
95 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
96 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
97 |
<at name="cellconstraints"> |
|
98 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
99 |
<at name="column">2</at> |
|
100 |
<at name="row">4</at> |
|
101 |
<at name="colspan">6</at> |
|
102 |
<at name="rowspan">1</at> |
|
103 |
<at name="halign">default</at> |
|
104 |
<at name="valign">default</at> |
|
105 |
<at name="insets" object="insets">0,0,0,0</at> |
|
106 |
</object> |
|
107 |
</at> |
|
108 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
109 |
</super> |
|
110 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
111 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
112 |
<at name="beanproperties"> |
|
113 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
114 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
115 |
<at name="properties"> |
|
116 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
117 |
<at name="text">_Images_to_import</at> |
|
118 |
<at name="height">17</at> |
|
119 |
<at name="width">751</at> |
|
120 |
<at name="name">labelImagesToImport</at> |
|
121 |
<at name="fill"> |
|
122 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
123 |
<at name="name">fill</at> |
|
124 |
</object> |
|
125 |
</at> |
|
126 |
<at name="border"> |
|
127 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
128 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
129 |
<at name="name">border</at> |
|
130 |
</super> |
|
131 |
<at name="borders"> |
|
132 |
<object classname="java.util.LinkedList"> |
|
133 |
<item > |
|
134 |
<at name="value"> |
|
135 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
136 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
137 |
<at name="name">border</at> |
|
138 |
</super> |
|
139 |
</object> |
|
140 |
</at> |
|
141 |
</item> |
|
142 |
</object> |
|
143 |
</at> |
|
144 |
</object> |
|
145 |
</at> |
|
146 |
</object> |
|
147 |
</at> |
|
148 |
</object> |
|
149 |
</at> |
|
150 |
</object> |
|
151 |
</at> |
|
152 |
</item> |
|
153 |
<item > |
|
154 |
<at name="value"> |
|
155 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
156 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
157 |
<at name="cellconstraints"> |
|
158 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
159 |
<at name="column">2</at> |
|
160 |
<at name="row">7</at> |
|
161 |
<at name="colspan">6</at> |
|
162 |
<at name="rowspan">1</at> |
|
163 |
<at name="halign">default</at> |
|
164 |
<at name="valign">default</at> |
|
165 |
<at name="insets" object="insets">0,0,0,0</at> |
|
166 |
</object> |
|
167 |
</at> |
|
168 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
169 |
</super> |
|
170 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
171 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
172 |
<at name="beanproperties"> |
|
173 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
174 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
175 |
<at name="properties"> |
|
176 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
177 |
<at name="text">_Folder_name_for_import_the_images</at> |
|
178 |
<at name="height">17</at> |
|
179 |
<at name="width">751</at> |
|
180 |
<at name="name">labelFolderName</at> |
|
181 |
<at name="fill"> |
|
182 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
183 |
<at name="name">fill</at> |
|
184 |
</object> |
|
185 |
</at> |
|
186 |
<at name="border"> |
|
187 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
188 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
189 |
<at name="name">border</at> |
|
190 |
</super> |
|
191 |
<at name="borders"> |
|
192 |
<object classname="java.util.LinkedList"> |
|
193 |
<item > |
|
194 |
<at name="value"> |
|
195 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
196 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
197 |
<at name="name">border</at> |
|
198 |
</super> |
|
199 |
</object> |
|
200 |
</at> |
|
201 |
</item> |
|
202 |
</object> |
|
203 |
</at> |
|
204 |
</object> |
|
205 |
</at> |
|
206 |
</object> |
|
207 |
</at> |
|
208 |
</object> |
|
209 |
</at> |
|
210 |
</object> |
|
211 |
</at> |
|
212 |
</item> |
|
213 |
<item > |
|
214 |
<at name="value"> |
|
215 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
216 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
217 |
<at name="cellconstraints"> |
|
218 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
219 |
<at name="column">3</at> |
|
220 |
<at name="row">8</at> |
|
221 |
<at name="colspan">5</at> |
|
222 |
<at name="rowspan">1</at> |
|
223 |
<at name="halign">default</at> |
|
224 |
<at name="valign">default</at> |
|
225 |
<at name="insets" object="insets">0,0,0,0</at> |
|
226 |
</object> |
|
227 |
</at> |
|
228 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
229 |
</super> |
|
230 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
231 |
<at name="beanclass">javax.swing.JTextField</at> |
|
232 |
<at name="beanproperties"> |
|
233 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
234 |
<at name="classname">javax.swing.JTextField</at> |
|
235 |
<at name="properties"> |
|
236 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
237 |
<at name="height">21</at> |
|
238 |
<at name="width">735</at> |
|
239 |
<at name="name">ctrltFolderName</at> |
|
240 |
<at name="border"> |
|
241 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
242 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
243 |
<at name="name">border</at> |
|
244 |
</super> |
|
245 |
<at name="borders"> |
|
246 |
<object classname="java.util.LinkedList"> |
|
247 |
<item > |
|
248 |
<at name="value"> |
|
249 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
250 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
251 |
<at name="name">border</at> |
|
252 |
</super> |
|
253 |
</object> |
|
254 |
</at> |
|
255 |
</item> |
|
256 |
</object> |
|
257 |
</at> |
|
258 |
</object> |
|
259 |
</at> |
|
260 |
</object> |
|
261 |
</at> |
|
262 |
</object> |
|
263 |
</at> |
|
264 |
</object> |
|
265 |
</at> |
|
266 |
</item> |
|
267 |
<item > |
|
268 |
<at name="value"> |
|
269 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
270 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
271 |
<at name="cellconstraints"> |
|
272 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
273 |
<at name="column">3</at> |
|
274 |
<at name="row">9</at> |
|
275 |
<at name="colspan">5</at> |
|
276 |
<at name="rowspan">1</at> |
|
277 |
<at name="halign">default</at> |
|
278 |
<at name="valign">default</at> |
|
279 |
<at name="insets" object="insets">0,0,0,0</at> |
|
280 |
</object> |
|
281 |
</at> |
|
282 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
283 |
</super> |
|
284 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
285 |
<at name="beanclass">javax.swing.JList</at> |
|
286 |
<at name="beanproperties"> |
|
287 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
288 |
<at name="classname">javax.swing.JList</at> |
|
289 |
<at name="properties"> |
|
290 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
291 |
<at name="scrollableTracksViewportWidth">true</at> |
|
292 |
<at name="height">78</at> |
|
293 |
<at name="items"> |
|
294 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
295 |
<at name="name">items</at> |
|
296 |
</object> |
|
297 |
</at> |
|
298 |
<at name="width">733</at> |
|
299 |
<at name="name">ctrlExistingFolders</at> |
|
300 |
<at name="scollBars"> |
|
301 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
302 |
<at name="name">scollBars</at> |
|
303 |
<at name="verticalpolicy">20</at> |
|
304 |
<at name="horizontalpolicy">30</at> |
|
305 |
<at name="border"> |
|
306 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
307 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
308 |
<at name="name">border</at> |
|
309 |
</super> |
|
310 |
<at name="borders"> |
|
311 |
<object classname="java.util.LinkedList"> |
|
312 |
<item > |
|
313 |
<at name="value"> |
|
314 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
315 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
316 |
<at name="name">border</at> |
|
317 |
</super> |
|
318 |
</object> |
|
319 |
</at> |
|
320 |
</item> |
|
321 |
</object> |
|
322 |
</at> |
|
323 |
</object> |
|
324 |
</at> |
|
325 |
</object> |
|
326 |
</at> |
|
327 |
<at name="border"> |
|
328 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
329 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
330 |
<at name="name">border</at> |
|
331 |
</super> |
|
332 |
<at name="borders"> |
|
333 |
<object classname="java.util.LinkedList"> |
|
334 |
<item > |
|
335 |
<at name="value"> |
|
336 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
337 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
338 |
<at name="name">border</at> |
|
339 |
</super> |
|
340 |
</object> |
|
341 |
</at> |
|
342 |
</item> |
|
343 |
</object> |
|
344 |
</at> |
|
345 |
</object> |
|
346 |
</at> |
|
347 |
<at name="scrollableTracksViewportHeight">true</at> |
|
348 |
</object> |
|
349 |
</at> |
|
350 |
</object> |
|
351 |
</at> |
|
352 |
</object> |
|
353 |
</at> |
|
354 |
</item> |
|
355 |
<item > |
|
356 |
<at name="value"> |
|
357 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
358 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
359 |
<at name="cellconstraints"> |
|
360 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
361 |
<at name="column">2</at> |
|
362 |
<at name="row">11</at> |
|
363 |
<at name="colspan">6</at> |
|
364 |
<at name="rowspan">1</at> |
|
365 |
<at name="halign">default</at> |
|
366 |
<at name="valign">default</at> |
|
367 |
<at name="insets" object="insets">0,0,0,0</at> |
|
368 |
</object> |
|
369 |
</at> |
|
370 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
371 |
</super> |
|
372 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
373 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
374 |
<at name="beanproperties"> |
|
375 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
376 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
377 |
<at name="properties"> |
|
378 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
379 |
<at name="text">_Default_size_to_use_in_symbols</at> |
|
380 |
<at name="height">17</at> |
|
381 |
<at name="width">751</at> |
|
382 |
<at name="name">labelSize</at> |
|
383 |
<at name="fill"> |
|
384 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
385 |
<at name="name">fill</at> |
|
386 |
</object> |
|
387 |
</at> |
|
388 |
<at name="border"> |
|
389 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
390 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
391 |
<at name="name">border</at> |
|
392 |
</super> |
|
393 |
<at name="borders"> |
|
394 |
<object classname="java.util.LinkedList"> |
|
395 |
<item > |
|
396 |
<at name="value"> |
|
397 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
398 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
399 |
<at name="name">border</at> |
|
400 |
</super> |
|
401 |
</object> |
|
402 |
</at> |
|
403 |
</item> |
|
404 |
</object> |
|
405 |
</at> |
|
406 |
</object> |
|
407 |
</at> |
|
408 |
</object> |
|
409 |
</at> |
|
410 |
</object> |
|
411 |
</at> |
|
412 |
</object> |
|
413 |
</at> |
|
414 |
</item> |
|
415 |
<item > |
|
416 |
<at name="value"> |
|
417 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
418 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
419 |
<at name="cellconstraints"> |
|
420 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
421 |
<at name="column">3</at> |
|
422 |
<at name="row">12</at> |
|
423 |
<at name="colspan">5</at> |
|
424 |
<at name="rowspan">1</at> |
|
425 |
<at name="halign">default</at> |
|
426 |
<at name="valign">default</at> |
|
427 |
<at name="insets" object="insets">0,0,0,0</at> |
|
428 |
</object> |
|
429 |
</at> |
|
430 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
431 |
</super> |
|
432 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
433 |
<at name="beanclass">javax.swing.JSpinner</at> |
|
434 |
<at name="beanproperties"> |
|
435 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
436 |
<at name="classname">javax.swing.JSpinner</at> |
|
437 |
<at name="properties"> |
|
438 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
439 |
<at name="height">24</at> |
|
440 |
<at name="width">735</at> |
|
441 |
<at name="name">ctrlDefaultSize</at> |
|
442 |
</object> |
|
443 |
</at> |
|
444 |
</object> |
|
445 |
</at> |
|
446 |
</object> |
|
447 |
</at> |
|
448 |
</item> |
|
449 |
<item > |
|
450 |
<at name="value"> |
|
451 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
452 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
453 |
<at name="cellconstraints"> |
|
454 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
455 |
<at name="column">5</at> |
|
456 |
<at name="row">17</at> |
|
457 |
<at name="colspan">1</at> |
|
458 |
<at name="rowspan">1</at> |
|
459 |
<at name="halign">default</at> |
|
460 |
<at name="valign">default</at> |
|
461 |
<at name="insets" object="insets">0,0,0,0</at> |
|
462 |
</object> |
|
463 |
</at> |
|
464 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
465 |
</super> |
|
466 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
467 |
<at name="beanclass">javax.swing.JButton</at> |
|
468 |
<at name="beanproperties"> |
|
469 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
470 |
<at name="classname">javax.swing.JButton</at> |
|
471 |
<at name="properties"> |
|
472 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
473 |
<at name="text">_Cancel</at> |
|
474 |
<at name="height">22</at> |
|
475 |
<at name="width">62</at> |
|
476 |
<at name="name">ctrlCancel</at> |
|
477 |
<at name="actionCommand">_Cancel</at> |
|
478 |
<at name="border"> |
|
479 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
480 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
481 |
<at name="name">border</at> |
|
482 |
</super> |
|
483 |
<at name="borders"> |
|
484 |
<object classname="java.util.LinkedList"> |
|
485 |
<item > |
|
486 |
<at name="value"> |
|
487 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
488 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
489 |
<at name="name">border</at> |
|
490 |
</super> |
|
491 |
</object> |
|
492 |
</at> |
|
493 |
</item> |
|
494 |
</object> |
|
495 |
</at> |
|
496 |
</object> |
|
497 |
</at> |
|
498 |
</object> |
|
499 |
</at> |
|
500 |
</object> |
|
501 |
</at> |
|
502 |
</object> |
|
503 |
</at> |
|
504 |
</item> |
|
505 |
<item > |
Also available in: Unified diff