Revision 10433
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.106/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/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.app</artifactId> |
|
6 |
<version>1.0.106</version> |
|
7 |
</parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage.app.mainplugin</artifactId> |
|
10 |
<version>1.0.106</version> |
|
11 |
<name>org.gvsig.legend.urbanhorizontalsignage.app.mainplugin</name> |
|
12 |
|
|
13 |
<properties> |
|
14 |
<!-- Package info property values --> |
|
15 |
<gvsig.package.info.state>testing</gvsig.package.info.state> |
|
16 |
<gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.4.0-A</gvsig.package.info.dependencies> |
|
17 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
18 |
<gvsig.package.info.name>Vector legend: urban horizontal signage</gvsig.package.info.name> |
|
19 |
<gvsig.package.info.description>Legend for urban horizontal signage.</gvsig.package.info.description> |
|
20 |
<gvsig.package.info.categories>View,Vector,Symbology</gvsig.package.info.categories> |
|
21 |
<gvsig.package.info.javaVM>j1_8</gvsig.package.info.javaVM> |
|
22 |
<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-base-legends/pool</gvsig.package.info.poolURL> |
|
23 |
</properties> |
|
24 |
|
|
25 |
<dependencies> |
|
26 |
<dependency> |
|
27 |
<groupId>org.gvsig</groupId> |
|
28 |
<artifactId>org.gvsig.andami</artifactId> |
|
29 |
<scope>compile</scope> |
|
30 |
</dependency> |
|
31 |
<dependency> |
|
32 |
<groupId>org.gvsig</groupId> |
|
33 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage.swing.api</artifactId> |
|
34 |
<scope>compile</scope> |
|
35 |
</dependency> |
|
36 |
<dependency> |
|
37 |
<groupId>org.gvsig</groupId> |
|
38 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage.lib.api</artifactId> |
|
39 |
<scope>compile</scope> |
|
40 |
</dependency> |
|
41 |
<dependency> |
|
42 |
<groupId>org.gvsig</groupId> |
|
43 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage.lib.impl</artifactId> |
|
44 |
<scope>runtime</scope> |
|
45 |
</dependency> |
|
46 |
<dependency> |
|
47 |
<groupId>org.gvsig</groupId> |
|
48 |
<artifactId>org.gvsig.legend.urbanhorizontalsignage.swing.impl</artifactId> |
|
49 |
<scope>runtime</scope> |
|
50 |
</dependency> |
|
51 |
<dependency> |
|
52 |
<groupId>org.gvsig</groupId> |
|
53 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
54 |
<scope>compile</scope> |
|
55 |
</dependency> |
|
56 |
<dependency> |
|
57 |
<groupId>org.gvsig</groupId> |
|
58 |
<artifactId>org.gvsig.legend.picturemarkersymboltable.lib.api</artifactId> |
|
59 |
<scope>compile</scope> |
|
60 |
</dependency> |
|
61 |
</dependencies> |
|
62 |
</project> |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.106/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Fri Jun 14 07:21:21 CEST 2024 |
|
2 |
buildNumber=197 |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.106/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2013 gvSIG |
|
2 |
Association. This program is free software; you can redistribute it and/or modify |
|
3 |
it under the terms of the GNU General Public License as published by the Free Software |
|
4 |
Foundation; either version 3 of the License, or (at your option) any later version. |
|
5 |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
6 |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
7 |
PURPOSE. See the GNU General Public License for more details. You should have received |
|
8 |
a copy of the GNU General Public License along with this program; if not, write to |
|
9 |
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
|
10 |
USA. For any additional information, do not hesitate to contact us at info AT gvsig.com, |
|
11 |
or visit our website www.gvsig.com. --> |
|
12 |
<assembly> |
|
13 |
<id>gvsig-plugin-package</id> |
|
14 |
<formats> |
|
15 |
<format>zip</format> |
|
16 |
</formats> |
|
17 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
18 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
19 |
<files> |
|
20 |
<file> |
|
21 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
22 |
<outputDirectory>lib</outputDirectory> |
|
23 |
</file> |
|
24 |
<file> |
|
25 |
<source>target/package.info</source> |
|
26 |
</file> |
|
27 |
</files> |
|
28 |
|
|
29 |
<fileSets> |
|
30 |
<fileSet> |
|
31 |
<directory>src/main/resources-plugin</directory> |
|
32 |
<outputDirectory>.</outputDirectory> |
|
33 |
</fileSet> |
|
34 |
</fileSets> |
|
35 |
|
|
36 |
|
|
37 |
<dependencySets> |
|
38 |
<dependencySet> |
|
39 |
<useProjectArtifact>false</useProjectArtifact> |
|
40 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
41 |
<outputDirectory>lib</outputDirectory> |
|
42 |
<includes> |
|
43 |
<include>org.gvsig:org.gvsig.legend.urbanhorizontalsignage.lib.api</include> |
|
44 |
<include>org.gvsig:org.gvsig.legend.urbanhorizontalsignage.lib.impl</include> |
|
45 |
<include>org.gvsig:org.gvsig.legend.urbanhorizontalsignage.swing.api</include> |
|
46 |
<include>org.gvsig:org.gvsig.legend.urbanhorizontalsignage.swing.impl</include> |
|
47 |
</includes> |
|
48 |
</dependencySet> |
|
49 |
</dependencySets> |
|
50 |
|
|
51 |
</assembly> |
|
52 |
|
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.106/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.106/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); |
|
134 |
cboTargetColorFields.setName("cboTargetColorFields"); |
|
135 |
cboTargetColorFields.setRequestFocusEnabled(false); |
|
136 |
jpanel1.add(cboTargetColorFields,cc.xywh(4,2,3,1)); |
|
137 |
|
|
138 |
cboTargetAreaFields.setEditable(true); |
|
139 |
cboTargetAreaFields.setName("cboTargetAreaFields"); |
|
140 |
cboTargetAreaFields.setRequestFocusEnabled(false); |
|
141 |
jpanel1.add(cboTargetAreaFields,cc.xywh(4,6,3,1)); |
|
142 |
|
|
143 |
cboTargetLengthFields.setEditable(true); |
|
144 |
cboTargetLengthFields.setName("cboTargetLengthFields"); |
|
145 |
cboTargetLengthFields.setRequestFocusEnabled(false); |
|
146 |
jpanel1.add(cboTargetLengthFields,cc.xywh(4,4,3,1)); |
|
147 |
|
|
148 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7 },new int[]{ 1,2,3,4,5,6,7 }); |
|
149 |
return jpanel1; |
|
150 |
} |
|
151 |
|
|
152 |
/** |
|
153 |
* Initializer |
|
154 |
*/ |
|
155 |
protected void initializePanel() |
|
156 |
{ |
|
157 |
setLayout(new BorderLayout()); |
|
158 |
add(createPanel(), BorderLayout.CENTER); |
|
159 |
} |
|
160 |
|
|
161 |
|
|
162 |
} |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.106/org.gvsig.legend.urbanhorizontalsignage.app/org.gvsig.legend.urbanhorizontalsignage.app.mainplugin/src/main/java/org/gvsig/legend/urbanhorizontalsignage/app/UrbanHorizontalSignageConfigForCopyPanel.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.legend.urbanhorizontalsignage.app; |
|
7 |
|
|
8 |
import javax.swing.JComponent; |
|
9 |
import org.gvsig.fmap.dal.DataTypes; |
|
10 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
11 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
|
12 |
import org.gvsig.fmap.dal.swing.DataSwingManager; |
|
13 |
import org.gvsig.fmap.dal.swing.featuretype.AttributeDescriptorPickerController; |
|
14 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.linelegend.UrbanHorizontalSignageConfig; |
|
15 |
import org.gvsig.legend.urbanhorizontalsignage.swing.api.linelegend.UrbanHorizontalSignageConfigPanel; |
|
16 |
import org.gvsig.tools.swing.api.Component; |
|
17 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
18 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
|
19 |
|
|
20 |
/** |
|
21 |
* |
|
22 |
* @author fdiaz |
|
23 |
*/ |
|
24 |
public class UrbanHorizontalSignageConfigForCopyPanel extends UrbanHorizontalSignageConfigForCopyPanelView implements UrbanHorizontalSignageConfigPanel, Component { |
|
25 |
|
|
26 |
private AttributeDescriptorPickerController targetColorFieldController; |
|
27 |
private AttributeDescriptorPickerController targetLengthFieldController; |
|
28 |
private AttributeDescriptorPickerController targetAreaFieldController; |
|
29 |
|
|
30 |
public UrbanHorizontalSignageConfigForCopyPanel() { |
|
31 |
|
|
32 |
initComponents(); |
|
33 |
|
|
34 |
} |
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
private void initComponents(){ |
|
39 |
ToolsSwingManager toolsSwingManager = ToolsSwingLocator.getToolsSwingManager(); |
|
40 |
DataSwingManager dataSwingManager = DALSwingLocator.getDataSwingManager(); |
|
41 |
|
|
42 |
targetColorFieldController = dataSwingManager.createAttributeDescriptorPickerController(cboTargetColorFields, (t) -> { |
|
43 |
return t.getDataType().isNumeric() || t.getType() == DataTypes.STRING; |
|
44 |
}); |
|
45 |
targetColorFieldController.setEditable(true); |
|
46 |
|
|
47 |
targetLengthFieldController = dataSwingManager.createAttributeDescriptorPickerController(cboTargetLengthFields, (t) -> { |
|
48 |
return t.getDataType().isNumeric(); |
|
49 |
}); |
|
50 |
targetLengthFieldController.setEditable(true); |
|
51 |
|
|
52 |
targetAreaFieldController = dataSwingManager.createAttributeDescriptorPickerController(cboTargetAreaFields, (t) -> { |
|
53 |
return t.getDataType().isNumeric(); |
|
54 |
}); |
|
55 |
targetAreaFieldController.setEditable(true); |
|
56 |
|
|
57 |
translateAll(); |
|
58 |
} |
|
59 |
|
|
60 |
private void translateAll() { |
|
61 |
ToolsSwingManager toolsSwingmanager = ToolsSwingLocator.getToolsSwingManager(); |
|
62 |
toolsSwingmanager.translate(this.lblTargetColorField); |
|
63 |
toolsSwingmanager.translate(this.lblTargetLengthField); |
|
64 |
toolsSwingmanager.translate(this.lblTargetAreaField); |
|
65 |
} |
|
66 |
|
|
67 |
@Override |
|
68 |
public void fetch(UrbanHorizontalSignageConfig config) { |
|
69 |
config.setTargetColorFieldName((String) this.targetColorFieldController.getName()); |
|
70 |
config.setTargetLenghtFieldName((String) this.targetLengthFieldController.getName()); |
|
71 |
config.setTargetAreaFieldName((String) this.targetAreaFieldController.getName()); |
|
72 |
} |
|
73 |
|
|
74 |
@Override |
|
75 |
public void put(UrbanHorizontalSignageConfig config) { |
|
76 |
this.targetColorFieldController.set(config.getTargetColorFieldName()); |
|
77 |
this.targetLengthFieldController.set(config.getTargetLenghtFieldName()); |
|
78 |
this.targetAreaFieldController.set(config.getTargetAreaFieldName()); |
|
79 |
} |
|
80 |
|
|
81 |
@Override |
|
82 |
public void setFeatureType(FeatureType type) { |
|
83 |
this.targetColorFieldController.setFeatureType(type); |
|
84 |
this.targetAreaFieldController.setFeatureType(type); |
|
85 |
this.targetLengthFieldController.setFeatureType(type); |
|
86 |
} |
|
87 |
|
|
88 |
@Override |
|
89 |
public JComponent asJComponent() { |
|
90 |
return this; |
|
91 |
} |
|
92 |
|
|
93 |
} |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.106/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 javax.swing.JOptionPane; |
|
5 |
import org.gvsig.andami.IconThemeHelper; |
|
6 |
import org.gvsig.andami.plugins.Extension; |
|
7 |
import org.gvsig.app.ApplicationLocator; |
|
8 |
import org.gvsig.app.ApplicationManager; |
|
9 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
10 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
11 |
import org.gvsig.fmap.dal.DALLocator; |
|
12 |
import org.gvsig.fmap.dal.DataManager; |
|
13 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
14 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
|
15 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
16 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
17 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
18 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.UrbanHorizontalSignageLocator; |
|
19 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.UrbanHorizontalSignageManager; |
|
20 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.linelegend.UrbanHorizontalSignageConfig; |
|
21 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.linelegend.UrbanHorizontalSignageLegend; |
|
22 |
import org.gvsig.legend.urbanhorizontalsignage.swing.api.ConvertLinesToPolygonsPanel; |
|
23 |
import org.gvsig.legend.urbanhorizontalsignage.swing.api.UrbanHorizontalSignageSwingLocator; |
|
24 |
import org.gvsig.legend.urbanhorizontalsignage.swing.api.UrbanHorizontalSignageSwingManager; |
|
25 |
import org.gvsig.tools.ToolsLocator; |
|
26 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
27 |
import org.gvsig.tools.i18n.I18nManager; |
|
28 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
29 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
|
30 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
31 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
32 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
33 |
import org.slf4j.Logger; |
|
34 |
import org.slf4j.LoggerFactory; |
|
35 |
|
|
36 |
@SuppressWarnings("UseSpecificCatch") |
|
37 |
public class UrbanHorizontalSignageExtension extends Extension { |
|
38 |
|
|
39 |
private static final Logger LOGGER = LoggerFactory.getLogger(UrbanHorizontalSignageExtension.class); |
|
40 |
|
|
41 |
@Override |
|
42 |
public void initialize() { |
|
43 |
IconThemeHelper.registerIcon("legend", "legend-overview-vectorial-urbanhorizontalsignage", this); |
|
44 |
IconThemeHelper.registerIcon("legend", "legend-overview-vectorial-picturemarkersymboltable", this); |
|
45 |
IconThemeHelper.registerIcon("action", "layer-modify-clipboard-copy-as-polygons", this); |
|
46 |
|
|
47 |
} |
|
48 |
|
|
49 |
@Override |
|
50 |
public void execute(String actionCommand) { |
|
51 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
52 |
|
|
53 |
if ("layer-modify-clipboard-copy-as-polygons".equalsIgnoreCase(actionCommand) ) { |
|
54 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
55 |
if (viewdoc == null) { |
|
56 |
return; |
|
57 |
} |
|
58 |
MapContext mapContext = viewdoc.getMapContext(); |
|
59 |
FLyrVect layer = mapContext.getLayers().getFirstActiveVectorLayer(); |
|
60 |
if (layer == null) { |
|
61 |
return; |
|
62 |
} |
|
63 |
copySelecctionAsPolygons(layer); |
|
64 |
|
|
65 |
} else if ("tools-urbanSignage-linesToPolygons".equalsIgnoreCase(actionCommand) ) { |
|
66 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
67 |
if (viewdoc == null) { |
|
68 |
return; |
|
69 |
} |
|
70 |
MapContext mapContext = viewdoc.getMapContext(); |
|
71 |
FLyrVect layer = mapContext.getLayers().getFirstActiveVectorLayer(); |
|
72 |
if (layer == null) { |
|
73 |
return; |
|
74 |
} |
|
75 |
if( !(layer.getLegend() instanceof UrbanHorizontalSignageLegend) ) { |
|
76 |
//FIXME mensaje al usuario? |
|
77 |
return; |
|
78 |
} |
|
79 |
UrbanHorizontalSignageLegend legend = (UrbanHorizontalSignageLegend) layer.getLegend(); |
|
80 |
UrbanHorizontalSignageConfig config = legend.getConfig(); // FIXME: clone |
|
81 |
FeatureSet lines; |
|
82 |
try { |
|
83 |
lines = layer.getFeatureStore().getFeatureSelection(); |
|
84 |
} catch(Exception ex) { |
|
85 |
//FIXME mensaje al usuario? |
|
86 |
return; |
|
87 |
} |
|
88 |
convertLinesAsPolygons(config, lines); |
|
89 |
} |
|
90 |
|
|
91 |
} |
|
92 |
|
|
93 |
private void copySelecctionAsPolygons(FLyrVect sourceLayer) { |
|
94 |
// UrbanHorizontalSignageManager uhsManager = UrbanHorizontalSignageLocator.getUrbanHorizontalSignageManager(); |
|
95 |
|
|
96 |
UrbanHorizontalSignageConfigForCopyPanel panel = new UrbanHorizontalSignageConfigForCopyPanel(); |
|
97 |
panel.setFeatureType(sourceLayer.getFeatureStore().getDefaultFeatureTypeQuietly()); |
|
98 |
UrbanHorizontalSignageLegend legend = (UrbanHorizontalSignageLegend) sourceLayer.getLegend(); |
|
99 |
panel.put(legend.getConfig()); |
|
100 |
|
|
101 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
102 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
103 |
|
|
104 |
Dialog theDialog = winManager.createDialog( |
|
105 |
panel.asJComponent(), |
|
106 |
i18n.getTranslation("_Copy_as_polygons"), |
|
107 |
i18n.getTranslation("_Copy_as_polygons"), |
|
108 |
WindowManager_v2.BUTTONS_OK_CANCEL |
|
109 |
); |
|
110 |
theDialog.setAutoclose(false); |
|
111 |
|
|
112 |
theDialog.setButtonLabel( |
|
113 |
WindowManager_v2.BUTTON_OK, |
|
114 |
i18n.getTranslation("_Accept") |
|
115 |
); |
|
116 |
theDialog.setButtonLabel( |
|
117 |
WindowManager_v2.BUTTON_CANCEL, |
|
118 |
i18n.getTranslation("_Cancel") |
|
119 |
); |
|
120 |
|
|
121 |
theDialog.addActionListener((ActionEvent e) -> { |
|
122 |
switch (theDialog.getAction()) { |
|
123 |
case WindowManager_v2.BUTTON_OK: |
|
124 |
Thread task = new Thread(() -> { |
|
125 |
panel.fetch(legend.getConfig()); |
|
126 |
performCopyAsPolygons(sourceLayer); |
|
127 |
theDialog.asJComponent().setVisible(false); |
|
128 |
}, "UHS_CopyAsPolygons"); |
|
129 |
task.start(); |
|
130 |
break; |
|
131 |
case WindowManager_v2.BUTTON_CANCEL: |
|
132 |
theDialog.asJComponent().setVisible(false); |
|
133 |
break; |
|
134 |
} |
|
135 |
}); |
|
136 |
|
|
137 |
theDialog.show(WindowManager.MODE.DIALOG); |
|
138 |
} |
|
139 |
|
|
140 |
private void performCopyAsPolygons(FLyrVect sourceLayer) { |
|
141 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
142 |
UrbanHorizontalSignageManager uhsManager = UrbanHorizontalSignageLocator.getUrbanHorizontalSignageManager(); |
|
143 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
144 |
DataManager dataManager = DALLocator.getDataManager(); |
|
145 |
|
|
146 |
UrbanHorizontalSignageLegend legend = (UrbanHorizontalSignageLegend) sourceLayer.getLegend(); |
|
147 |
FeatureStore tempTargetStore = null; |
|
148 |
FeatureSet tempFeatureSet = null; |
|
149 |
try { |
|
150 |
|
|
151 |
FeatureSet sourceFeatureSet = sourceLayer.getFeatureStore().getFeatureSelection(); |
|
152 |
tempTargetStore = uhsManager.createTemporaryPolygonsFromLines(legend.getConfig(), sourceFeatureSet, null); |
|
153 |
tempFeatureSet = tempTargetStore.getFeatureSet(); |
|
154 |
|
|
155 |
int n = application.confirmDialog( |
|
156 |
"_Number_of_geometries_to_be_copied_to_the_clipboard" + " " + tempFeatureSet.getSize() + "\n" + "_Do_you_want_to_continue", |
|
157 |
i18n.getTranslation("_Copy_selected_features_as_polygons_to_clipboard"), |
|
158 |
JOptionPane.YES_NO_OPTION, |
|
159 |
JOptionPane.QUESTION_MESSAGE); |
|
160 |
if (n == JOptionPane.YES_OPTION) { |
|
161 |
dataManager.putFeaturesInClipboard(tempFeatureSet); |
|
162 |
} |
|
163 |
|
|
164 |
} catch (Exception e) { |
|
165 |
LOGGER.warn("Can't get the selection as JSON.", e); |
|
166 |
} finally { |
|
167 |
DisposeUtils.disposeQuietly(tempTargetStore); |
|
168 |
DisposeUtils.disposeQuietly(tempFeatureSet); |
|
169 |
} |
|
170 |
|
|
171 |
} |
|
172 |
|
|
173 |
private void convertLinesAsPolygons(UrbanHorizontalSignageConfig config, FeatureSet source) { |
|
174 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
175 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
176 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
177 |
UrbanHorizontalSignageManager uhsManager = UrbanHorizontalSignageLocator.getUrbanHorizontalSignageManager(); |
|
178 |
UrbanHorizontalSignageSwingManager uhsSwingManager = UrbanHorizontalSignageSwingLocator.getUrbanHorizontalSignageSwingManager(); |
|
179 |
|
|
180 |
|
|
181 |
final ConvertLinesToPolygonsPanel panel = uhsSwingManager.createConvertLinesToPolygonsPanel(); |
|
182 |
panel.setSource(source); |
|
183 |
// panel.setStores(new StoresWithLayerTypeIcon()); |
|
184 |
panel.put(config); |
|
185 |
|
|
186 |
Dialog theDialog = winManager.createDialog( |
|
187 |
panel.asJComponent(), |
|
188 |
i18n.getTranslation("_Convert_lines_to_polygons"), |
|
189 |
i18n.getTranslation("_Convert_Urban_signage_lines_to_polygons"), |
|
190 |
WindowManager_v2.BUTTONS_OK_CANCEL |
|
191 |
); |
|
192 |
theDialog.setButtonLabel(WindowManager_v2.BUTTON_OK, i18n.getTranslation("_Convert")); |
|
193 |
theDialog.setButtonLabel(WindowManager_v2.BUTTON_CANCEL, i18n.getTranslation("_Close")); |
|
194 |
theDialog.setAutoclose(false); |
|
195 |
|
|
196 |
theDialog.addActionListener((ActionEvent e) -> { |
|
197 |
switch (theDialog.getAction()) { |
|
198 |
case WindowManager_v2.BUTTON_OK: |
|
199 |
Thread task = new Thread(() -> { |
|
200 |
try { |
|
201 |
theDialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, false); |
|
202 |
panel.setTaskStatusVisible(true); |
|
203 |
uhsManager.convertLinesToPolygons( |
|
204 |
panel.getConfig(), |
|
205 |
panel.getSource(), |
|
206 |
panel.getTargetStore(), |
|
207 |
panel.getDeleteSourceAtFinish(), |
|
208 |
panel.getTaskStatus() |
|
209 |
); |
|
210 |
theDialog.asJComponent().setVisible(false); |
|
211 |
} catch(Exception ex) { |
|
212 |
LOGGER.warn("Can't convert lines to polygons", ex); |
|
213 |
ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
214 |
dialogs.messageDialog( |
|
215 |
i18n.getTranslation("_Cant_convert_lines_to_polygons") +"\n\n" + ex.getLocalizedMessage(), |
|
216 |
i18n.getTranslation("_Convert_Urban_signage_lines_to_polygons"), |
|
217 |
JOptionPane.WARNING_MESSAGE |
|
218 |
); |
|
219 |
} |
|
220 |
}, "UHS_ConvertLinesToPolygons"); |
|
221 |
task.start(); |
|
222 |
break; |
|
223 |
case WindowManager_v2.BUTTON_CANCEL: |
|
224 |
theDialog.asJComponent().setVisible(false); |
|
225 |
break; |
|
226 |
} |
|
227 |
}); |
|
228 |
|
|
229 |
theDialog.show(WindowManager.MODE.WINDOW); |
|
230 |
} |
|
231 |
|
|
232 |
@Override |
|
233 |
public boolean isEnabled() { |
|
234 |
// it's enabled if there is exactly one vector layer in the active view |
|
235 |
// and it has a selection |
|
236 |
|
|
237 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
238 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
239 |
if (viewdoc == null) { |
|
240 |
return false; |
|
241 |
} |
|
242 |
MapContext mapContext = viewdoc.getMapContext(); |
|
243 |
FLyrVect layer = mapContext.getLayers().getFirstActiveVectorLayer(); |
|
244 |
if (layer == null) { |
|
245 |
return false; |
|
246 |
} |
|
247 |
if (!layer.isAvailable()) { |
|
248 |
// This can happen when opening a persisted project |
|
249 |
// and there is a "slow" layer (GeoDB) |
|
250 |
return false; |
|
251 |
} |
|
252 |
try { |
|
253 |
FeatureStore store = layer.getFeatureStore(); |
|
254 |
if( store == null ) { |
|
255 |
return false; |
|
256 |
} |
|
257 |
FeatureSelection selection = store.getFeatureSelection(); |
|
258 |
if (selection.isEmpty()) { |
|
259 |
return false; |
|
260 |
} |
|
261 |
return (layer.getLegend() instanceof UrbanHorizontalSignageLegend); |
|
262 |
// return !selection.isEmpty(); |
|
263 |
} catch (Exception ex) { |
|
264 |
LOGGER.warn("Can't get selection from layer '" + layer.getName() + "'.", ex); |
|
265 |
return false; |
|
266 |
} |
|
267 |
} |
|
268 |
|
|
269 |
@Override |
|
270 |
public boolean isVisible() { |
|
271 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
272 |
return application.getActiveDocument(ViewManager.TYPENAME) != null; |
|
273 |
} |
|
274 |
|
|
275 |
// private static class StoresWithLayerTypeIcon implements CompoundStoresTreeModel { |
|
276 |
// |
|
277 |
// private final CompoundStoresTreeModel delegated; |
|
278 |
// |
|
279 |
// public StoresWithLayerTypeIcon() { |
|
280 |
// ApplicationManager application = ApplicationLocator.getManager(); |
|
281 |
// this.delegated = (CompoundStoresTreeModel) application.createProjectStoresTreeModel(); |
|
282 |
// } |
|
283 |
// |
|
284 |
// @Override |
|
285 |
// public void setFilter(Predicate<DataStore> filter) { |
|
286 |
// this.delegated.setFilter(filter); |
|
287 |
// } |
|
288 |
// |
|
289 |
// @Override |
|
290 |
// public void addLayers(FLayers layers) { |
|
291 |
// this.delegated.addLayers(layers); |
|
292 |
// } |
|
293 |
// |
|
294 |
// @Override |
|
295 |
// public Icon getIcon(Object item) { |
|
296 |
// Icon icon = this.delegated.getIcon(item); |
|
297 |
// if( item instanceof LabeledValue ) { |
|
298 |
// item = ((LabeledValue)item).getValue(); |
|
299 |
// } |
|
300 |
// if (item instanceof FeatureStore) { |
|
301 |
// try { |
|
302 |
// FeatureStore store = (FeatureStore) item; |
|
303 |
// FeatureType ft = store.getDefaultFeatureTypeQuietly(); |
|
304 |
// int type = ft.getDefaultGeometryAttribute().getGeomType().getType(); |
|
305 |
// Icon icon2 = MapContextLocator.getMapContextManager().getIcon( |
|
306 |
// type, |
|
307 |
// !store.isFeatureSelectionEmpty() |
|
308 |
// ); |
|
309 |
// if( icon2!=null ) { |
|
310 |
// icon = ToolsSwingLocator.getToolsSwingManager().createCompoundIcon( |
|
311 |
// SwingConstants.HORIZONTAL, 2, icon, icon2 |
|
312 |
// ); |
|
313 |
// } |
|
314 |
// } catch(Exception ex) { |
|
315 |
// LOGGER.trace("Can't get geometry type from store.", ex); |
|
316 |
// } |
|
317 |
// } |
|
318 |
// return icon; |
|
319 |
// } |
|
320 |
// |
|
321 |
// @Override |
|
322 |
// public Object getRoot() { |
|
323 |
// return this.delegated.getRoot(); |
|
324 |
// } |
|
325 |
// |
|
326 |
// @Override |
|
327 |
// public Object getChild(Object parent, int index) { |
|
328 |
// return this.delegated.getChild(parent, index); |
|
329 |
// } |
|
330 |
// |
|
331 |
// @Override |
|
332 |
// public int getChildCount(Object parent) { |
|
333 |
// return this.delegated.getChildCount(parent); |
|
334 |
// } |
|
335 |
// |
|
336 |
// @Override |
|
337 |
// public boolean isLeaf(Object node) { |
|
338 |
// return this.delegated.isLeaf(node); |
|
339 |
// } |
|
340 |
// |
|
341 |
// @Override |
|
342 |
// public void valueForPathChanged(TreePath path, Object newValue) { |
|
343 |
// this.delegated.valueForPathChanged(path, newValue); |
|
344 |
// } |
|
345 |
// |
|
346 |
// @Override |
|
347 |
// public int getIndexOfChild(Object parent, Object child) { |
|
348 |
// return this.delegated.getIndexOfChild(parent, child); |
|
349 |
// } |
|
350 |
// |
|
351 |
// @Override |
|
352 |
// public void addTreeModelListener(TreeModelListener l) { |
|
353 |
// this.delegated.addTreeModelListener(l); |
|
354 |
// } |
|
355 |
// |
|
356 |
// @Override |
|
357 |
// public void removeTreeModelListener(TreeModelListener l) { |
|
358 |
// this.delegated.removeTreeModelListener(l); |
|
359 |
// } |
|
360 |
// |
|
361 |
// } |
|
362 |
|
|
363 |
} |
org.gvsig.legend.urbanhorizontalsignage/tags/org.gvsig.legend.urbanhorizontalsignage-1.0.106/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.picturemarkersymboltable.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.106/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.picturemarkersymboltable.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 |
} |
Also available in: Unified diff