Revision 7153
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<groupId>org.gvsig</groupId> |
|
4 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage</artifactId> |
|
5 |
<version>1.0.41</version> |
|
6 |
<packaging>pom</packaging> |
|
7 |
<name>${project.artifactId}</name> |
|
8 |
<description>Legend for urban horizontal signage.</description> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.desktop</artifactId> |
|
12 |
<version>2.0.374</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<url>https://devel.gvsig.org/sites/org.gvsig.legend.urbanhorizontalsignage/${project.version}</url> |
|
16 |
<scm> |
|
17 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-base-legends/org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41</connection> |
|
18 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-base-legends/org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41</developerConnection> |
|
19 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-base-legends/repository/show/org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41</url> |
|
20 |
</scm> |
|
21 |
<repositories> |
|
22 |
<repository> |
|
23 |
<id>gvsig-public-http-repository</id> |
|
24 |
<name>gvSIG maven public HTTP repository</name> |
|
25 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
26 |
<releases> |
|
27 |
<enabled>true</enabled> |
|
28 |
<updatePolicy>daily</updatePolicy> |
|
29 |
<checksumPolicy>warn</checksumPolicy> |
|
30 |
</releases> |
|
31 |
<snapshots> |
|
32 |
<enabled>true</enabled> |
|
33 |
<updatePolicy>daily</updatePolicy> |
|
34 |
<checksumPolicy>warn</checksumPolicy> |
|
35 |
</snapshots> |
|
36 |
</repository> |
|
37 |
</repositories> |
|
38 |
|
|
39 |
<distributionManagement> |
|
40 |
<site> |
|
41 |
<id>gvsig-repository</id> |
|
42 |
<url>dav:https://devel.gvsig.org/download/projects/gvsig-base-legends/pool/${project.artifactId}/${project.version}</url> |
|
43 |
</site> |
|
44 |
</distributionManagement> |
|
45 |
|
|
46 |
<build> |
|
47 |
<plugins> |
|
48 |
<plugin> |
|
49 |
<groupId>org.apache.maven.plugins</groupId> |
|
50 |
<artifactId>maven-release-plugin</artifactId> |
|
51 |
<configuration> |
|
52 |
<tagBase>https://devel.gvsig.org/svn/gvsig-base-legends/org.gvsig.legend.urbanhorizontalsignage/tags</tagBase> |
|
53 |
</configuration> |
|
54 |
</plugin> |
|
55 |
</plugins> |
|
56 |
</build> |
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
<dependencyManagement> |
|
61 |
<dependencies> |
|
62 |
<dependency> |
|
63 |
<groupId>org.gvsig</groupId> |
|
64 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage.lib.api</artifactId> |
|
65 |
<version>1.0.41</version> |
|
66 |
</dependency> |
|
67 |
<dependency> |
|
68 |
<groupId>org.gvsig</groupId> |
|
69 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage.lib.impl</artifactId> |
|
70 |
<version>1.0.41</version> |
|
71 |
</dependency> |
|
72 |
<dependency> |
|
73 |
<groupId>org.gvsig</groupId> |
|
74 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage.swing.api</artifactId> |
|
75 |
<version>1.0.41</version> |
|
76 |
</dependency> |
|
77 |
<dependency> |
|
78 |
<groupId>org.gvsig</groupId> |
|
79 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage.swing.impl</artifactId> |
|
80 |
<version>1.0.41</version> |
|
81 |
</dependency> |
|
82 |
<dependency> |
|
83 |
<groupId>org.gvsig</groupId> |
|
84 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage.app.mainplugin</artifactId> |
|
85 |
<version>1.0.41</version> |
|
86 |
</dependency> |
|
87 |
</dependencies> |
|
88 |
</dependencyManagement> |
|
89 |
<modules> |
|
90 |
<module>org.gvsig.legend.urbanhorizontalsignage.lib</module> |
|
91 |
<module>org.gvsig.legend.urbanhorizontalsignage.swing</module> |
|
92 |
<module>org.gvsig.legend.urbanhorizontalsignage.app</module> |
|
93 |
</modules> |
|
94 |
</project> |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41/org.gvsig.legend.urbanhorizontalsignage.app/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage</artifactId> |
|
6 |
<version>1.0.41</version> |
|
7 |
</parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage.app</artifactId> |
|
10 |
<packaging>pom</packaging> |
|
11 |
<name>org.gvsig.legend.urbanhorizontalsignage.app</name> |
|
12 |
|
|
13 |
<modules> |
|
14 |
<module>org.gvsig.legend.urbanhorizontalsignage.app.mainplugin</module> |
|
15 |
</modules> |
|
16 |
|
|
17 |
</project> |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/src/main/java/org/gvsig/legend/urbanhorizontalsignage/app/UrbanHorizontalSignageExtension.java | ||
---|---|---|
1 |
package org.gvsig.legend.urbanhorizontalsignage.app; |
|
2 |
|
|
3 |
import java.awt.event.ActionEvent; |
|
4 |
import java.util.function.Predicate; |
|
5 |
import javax.swing.Icon; |
|
6 |
import javax.swing.JOptionPane; |
|
7 |
import javax.swing.SwingConstants; |
|
8 |
import javax.swing.event.TreeModelListener; |
|
9 |
import javax.swing.tree.TreePath; |
|
10 |
import org.gvsig.andami.IconThemeHelper; |
|
11 |
import org.gvsig.andami.plugins.Extension; |
|
12 |
import org.gvsig.app.ApplicationLocator; |
|
13 |
import org.gvsig.app.ApplicationManager; |
|
14 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
15 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
16 |
import org.gvsig.fmap.dal.DALLocator; |
|
17 |
import org.gvsig.fmap.dal.DataManager; |
|
18 |
import org.gvsig.fmap.dal.DataStore; |
|
19 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
20 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
|
21 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
22 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
23 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
24 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
25 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
|
26 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
27 |
import org.gvsig.fmap.mapcontrol.CompoundStoresTreeModel; |
|
28 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.linelegend.UrbanHorizontalSignageLegend; |
|
29 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.UrbanHorizontalSignageLocator; |
|
30 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.UrbanHorizontalSignageManager; |
|
31 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.linelegend.UrbanHorizontalSignageConfig; |
|
32 |
import org.gvsig.legend.urbanhorizontalsignage.swing.api.ConvertLinesToPolygonsPanel; |
|
33 |
import org.gvsig.legend.urbanhorizontalsignage.swing.api.UrbanHorizontalSignageSwingLocator; |
|
34 |
import org.gvsig.legend.urbanhorizontalsignage.swing.api.UrbanHorizontalSignageSwingManager; |
|
35 |
import org.gvsig.tools.ToolsLocator; |
|
36 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
37 |
import org.gvsig.tools.i18n.I18nManager; |
|
38 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
39 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
40 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
41 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
42 |
import org.gvsig.tools.util.LabeledValue; |
|
43 |
import org.slf4j.Logger; |
|
44 |
import org.slf4j.LoggerFactory; |
|
45 |
|
|
46 |
@SuppressWarnings("UseSpecificCatch") |
|
47 |
public class UrbanHorizontalSignageExtension extends Extension { |
|
48 |
|
|
49 |
private static final Logger LOGGER = LoggerFactory.getLogger(UrbanHorizontalSignageExtension.class); |
|
50 |
|
|
51 |
@Override |
|
52 |
public void initialize() { |
|
53 |
IconThemeHelper.registerIcon("legend", "legend-overview-vectorial-urbanhorizontalsignage", this); |
|
54 |
IconThemeHelper.registerIcon("legend", "legend-overview-vectorial-picturemarkersymboltable", this); |
|
55 |
IconThemeHelper.registerIcon("action", "layer-modify-clipboard-copy-as-polygons", this); |
|
56 |
|
|
57 |
} |
|
58 |
|
|
59 |
@Override |
|
60 |
public void execute(String actionCommand) { |
|
61 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
62 |
|
|
63 |
if ("layer-modify-clipboard-copy-as-polygons".equalsIgnoreCase(actionCommand) ) { |
|
64 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
65 |
if (viewdoc == null) { |
|
66 |
return; |
|
67 |
} |
|
68 |
MapContext mapContext = viewdoc.getMapContext(); |
|
69 |
FLyrVect layer = mapContext.getLayers().getFirstActiveVectorLayer(); |
|
70 |
if (layer == null) { |
|
71 |
return; |
|
72 |
} |
|
73 |
copySelecctionAsPolygons(layer); |
|
74 |
|
|
75 |
} else if ("tools-urbanSignage-linesToPolygons".equalsIgnoreCase(actionCommand) ) { |
|
76 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
77 |
if (viewdoc == null) { |
|
78 |
return; |
|
79 |
} |
|
80 |
MapContext mapContext = viewdoc.getMapContext(); |
|
81 |
FLyrVect layer = mapContext.getLayers().getFirstActiveVectorLayer(); |
|
82 |
if (layer == null) { |
|
83 |
return; |
|
84 |
} |
|
85 |
if( !(layer.getLegend() instanceof UrbanHorizontalSignageLegend) ) { |
|
86 |
//FIXME mensaje al usuario? |
|
87 |
return; |
|
88 |
} |
|
89 |
UrbanHorizontalSignageLegend legend = (UrbanHorizontalSignageLegend) layer.getLegend(); |
|
90 |
UrbanHorizontalSignageConfig config = legend.getConfig(); // FIXME: clone |
|
91 |
FeatureSet lines; |
|
92 |
try { |
|
93 |
lines = layer.getFeatureStore().getFeatureSelection(); |
|
94 |
} catch(Exception ex) { |
|
95 |
//FIXME mensaje al usuario? |
|
96 |
return; |
|
97 |
} |
|
98 |
convertLinesAsPolygons(config, lines); |
|
99 |
} |
|
100 |
|
|
101 |
} |
|
102 |
|
|
103 |
private void copySelecctionAsPolygons(FLyrVect sourceLayer) { |
|
104 |
// UrbanHorizontalSignageManager uhsManager = UrbanHorizontalSignageLocator.getUrbanHorizontalSignageManager(); |
|
105 |
|
|
106 |
UrbanHorizontalSignageConfigForCopyPanel panel = new UrbanHorizontalSignageConfigForCopyPanel(); |
|
107 |
panel.setFeatureType(sourceLayer.getFeatureStore().getDefaultFeatureTypeQuietly()); |
|
108 |
UrbanHorizontalSignageLegend legend = (UrbanHorizontalSignageLegend) sourceLayer.getLegend(); |
|
109 |
panel.put(legend.getConfig()); |
|
110 |
|
|
111 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
112 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
113 |
|
|
114 |
Dialog theDialog = winManager.createDialog( |
|
115 |
panel.asJComponent(), |
|
116 |
i18n.getTranslation("_Copy_as_polygons"), |
|
117 |
i18n.getTranslation("_Copy_as_polygons"), |
|
118 |
WindowManager_v2.BUTTONS_OK_CANCEL |
|
119 |
); |
|
120 |
theDialog.setAutoclose(false); |
|
121 |
|
|
122 |
theDialog.setButtonLabel( |
|
123 |
WindowManager_v2.BUTTON_OK, |
|
124 |
i18n.getTranslation("_Accept") |
|
125 |
); |
|
126 |
theDialog.setButtonLabel( |
|
127 |
WindowManager_v2.BUTTON_CANCEL, |
|
128 |
i18n.getTranslation("_Cancel") |
|
129 |
); |
|
130 |
|
|
131 |
theDialog.addActionListener((ActionEvent e) -> { |
|
132 |
switch (theDialog.getAction()) { |
|
133 |
case WindowManager_v2.BUTTON_OK: |
|
134 |
Thread task = new Thread(() -> { |
|
135 |
panel.fetch(legend.getConfig()); |
|
136 |
performCopyAsPolygons(sourceLayer); |
|
137 |
theDialog.asJComponent().setVisible(false); |
|
138 |
}, "UHS_CopyAsPolygons"); |
|
139 |
task.start(); |
|
140 |
break; |
|
141 |
case WindowManager_v2.BUTTON_CANCEL: |
|
142 |
theDialog.asJComponent().setVisible(false); |
|
143 |
break; |
|
144 |
} |
|
145 |
}); |
|
146 |
|
|
147 |
theDialog.show(WindowManager.MODE.DIALOG); |
|
148 |
} |
|
149 |
|
|
150 |
private void performCopyAsPolygons(FLyrVect sourceLayer) { |
|
151 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
152 |
UrbanHorizontalSignageManager uhsManager = UrbanHorizontalSignageLocator.getUrbanHorizontalSignageManager(); |
|
153 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
154 |
DataManager dataManager = DALLocator.getDataManager(); |
|
155 |
|
|
156 |
UrbanHorizontalSignageLegend legend = (UrbanHorizontalSignageLegend) sourceLayer.getLegend(); |
|
157 |
FeatureStore tempTargetStore = null; |
|
158 |
FeatureSet tempFeatureSet = null; |
|
159 |
try { |
|
160 |
|
|
161 |
FeatureSet sourceFeatureSet = sourceLayer.getFeatureStore().getFeatureSelection(); |
|
162 |
tempTargetStore = uhsManager.createTemporaryPolygonsFromLines(legend.getConfig(), sourceFeatureSet, null); |
|
163 |
tempFeatureSet = tempTargetStore.getFeatureSet(); |
|
164 |
|
|
165 |
int n = application.confirmDialog( |
|
166 |
"_Number_of_geometries_to_be_copied_to_the_clipboard" + " " + tempFeatureSet.getSize() + "\n" + "_Do_you_want_to_continue", |
|
167 |
i18n.getTranslation("_Copy_selected_features_as_polygons_to_clipboard"), |
|
168 |
JOptionPane.YES_NO_OPTION, |
|
169 |
JOptionPane.QUESTION_MESSAGE); |
|
170 |
if (n == JOptionPane.YES_OPTION) { |
|
171 |
dataManager.putFeaturesInClipboard(tempFeatureSet); |
|
172 |
} |
|
173 |
|
|
174 |
} catch (Exception e) { |
|
175 |
LOGGER.warn("Can't get the selection as JSON.", e); |
|
176 |
} finally { |
|
177 |
DisposeUtils.disposeQuietly(tempTargetStore); |
|
178 |
DisposeUtils.disposeQuietly(tempFeatureSet); |
|
179 |
} |
|
180 |
|
|
181 |
} |
|
182 |
|
|
183 |
private void convertLinesAsPolygons(UrbanHorizontalSignageConfig config, FeatureSet source) { |
|
184 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
185 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
186 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
187 |
UrbanHorizontalSignageManager uhsManager = UrbanHorizontalSignageLocator.getUrbanHorizontalSignageManager(); |
|
188 |
UrbanHorizontalSignageSwingManager uhsSwingManager = UrbanHorizontalSignageSwingLocator.getUrbanHorizontalSignageSwingManager(); |
|
189 |
|
|
190 |
|
|
191 |
final ConvertLinesToPolygonsPanel panel = uhsSwingManager.createConvertLinesToPolygonsPanel(); |
|
192 |
panel.setSource(source); |
|
193 |
panel.setStores(new StoresWithLayerTypeIcon()); |
|
194 |
panel.put(config); |
|
195 |
|
|
196 |
Dialog theDialog = winManager.createDialog( |
|
197 |
panel.asJComponent(), |
|
198 |
i18n.getTranslation("_Convert_lines_to_polygons"), |
|
199 |
i18n.getTranslation("_Convert_Urban_signage_lines_to_polygons"), |
|
200 |
WindowManager_v2.BUTTONS_OK_CANCEL |
|
201 |
); |
|
202 |
theDialog.setButtonLabel(WindowManager_v2.BUTTON_OK, i18n.getTranslation("_Convert")); |
|
203 |
theDialog.setButtonLabel(WindowManager_v2.BUTTON_CANCEL, i18n.getTranslation("_Close")); |
|
204 |
theDialog.setAutoclose(false); |
|
205 |
|
|
206 |
theDialog.addActionListener((ActionEvent e) -> { |
|
207 |
switch (theDialog.getAction()) { |
|
208 |
case WindowManager_v2.BUTTON_OK: |
|
209 |
Thread task = new Thread(() -> { |
|
210 |
try { |
|
211 |
theDialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, false); |
|
212 |
panel.setTaskStatusVisible(true); |
|
213 |
uhsManager.convertLinesToPolygons( |
|
214 |
panel.getConfig(), |
|
215 |
panel.getSource(), |
|
216 |
panel.getTargetStore(), |
|
217 |
panel.getDeleteSourceAtFinish(), |
|
218 |
panel.getTaskStatus() |
|
219 |
); |
|
220 |
theDialog.asJComponent().setVisible(false); |
|
221 |
} catch(Exception ex) { |
|
222 |
LOGGER.warn("Can't convert lines to polygons", ex); |
|
223 |
} |
|
224 |
}, "UHS_ConvertLinesToPolygons"); |
|
225 |
task.start(); |
|
226 |
break; |
|
227 |
case WindowManager_v2.BUTTON_CANCEL: |
|
228 |
theDialog.asJComponent().setVisible(false); |
|
229 |
break; |
|
230 |
} |
|
231 |
}); |
|
232 |
|
|
233 |
theDialog.show(WindowManager.MODE.WINDOW); |
|
234 |
} |
|
235 |
|
|
236 |
@Override |
|
237 |
public boolean isEnabled() { |
|
238 |
// it's enabled if there is exactly one vector layer in the active view |
|
239 |
// and it has a selection |
|
240 |
|
|
241 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
242 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
243 |
if (viewdoc == null) { |
|
244 |
return false; |
|
245 |
} |
|
246 |
MapContext mapContext = viewdoc.getMapContext(); |
|
247 |
FLyrVect layer = mapContext.getLayers().getFirstActiveVectorLayer(); |
|
248 |
if (layer == null) { |
|
249 |
return false; |
|
250 |
} |
|
251 |
if (!layer.isAvailable()) { |
|
252 |
// This can happen when opening a persisted project |
|
253 |
// and there is a "slow" layer (GeoDB) |
|
254 |
return false; |
|
255 |
} |
|
256 |
try { |
|
257 |
FeatureStore store = layer.getFeatureStore(); |
|
258 |
FeatureSelection selection = store.getFeatureSelection(); |
|
259 |
if (selection.isEmpty()) { |
|
260 |
return false; |
|
261 |
} |
|
262 |
return (layer.getLegend() instanceof UrbanHorizontalSignageLegend); |
|
263 |
// return !selection.isEmpty(); |
|
264 |
} catch (Exception ex) { |
|
265 |
LOGGER.warn("Can't get selection from layer '" + layer.getName() + "'.", ex); |
|
266 |
return false; |
|
267 |
} |
|
268 |
} |
|
269 |
|
|
270 |
@Override |
|
271 |
public boolean isVisible() { |
|
272 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
273 |
return application.getActiveDocument(ViewManager.TYPENAME) != null; |
|
274 |
} |
|
275 |
|
|
276 |
private static class StoresWithLayerTypeIcon implements CompoundStoresTreeModel { |
|
277 |
|
|
278 |
private final CompoundStoresTreeModel delegated; |
|
279 |
|
|
280 |
public StoresWithLayerTypeIcon() { |
|
281 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
282 |
this.delegated = (CompoundStoresTreeModel) application.createProjectStoresTreeModel(); |
|
283 |
} |
|
284 |
|
|
285 |
@Override |
|
286 |
public void setFilter(Predicate<DataStore> filter) { |
|
287 |
this.delegated.setFilter(filter); |
|
288 |
} |
|
289 |
|
|
290 |
@Override |
|
291 |
public void addLayers(FLayers layers) { |
|
292 |
this.delegated.addLayers(layers); |
|
293 |
} |
|
294 |
|
|
295 |
@Override |
|
296 |
public Icon getIcon(Object item) { |
|
297 |
Icon icon = this.delegated.getIcon(item); |
|
298 |
if( item instanceof LabeledValue ) { |
|
299 |
item = ((LabeledValue)item).getValue(); |
|
300 |
} |
|
301 |
if (item instanceof FeatureStore) { |
|
302 |
try { |
|
303 |
FeatureStore store = (FeatureStore) item; |
|
304 |
FeatureType ft = store.getDefaultFeatureTypeQuietly(); |
|
305 |
int type = ft.getDefaultGeometryAttribute().getGeomType().getType(); |
|
306 |
Icon icon2 = MapContextLocator.getMapContextManager().getIcon( |
|
307 |
type, |
|
308 |
!store.isFeatureSelectionEmpty() |
|
309 |
); |
|
310 |
if( icon2!=null ) { |
|
311 |
icon = ToolsSwingLocator.getToolsSwingManager().createCompoundIcon( |
|
312 |
SwingConstants.HORIZONTAL, 2, icon, icon2 |
|
313 |
); |
|
314 |
} |
|
315 |
} catch(Exception ex) { |
|
316 |
LOGGER.trace("Can't get geometry type from store.", ex); |
|
317 |
} |
|
318 |
} |
|
319 |
return icon; |
|
320 |
} |
|
321 |
|
|
322 |
@Override |
|
323 |
public Object getRoot() { |
|
324 |
return this.delegated.getRoot(); |
|
325 |
} |
|
326 |
|
|
327 |
@Override |
|
328 |
public Object getChild(Object parent, int index) { |
|
329 |
return this.delegated.getChild(parent, index); |
|
330 |
} |
|
331 |
|
|
332 |
@Override |
|
333 |
public int getChildCount(Object parent) { |
|
334 |
return this.delegated.getChildCount(parent); |
|
335 |
} |
|
336 |
|
|
337 |
@Override |
|
338 |
public boolean isLeaf(Object node) { |
|
339 |
return this.delegated.isLeaf(node); |
|
340 |
} |
|
341 |
|
|
342 |
@Override |
|
343 |
public void valueForPathChanged(TreePath path, Object newValue) { |
|
344 |
this.delegated.valueForPathChanged(path, newValue); |
|
345 |
} |
|
346 |
|
|
347 |
@Override |
|
348 |
public int getIndexOfChild(Object parent, Object child) { |
|
349 |
return this.delegated.getIndexOfChild(parent, child); |
|
350 |
} |
|
351 |
|
|
352 |
@Override |
|
353 |
public void addTreeModelListener(TreeModelListener l) { |
|
354 |
this.delegated.addTreeModelListener(l); |
|
355 |
} |
|
356 |
|
|
357 |
@Override |
|
358 |
public void removeTreeModelListener(TreeModelListener l) { |
|
359 |
this.delegated.removeTreeModelListener(l); |
|
360 |
} |
|
361 |
|
|
362 |
} |
|
363 |
|
|
364 |
} |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/src/main/java/org/gvsig/legend/urbanhorizontalsignage/app/rotate/RotatePointBehavior.java | ||
---|---|---|
1 |
package org.gvsig.legend.urbanhorizontalsignage.app.rotate; |
|
2 |
|
|
3 |
import java.awt.event.InputEvent; |
|
4 |
import java.awt.event.MouseEvent; |
|
5 |
import java.awt.geom.AffineTransform; |
|
6 |
import java.awt.geom.Point2D; |
|
7 |
import javax.swing.SwingUtilities; |
|
8 |
import org.gvsig.euclidean.EuclideanLine2D; |
|
9 |
import org.gvsig.euclidean.EuclideanManager; |
|
10 |
import org.gvsig.fmap.dal.feature.Feature; |
|
11 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
12 |
import org.gvsig.fmap.geom.Geometry; |
|
13 |
import org.gvsig.fmap.geom.primitive.Point; |
|
14 |
import org.gvsig.fmap.mapcontext.ViewPort; |
|
15 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
16 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
17 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
18 |
import org.gvsig.fmap.mapcontrol.MapControlDrawer; |
|
19 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior; |
|
20 |
import org.gvsig.fmap.mapcontrol.tools.BehaviorException; |
|
21 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener; |
|
22 |
import org.gvsig.legend.urbanverticalsignage.lib.api.PictureMarkerSymbolTableLegend; |
|
23 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol; |
|
24 |
import org.gvsig.tools.util.ToolsUtilLocator; |
|
25 |
import org.slf4j.Logger; |
|
26 |
import org.slf4j.LoggerFactory; |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
* @author gvSIG Team |
|
31 |
*/ |
|
32 |
@SuppressWarnings("UseSpecificCatch") |
|
33 |
public class RotatePointBehavior extends Behavior { |
|
34 |
|
|
35 |
protected static final Logger LOGGER = LoggerFactory.getLogger(RotatePointBehavior.class); |
|
36 |
|
|
37 |
protected RotatePointListener listener; |
|
38 |
|
|
39 |
private double angle; |
|
40 |
private Point2D currentPoint; |
|
41 |
private Point2D centerPoint; |
|
42 |
private IMarkerSymbol symbol; |
|
43 |
private Feature feature; |
|
44 |
private String layerName; |
|
45 |
private PictureMarkerSymbolTableLegend legend; |
|
46 |
|
|
47 |
public RotatePointBehavior(RotatePointListener listener) { |
|
48 |
this.listener = listener; |
|
49 |
} |
|
50 |
|
|
51 |
@Override |
|
52 |
public void setMapControl(MapControl mc) { |
|
53 |
super.setMapControl(mc); |
|
54 |
updateCurrentValues(); |
|
55 |
} |
|
56 |
|
|
57 |
@Override |
|
58 |
public void paintComponent(MapControlDrawer drawer) { |
|
59 |
if (this.feature == null || this.symbol == null || this.currentPoint==null) { |
|
60 |
return; |
|
61 |
} |
|
62 |
Geometry geom = this.feature.getDefaultGeometry(); |
|
63 |
if (geom == null) { |
|
64 |
return; |
|
65 |
} |
|
66 |
this.symbol.setRotation(angle); |
|
67 |
drawer.draw(geom, this.symbol); |
|
68 |
|
|
69 |
EuclideanManager euclideanManager = ToolsUtilLocator.getEuclideanManager(); |
|
70 |
double d = distance(this.centerPoint, this.currentPoint); |
|
71 |
drawer.drawLine( |
|
72 |
(int) this.centerPoint.getX(), (int) this.centerPoint.getY(), |
|
73 |
(int) this.currentPoint.getX(), (int) this.currentPoint.getY() |
|
74 |
); |
|
75 |
drawer.drawLine( |
|
76 |
(int) this.centerPoint.getX(), (int) this.centerPoint.getY(), |
|
77 |
(int) (this.centerPoint.getX()+d), (int) this.centerPoint.getY() |
|
78 |
); |
|
79 |
} |
|
80 |
|
|
81 |
private void updateCurrentValues() { |
|
82 |
this.angle = 0; |
|
83 |
this.centerPoint = null; |
|
84 |
this.currentPoint = null; |
|
85 |
|
|
86 |
this.feature = null; |
|
87 |
this.layerName = null; |
|
88 |
this.legend = null; |
|
89 |
this.symbol = null; |
|
90 |
try { |
|
91 |
FLayer[] layers = this.getMapControl().getMapContext().getLayers().getActives(); |
|
92 |
if (layers == null || layers.length != 1) { |
|
93 |
return; |
|
94 |
} |
|
95 |
FLyrVect layer = (FLyrVect) layers[0]; |
|
96 |
FeatureSelection selection = layer.getFeatureStore().getFeatureSelection(); |
|
97 |
feature = selection.first(); |
|
98 |
if (symbol == null && feature != null) { |
|
99 |
this.legend = (PictureMarkerSymbolTableLegend) layer.getLegend(); |
|
100 |
symbol = (IMarkerSymbol) legend.getSymbolByFeature(feature); |
|
101 |
} |
|
102 |
Point point = (Point) feature.getDefaultGeometry(); |
|
103 |
ViewPort vp = this.getMapControl().getViewPort(); |
|
104 |
this.centerPoint = vp.fromMapPoint(point.getX(), point.getY()); |
|
105 |
} catch (Exception ex) { |
|
106 |
this.angle = 0; |
|
107 |
this.currentPoint = null; |
|
108 |
|
|
109 |
this.centerPoint = null; |
|
110 |
this.legend = null; |
|
111 |
this.feature = null; |
|
112 |
this.layerName = null; |
|
113 |
this.symbol = null; |
|
114 |
} |
|
115 |
} |
|
116 |
|
|
117 |
@Override |
|
118 |
public void mouseMoved(MouseEvent mouseEvent) throws BehaviorException { |
|
119 |
|
|
120 |
if (((mouseEvent.getModifiersEx() & (InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK |
|
121 |
| InputEvent.ALT_DOWN_MASK | InputEvent.ALT_GRAPH_DOWN_MASK | InputEvent.META_DOWN_MASK)) != 0) |
|
122 |
|| SwingUtilities.isLeftMouseButton(mouseEvent)) { |
|
123 |
return; |
|
124 |
} |
|
125 |
try { |
|
126 |
if (mouseEvent.getClickCount() == 1) { |
|
127 |
listener.rotate(feature, legend.getRotationFieldName(), angle); |
|
128 |
return; |
|
129 |
} |
|
130 |
this.currentPoint = mouseEvent.getPoint(); |
|
131 |
|
|
132 |
EuclideanManager euclideanManager = ToolsUtilLocator.getEuclideanManager(); |
|
133 |
double d = distance(this.centerPoint, this.currentPoint); |
|
134 |
EuclideanLine2D line = euclideanManager.createLine2D( |
|
135 |
this.centerPoint.getX(), this.centerPoint.getY(), |
|
136 |
this.currentPoint.getX(), this.currentPoint.getY() |
|
137 |
); |
|
138 |
// EuclideanLine2D line0 = euclideanManager.createLine2D( |
|
139 |
// this.centerPoint.getX(), this.centerPoint.getY(), |
|
140 |
// this.centerPoint.getX()+d, this.centerPoint.getY() |
|
141 |
// ); |
|
142 |
// Point2D.Double p = new Point2D.Double(this.centerPoint.getX()+d, this.centerPoint.getY()-1); |
|
143 |
this.angle = Math.toDegrees(line.getAngle()); |
|
144 |
LOGGER.info("Angulo: " + angle); |
|
145 |
|
|
146 |
} catch (Exception ex) { |
|
147 |
LOGGER.warn("Can't rotate from point of the layer " + layerName, ex); |
|
148 |
} |
|
149 |
} |
|
150 |
|
|
151 |
@Override |
|
152 |
public void mouseDragged(MouseEvent e) throws BehaviorException { |
|
153 |
mouseMoved(e); |
|
154 |
} |
|
155 |
|
|
156 |
public void setListener(ToolListener listener) { |
|
157 |
this.listener = (RotatePointListener) listener; |
|
158 |
} |
|
159 |
|
|
160 |
@Override |
|
161 |
public ToolListener getListener() { |
|
162 |
return listener; |
|
163 |
} |
|
164 |
|
|
165 |
public double distance(Point2D p1, Point2D p2) { |
|
166 |
double x = Math.sqrt( Math.pow(p2.getX()-p1.getX(), 2)+Math.pow(p2.getY()-p1.getY(), 2)); |
|
167 |
return x; |
|
168 |
} |
|
169 |
} |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/src/main/java/org/gvsig/legend/urbanhorizontalsignage/app/rotate/RotatePointListener.java | ||
---|---|---|
1 |
package org.gvsig.legend.urbanhorizontalsignage.app.rotate; |
|
2 |
|
|
3 |
import org.gvsig.fmap.dal.feature.Feature; |
|
4 |
import org.gvsig.fmap.mapcontrol.tools.BehaviorException; |
|
5 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener; |
|
6 |
|
|
7 |
/** |
|
8 |
* |
|
9 |
* @author gvSIG Team |
|
10 |
*/ |
|
11 |
public interface RotatePointListener extends ToolListener { |
|
12 |
|
|
13 |
public void rotate(Feature feature, String fieldName, double angle) throws BehaviorException; |
|
14 |
} |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/src/main/java/org/gvsig/legend/urbanhorizontalsignage/app/rotate/RotatePointListenerImpl.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2014 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
|
|
24 |
package org.gvsig.legend.urbanhorizontalsignage.app.rotate; |
|
25 |
|
|
26 |
import org.gvsig.fmap.dal.exception.DataException; |
|
27 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
|
28 |
import org.gvsig.fmap.dal.feature.Feature; |
|
29 |
|
|
30 |
import org.slf4j.Logger; |
|
31 |
import org.slf4j.LoggerFactory; |
|
32 |
|
|
33 |
import org.gvsig.fmap.mapcontrol.tools.BehaviorException; |
|
34 |
import org.gvsig.fmap.mapcontrol.tools.Listeners.AbstractToolListener; |
|
35 |
|
|
36 |
/** |
|
37 |
* @author gvSIG Team |
|
38 |
* |
|
39 |
*/ |
|
40 |
@SuppressWarnings("UseSpecificCatch") |
|
41 |
public class RotatePointListenerImpl |
|
42 |
extends AbstractToolListener |
|
43 |
implements RotatePointListener |
|
44 |
{ |
|
45 |
|
|
46 |
private static final Logger LOGGER = LoggerFactory.getLogger(RotatePointListenerImpl.class); |
|
47 |
|
|
48 |
public static final String ROTATE_TOOL_NAME = "RotatePoint"; |
|
49 |
|
|
50 |
|
|
51 |
public RotatePointListenerImpl() { |
|
52 |
super(); |
|
53 |
} |
|
54 |
|
|
55 |
@Override |
|
56 |
public void rotate(Feature feature, String fieldName, double angle) throws BehaviorException { |
|
57 |
try { |
|
58 |
EditableFeature ef = feature.getEditable(); |
|
59 |
ef.set(fieldName, angle); |
|
60 |
feature.getStore().update(ef); |
|
61 |
} catch (DataException ex) { |
|
62 |
LOGGER.debug("Can't save rotation to feature", ex); |
|
63 |
|
|
64 |
} |
|
65 |
} |
|
66 |
|
|
67 |
} |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/src/main/java/org/gvsig/legend/urbanhorizontalsignage/app/rotate/RotatePointExtension.java | ||
---|---|---|
1 |
package org.gvsig.legend.urbanhorizontalsignage.app.rotate; |
|
2 |
|
|
3 |
import org.gvsig.andami.plugins.Extension; |
|
4 |
import org.gvsig.app.ApplicationLocator; |
|
5 |
import org.gvsig.app.ApplicationManager; |
|
6 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
7 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
8 |
import org.gvsig.app.project.documents.view.gui.IView; |
|
9 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
10 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
11 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
12 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
13 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
14 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior; |
|
15 |
import org.gvsig.legend.urbanverticalsignage.lib.api.PictureMarkerSymbolTableLegend; |
|
16 |
import org.slf4j.Logger; |
|
17 |
import org.slf4j.LoggerFactory; |
|
18 |
|
|
19 |
@SuppressWarnings("UseSpecificCatch") |
|
20 |
public class RotatePointExtension extends Extension { |
|
21 |
|
|
22 |
private static final Logger LOGGER = LoggerFactory.getLogger(RotatePointExtension.class); |
|
23 |
|
|
24 |
@Override |
|
25 |
public void initialize() { |
|
26 |
// IconThemeHelper.registerIcon("legend", "legend-overview-vectorial-urbanhorizontalsignage", this); |
|
27 |
// IconThemeHelper.registerIcon("legend", "legend-overview-vectorial-picturemarkersymboltable", this); |
|
28 |
// IconThemeHelper.registerIcon("action", "layer-modify-clipboard-copy-as-polygons", this); |
|
29 |
|
|
30 |
} |
|
31 |
|
|
32 |
@Override |
|
33 |
public void execute(String actionCommand) { |
|
34 |
|
|
35 |
if (actionCommand.compareToIgnoreCase("layer-modify-rotatepoint") != 0) { |
|
36 |
return; |
|
37 |
} |
|
38 |
|
|
39 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
40 |
IView view = (IView) application.getActiveComponent(ViewDocument.class); |
|
41 |
if (view == null) { |
|
42 |
return; |
|
43 |
} |
|
44 |
MapControl mapControl = view.getMapControl(); |
|
45 |
if (mapControl == null) { |
|
46 |
return; |
|
47 |
} |
|
48 |
MapContext mapContext = mapControl.getMapContext(); |
|
49 |
if (mapContext == null) { |
|
50 |
return; |
|
51 |
} |
|
52 |
FLyrVect layer = mapContext.getLayers().getFirstActiveVectorLayer(); |
|
53 |
if (layer == null) { |
|
54 |
return; |
|
55 |
} |
|
56 |
if (!mapControl.hasTool(RotatePointListenerImpl.ROTATE_TOOL_NAME)) { |
|
57 |
RotatePointListenerImpl listener = new RotatePointListenerImpl(); |
|
58 |
Behavior behavior = new RotatePointBehavior(listener); |
|
59 |
mapControl.addBehavior(RotatePointListenerImpl.ROTATE_TOOL_NAME, behavior); |
|
60 |
} |
|
61 |
mapControl.setTool(RotatePointListenerImpl.ROTATE_TOOL_NAME); |
|
62 |
} |
|
63 |
|
|
64 |
|
|
65 |
@Override |
|
66 |
public boolean isEnabled() { |
|
67 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
68 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
69 |
if (viewdoc == null) { |
|
70 |
return false; |
|
71 |
} |
|
72 |
MapContext mapContext = viewdoc.getMapContext(); |
|
73 |
FLyrVect layer = mapContext.getLayers().getFirstActiveVectorLayer(); |
|
74 |
if (layer == null) { |
|
75 |
return false; |
|
76 |
} |
|
77 |
if (!layer.isAvailable()) { |
|
78 |
// This can happen when opening a persisted project |
|
79 |
// and there is a "slow" layer (GeoDB) |
|
80 |
return false; |
|
81 |
} |
|
82 |
try { |
|
83 |
FeatureStore store = layer.getFeatureStore(); |
|
84 |
FeatureSelection selection = store.getFeatureSelection(); |
|
85 |
if (selection.isEmpty()) { |
|
86 |
return false; |
|
87 |
} |
|
88 |
return (layer.getLegend() instanceof PictureMarkerSymbolTableLegend); |
|
89 |
} catch (Exception ex) { |
|
90 |
LOGGER.warn("Can't get selection from layer '" + layer.getName() + "'.", ex); |
|
91 |
return false; |
|
92 |
} |
|
93 |
} |
|
94 |
|
|
95 |
@Override |
|
96 |
public boolean isVisible() { |
|
97 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
98 |
return application.getActiveDocument(ViewManager.TYPENAME) != null; |
|
99 |
} |
|
100 |
|
|
101 |
} |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/src/main/java/org/gvsig/legend/urbanhorizontalsignage/app/UrbanHorizontalSignageConfigForCopyPanelView.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/fdiaz/projects/gvSIG/org.gvsig.legend.urbanhorizontalsignage/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/src/main/java/org/gvsig/legend/urbanhorizontalsignage/app/UrbanHorizontalSignageConfigForCopyPanelView.xml</at> |
|
28 |
<at name="rowspecs">CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE</at> |
|
29 |
<at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE</at> |
|
30 |
<at name="components"> |
|
31 |
<object classname="java.util.LinkedList"> |
|
32 |
<item > |
|
33 |
<at name="value"> |
|
34 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
35 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
36 |
<at name="cellconstraints"> |
|
37 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
38 |
<at name="column">2</at> |
|
39 |
<at name="row">2</at> |
|
40 |
<at name="colspan">1</at> |
|
41 |
<at name="rowspan">1</at> |
|
42 |
<at name="halign">default</at> |
|
43 |
<at name="valign">default</at> |
|
44 |
<at name="insets" object="insets">0,0,0,0</at> |
|
45 |
</object> |
|
46 |
</at> |
|
47 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
48 |
</super> |
|
49 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
50 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
51 |
<at name="beanproperties"> |
|
52 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
53 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
54 |
<at name="properties"> |
|
55 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
56 |
<at name="border"> |
|
57 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
58 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
59 |
<at name="name">border</at> |
|
60 |
</super> |
|
61 |
<at name="borders"> |
|
62 |
<object classname="java.util.LinkedList"> |
|
63 |
<item > |
|
64 |
<at name="value"> |
|
65 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
66 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
67 |
<at name="name">border</at> |
|
68 |
</super> |
|
69 |
</object> |
|
70 |
</at> |
|
71 |
</item> |
|
72 |
</object> |
|
73 |
</at> |
|
74 |
</object> |
|
75 |
</at> |
|
76 |
<at name="name">lblTargetColorField</at> |
|
77 |
<at name="width">117</at> |
|
78 |
<at name="text">_Target_Color_field</at> |
|
79 |
<at name="fill"> |
|
80 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
81 |
<at name="name">fill</at> |
|
82 |
</object> |
|
83 |
</at> |
|
84 |
<at name="height">14</at> |
|
85 |
</object> |
|
86 |
</at> |
|
87 |
</object> |
|
88 |
</at> |
|
89 |
</object> |
|
90 |
</at> |
|
91 |
</item> |
|
92 |
<item > |
|
93 |
<at name="value"> |
|
94 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
95 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
96 |
<at name="cellconstraints"> |
|
97 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
98 |
<at name="column">2</at> |
|
99 |
<at name="row">4</at> |
|
100 |
<at name="colspan">1</at> |
|
101 |
<at name="rowspan">1</at> |
|
102 |
<at name="halign">default</at> |
|
103 |
<at name="valign">default</at> |
|
104 |
<at name="insets" object="insets">0,0,0,0</at> |
|
105 |
</object> |
|
106 |
</at> |
|
107 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
108 |
</super> |
|
109 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
110 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
111 |
<at name="beanproperties"> |
|
112 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
113 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
114 |
<at name="properties"> |
|
115 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
116 |
<at name="border"> |
|
117 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
118 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
119 |
<at name="name">border</at> |
|
120 |
</super> |
|
121 |
<at name="borders"> |
|
122 |
<object classname="java.util.LinkedList"> |
|
123 |
<item > |
|
124 |
<at name="value"> |
|
125 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
126 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
127 |
<at name="name">border</at> |
|
128 |
</super> |
|
129 |
</object> |
|
130 |
</at> |
|
131 |
</item> |
|
132 |
</object> |
|
133 |
</at> |
|
134 |
</object> |
|
135 |
</at> |
|
136 |
<at name="name">lblTargetLengthField</at> |
|
137 |
<at name="width">117</at> |
|
138 |
<at name="text">_Target_Length_field</at> |
|
139 |
<at name="fill"> |
|
140 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
141 |
<at name="name">fill</at> |
|
142 |
</object> |
|
143 |
</at> |
|
144 |
<at name="height">14</at> |
|
145 |
</object> |
|
146 |
</at> |
|
147 |
</object> |
|
148 |
</at> |
|
149 |
</object> |
|
150 |
</at> |
|
151 |
</item> |
|
152 |
<item > |
|
153 |
<at name="value"> |
|
154 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
155 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
156 |
<at name="cellconstraints"> |
|
157 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
158 |
<at name="column">2</at> |
|
159 |
<at name="row">6</at> |
|
160 |
<at name="colspan">1</at> |
|
161 |
<at name="rowspan">1</at> |
|
162 |
<at name="halign">default</at> |
|
163 |
<at name="valign">default</at> |
|
164 |
<at name="insets" object="insets">0,0,0,0</at> |
|
165 |
</object> |
|
166 |
</at> |
|
167 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
168 |
</super> |
|
169 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
170 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
171 |
<at name="beanproperties"> |
|
172 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
173 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
174 |
<at name="properties"> |
|
175 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
176 |
<at name="border"> |
|
177 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
178 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
179 |
<at name="name">border</at> |
|
180 |
</super> |
|
181 |
<at name="borders"> |
|
182 |
<object classname="java.util.LinkedList"> |
|
183 |
<item > |
|
184 |
<at name="value"> |
|
185 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
186 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
187 |
<at name="name">border</at> |
|
188 |
</super> |
|
189 |
</object> |
|
190 |
</at> |
|
191 |
</item> |
|
192 |
</object> |
|
193 |
</at> |
|
194 |
</object> |
|
195 |
</at> |
|
196 |
<at name="name">lblTargetAreaField</at> |
|
197 |
<at name="width">117</at> |
|
198 |
<at name="text">_Target_Area_field</at> |
|
199 |
<at name="fill"> |
|
200 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
201 |
<at name="name">fill</at> |
|
202 |
</object> |
|
203 |
</at> |
|
204 |
<at name="height">14</at> |
|
205 |
</object> |
|
206 |
</at> |
|
207 |
</object> |
|
208 |
</at> |
|
209 |
</object> |
|
210 |
</at> |
|
211 |
</item> |
|
212 |
<item > |
|
213 |
<at name="value"> |
|
214 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
215 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
216 |
<at name="cellconstraints"> |
|
217 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
218 |
<at name="column">4</at> |
|
219 |
<at name="row">2</at> |
|
220 |
<at name="colspan">3</at> |
|
221 |
<at name="rowspan">1</at> |
|
222 |
<at name="halign">default</at> |
|
223 |
<at name="valign">default</at> |
|
224 |
<at name="insets" object="insets">0,0,0,0</at> |
|
225 |
</object> |
|
226 |
</at> |
|
227 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
228 |
</super> |
|
229 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
230 |
<at name="beanclass">javax.swing.JComboBox</at> |
|
231 |
<at name="beanproperties"> |
|
232 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
233 |
<at name="classname">javax.swing.JComboBox</at> |
|
234 |
<at name="properties"> |
|
235 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
236 |
<at name="border"> |
|
237 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
238 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
239 |
<at name="name">border</at> |
|
240 |
</super> |
|
241 |
<at name="borders"> |
|
242 |
<object classname="java.util.LinkedList"> |
|
243 |
<item > |
|
244 |
<at name="value"> |
|
245 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
246 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
247 |
<at name="name">border</at> |
|
248 |
</super> |
|
249 |
</object> |
|
250 |
</at> |
|
251 |
</item> |
|
252 |
</object> |
|
253 |
</at> |
|
254 |
</object> |
|
255 |
</at> |
|
256 |
<at name="componentCount">3</at> |
|
257 |
<at name="editable">true</at> |
|
258 |
<at name="requestFocusEnabled">false</at> |
|
259 |
<at name="name">cboTargetColorFields</at> |
|
260 |
<at name="width">1155</at> |
|
261 |
<at name="items"> |
|
262 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
263 |
<at name="name">items</at> |
|
264 |
</object> |
|
265 |
</at> |
|
266 |
<at name="height">20</at> |
|
267 |
</object> |
|
268 |
</at> |
|
269 |
</object> |
|
270 |
</at> |
|
271 |
</object> |
|
272 |
</at> |
|
273 |
</item> |
|
274 |
<item > |
|
275 |
<at name="value"> |
|
276 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
277 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
278 |
<at name="cellconstraints"> |
|
279 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
280 |
<at name="column">4</at> |
|
281 |
<at name="row">6</at> |
|
282 |
<at name="colspan">3</at> |
|
283 |
<at name="rowspan">1</at> |
|
284 |
<at name="halign">default</at> |
|
285 |
<at name="valign">default</at> |
|
286 |
<at name="insets" object="insets">0,0,0,0</at> |
|
287 |
</object> |
|
288 |
</at> |
|
289 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
290 |
</super> |
|
291 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
292 |
<at name="beanclass">javax.swing.JComboBox</at> |
|
293 |
<at name="beanproperties"> |
|
294 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
295 |
<at name="classname">javax.swing.JComboBox</at> |
|
296 |
<at name="properties"> |
|
297 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
298 |
<at name="border"> |
|
299 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
300 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
301 |
<at name="name">border</at> |
|
302 |
</super> |
|
303 |
<at name="borders"> |
|
304 |
<object classname="java.util.LinkedList"> |
|
305 |
<item > |
|
306 |
<at name="value"> |
|
307 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
308 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
309 |
<at name="name">border</at> |
|
310 |
</super> |
|
311 |
</object> |
|
312 |
</at> |
|
313 |
</item> |
|
314 |
</object> |
|
315 |
</at> |
|
316 |
</object> |
|
317 |
</at> |
|
318 |
<at name="componentCount">3</at> |
|
319 |
<at name="editable">true</at> |
|
320 |
<at name="requestFocusEnabled">false</at> |
|
321 |
<at name="name">cboTargetAreaFields</at> |
|
322 |
<at name="width">1155</at> |
|
323 |
<at name="items"> |
|
324 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
325 |
<at name="name">items</at> |
|
326 |
</object> |
|
327 |
</at> |
|
328 |
<at name="height">20</at> |
|
329 |
</object> |
|
330 |
</at> |
|
331 |
</object> |
|
332 |
</at> |
|
333 |
</object> |
|
334 |
</at> |
|
335 |
</item> |
|
336 |
<item > |
|
337 |
<at name="value"> |
|
338 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
339 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
340 |
<at name="cellconstraints"> |
|
341 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
342 |
<at name="column">4</at> |
|
343 |
<at name="row">4</at> |
|
344 |
<at name="colspan">3</at> |
|
345 |
<at name="rowspan">1</at> |
|
346 |
<at name="halign">default</at> |
|
347 |
<at name="valign">default</at> |
|
348 |
<at name="insets" object="insets">0,0,0,0</at> |
|
349 |
</object> |
|
350 |
</at> |
|
351 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
352 |
</super> |
|
353 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
354 |
<at name="beanclass">javax.swing.JComboBox</at> |
|
355 |
<at name="beanproperties"> |
|
356 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
357 |
<at name="classname">javax.swing.JComboBox</at> |
|
358 |
<at name="properties"> |
|
359 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
360 |
<at name="border"> |
|
361 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
362 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
363 |
<at name="name">border</at> |
|
364 |
</super> |
|
365 |
<at name="borders"> |
|
366 |
<object classname="java.util.LinkedList"> |
|
367 |
<item > |
|
368 |
<at name="value"> |
|
369 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
370 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
371 |
<at name="name">border</at> |
|
372 |
</super> |
|
373 |
</object> |
|
374 |
</at> |
|
375 |
</item> |
|
376 |
</object> |
|
377 |
</at> |
|
378 |
</object> |
|
379 |
</at> |
|
380 |
<at name="componentCount">3</at> |
|
381 |
<at name="editable">true</at> |
|
382 |
<at name="requestFocusEnabled">false</at> |
|
383 |
<at name="name">cboTargetLengthFields</at> |
|
384 |
<at name="width">1155</at> |
|
385 |
<at name="items"> |
|
386 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
387 |
<at name="name">items</at> |
|
388 |
</object> |
|
389 |
</at> |
|
390 |
<at name="height">20</at> |
|
391 |
</object> |
|
392 |
</at> |
|
393 |
</object> |
|
394 |
</at> |
|
395 |
</object> |
|
396 |
</at> |
|
397 |
</item> |
|
398 |
</object> |
|
399 |
</at> |
|
400 |
<at name="properties"> |
|
401 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
402 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
|
403 |
<at name="properties"> |
|
404 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
405 |
<at name="border"> |
|
406 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
407 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
408 |
<at name="name">border</at> |
|
409 |
</super> |
|
410 |
<at name="borders"> |
|
411 |
<object classname="java.util.LinkedList"/> |
|
412 |
</at> |
|
413 |
</object> |
|
414 |
</at> |
|
415 |
<at name="name"/> |
|
416 |
<at name="fill"> |
|
417 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
418 |
<at name="name">fill</at> |
|
419 |
</object> |
|
420 |
</at> |
|
421 |
<at name="scollBars"> |
|
422 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
423 |
<at name="name">scollBars</at> |
|
424 |
<at name="verticalpolicy">21</at> |
|
425 |
<at name="horizontalpolicy">31</at> |
|
426 |
<at name="border"> |
|
427 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
428 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
429 |
<at name="name">border</at> |
|
430 |
</super> |
|
431 |
<at name="borders"> |
|
432 |
<object classname="java.util.LinkedList"> |
|
433 |
<item > |
|
434 |
<at name="value"> |
|
435 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
436 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
437 |
<at name="name">border</at> |
|
438 |
</super> |
|
439 |
</object> |
|
440 |
</at> |
|
441 |
</item> |
|
442 |
</object> |
|
443 |
</at> |
|
444 |
</object> |
|
445 |
</at> |
|
446 |
</object> |
|
447 |
</at> |
|
448 |
</object> |
|
449 |
</at> |
|
450 |
</object> |
|
451 |
</at> |
|
452 |
<at name="cellpainters"> |
|
453 |
<object classname="com.jeta.forms.store.support.Matrix"> |
|
454 |
<at name="rows"> |
|
455 |
<object classname="[Ljava.lang.Object;" size="7"> |
|
456 |
<at name="item" index="0"> |
|
457 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
458 |
</at> |
|
459 |
<at name="item" index="1"> |
|
460 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
461 |
</at> |
|
462 |
<at name="item" index="2"> |
|
463 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
464 |
</at> |
|
465 |
<at name="item" index="3"> |
|
466 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
467 |
</at> |
|
468 |
<at name="item" index="4"> |
|
469 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
470 |
</at> |
|
471 |
<at name="item" index="5"> |
|
472 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
473 |
</at> |
|
474 |
<at name="item" index="6"> |
|
475 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
476 |
</at> |
|
477 |
</object> |
|
478 |
</at> |
|
479 |
</object> |
|
480 |
</at> |
|
481 |
<at name="rowgroups"> |
|
482 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
483 |
<at name="groups"> |
|
484 |
<object classname="java.util.HashMap"/> |
|
485 |
</at> |
|
486 |
</object> |
|
487 |
</at> |
|
488 |
<at name="colgroups"> |
|
489 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
490 |
<at name="groups"> |
|
491 |
<object classname="java.util.HashMap"/> |
|
492 |
</at> |
|
493 |
</object> |
|
494 |
</at> |
|
495 |
</object> |
|
496 |
</at> |
|
497 |
</object> |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.41/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/src/main/java/org/gvsig/legend/urbanhorizontalsignage/app/UrbanHorizontalSignageConfigForCopyPanelView.java | ||
---|---|---|
1 |
package org.gvsig.legend.urbanhorizontalsignage.app; |
|
2 |
|
|
3 |
import com.jeta.open.i18n.I18NUtils; |
|
4 |
import com.jgoodies.forms.layout.CellConstraints; |
|
5 |
import com.jgoodies.forms.layout.FormLayout; |
|
6 |
import java.awt.BorderLayout; |
|
7 |
import java.awt.ComponentOrientation; |
|
8 |
import java.awt.Container; |
|
9 |
import java.awt.Dimension; |
|
10 |
import javax.swing.Box; |
|
11 |
import javax.swing.ImageIcon; |
|
12 |
import javax.swing.JComboBox; |
|
13 |
import javax.swing.JFrame; |
|
14 |
import javax.swing.JLabel; |
|
15 |
import javax.swing.JPanel; |
|
16 |
|
|
17 |
|
|
18 |
public class UrbanHorizontalSignageConfigForCopyPanelView extends JPanel |
|
19 |
{ |
|
20 |
JLabel lblTargetColorField = new JLabel(); |
|
21 |
JLabel lblTargetLengthField = new JLabel(); |
|
22 |
JLabel lblTargetAreaField = new JLabel(); |
|
23 |
JComboBox cboTargetColorFields = new JComboBox(); |
|
24 |
JComboBox cboTargetAreaFields = new JComboBox(); |
|
25 |
JComboBox cboTargetLengthFields = new JComboBox(); |
|
26 |
|
|
27 |
/** |
|
28 |
* Default constructor |
|
29 |
*/ |
|
30 |
public UrbanHorizontalSignageConfigForCopyPanelView() |
|
31 |
{ |
|
32 |
initializePanel(); |
|
33 |
} |
|
34 |
|
|
35 |
/** |
|
36 |
* Adds fill components to empty cells in the first row and first column of the grid. |
|
37 |
* This ensures that the grid spacing will be the same as shown in the designer. |
|
38 |
* @param cols an array of column indices in the first row where fill components should be added. |
|
39 |
* @param rows an array of row indices in the first column where fill components should be added. |
|
40 |
*/ |
|
41 |
void addFillComponents( Container panel, int[] cols, int[] rows ) |
|
42 |
{ |
|
43 |
Dimension filler = new Dimension(10,10); |
|
44 |
|
|
45 |
boolean filled_cell_11 = false; |
|
46 |
CellConstraints cc = new CellConstraints(); |
|
47 |
if ( cols.length > 0 && rows.length > 0 ) |
|
48 |
{ |
|
49 |
if ( cols[0] == 1 && rows[0] == 1 ) |
|
50 |
{ |
|
51 |
/** add a rigid area */ |
|
52 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) ); |
|
53 |
filled_cell_11 = true; |
|
54 |
} |
|
55 |
} |
|
56 |
|
|
57 |
for( int index = 0; index < cols.length; index++ ) |
|
58 |
{ |
|
59 |
if ( cols[index] == 1 && filled_cell_11 ) |
|
60 |
{ |
|
61 |
continue; |
|
62 |
} |
|
63 |
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) ); |
|
64 |
} |
|
65 |
|
|
66 |
for( int index = 0; index < rows.length; index++ ) |
|
67 |
{ |
|
68 |
if ( rows[index] == 1 && filled_cell_11 ) |
|
69 |
{ |
|
70 |
continue; |
|
71 |
} |
|
72 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) ); |
|
73 |
} |
|
74 |
|
|
75 |
} |
|
76 |
|
|
77 |
/** |
|
78 |
* Helper method to load an image file from the CLASSPATH |
|
79 |
* @param imageName the package and name of the file to load relative to the CLASSPATH |
|
80 |
* @return an ImageIcon instance with the specified image file |
|
81 |
* @throws IllegalArgumentException if the image resource cannot be loaded. |
|
82 |
*/ |
|
83 |
public ImageIcon loadImage( String imageName ) |
|
84 |
{ |
|
85 |
try |
|
86 |
{ |
|
87 |
ClassLoader classloader = getClass().getClassLoader(); |
|
88 |
java.net.URL url = classloader.getResource( imageName ); |
|
89 |
if ( url != null ) |
|
90 |
{ |
|
91 |
ImageIcon icon = new ImageIcon( url ); |
|
92 |
return icon; |
|
93 |
} |
|
94 |
} |
|
95 |
catch( Exception e ) |
|
96 |
{ |
|
97 |
e.printStackTrace(); |
|
98 |
} |
|
99 |
throw new IllegalArgumentException( "Unable to load image: " + imageName ); |
|
100 |
} |
|
101 |
|
|
102 |
/** |
|
103 |
* Method for recalculating the component orientation for |
|
104 |
* right-to-left Locales. |
|
105 |
* @param orientation the component orientation to be applied |
|
106 |
*/ |
|
107 |
public void applyComponentOrientation( ComponentOrientation orientation ) |
|
108 |
{ |
|
109 |
// Not yet implemented... |
|
110 |
// I18NUtils.applyComponentOrientation(this, orientation); |
|
111 |
super.applyComponentOrientation(orientation); |
|
112 |
} |
|
113 |
|
|
114 |
public JPanel createPanel() |
|
115 |
{ |
|
116 |
JPanel jpanel1 = new JPanel(); |
|
117 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE","CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE"); |
|
118 |
CellConstraints cc = new CellConstraints(); |
|
119 |
jpanel1.setLayout(formlayout1); |
|
120 |
|
|
121 |
lblTargetColorField.setName("lblTargetColorField"); |
|
122 |
lblTargetColorField.setText("_Target_Color_field"); |
|
123 |
jpanel1.add(lblTargetColorField,cc.xy(2,2)); |
|
124 |
|
|
125 |
lblTargetLengthField.setName("lblTargetLengthField"); |
|
126 |
lblTargetLengthField.setText("_Target_Length_field"); |
|
127 |
jpanel1.add(lblTargetLengthField,cc.xy(2,4)); |
|
128 |
|
|
129 |
lblTargetAreaField.setName("lblTargetAreaField"); |
|
130 |
lblTargetAreaField.setText("_Target_Area_field"); |
|
131 |
jpanel1.add(lblTargetAreaField,cc.xy(2,6)); |
|
132 |
|
|
133 |
cboTargetColorFields.setEditable(true); |
Also available in: Unified diff