Revision 21358
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutFunctions.java | ||
---|---|---|
51 | 51 |
import java.awt.geom.Point2D; |
52 | 52 |
import java.awt.geom.Rectangle2D; |
53 | 53 |
|
54 |
import com.iver.cit.gvsig.project.documents.layout.commands.EditableFeatureSource; |
|
55 | 54 |
import com.iver.cit.gvsig.project.documents.layout.commands.FrameCommandsRecord; |
56 | 55 |
import com.iver.cit.gvsig.project.documents.layout.fframes.FFrameGroup; |
57 | 56 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
... | ... | |
84 | 83 |
boolean isUpdate = false; |
85 | 84 |
layout.getLayoutContext().updateFFrames(); |
86 | 85 |
IFFrame[] fframes=layout.getLayoutContext().getFFrames(); |
87 |
FrameCommandsRecord efs=layout.getLayoutContext().getEFS();
|
|
86 |
FrameCommandsRecord efs=layout.getLayoutContext().getFrameCommandsRecord();
|
|
88 | 87 |
efs.startComplex(); |
89 | 88 |
for (int i = 0; i < fframes.length; i++) { |
90 | 89 |
fframe = fframes[i]; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/tools/LayoutEditGraphicsListenerImpl.java | ||
---|---|---|
124 | 124 |
IFFrame fframeAux=frame.cloneFFrame(layout); |
125 | 125 |
((IFFrameEditableVertex)fframeAux).startEditing(); |
126 | 126 |
((IFFrameEditableVertex)fframeAux).pointReleased(FLayoutUtilities.toSheetPoint(event.getPoint(),layout.getLayoutControl().getAT()),((IFFrameEditableVertex)frame).getGeometry()); |
127 |
layout.getLayoutContext().getEFS().update(frame,fframeAux);
|
|
127 |
layout.getLayoutContext().getFrameCommandsRecord().update(frame,fframeAux);
|
|
128 | 128 |
fframeAux.getBoundingBox(layout.getLayoutControl().getAT()); |
129 | 129 |
layout.getLayoutContext().updateFFrames(); |
130 | 130 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/commands/DefaultEditableFeatureSource.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.cit.gvsig.project.documents.layout.commands; |
|
42 |
|
|
43 |
import java.awt.Image; |
|
44 |
import java.util.ArrayList; |
|
45 |
import java.util.BitSet; |
|
46 |
|
|
47 |
import org.gvsig.data.commands.AbstractCommand; |
|
48 |
import org.gvsig.data.commands.Command; |
|
49 |
import org.gvsig.data.commands.CommandsRecord; |
|
50 |
|
|
51 |
import com.iver.andami.PluginServices; |
|
52 |
import com.iver.cit.gvsig.project.documents.layout.fframes.FFrameGroup; |
|
53 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
|
54 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrameViewDependence; |
|
55 |
|
|
56 |
|
|
57 |
/** |
|
58 |
* Class responsible for the edition of the FFrames. |
|
59 |
* |
|
60 |
* @author Vicente Caballero Navarro |
|
61 |
*/ |
|
62 |
public class DefaultEditableFeatureSource implements EditableFeatureSource { |
|
63 |
private ArrayList<IFFrame> fframes = new ArrayList<IFFrame>(); |
|
64 |
private CommandsRecord cr; |
|
65 |
private BitSet invalidates = new BitSet(); |
|
66 |
private boolean complex = false; |
|
67 |
private int numAdd = 0; |
|
68 |
|
|
69 |
public DefaultEditableFeatureSource() { |
|
70 |
this.cr = new FrameCommandsRecord(); |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* Returns from an index the FFrame. |
|
75 |
* |
|
76 |
* @param index |
|
77 |
* |
|
78 |
* @return FFrame. |
|
79 |
*/ |
|
80 |
public IFFrame getFFrame(int index) { |
|
81 |
return fframes.get(index); |
|
82 |
} |
|
83 |
|
|
84 |
/** |
|
85 |
* Returns the number of FFrame. |
|
86 |
* |
|
87 |
* @return Number of FFrames |
|
88 |
*/ |
|
89 |
public int getFFrameCount() { |
|
90 |
return fframes.size(); |
|
91 |
} |
|
92 |
|
|
93 |
/** |
|
94 |
* Add a FFrame in the mechanism of control creating a command. |
|
95 |
* |
|
96 |
* @param f FFrame to add |
|
97 |
*/ |
|
98 |
public void addFFrame(IFFrame f) { |
|
99 |
int virtualIndex = doAddFFrame(f); |
|
100 |
AbstractCommand command=new InsertFrameCommand(this, f, virtualIndex); |
|
101 |
command.setDescription(f.getNameFFrame()); |
|
102 |
if (complex) { |
|
103 |
commands.add(command); |
|
104 |
} else { |
|
105 |
cr.add(command); |
|
106 |
PluginServices.getMainFrame().enableControls(); |
|
107 |
} |
|
108 |
} |
|
109 |
|
|
110 |
/** |
|
111 |
* Undo the last command added. |
|
112 |
* @throws EditionCommandException |
|
113 |
*/ |
|
114 |
public void undo() { |
|
115 |
if (moreUndoCommands()) { |
|
116 |
cr.undo(); |
|
117 |
} |
|
118 |
} |
|
119 |
|
|
120 |
/** |
|
121 |
* Redo the last command undid. |
|
122 |
* @throws EditionCommandException |
|
123 |
*/ |
|
124 |
public void redo() { |
|
125 |
if (moreRedoCommands()) { |
|
126 |
cr.redo(); |
|
127 |
} |
|
128 |
} |
|
129 |
|
|
130 |
/** |
|
131 |
* Returns if there are more commands to undo |
|
132 |
* |
|
133 |
* @return True if there are more commands to undo |
|
134 |
*/ |
|
135 |
public boolean moreUndoCommands() { |
|
136 |
return cr.moreUndoCommands(); |
|
137 |
} |
|
138 |
|
|
139 |
/** |
|
140 |
* Returns if there are more commands to redo |
|
141 |
* |
|
142 |
* @return True if there are more commands to redo |
|
143 |
*/ |
|
144 |
public boolean moreRedoCommands() { |
|
145 |
return cr.moreRedoCommands(); |
|
146 |
} |
|
147 |
|
|
148 |
/** |
|
149 |
* Remove the FFrame by the index. |
|
150 |
* |
|
151 |
* @param index |
|
152 |
*/ |
|
153 |
public void removeFFrame(int index) { |
|
154 |
if (invalidates.get(index)) { |
|
155 |
return; |
|
156 |
} |
|
157 |
IFFrame frame=getFFrame(index); |
|
158 |
doRemoveFFrame(index); |
|
159 |
AbstractCommand command=new DeleteFrameCommand(this, index); |
|
160 |
command.setDescription(frame.getNameFFrame()); |
|
161 |
if (complex) { |
|
162 |
commands.add(command); |
|
163 |
} else { |
|
164 |
cr.add(command); |
|
165 |
PluginServices.getMainFrame().enableControls(); |
|
166 |
} |
|
167 |
} |
|
168 |
|
|
169 |
/** |
|
170 |
* Modify a fframe to another fframe new. |
|
171 |
* |
|
172 |
* @param fant Previous Fframe. |
|
173 |
* @param fnew New FFrame. |
|
174 |
*/ |
|
175 |
public boolean modifyFFrame(IFFrame fant, IFFrame fnew) { |
|
176 |
int posAnt = -1; |
|
177 |
|
|
178 |
for (int i = 0; i < fframes.size(); i++) { |
|
179 |
if (fframes.get(i).equals(fant) && !invalidates.get(i)) { |
|
180 |
posAnt = i; |
|
181 |
} |
|
182 |
} |
|
183 |
if (posAnt==-1) |
|
184 |
return false; |
|
185 |
int pos = doModifyFFrame(posAnt, fnew); |
|
186 |
AbstractCommand command=new UpdateFrameCommand(this, fnew, posAnt, pos); |
|
187 |
command.setDescription(fant.getNameFFrame()); |
|
188 |
if (complex) { |
|
189 |
commands.add(command); |
|
190 |
} else { |
|
191 |
cr.add(command); |
|
192 |
PluginServices.getMainFrame().enableControls(); |
|
193 |
} |
|
194 |
|
|
195 |
refreshDependences(fant, fnew); |
|
196 |
return true; |
|
197 |
} |
|
198 |
|
|
199 |
public void setImage(Image i) { |
|
200 |
// TODO Auto-generated method stub |
|
201 |
} |
|
202 |
|
|
203 |
public Image getImage() { |
|
204 |
// TODO Auto-generated method stub |
|
205 |
return null; |
|
206 |
} |
|
207 |
|
|
208 |
/** |
|
209 |
* Start a composed command of other simpler commands. |
|
210 |
* Create an only one command to reproduce if all at once. |
|
211 |
*/ |
|
212 |
public void startComplexCommand() { |
|
213 |
complex = true; |
|
214 |
commands = new CommandCollection(); |
|
215 |
} |
|
216 |
|
|
217 |
/** |
|
218 |
* Terminate a composed command. |
|
219 |
*/ |
|
220 |
public void endComplexCommand(String description) { |
|
221 |
if (commands.isEmpty()) { |
|
222 |
complex = false; |
|
223 |
return; |
|
224 |
} |
|
225 |
commands.setDescription(description); |
|
226 |
cr.pushCommand(commands); |
|
227 |
complex = false; |
|
228 |
PluginServices.getMainFrame().enableControls(); |
|
229 |
} |
|
230 |
|
|
231 |
/** |
|
232 |
* Undo add FFrame from index. |
|
233 |
* |
|
234 |
* @param index |
|
235 |
*/ |
|
236 |
public void undoAddFFrame(int index) { |
|
237 |
doRemoveFFrame(index); |
|
238 |
numAdd--; |
|
239 |
} |
|
240 |
|
|
241 |
/** |
|
242 |
* Add FFrame. |
|
243 |
* |
|
244 |
* @param frame |
|
245 |
* |
|
246 |
* @return index of new fframe. |
|
247 |
*/ |
|
248 |
public int doAddFFrame(IFFrame frame) { |
|
249 |
fframes.add(frame); |
|
250 |
numAdd++; |
|
251 |
|
|
252 |
return fframes.size() - 1; |
|
253 |
} |
|
254 |
|
|
255 |
/** |
|
256 |
* Add FFrame from index. |
|
257 |
* |
|
258 |
* @param frame New FFrame. |
|
259 |
* @param index Index of new FFrame. |
|
260 |
*/ |
|
261 |
public void doAddFFrame(IFFrame frame, int index) { |
|
262 |
invalidates.set(index, false); |
|
263 |
fframes.set(index, frame); |
|
264 |
numAdd++; |
|
265 |
} |
|
266 |
|
|
267 |
/** |
|
268 |
* Undo modify an FFrame modified. |
|
269 |
* |
|
270 |
* @param fant Previous fframe. |
|
271 |
* @param fnew New FFrame. |
|
272 |
* @param indexAnt Actual index. |
|
273 |
* @param indexLast Previous index. |
|
274 |
*/ |
|
275 |
public void undoModifyFFrame(int index, |
|
276 |
int newIndex) { |
|
277 |
undoRemoveFFrame(index); |
|
278 |
undoAddFFrame(newIndex); |
|
279 |
IFFrame fant=fframes.get(newIndex); |
|
280 |
IFFrame fnew=fframes.get(index); |
|
281 |
refreshDependences(fant,fnew); |
|
282 |
} |
|
283 |
|
|
284 |
/** |
|
285 |
* Modify FFrame from index and new FFrame. |
|
286 |
* |
|
287 |
* @param indexAnt Actual index. |
|
288 |
* @param frameNext New FFrame. |
|
289 |
* |
|
290 |
* @return New index of FFrame. |
|
291 |
*/ |
|
292 |
public int doModifyFFrame(int indexAnt, IFFrame frameNext) { |
|
293 |
doRemoveFFrame(indexAnt); |
|
294 |
|
|
295 |
return doAddFFrame(frameNext); |
|
296 |
} |
|
297 |
|
|
298 |
/** |
|
299 |
* Undo Remove FFrame from index. |
|
300 |
* |
|
301 |
* @param index Actual index of FFrame. |
|
302 |
*/ |
|
303 |
public void undoRemoveFFrame(int index) { |
|
304 |
invalidates.set(index, false); |
|
305 |
} |
|
306 |
|
|
307 |
/** |
|
308 |
* Remove FFrame from actual index. |
|
309 |
* |
|
310 |
* @param index Actual index. |
|
311 |
*/ |
|
312 |
public void doRemoveFFrame(int index) { |
|
313 |
invalidates.set(index, true); |
|
314 |
} |
|
315 |
|
|
316 |
/** |
|
317 |
* Returns all the fframes that are not removed. |
|
318 |
* |
|
319 |
* @return Vector with fframes. |
|
320 |
*/ |
|
321 |
public IFFrame[] getFFrames() { |
|
322 |
ArrayList<IFFrame> frames = new ArrayList<IFFrame>(); |
|
323 |
|
|
324 |
for (int i = 0; i < getFFrameCount(); i++) { |
|
325 |
if (!invalidates.get(i)) { |
|
326 |
frames.add(fframes.get(i)); |
|
327 |
} |
|
328 |
} |
|
329 |
|
|
330 |
IFFrame[] fframesV = frames.toArray(new IFFrame[0]); |
|
331 |
|
|
332 |
return fframesV; |
|
333 |
} |
|
334 |
|
|
335 |
/** |
|
336 |
* Returns all the fframes, remove and done not remove. |
|
337 |
* |
|
338 |
* @return All FFrames. |
|
339 |
*/ |
|
340 |
public IFFrame[] getAllFFrames() { |
|
341 |
return fframes.toArray(new IFFrame[0]); |
|
342 |
} |
|
343 |
|
|
344 |
/** |
|
345 |
* Returns all the fframes, remove and done not remove and the ones that are in the FFrameGroups |
|
346 |
* |
|
347 |
* @return All FFrames. |
|
348 |
*/ |
|
349 |
public IFFrame[] getAllFFrameToDepends() { |
|
350 |
IFFrame[] fs = getAllFFrames(); |
|
351 |
|
|
352 |
return getFFrameToDepends(fs); |
|
353 |
} |
|
354 |
|
|
355 |
private IFFrame[] getFFrameToDepends(IFFrame[] fs) { |
|
356 |
ArrayList<IFFrame> result = new ArrayList<IFFrame>(); |
|
357 |
|
|
358 |
for (int i = 0; i < fs.length; i++) { |
|
359 |
result.add(fs[i]); |
|
360 |
|
|
361 |
if (fs[i] instanceof FFrameGroup) { |
|
362 |
IFFrame[] ffs = getFFrameToDepends(((FFrameGroup) fs[i]).getFFrames()); |
|
363 |
|
|
364 |
for (int j = 0; j < ffs.length; j++) { |
|
365 |
result.add(ffs[j]); |
|
366 |
} |
|
367 |
} |
|
368 |
} |
|
369 |
|
|
370 |
return result.toArray(new IFFrame[0]); |
|
371 |
} |
|
372 |
|
|
373 |
private void refreshDependences(IFFrame fant, IFFrame fnew) { |
|
374 |
for (int i = 0; i < fframes.size(); i++) { |
|
375 |
if (fframes.get(i) instanceof IFFrameViewDependence) { |
|
376 |
IFFrameViewDependence f = (IFFrameViewDependence) fframes.get(i); |
|
377 |
f.refreshDependence(fant, fnew); |
|
378 |
} |
|
379 |
} |
|
380 |
} |
|
381 |
|
|
382 |
/** |
|
383 |
* Returns the command record. |
|
384 |
* |
|
385 |
* @return CommandRecord. |
|
386 |
*/ |
|
387 |
public CommandsRecord getCommandRecord() { |
|
388 |
return cr; |
|
389 |
} |
|
390 |
|
|
391 |
public void redoModifyFFrame(int index, int newIndex, IFFrame frame) { |
|
392 |
doRemoveFFrame(index); |
|
393 |
doAddFFrame(frame,newIndex); |
|
394 |
IFFrame fant=fframes.get(newIndex); |
|
395 |
refreshDependences(fant,frame); |
|
396 |
} |
|
397 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/commands/EditableFeatureSource.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.cit.gvsig.project.documents.layout.commands; |
|
42 |
|
|
43 |
import java.awt.Image; |
|
44 |
|
|
45 |
import org.gvsig.data.commands.CommandsRecord; |
|
46 |
|
|
47 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
|
48 |
|
|
49 |
|
|
50 |
/** |
|
51 |
* Interface of class to control the edition of FFrames. |
|
52 |
* |
|
53 |
* @author Vicente Caballero Navarro |
|
54 |
*/ |
|
55 |
public interface EditableFeatureSource { |
|
56 |
/** |
|
57 |
* Returns from an index the FFrame. |
|
58 |
* |
|
59 |
* @param index |
|
60 |
* |
|
61 |
* @return FFrame. |
|
62 |
*/ |
|
63 |
IFFrame getFFrame(int index); |
|
64 |
/** |
|
65 |
* Returns all the fframes that are not removed. |
|
66 |
* |
|
67 |
* @return Vector with fframes. |
|
68 |
*/ |
|
69 |
IFFrame[] getFFrames(); |
|
70 |
/** |
|
71 |
* Returns the number of FFrame. |
|
72 |
* |
|
73 |
* @return Number of FFrames |
|
74 |
*/ |
|
75 |
int getFFrameCount(); |
|
76 |
/** |
|
77 |
* Add a FFrame in the mechanism of control creating a command. |
|
78 |
* |
|
79 |
* @param f FFrame to add |
|
80 |
*/ |
|
81 |
void addFFrame(IFFrame f); |
|
82 |
/** |
|
83 |
* Undo the last command added. |
|
84 |
* @throws EditionCommandException |
|
85 |
*/ |
|
86 |
void undo(); |
|
87 |
/** |
|
88 |
* Redo the last command undid. |
|
89 |
* @throws EditionCommandException |
|
90 |
*/ |
|
91 |
void redo(); |
|
92 |
/** |
|
93 |
* Returns if there are more commands to undo |
|
94 |
* |
|
95 |
* @return True if there are more commands to undo |
|
96 |
*/ |
|
97 |
boolean moreUndoCommands(); |
|
98 |
/** |
|
99 |
* Returns if there are more commands to redo |
|
100 |
* |
|
101 |
* @return True if there are more commands to redo |
|
102 |
*/ |
|
103 |
boolean moreRedoCommands(); |
|
104 |
/** |
|
105 |
* Remove the FFrame by the index. |
|
106 |
* |
|
107 |
* @param index |
|
108 |
*/ |
|
109 |
void removeFFrame(int index); |
|
110 |
/** |
|
111 |
* Modify a fframe to another fframe new. |
|
112 |
* |
|
113 |
* @param fant Previous Fframe. |
|
114 |
* @param fnew New FFrame. |
|
115 |
*/ |
|
116 |
boolean modifyFFrame(IFFrame fant, IFFrame fnew); |
|
117 |
|
|
118 |
void setImage(Image i); |
|
119 |
|
|
120 |
Image getImage(); |
|
121 |
/** |
|
122 |
* Start a composed command of other simpler commands. |
|
123 |
* Create an only one command to reproduce if all at once. |
|
124 |
*/ |
|
125 |
void startComplexCommand(); |
|
126 |
/** |
|
127 |
* Terminate a composed command. |
|
128 |
*/ |
|
129 |
void endComplexCommand(String description); |
|
130 |
/** |
|
131 |
* Undo add FFrame from index. |
|
132 |
* |
|
133 |
* @param index |
|
134 |
*/ |
|
135 |
void undoAddFFrame(int index); |
|
136 |
/** |
|
137 |
* Add FFrame. |
|
138 |
* |
|
139 |
* @param frame |
|
140 |
* |
|
141 |
* @return index of new fframe. |
|
142 |
*/ |
|
143 |
int doAddFFrame(IFFrame frame); |
|
144 |
/** |
|
145 |
* Add FFrame from index. |
|
146 |
* |
|
147 |
* @param frame New FFrame. |
|
148 |
* @param index Index of new FFrame. |
|
149 |
*/ |
|
150 |
void doAddFFrame(IFFrame frame, int index); |
|
151 |
/** |
|
152 |
* Undo modify an FFrame modified. |
|
153 |
* |
|
154 |
* @param fant Previous fframe. |
|
155 |
* @param fnew New FFrame. |
|
156 |
* @param indexAnt Actual index. |
|
157 |
* @param indexLast Previous index. |
|
158 |
*/ |
|
159 |
void undoModifyFFrame( int indexAnt, |
|
160 |
int previousIndex); |
|
161 |
/** |
|
162 |
* Modify FFrame from index and new FFrame. |
|
163 |
* |
|
164 |
* @param indexAnt Actual index. |
|
165 |
* @param frameNext New FFrame. |
|
166 |
* |
|
167 |
* @return New index of FFrame. |
|
168 |
*/ |
|
169 |
int doModifyFFrame(int indexAnt, IFFrame frameNext); |
|
170 |
/** |
|
171 |
* Undo Remove FFrame from index. |
|
172 |
* |
|
173 |
* @param index Actual index of FFrame. |
|
174 |
*/ |
|
175 |
void undoRemoveFFrame(int index); |
|
176 |
/** |
|
177 |
* Remove FFrame from actual index. |
|
178 |
* |
|
179 |
* @param index Actual index. |
|
180 |
*/ |
|
181 |
void doRemoveFFrame(int index); |
|
182 |
/** |
|
183 |
* Returns all the fframes, remove and done not remove. |
|
184 |
* |
|
185 |
* @return All FFrames. |
|
186 |
*/ |
|
187 |
IFFrame[] getAllFFrames(); |
|
188 |
/** |
|
189 |
* Returns the command record. |
|
190 |
* |
|
191 |
* @return CommandRecord. |
|
192 |
*/ |
|
193 |
CommandsRecord getCommandRecord(); |
|
194 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/LayoutContext.java | ||
---|---|---|
8 | 8 |
|
9 | 9 |
import com.iver.andami.PluginServices; |
10 | 10 |
import com.iver.cit.gvsig.project.documents.exceptions.SaveException; |
11 |
import com.iver.cit.gvsig.project.documents.layout.commands.DefaultEditableFeatureSource; |
|
12 | 11 |
import com.iver.cit.gvsig.project.documents.layout.commands.FrameCommandsRecord; |
13 | 12 |
import com.iver.cit.gvsig.project.documents.layout.commands.FrameManager; |
14 | 13 |
import com.iver.cit.gvsig.project.documents.layout.fframes.FFrameGroup; |
... | ... | |
175 | 174 |
* Returns the EditableFeatureSource, is the control of all change in the FFrames of Layout. |
176 | 175 |
* @return EditableFatureSource. |
177 | 176 |
*/ |
178 |
public FrameCommandsRecord getEFS() {
|
|
177 |
public FrameCommandsRecord getFrameCommandsRecord() {
|
|
179 | 178 |
return fcr; |
180 | 179 |
} |
181 | 180 |
/** |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/LayoutKeyEvent.java | ||
---|---|---|
38 | 38 |
} |
39 | 39 |
public static boolean paste(Layout layout) { |
40 | 40 |
IFFrame copyFFrame = null; |
41 |
layout.getLayoutContext().getEFS().startComplex();
|
|
41 |
layout.getLayoutContext().getFrameCommandsRecord().startComplex();
|
|
42 | 42 |
for (int i = 0; i < selectFFrames.length; i++) { |
43 | 43 |
copyFFrame = selectFFrames[i].cloneFFrame(layout); |
44 | 44 |
if (i == 0) |
... | ... | |
46 | 46 |
else |
47 | 47 |
layout.getLayoutContext().addFFrame(copyFFrame, false, true); |
48 | 48 |
} |
49 |
layout.getLayoutContext().getEFS().endComplex(
|
|
49 |
layout.getLayoutContext().getFrameCommandsRecord().endComplex(
|
|
50 | 50 |
PluginServices.getText(layout, "paste_elements")); |
51 | 51 |
layout.getLayoutContext().callLayoutDrawListeners(); |
52 | 52 |
return true; |
53 | 53 |
} |
54 | 54 |
public static boolean undo(Layout layout) { |
55 |
layout.getLayoutContext().getEFS().undo();
|
|
55 |
layout.getLayoutContext().getFrameCommandsRecord().undo();
|
|
56 | 56 |
layout.getLayoutContext().updateFFrames(); |
57 | 57 |
layout.getLayoutContext().callLayoutDrawListeners(); |
58 | 58 |
PluginServices.getMainFrame().enableControls(); |
59 | 59 |
return true; |
60 | 60 |
} |
61 | 61 |
public static boolean redo(Layout layout) { |
62 |
layout.getLayoutContext().getEFS().redo();
|
|
62 |
layout.getLayoutContext().getFrameCommandsRecord().redo();
|
|
63 | 63 |
layout.getLayoutContext().updateFFrames(); |
64 | 64 |
layout.getLayoutContext().callLayoutDrawListeners(); |
65 | 65 |
PluginServices.getMainFrame().enableControls(); |
... | ... | |
118 | 118 |
if (e.getKeyCode()==KeyEvent.VK_LEFT || e.getKeyCode()==KeyEvent.VK_RIGHT || e.getKeyCode()==KeyEvent.VK_UP || e.getKeyCode()==KeyEvent.VK_DOWN) { |
119 | 119 |
if (fframes.length==0) |
120 | 120 |
return false; |
121 |
layout.getLayoutContext().getEFS().startComplex();
|
|
121 |
layout.getLayoutContext().getFrameCommandsRecord().startComplex();
|
|
122 | 122 |
for (int i = 0; i < fframes.length; i++) { |
123 | 123 |
IFFrame fframeAux = fframes[i].cloneFFrame(layout); |
124 | 124 |
Rectangle2D r = getRectMove(fframes[i] |
125 | 125 |
.getBoundingBox(layout.getLayoutControl().getAT()), difX, difY); |
126 | 126 |
fframeAux.setBoundBox(FLayoutUtilities.toSheetRect(r, |
127 | 127 |
layout.getLayoutControl().getAT())); |
128 |
layout.getLayoutContext().getEFS().update(fframes[i], fframeAux);
|
|
128 |
layout.getLayoutContext().getFrameCommandsRecord().update(fframes[i], fframeAux);
|
|
129 | 129 |
} |
130 |
layout.getLayoutContext().getEFS().endComplex(
|
|
130 |
layout.getLayoutContext().getFrameCommandsRecord().endComplex(
|
|
131 | 131 |
PluginServices.getText(this, "move_elements")); |
132 | 132 |
layout.getLayoutContext().updateFFrames(); |
133 | 133 |
layout.getLayoutControl().refresh(); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/contextmenu/gui/SimplifyLayoutMenuEntry.java | ||
---|---|---|
83 | 83 |
|
84 | 84 |
|
85 | 85 |
public void execute(LayoutContext layoutContext, IFFrame[] selectedFrames) { |
86 |
layoutContext.getEFS().startComplex();
|
|
86 |
layoutContext.getFrameCommandsRecord().startComplex();
|
|
87 | 87 |
for (int i = selectedFrames.length - 1; i >= 0; i--) { |
88 | 88 |
IFFrame fframe = selectedFrames[i]; |
89 | 89 |
if (fframe instanceof FFrameLegend) { |
90 | 90 |
((FFrameLegend) fframe).toFFrames(layoutContext); |
91 | 91 |
} |
92 | 92 |
} |
93 |
layoutContext.getEFS().endComplex(PluginServices.getText(this,"simplify"));
|
|
93 |
layoutContext.getFrameCommandsRecord().endComplex(PluginServices.getText(this,"simplify"));
|
|
94 | 94 |
layoutContext.callLayoutDrawListeners(); |
95 | 95 |
} |
96 | 96 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/contextmenu/gui/BeforeLayoutMenuEntry.java | ||
---|---|---|
81 | 81 |
|
82 | 82 |
|
83 | 83 |
public void execute(LayoutContext layoutContext, IFFrame[] selectedFrames) { |
84 |
layoutContext.getEFS().startComplex();
|
|
84 |
layoutContext.getFrameCommandsRecord().startComplex();
|
|
85 | 85 |
for (int i = selectedFrames.length - 1; i >= 0; i--) { |
86 | 86 |
IFFrame fframe = selectedFrames[i]; |
87 | 87 |
if (fframe instanceof FFrameGroup) { |
... | ... | |
90 | 90 |
|
91 | 91 |
IFFrame fframeAux=fframe.cloneFFrame(getLayout()); |
92 | 92 |
fframeAux.setLevel(layoutContext.getNumBefore()); |
93 |
layoutContext.getEFS().update(fframe,fframeAux);
|
|
93 |
layoutContext.getFrameCommandsRecord().update(fframe,fframeAux);
|
|
94 | 94 |
fframeAux.getBoundingBox(layoutContext.getAT()); |
95 | 95 |
} |
96 |
layoutContext.getEFS().endComplex(PluginServices.getText(this,"change_before"));
|
|
96 |
layoutContext.getFrameCommandsRecord().endComplex(PluginServices.getText(this,"change_before"));
|
|
97 | 97 |
layoutContext.updateFFrames(); |
98 | 98 |
layoutContext.callLayoutDrawListeners(); |
99 | 99 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/contextmenu/gui/PropertyLayoutMenuEntry.java | ||
---|---|---|
87 | 87 |
if (fframeAux!=null) { |
88 | 88 |
if (fframeAux instanceof IFFrameUseFMap) |
89 | 89 |
((IFFrameUseFMap)fframeAux).refresh(); |
90 |
layoutContext.getEFS().update(frame,fframeAux);
|
|
90 |
layoutContext.getFrameCommandsRecord().update(frame,fframeAux);
|
|
91 | 91 |
fframeAux.getBoundingBox(layoutContext.getAT()); |
92 | 92 |
layoutContext.updateFFrames(); |
93 | 93 |
layoutContext.callLayoutDrawListeners(); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/contextmenu/gui/BehindLayoutMenuEntry.java | ||
---|---|---|
81 | 81 |
|
82 | 82 |
|
83 | 83 |
public void execute(LayoutContext layoutContext, IFFrame[] selectedFrames) { |
84 |
layoutContext.getEFS().startComplex();
|
|
84 |
layoutContext.getFrameCommandsRecord().startComplex();
|
|
85 | 85 |
for (int i = selectedFrames.length - 1; i >= 0; i--) { |
86 | 86 |
IFFrame fframe = selectedFrames[i]; |
87 | 87 |
if (fframe instanceof FFrameGroup) { |
... | ... | |
90 | 90 |
|
91 | 91 |
IFFrame fframeAux=fframe.cloneFFrame(getLayout()); |
92 | 92 |
fframeAux.setLevel(layoutContext.getNumBehind()); |
93 |
layoutContext.getEFS().update(fframe,fframeAux);
|
|
93 |
layoutContext.getFrameCommandsRecord().update(fframe,fframeAux);
|
|
94 | 94 |
fframeAux.getBoundingBox(layoutContext.getAT()); |
95 | 95 |
|
96 | 96 |
} |
97 |
layoutContext.getEFS().endComplex(PluginServices.getText(this,"change_behind"));
|
|
97 |
layoutContext.getFrameCommandsRecord().endComplex(PluginServices.getText(this,"change_behind"));
|
|
98 | 98 |
layoutContext.updateFFrames(); |
99 | 99 |
layoutContext.callLayoutDrawListeners(); |
100 | 100 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/fframes/FFrameLegend.java | ||
---|---|---|
252 | 252 |
} else if (layer instanceof Classifiable && !(layer instanceof IHasImageLegend) ) { |
253 | 253 |
Classifiable cO = (Classifiable) layer; |
254 | 254 |
|
255 |
if (cO.getLegend() instanceof IClassifiedLegend && !(cO instanceof FLyrAnnotation)) { |
|
255 |
if (cO.getLegend() instanceof IClassifiedLegend){// && !(cO instanceof FLyrAnnotation)) {
|
|
256 | 256 |
IClassifiedLegend cli = (IClassifiedLegend) cO.getLegend(); |
257 | 257 |
double dX = 0; |
258 | 258 |
double dY = n[0] * h; |
... | ... | |
528 | 528 |
Classifiable cO = (Classifiable) layer; |
529 | 529 |
n++; |
530 | 530 |
|
531 |
if (cO.getLegend() instanceof IClassifiedLegend && !(cO instanceof FLyrAnnotation)) { |
|
531 |
if (cO.getLegend() instanceof IClassifiedLegend){// && !(cO instanceof FLyrAnnotation)) {
|
|
532 | 532 |
IClassifiedLegend cli = (IClassifiedLegend) cO.getLegend(); |
533 | 533 |
|
534 | 534 |
for (int j = 0; j < cli.getValues().length; j++) { |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/gui/dialogs/FBorderDialog.java | ||
---|---|---|
634 | 634 |
fframegraphics.setBoundBox(re); |
635 | 635 |
if (symbol!=null) |
636 | 636 |
fframegraphics.setFSymbol(symbol); |
637 |
layout.getLayoutContext().getEFS().startComplex();
|
|
637 |
layout.getLayoutContext().getFrameCommandsRecord().startComplex();
|
|
638 | 638 |
layout.getLayoutContext().addFFrame(fframegraphics, false,true); |
639 | 639 |
flg.grouping(); |
640 |
layout.getLayoutContext().getEFS().endComplex(PluginServices.getText(this,"group_graphic_line"));
|
|
640 |
layout.getLayoutContext().getFrameCommandsRecord().endComplex(PluginServices.getText(this,"group_graphic_line"));
|
|
641 | 641 |
|
642 | 642 |
} |
643 | 643 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/gui/dialogs/EventsFAlign.java | ||
---|---|---|
51 | 51 |
import java.util.TreeMap; |
52 | 52 |
|
53 | 53 |
import com.iver.andami.PluginServices; |
54 |
import com.iver.cit.gvsig.project.documents.layout.commands.EditableFeatureSource; |
|
55 | 54 |
import com.iver.cit.gvsig.project.documents.layout.commands.FrameCommandsRecord; |
56 | 55 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
57 | 56 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
... | ... | |
91 | 90 |
} |
92 | 91 |
} |
93 | 92 |
|
94 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
93 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
95 | 94 |
efs.startComplex(); |
96 | 95 |
|
97 | 96 |
for (int i = fframes.length - 1; i >= 0; i--) { |
... | ... | |
113 | 112 |
private void alignLeftL() { |
114 | 113 |
double xmin = 0; |
115 | 114 |
IFFrame[] fframes = m_layout.getLayoutContext().getFFrameSelected(); |
116 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
115 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
117 | 116 |
efs.startComplex(); |
118 | 117 |
|
119 | 118 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
147 | 146 |
} |
148 | 147 |
} |
149 | 148 |
|
150 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
149 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
151 | 150 |
efs.startComplex(); |
152 | 151 |
|
153 | 152 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
171 | 170 |
xcenter = m_layout.getLayoutContext().getAtributes().m_sizePaper.getAncho() / 2; |
172 | 171 |
|
173 | 172 |
IFFrame[] fframes = m_layout.getLayoutContext().getFFrameSelected(); |
174 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
173 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
175 | 174 |
efs.startComplex(); |
176 | 175 |
|
177 | 176 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
203 | 202 |
} |
204 | 203 |
} |
205 | 204 |
|
206 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
205 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
207 | 206 |
efs.startComplex(); |
208 | 207 |
|
209 | 208 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
227 | 226 |
xmax = m_layout.getLayoutContext().getAtributes().m_sizePaper.getAncho(); |
228 | 227 |
|
229 | 228 |
IFFrame[] fframes = m_layout.getLayoutContext().getFFrameSelected(); |
230 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
229 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
231 | 230 |
efs.startComplex(); |
232 | 231 |
|
233 | 232 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
260 | 259 |
} |
261 | 260 |
} |
262 | 261 |
|
263 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
262 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
264 | 263 |
efs.startComplex(); |
265 | 264 |
|
266 | 265 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
284 | 283 |
ymax = m_layout.getLayoutContext().getAtributes().m_sizePaper.getAlto(); |
285 | 284 |
|
286 | 285 |
IFFrame[] fframes = m_layout.getLayoutContext().getFFrameSelected(); |
287 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
286 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
288 | 287 |
efs.startComplex(); |
289 | 288 |
|
290 | 289 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
316 | 315 |
} |
317 | 316 |
} |
318 | 317 |
|
319 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
318 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
320 | 319 |
efs.startComplex(); |
321 | 320 |
|
322 | 321 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
337 | 336 |
private void alignUpL() { |
338 | 337 |
double ymin = 0; |
339 | 338 |
IFFrame[] fframes = m_layout.getLayoutContext().getFFrameSelected(); |
340 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
339 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
341 | 340 |
efs.startComplex(); |
342 | 341 |
|
343 | 342 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
370 | 369 |
} |
371 | 370 |
} |
372 | 371 |
|
373 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
372 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
374 | 373 |
efs.startComplex(); |
375 | 374 |
|
376 | 375 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
394 | 393 |
ycenter = m_layout.getLayoutContext().getAtributes().m_sizePaper.getAlto() / 2; |
395 | 394 |
|
396 | 395 |
IFFrame[] fframes = m_layout.getLayoutContext().getFFrameSelected(); |
397 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
396 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
398 | 397 |
efs.startComplex(); |
399 | 398 |
|
400 | 399 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
435 | 434 |
|
436 | 435 |
double dif = xmax - xmin; |
437 | 436 |
double dist = dif / num; |
438 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
437 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
439 | 438 |
efs.startComplex(); |
440 | 439 |
|
441 | 440 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
465 | 464 |
|
466 | 465 |
double dif = xmax - xmin; |
467 | 466 |
double dist = dif / num; |
468 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
467 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
469 | 468 |
efs.startComplex(); |
470 | 469 |
|
471 | 470 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
506 | 505 |
|
507 | 506 |
double dif = xmax - xmin; |
508 | 507 |
double dist = dif / num; |
509 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
508 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
510 | 509 |
efs.startComplex(); |
511 | 510 |
|
512 | 511 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
536 | 535 |
|
537 | 536 |
double dif = xmax - xmin; |
538 | 537 |
double dist = dif / num; |
539 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
538 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
540 | 539 |
efs.startComplex(); |
541 | 540 |
|
542 | 541 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
577 | 576 |
|
578 | 577 |
double dif = ymax - ymin; |
579 | 578 |
double dist = dif / num; |
580 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
579 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
581 | 580 |
efs.startComplex(); |
582 | 581 |
|
583 | 582 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
608 | 607 |
|
609 | 608 |
double dif = ymax - ymin; |
610 | 609 |
double dist = dif / num; |
611 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
610 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
612 | 611 |
efs.startComplex(); |
613 | 612 |
|
614 | 613 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
649 | 648 |
|
650 | 649 |
double dif = ymax - ymin; |
651 | 650 |
double dist = dif / num; |
652 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
651 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
653 | 652 |
efs.startComplex(); |
654 | 653 |
|
655 | 654 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
680 | 679 |
|
681 | 680 |
double dif = ymax - ymin; |
682 | 681 |
double dist = dif / num; |
683 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
682 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
684 | 683 |
efs.startComplex(); |
685 | 684 |
|
686 | 685 |
for (int i = fframes.length - 1; i >= 0; i--) { |
... | ... | |
720 | 719 |
|
721 | 720 |
double dif = xmax - xmin; |
722 | 721 |
double dist = dif / num; |
723 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
722 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
724 | 723 |
efs.startComplex(); |
725 | 724 |
|
726 | 725 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
752 | 751 |
|
753 | 752 |
double dif = xmax - xmin; |
754 | 753 |
double dist = dif / num; |
755 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
754 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
756 | 755 |
efs.startComplex(); |
757 | 756 |
|
758 | 757 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
793 | 792 |
|
794 | 793 |
double dif = ymax - ymin; |
795 | 794 |
double dist = dif / num; |
796 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
795 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
797 | 796 |
efs.startComplex(); |
798 | 797 |
|
799 | 798 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
825 | 824 |
|
826 | 825 |
double dif = ymax - ymin; |
827 | 826 |
double dist = dif / num; |
828 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
827 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
829 | 828 |
efs.startComplex(); |
830 | 829 |
|
831 | 830 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
858 | 857 |
} |
859 | 858 |
} |
860 | 859 |
|
861 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
860 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
862 | 861 |
efs.startComplex(); |
863 | 862 |
|
864 | 863 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
889 | 888 |
} |
890 | 889 |
} |
891 | 890 |
|
892 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
891 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
893 | 892 |
efs.startComplex(); |
894 | 893 |
|
895 | 894 |
for (int i = 0; i < fframes.length; i++) { |
... | ... | |
950 | 949 |
|
951 | 950 |
double dist = total / (num - 1); |
952 | 951 |
Iterator k = treemap.keySet().iterator(); |
953 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
952 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
954 | 953 |
efs.startComplex(); |
955 | 954 |
|
956 | 955 |
if (k.hasNext()) { |
... | ... | |
1027 | 1026 |
|
1028 | 1027 |
double dist = total / (num - 1); |
1029 | 1028 |
Iterator k = treemap.keySet().iterator(); |
1030 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getEFS();
|
|
1029 |
FrameCommandsRecord efs = m_layout.getLayoutContext().getFrameCommandsRecord();
|
|
1031 | 1030 |
efs.startComplex(); |
1032 | 1031 |
|
1033 | 1032 |
if (k.hasNext()) { |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/gui/dialogs/FPositionDialog.java | ||
---|---|---|
241 | 241 |
//((IFFrame) selecList.get(0)).setBoundBox(r); |
242 | 242 |
IFFrame fframeAux=fframe.cloneFFrame(layout); |
243 | 243 |
fframeAux.setBoundBox(r); |
244 |
layout.getLayoutContext().getEFS().update(fframe,fframeAux);
|
|
244 |
layout.getLayoutContext().getFrameCommandsRecord().update(fframe,fframeAux);
|
|
245 | 245 |
layout.getLayoutContext().updateFFrames(); |
246 | 246 |
//} |
247 | 247 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutGraphics.java | ||
---|---|---|
84 | 84 |
* Transforma un FFrameLegend a FFrames de tipo FFrameSymbol y FFrameText. |
85 | 85 |
*/ |
86 | 86 |
public void simplify() { |
87 |
layout.getLayoutContext().getEFS().startComplex();
|
|
87 |
layout.getLayoutContext().getFrameCommandsRecord().startComplex();
|
|
88 | 88 |
IFFrame[] fframes=layout.getLayoutContext().getFFrames(); |
89 | 89 |
for (int i = fframes.length - 1; i >= 0; i--) { |
90 | 90 |
IFFrame fframe = fframes[i]; |
... | ... | |
95 | 95 |
} |
96 | 96 |
} |
97 | 97 |
} |
98 |
layout.getLayoutContext().getEFS().endComplex(PluginServices.getText(this,"simplify"));
|
|
98 |
layout.getLayoutContext().getFrameCommandsRecord().endComplex(PluginServices.getText(this,"simplify"));
|
|
99 | 99 |
layout.getLayoutControl().refresh(); |
100 | 100 |
} |
101 | 101 |
|
... | ... | |
143 | 143 |
* FFrames individuales. |
144 | 144 |
*/ |
145 | 145 |
public void ungrouping() { |
146 |
layout.getLayoutContext().getEFS().startComplex();
|
|
146 |
layout.getLayoutContext().getFrameCommandsRecord().startComplex();
|
|
147 | 147 |
IFFrame[] fframes=layout.getLayoutContext().getFFrames(); |
148 | 148 |
for (int i = fframes.length - 1; i >= 0; i--) { |
149 | 149 |
IFFrame fframe = fframes[i]; |
... | ... | |
167 | 167 |
} |
168 | 168 |
} |
169 | 169 |
} |
170 |
layout.getLayoutContext().getEFS().endComplex(PluginServices.getText(this,"ungroup"));
|
|
170 |
layout.getLayoutContext().getFrameCommandsRecord().endComplex(PluginServices.getText(this,"ungroup"));
|
|
171 | 171 |
layout.getLayoutControl().refresh(); |
172 | 172 |
} |
173 | 173 |
|
... | ... | |
182 | 182 |
* Posiciona los FFrames seleccionados delante de los no seleccionados. |
183 | 183 |
*/ |
184 | 184 |
public void before() { |
185 |
layout.getLayoutContext().getEFS().startComplex();
|
|
185 |
layout.getLayoutContext().getFrameCommandsRecord().startComplex();
|
|
186 | 186 |
IFFrame[] fframes=layout.getLayoutContext().getFFrames(); |
187 | 187 |
for (int i = fframes.length - 1; i >= 0; i--) { |
188 | 188 |
IFFrame fframe = fframes[i]; |
... | ... | |
193 | 193 |
|
194 | 194 |
IFFrame fframeAux=fframe.cloneFFrame(layout); |
195 | 195 |
fframeAux.setLevel(layout.getLayoutContext().getNumBefore()); |
196 |
layout.getLayoutContext().getEFS().update(fframe,fframeAux);
|
|
196 |
layout.getLayoutContext().getFrameCommandsRecord().update(fframe,fframeAux);
|
|
197 | 197 |
fframeAux.getBoundingBox(layout.getLayoutControl().getAT()); |
198 | 198 |
} |
199 | 199 |
} |
200 |
layout.getLayoutContext().getEFS().endComplex(PluginServices.getText(this,"change_before"));
|
|
200 |
layout.getLayoutContext().getFrameCommandsRecord().endComplex(PluginServices.getText(this,"change_before"));
|
|
201 | 201 |
layout.getLayoutContext().updateFFrames(); |
202 | 202 |
layout.getLayoutControl().refresh(); |
203 | 203 |
} |
... | ... | |
207 | 207 |
* seleccionados. |
208 | 208 |
*/ |
209 | 209 |
public void behind() { |
210 |
layout.getLayoutContext().getEFS().startComplex();
|
|
210 |
layout.getLayoutContext().getFrameCommandsRecord().startComplex();
|
|
211 | 211 |
IFFrame[] fframes=layout.getLayoutContext().getFFrames(); |
212 | 212 |
for (int i = fframes.length - 1; i >= 0; i--) { |
213 | 213 |
IFFrame fframe = fframes[i]; |
... | ... | |
218 | 218 |
|
219 | 219 |
IFFrame fframeAux=fframe.cloneFFrame(layout); |
220 | 220 |
fframeAux.setLevel(layout.getLayoutContext().getNumBehind()); |
221 |
layout.getLayoutContext().getEFS().update(fframe,fframeAux);
|
|
221 |
layout.getLayoutContext().getFrameCommandsRecord().update(fframe,fframeAux);
|
|
222 | 222 |
fframeAux.getBoundingBox(layout.getLayoutControl().getAT()); |
223 | 223 |
} |
224 | 224 |
} |
225 |
layout.getLayoutContext().getEFS().endComplex(PluginServices.getText(this,"change_behind"));
|
|
225 |
layout.getLayoutContext().getFrameCommandsRecord().endComplex(PluginServices.getText(this,"change_behind"));
|
|
226 | 226 |
layout.getLayoutContext().updateFFrames(); |
227 | 227 |
layout.getLayoutControl().refresh(); |
228 | 228 |
} |
... | ... | |
243 | 243 |
if (fframeAux!=null) { |
244 | 244 |
if (fframeAux instanceof IFFrameUseFMap) |
245 | 245 |
((IFFrameUseFMap)fframeAux).refresh(); |
246 |
layout.getLayoutContext().getEFS().update(frame,fframeAux);
|
|
246 |
layout.getLayoutContext().getFrameCommandsRecord().update(frame,fframeAux);
|
|
247 | 247 |
fframeAux.getBoundingBox(layout.getLayoutControl().getAT()); |
248 | 248 |
layout.getLayoutContext().updateFFrames(); |
249 | 249 |
layout.getLayoutControl().setIsReSel(true); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/ProjectDocument.java | ||
---|---|---|
284 | 284 |
* |
285 | 285 |
* @throws XMLException |
286 | 286 |
* @throws OpenException |
287 |
* @throws ReadException |
|
287 | 288 |
* @throws ReadDriverException |
288 | 289 |
*/ |
289 | 290 |
public void setXMLEntity(XMLEntity xml) |
290 |
throws XMLException, OpenException{ |
|
291 |
throws XMLException, OpenException, ReadException{
|
|
291 | 292 |
|
292 | 293 |
this.setComment(xml.getStringProperty("comment")); |
293 | 294 |
this.setCreationDate(xml.getStringProperty("creationDate")); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/Project.java | ||
---|---|---|
56 | 56 |
import java.util.TreeMap; |
57 | 57 |
|
58 | 58 |
import org.cresques.cts.IProjection; |
59 |
import org.gvsig.data.ReadException; |
|
60 |
import org.gvsig.data.WriteException; |
|
59 | 61 |
import org.gvsig.fmap.crs.CRSFactory; |
60 | 62 |
import org.gvsig.fmap.mapcontext.MapContext; |
61 | 63 |
import org.gvsig.fmap.mapcontext.ViewPort; |
... | ... | |
1437 | 1439 |
* return (ProjectMap) o; } |
1438 | 1440 |
*/ |
1439 | 1441 |
public SelectableDataSource getDataSourceByLayer(FLayer layer) |
1440 |
throws ReadDriverException {
|
|
1442 |
throws ReadException { |
|
1441 | 1443 |
ArrayList tables = getDocumentsByType(ProjectTableFactory.registerName); |
1442 | 1444 |
SelectableDataSource dataSource = null; |
1443 | 1445 |
for (int i = 0; i < tables.size(); i++) { |
... | ... | |
1494 | 1496 |
.getName(), t.getOriginal()); |
1495 | 1497 |
usedDataSources.put(ds.getName(), ds); |
1496 | 1498 |
} |
1497 |
} catch (ReadDriverException e) {
|
|
1499 |
} catch (ReadException e) { |
|
1498 | 1500 |
e.printStackTrace(); |
1499 | 1501 |
} |
1500 | 1502 |
// Ahora las vistas |
... | ... | |
1519 | 1521 |
|
1520 | 1522 |
} // for i |
1521 | 1523 |
|
1522 |
} catch (ReadDriverException e) {
|
|
1524 |
} catch (ReadException e) { |
|
1523 | 1525 |
e.printStackTrace(); |
1524 | 1526 |
} |
1525 | 1527 |
|
... | ... | |
1548 | 1550 |
|
1549 | 1551 |
} // for i |
1550 | 1552 |
|
1551 |
} catch (ReadDriverException e) {
|
|
1553 |
} catch (ReadException e) { |
|
1552 | 1554 |
e.printStackTrace(); |
1553 | 1555 |
} |
1554 | 1556 |
|
... | ... | |
1566 | 1568 |
ds.remove(); |
1567 | 1569 |
} |
1568 | 1570 |
} |
1569 |
} catch (DriverLoadException e) {
|
|
1571 |
} catch (ReadException e) {
|
|
1570 | 1572 |
e.printStackTrace(); |
1571 |
} catch (NoSuchTableException e) {
|
|
1573 |
} catch (WriteException e) {
|
|
1572 | 1574 |
e.printStackTrace(); |
1573 |
} catch (ReadDriverException e) { |
|
1574 |
e.printStackTrace(); |
|
1575 |
} catch (WriteDriverException e) { |
|
1576 |
e.printStackTrace(); |
|
1577 | 1575 |
} |
1578 | 1576 |
} |
1579 | 1577 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectFactory.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.project; |
42 | 42 |
|
43 |
import org.gvsig.fmap.drivers.writing.IEditableSource;
|
|
43 |
import org.gvsig.data.vectorial.FeatureStore;
|
|
44 | 44 |
|
45 | 45 |
import com.iver.cit.gvsig.project.documents.ProjectDocumentFactory; |
46 | 46 |
import com.iver.cit.gvsig.project.documents.layout.ProjectMap; |
... | ... | |
73 | 73 |
return pm; |
74 | 74 |
} |
75 | 75 |
|
76 |
public static ProjectTable createTable(String name, IEditableSource ies){
|
|
76 |
public static ProjectTable createTable(String name, FeatureStore fs){
|
|
77 | 77 |
ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance(); |
78 | 78 |
ExtensionPoint extPoint=((ExtensionPoint)extensionPoints.get("Documents")); |
79 | 79 |
ProjectDocumentFactory pdf=null; |
... | ... | |
85 | 85 |
e.printStackTrace(); |
86 | 86 |
} |
87 | 87 |
|
88 |
ProjectTable pt = ProjectTableFactory.createTable(name, ies);
|
|
88 |
ProjectTable pt = ProjectTableFactory.createTable(name, fs);
|
|
89 | 89 |
pt.setProjectDocumentFactory(pdf); |
90 | 90 |
return pt; |
91 | 91 |
} |
Also available in: Unified diff