Revision 26278

View differences:

tags/3D_Animation_v1_0alpha_Build_7/extensions/extAnimationGUI/config/text.properties
1
#Default language
2
#AnimationGui
3
Check_Text=Visualizaci\u00f3n frames
4
Label_Duration =Duraci\u00f3n
5
Label_Mode=Modo
6
Window_Title=Controles de animaci\u00f3n
7
Text_Secs=segs
8
Capturar_encuadre=Capturar encuadre
9
Capturar_capa=Capturar capa
10
Controles_de_animacion=Controles de animaci\u00f3n
11
Exportar_video=Exportar v?deo
12
Borrar_animacion=Borrar animaci\u00f3n
13
Animacion=Animaci\u00f3n
14
Crear_animacion_trans=Crear animaci\u00f3n con transparencias
15
no_views=Ninguna vista abierta
16
no_layers=Ninguna capa en la vista
17
Animacion_vacia2=Animaci\u00f3n sin vistas asignadas
18
Animacion_de_transparencias=Animaci\u00f3n de transparencias
19
Animacion_sin_vistas_incluidas=Animaci\u00f3n sin vistas incluidas
20
Capturar_fotograma=Capturar fotograma
21
Player=Player
22
Borrar_animacion=Borrar animaci\u00f3n
23
Vista_a_animar=Vista a animar
24
Modo_de_reproduccion=Modo de reproducci\u00f3n
25
Duracion_de_la_animacion=Duraci\u00f3n de la animaci\u00f3n
26
Grabar_animacion=Grabar animaci\u00f3n
27
Stop=Stop
28
Play=Play
29
Pause=Pause
30
Vista_animada_info=Vista animada, no se puede relacionar con otro documento de animaci\u00f3n
31
Vista_animada_titulo=animada
32
Animacion_en_curso_info=Animaci\u00f3n en curso. Para a\u00f1adir keyframes, parar antes la animaci\u00f3n
33
Animacion_en_curso_info2=Animaci\u00f3n
34
Animacion_en_curso_titulo=en curso
35
Animacion_borrar_info=Animaci?n en curso, para borrar parar antes la animaci\u00f3n
36
Animacion_borrar_titulo=Animaci\u00f3n en curso
37
No_vistas_info=Animaci\u00f3n
38
No_vistas_info2=sin ninguna vista asociada
39
No_vistas_titulo=Animaci\u00f3n vac?a
40
Closed_views_info=Ninguna vista abierta para aplicarle animaci?n por transparencias
41
Closed_views_titulo=Vistas cerradas
42
Closed_views_titulo2=Ninguna vista abierta para la captura de fotogramas en
43
Mensaje_capas_info=Selecciona las capas en el TOC para aplicarles transparencia
44
Mensaje_capas_titulo=Capas no seleccionadas
45
Loop_mode=Modo salto
46
Ping_pong_loop=Ping pong
47
Play_once=Reproducir una vez
48
Loop_once_backwards=Hacia atr?s una vez
49
Project_animation_document=Animaci\u00f3n
50
seconds=(segundos)
tags/3D_Animation_v1_0alpha_Build_7/extensions/extAnimationGUI/config/about.htm
1
<html>
2
  <head>
3
    <title>Extension 3D del programa GvSIG </title>
4
    <meta content="">
5
    <style></style>
6
  </head>
7
  <body>
8
<table width="60%" border="0">
9
  <tr>
10
    <td width="64%"><img src="images/logo_horiz_bicolor_gva.png" width="329" height="50"></td>
11
    <td width="36%"><div align="right"><img src="images/logoIver.png" width="87" height="50"></div></td>
12
  </tr>
13
  <tr>
14
    <td colspan="2"><font face="Arial, Helvetica, sans-serif">&copy; Copyright
15
      Generalitat Valenciana, IVER T.I and other contributors 2005.</font></td>
16
  </tr>
17
</table>
18
  <h3>Extesi&oacute;n de la Aplicaci&oacute;n para el tratamiento de top&oacute;nimos del Instituto Geogr&aacute;fico Nacional</h3>
19
  <p><br><br><b> Build Number: #build.number#</b></p>
20
  </body>
21
</html>
tags/3D_Animation_v1_0alpha_Build_7/extensions/extAnimationGUI/config/text_ca.properties
1
#Translations for language [ca]
2
#AnimationGui
3
Check_Text=Visualizaci?n frames
4
Label_Duration =Duraci?n
5
Label_Mode=Modo
6
Window_Title=Controles de animaci?n
7
Text_Secs=segs
8
Capturar_encuadre=Capturar encuadre
9
Capturar_capa=Capturar capa
10
Controles_de_animacion=Controles de animaci?n
11
Exportar_video=Exportar v?deo
12
Borrar_animacion=Borrar animaci?n
13
Animacion=Animaci?n
14
Crear_animacion_trans=Crear animaci?n con transparencias
tags/3D_Animation_v1_0alpha_Build_7/extensions/extAnimationGUI/config/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="com.iver.cit.gvsig" />
4
	<depends plugin-name="org.gvsig.ext3Dgui" />
5
	<depends plugin-name="org.gvsig.extAnimation3D" />
6
	<depends plugin-name="org.gvsig.extAnimation2D" />
7
	<depends plugin-name="org.gvsig.extAnimationCommon" />
8
	<libraries library-dir="./lib" />
9
	<resourceBundle name="text" />
10
	<extensions>
11
		<extension class-name="com.iver.ai2.animationgui.gui.AnimationDocumentRegister"
12
			description="Shows a Animation" active="true" priority="50">
13
			<tool-bar name="Tools3D">
14
				<selectable-tool icon="images/reproductoranim/pause.png"
15
					action-command="SHOW3D" tooltip="show_animation_document" />
16
			</tool-bar>
17
		</extension>
18
		<extension
19
			class-name="com.iver.ai2.animationgui.gui.MenuAnimation3D"
20
			description="Extensi?n encargada de abrir el menu de animaci?n 3D."
21
			active="true" priority="40">
22
		</extension>
23
		<extension
24
			class-name="com.iver.ai2.animationgui.gui.MenuAnimationTransparency"
25
			description="Extensi?n encargada de abrir el menu de animaci?n 3D."
26
			active="true" priority="40">
27
		</extension>
28
	</extensions>
29
</plugin-config>
tags/3D_Animation_v1_0alpha_Build_7/extensions/extAnimationGUI/build.number
1
#Build Number for ANT. Do not edit!
2
#Wed Jan 16 11:54:01 CET 2008
3
build.number=1209
tags/3D_Animation_v1_0alpha_Build_7/extensions/extAnimationGUI/src/com/iver/ai2/animationgui/gui/AnimationContol3D.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 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
package com.iver.ai2.animationgui.gui;
20

  
21
import java.awt.Checkbox;
22
import java.awt.GridBagConstraints;
23
import java.awt.Insets;
24
import java.awt.event.ActionEvent;
25
import java.awt.event.ActionListener;
26
import java.awt.event.FocusEvent;
27
import java.awt.event.FocusListener;
28
import java.awt.event.ItemEvent;
29
import java.awt.event.ItemListener;
30
import java.awt.event.KeyEvent;
31
import java.awt.event.KeyListener;
32
import java.net.URL;
33
import java.util.ArrayList;
34
import java.util.Iterator;
35
import java.util.List;
36

  
37
import javax.swing.ImageIcon;
38
import javax.swing.JButton;
39
import javax.swing.JComboBox;
40
import javax.swing.JLabel;
41
import javax.swing.JOptionPane;
42
import javax.swing.JPanel;
43
import javax.swing.JTextField;
44

  
45
import org.gvsig.gui.beans.swing.GridBagLayoutPanel;
46
import org.gvsig.gvsig3dgui.view.View3D;
47
import org.gvsig.osgvp.planets.PlanetViewer;
48

  
49
import com.iver.ai2.gvsig3d.resources.ResourcesFactory;
50
import com.iver.andami.PluginServices;
51
import com.iver.cit.gvsig.animation.AnimationPlayer;
52
import com.iver.cit.gvsig.project.documents.view.gui.BaseView;
53

  
54
/**
55
 * @author ?ngel Fraile Gri??n  e-mail: angel.fraile@iver.es
56
 * @since 1.1
57
 * 
58
 * Class to create and to process the event's panel animation.
59
 */
60

  
61
public class AnimationContol3D extends GridBagLayoutPanel implements
62
		ActionListener, KeyListener, ItemListener, FocusListener {
63

  
64
	/**
65
	 * default static final serial version ID
66
	 */
67
	private static final long serialVersionUID = 1L;
68

  
69
	private int operation; // Used in choice's functions
70

  
71
	private JLabel label = null;
72

  
73
	private JLabel label2 = null;
74
	
75
	private JLabel label3 = null;
76

  
77
	private JTextField textosegs = null;
78

  
79
	private JComboBox choice = null;
80

  
81
	private JButton buttonIcon = null;
82

  
83
	private JButton buttonIcon1 = null;
84

  
85
	private JButton buttonIcon2 = null;
86

  
87
	private JButton buttonIcon3 = null;
88

  
89
	private ImageIcon image = null;
90

  
91
	private ImageIcon image1 = null;
92

  
93
	private ImageIcon image2 = null;
94

  
95
	private ImageIcon image3 = null;
96

  
97
	private Checkbox checkbox = null;
98

  
99
	private String buttonPath;
100

  
101
	private double globalTime;
102

  
103
	private AnimationPlayer animationPlayer;
104

  
105
	private int animationMode;
106

  
107
	private boolean playFlag = false;
108

  
109
	private boolean pauseFlag = false;
110

  
111
	private StateUpdate runnable;
112

  
113
	private ArrayList<WindowClosedListener> actionCommandListeners = new ArrayList<WindowClosedListener>();
114

  
115
	private List<BaseView> viewListAdded =  new ArrayList<BaseView>();
116
	
117

  
118
	/**
119
	 * Default constructor.
120
	 * 
121
	 * @param animationPlayer: player associate
122
	 */
123
	public AnimationContol3D(AnimationPlayer animationPlayer) {
124

  
125
		this.animationPlayer = animationPlayer;
126
		this.animationPlayer.setAnimationPlayerState(AnimationPlayer.ANIMATION_INITIAL);
127

  
128
		// Setting up the button path
129
		String oldPath = ResourcesFactory.getExtPath();// Save the path.
130
		ResourcesFactory
131
				.setExtPath("/gvSIG/extensiones/com.iver.ai2.animationgui.gui/images/reproductoranim/");
132
		ResourcesFactory.setExtPath("/images/reproductoranim/");// my new path
133
		buttonPath = ResourcesFactory.getResourcesPath();
134
		URL path;
135
		path = this.getClass().getClassLoader().getResource("images/reproductoranim/");
136
		buttonPath = path.getPath(); 
137
		ResourcesFactory.setExtPath(oldPath);// Restore the old path.
138
		System.out.println(oldPath);
139
		System.out.println(buttonPath);
140

  
141
		initialize();
142
	}
143

  
144
	/*
145
	 * Panel creation.
146
	 * 
147
	 */
148
	private void initialize() {
149
		// Bag where have declared the characteristic of a Component in the
150
		// panel.
151
		GridBagConstraints c;
152

  
153
		/*
154
		 * gridx: column position in grid gridy: row position in grid anchor:
155
		 * bottom of space
156
		 */
157

  
158
		// Creation of four buttons: play, stop, pause y record.
159
		c = new GridBagConstraints();
160
		c.gridx = 0;
161
		c.gridy = 0;
162
		c.insets = new Insets(2, 5, 2, 2);
163

  
164
		this.add(getPlayButton(), c);
165

  
166
		c = new GridBagConstraints();
167
		c.gridx = 1;
168
		c.gridy = 0;
169
		c.insets = new Insets(2, 2, 2, 2);
170
		this.add(getPauseButton(), c);
171

  
172
		c = new GridBagConstraints();
173
		c.gridx = 2;
174
		c.gridy = 0;
175
		c.insets = new Insets(2, 2, 2, 2);
176
		this.add(getStopButton(), c);
177

  
178
		c = new GridBagConstraints();
179
		c.gridx = 3;
180
		c.gridy = 0;
181
		c.gridwidth = 2;
182
		c.fill = GridBagConstraints.BOTH;
183
		c.insets = new Insets(2, 2, 2, 5);
184
		this.add(getRecButton(), c);
185

  
186
		// Space between rows.
187
		c = new GridBagConstraints();
188
		c.insets = new Insets(2, 5, 2, 2);
189
		c.gridx = 1;
190
		c.gridy = 1;
191
		c.anchor = GridBagConstraints.WEST;
192
		this.add(getLabelDuration(), c);
193

  
194
		// textField to introduce the duration of the movie in seconds or
195
		// frames.
196
		c = new GridBagConstraints();
197
		c.insets = new Insets(2, 2, 2, 5);
198
		c.gridx = 2;
199
		c.gridy = 1;
200
		c.gridwidth = 1;
201
		c.anchor = GridBagConstraints.WEST;
202
		c.fill = GridBagConstraints.BOTH;
203
		this.add(getSeconds(), c);
204

  
205
		c = new GridBagConstraints();
206
		c.insets = new Insets(2, 2, 2, 5);
207
		c.gridx = 3;
208
		c.gridy = 1;
209
		c.gridwidth = 1;
210
		c.anchor = GridBagConstraints.WEST;
211
		c.fill = GridBagConstraints.BOTH;
212
		this.add(getLabelSeconds(), c);
213
		
214
		// checkbox for the provisional selection of video in seconds or frames.
215
		// c.gridx = 3;
216
		// c.gridy = 1;
217
		// c.gridwidth = 2;
218
		// c.anchor = GridBagConstraints.EAST;
219
		// this.add(getJCheckBox(), c);
220

  
221
		c = new GridBagConstraints();
222
		c.insets = new Insets(2, 5, 2, 2);
223
		c.gridx = 1;
224
		c.gridy = 3;
225
		c.anchor = GridBagConstraints.WEST;
226
		this.add(getLabelMode(), c);
227
		
228
		
229
		// choice for mode player selection.
230
		c = new GridBagConstraints();
231
		c.insets = new Insets(2, 2, 5, 5);
232
		c.gridx = 2;
233
		c.gridy = 3;
234
		c.anchor = GridBagConstraints.WEST;
235
		c.fill = GridBagConstraints.BOTH;
236
		c.gridwidth = 3;
237
		this.add(getChoiceValue(), c);
238
		choice.setSelectedIndex(this.animationPlayer.getAnimationMode());
239
		
240
		c = new GridBagConstraints();
241
		c.insets = new Insets(0, 0, 0, 0);
242
		c.gridx = 0;
243
		c.gridy = 3;
244
		c.gridwidth = 5;
245
		c.weightx = 1.0;
246
		c.weighty = 1.0;
247
		this.add(new JPanel(), c);
248

  
249
		setGlobalTime(this.animationPlayer.getGlobalTime() / 1000);
250

  
251
	}
252

  
253
	/**
254
	 * 
255
	 * @return JLabel.
256
	 */
257
	private JLabel getLabelMode() {
258
		label2 = new JLabel(PluginServices.getText(this, "Label_Mode"));
259
		label2.setToolTipText(PluginServices.getText(this, "Modo_de_reproduccion"));
260
		return label2;
261
	}
262

  
263
	/**
264
	 * 
265
	 * @return JLabel.
266
	 */
267
	private JLabel getLabelDuration() {
268
		label = new JLabel(PluginServices.getText(this, "Label_Duration"));
269
		label.setToolTipText(PluginServices.getText(this, "Duracion_de_la_animacion"));
270
		return label;
271
	}
272

  
273
	private JLabel getLabelSeconds() {
274
		label3 = new JLabel(PluginServices.getText(this, "seconds"));
275
		return label3;
276
	}
277
	
278
	/**
279
	 * @return Choice. Return the choice with the different modes of display.
280
	 */
281
	private JComboBox getChoiceValue() {
282
		if (choice == null) {
283
			choice = new JComboBox();
284
			choice.addItem(PluginServices.getText(this, "Loop_mode"));
285
			choice.addItem(PluginServices.getText(this,"Ping_pong_loop"));
286
			choice.addItem(PluginServices.getText(this,"Play_once"));
287
			choice.addItem(PluginServices.getText(this,"Loop_once_backwards"));
288
			choice.addItemListener(this);
289
			choice.setToolTipText(PluginServices.getText(this, "Modo_de_reproduccion"));
290
		}
291
		return choice;
292
	}
293

  
294
	/**
295
	 * @return TextField. Return textfield where the user put the seconds of the
296
	 *         movie.
297
	 */
298
	private JTextField getSeconds() {
299
		if (textosegs == null) {
300
			textosegs = new JTextField(PluginServices
301
					.getText(this, "Text_Secs"), 4);
302
			textosegs.setName("SECONDS");
303
			textosegs.setHorizontalAlignment(JTextField.RIGHT);
304
			textosegs.addKeyListener(this);
305
			textosegs.addFocusListener(this);
306
			textosegs.setToolTipText(PluginServices.getText(this, "Duracion_de_la_animacion"));
307
		}
308
		return textosegs;
309
	}
310

  
311
	/**
312
	 * @return JButton. Return record button.
313
	 */
314
	private JButton getRecButton() {
315
		if (buttonIcon3 == null) {
316
			buttonIcon3 = new JButton();
317
			// path where are the image to load in the button.
318
			image3 = new ImageIcon(buttonPath + "/record.png");
319
			buttonIcon3.setIcon(image3);
320
			buttonIcon3.setActionCommand("REC");
321
			buttonIcon3.addActionListener(this);
322
			buttonIcon3.setToolTipText(PluginServices.getText(this, "Grabar_animacion"));
323
		}
324
		return buttonIcon3;
325
	}
326

  
327
	/**
328
	 * @return JButton. Return stop button.
329
	 */
330
	private JButton getStopButton() {
331
		if (buttonIcon2 == null) {
332
			buttonIcon2 = new JButton();
333
			image2 = new ImageIcon(buttonPath + "/stop.png");
334
			buttonIcon2.setIcon(image2);
335
			buttonIcon2.setActionCommand("STOP");
336
			buttonIcon2.addActionListener(this);
337
			buttonIcon2.setToolTipText(PluginServices.getText(this, "Stop"));
338
		}
339
		return buttonIcon2;
340
	}
341

  
342
	/**
343
	 * @return JButton. Return pause button.
344
	 */
345
	private JButton getPauseButton() {
346
		if (buttonIcon1 == null) {
347
			buttonIcon1 = new JButton();
348
			image1 = new ImageIcon(buttonPath + "/pause.png");
349
			buttonIcon1.setIcon(image1);
350
			buttonIcon1.setActionCommand("PAUSE");
351
			buttonIcon1.addActionListener(this);
352
			buttonIcon1.setToolTipText(PluginServices.getText(this, "Pause"));
353
		}
354
		return buttonIcon1;
355
	}
356

  
357
	/**
358
	 * @return JButton. Return play button.
359
	 */
360
	public JButton getPlayButton() {
361
		if (buttonIcon == null) {
362
			buttonIcon = new JButton();
363
			image = new ImageIcon(buttonPath + "/play.png");
364
			buttonIcon.setIcon(image);
365
			buttonIcon.setActionCommand("PLAY");
366
			buttonIcon.addActionListener(this);
367
			buttonIcon.setIcon(image);
368
			buttonIcon.setToolTipText(PluginServices.getText(this, "Play"));
369
		
370
		}
371
		return buttonIcon;
372
	}
373
	
374
	/**
375
	 * 
376
	 * @param viewListAdded: open views list
377
	 */
378
	
379
	public void setViewListAdded(List<BaseView> viewListAdded) {
380
		this.viewListAdded = viewListAdded;
381
	}
382

  
383

  
384
	/**
385
	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
386
	 *      logic events of pressed buttons.
387
	 */
388
	public void actionPerformed(ActionEvent arg0) {
389
		String actionCommand = arg0.getActionCommand();
390
		
391
		if (actionCommand.equals("PLAY")) { // play pressed
392
			
393
			if(this.animationPlayer.getAnimationContainer().isEmpty())
394
			{
395
				JOptionPane.showMessageDialog(null,PluginServices.getText(this,"Animacion_sin_vistas_incluidas"),
396
						"Animaci?n vacia", JOptionPane.WARNING_MESSAGE);
397
				return;
398
			}
399
			
400
			if (runnable == null) {
401
				runnable = new StateUpdate();
402
				// Create the thread supplying it with the runnable object
403
				Thread thread = new Thread(runnable);
404
				// Start the thread
405
				thread.start();
406
			}
407
			
408
			Iterator<BaseView> iter = viewListAdded.iterator();
409
			while (iter.hasNext()) {
410
				Object object = iter.next();
411
				if (object instanceof View3D){
412
					((View3D) object).getCanvas3d().getOSGViewer().setCameraManipulator(null);
413
				}
414
			}
415
			
416
			this.animationPlayer.play();
417
			playFlag = true;
418
			if (this.animationPlayer.getAnimationPlayerState() == AnimationPlayer.ANIMATION_PLAY) {
419
				image = new ImageIcon(buttonPath + "/playon.png");
420
				buttonIcon.setIcon(image);
421
			
422
				if (pauseFlag) {
423
					image1 = new ImageIcon(buttonPath + "/pause.png");
424
					buttonIcon1.setIcon(image1);
425
				}
426

  
427
			}
428

  
429
		} else if (actionCommand.equals("PAUSE")) { // pause pressed
430

  
431
			this.animationPlayer.pause();
432
			if (this.animationPlayer.getAnimationPlayerState() == AnimationPlayer.ANIMATION_PAUSE
433
					&& playFlag) {
434
				playFlag = false;
435
				pauseFlag = true;
436
				image = new ImageIcon(buttonPath + "/play.png");
437
				buttonIcon.setIcon(image);
438
				image1 = new ImageIcon(buttonPath + "/pauseon.png");
439
				buttonIcon1.setIcon(image1);
440
			}
441
		} else if (actionCommand.equals("STOP")) {
442

  
443
			Iterator<BaseView> iter = viewListAdded.iterator();
444
			while (iter.hasNext()) {
445
				Object object = iter.next();
446
				if (object instanceof View3D){
447
					((PlanetViewer) ((View3D) object).getCanvas3d().getOSGViewer()).restoreCustomTerrainManipulator();
448
				}
449
			}
450
			
451
			animationPlayer.stop();
452
			if (runnable != null)
453
				runnable.end();
454
			if (this.animationPlayer.getAnimationPlayerState() == AnimationPlayer.ANIMATION_STOP
455
					&& (playFlag || pauseFlag)) {
456

  
457
				if (playFlag) {
458
					image = new ImageIcon(buttonPath + "/play.png");
459
					buttonIcon.setIcon(image);
460
					playFlag = false;
461
				} else {
462
					image1 = new ImageIcon(buttonPath + "/pause.png");
463
					buttonIcon1.setIcon(image1);
464
					pauseFlag = false;
465
				}
466
			}
467
		
468
		} else if (actionCommand.equals("REC")) {
469
			animationPlayer.record();
470
			JOptionPane.showMessageDialog(null, "Opci?n no disponible",
471
					"Alertas de prueba", JOptionPane.WARNING_MESSAGE);
472

  
473
		}// if
474
	}// public void
475

  
476
	/*
477
	 * @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent)
478
	 * 
479
	 */
480
	public void keyPressed(KeyEvent arg0) {
481
		// TODO Auto-generated method stub
482
	}
483

  
484
	/**
485
	 * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
486
	 *      Events when you put the film�s seconds in the animation panel.
487
	 */
488
	public void keyReleased(KeyEvent arg0) {
489
//		System.out.println("valor del campo segundos: "
490
//				+ this.textosegs.getText());
491
		try {
492
			globalTime = new Double(this.textosegs.getText()).doubleValue();
493
		}
494
		catch (Exception e) {
495
		}
496
		this.animationPlayer.setGlobalTime(globalTime);
497
	}
498

  
499
	/*
500
	 * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
501
	 */
502
	public void keyTyped(KeyEvent arg0) {
503
		// TODO Auto-generated method stub
504
	}
505

  
506
	/**
507
	 * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
508
	 *      ItemListener methods.
509
	 */
510
	public void itemStateChanged(ItemEvent event) {
511
		Object obj = event.getSource();
512
		if (obj == choice) {
513
			operation = choice.getSelectedIndex(); // get select item.
514
			setMode(operation);
515
		} else if (obj == checkbox) {
516
			System.out.println("opcion seleccionada checkbox");
517
		}
518
	}
519

  
520
	/*
521
	 * Player options modes. 
522
	 */
523
	private void setMode(int option) {
524

  
525
		if (option == 2) {
526
			animationMode = AnimationPlayer.PLAY_ONCE;
527
		} else if (option == 0) {
528
			animationMode = AnimationPlayer.LOOP;
529
		} else if (option == 3) {
530
			animationMode = AnimationPlayer.PLAY_ONCE_BACKWARDS;
531
		} else if (option == 1)
532
			animationMode = AnimationPlayer.PING_PONG_LOOP;
533
		
534
		this.animationPlayer.setAnimationMode(animationMode);
535

  
536
		//System.out.println("opcion: " + mode);
537
	}
538

  
539
	public void setGlobalTime(double time) {
540
		textosegs.setText(Double.toString(time));
541
	}
542

  
543
	/*
544
	 * Class to control the automatically stop state of the actual animation.
545
	 */
546

  
547
	public class StateUpdate implements Runnable {
548

  
549
		private boolean finish = false;
550

  
551
		public void run() {
552

  
553
			while (true) {
554
				try {
555
					Thread.sleep(800);
556
					synchronized (this) {
557
						if (finish) {
558
							Iterator<BaseView> iter = viewListAdded.iterator();
559
							while (iter.hasNext()) {
560
								Object object = iter.next();
561
								if (object instanceof View3D){
562
									((PlanetViewer) ((View3D) object).getCanvas3d().getOSGViewer()).restoreCustomTerrainManipulator();
563
								}
564
							}
565
							break;
566
						}
567
					}
568
				} catch (InterruptedException e) {
569

  
570
					e.printStackTrace();
571
				}
572
				
573
				if (animationPlayer.getAnimationPlayerState() == AnimationPlayer.ANIMATION_STOP
574
						&& (playFlag || pauseFlag)) {
575

  
576
					if (playFlag) {
577
						image = new ImageIcon(buttonPath + "/play.png");
578
						buttonIcon.setIcon(image);
579
						playFlag = false;
580
					} else {
581
						image1 = new ImageIcon(buttonPath + "/pause.png");
582
						buttonIcon1.setIcon(image1);
583
						pauseFlag = false;
584
					}
585
					runnable.end();
586
				}// long if
587
			}
588
		}
589

  
590
		/*
591
		 * function to stop the thread.
592
		 */
593

  
594
		public synchronized void end() {
595
			finish = true;
596
			runnable = null;
597
		}
598
	}// end class StateUpdate.
599

  
600
	/**
601
	 * Add a listener in a event list
602
	 * @param listener
603
	 */
604
	public void addWindowClosedListener(WindowClosedListener listener) {
605
		if (!actionCommandListeners.contains(listener))
606
			actionCommandListeners.add(listener);
607
	}
608
	
609
	/**
610
	 * Clear a listener in a event list
611
	 * @param listener
612
	 */
613
	public void removeWindowClosedListener(WindowClosedListener listener) {
614
		actionCommandListeners.remove(listener);
615
	}
616

  
617
	public void focusGained(FocusEvent e) {
618
		// TODO Auto-generated method stub
619
	}
620

  
621
	public void focusLost(FocusEvent e) {
622
		textosegs.setText(Double.toString(globalTime));
623
	}
624
}
tags/3D_Animation_v1_0alpha_Build_7/extensions/extAnimationGUI/src/com/iver/ai2/animationgui/gui/toc/AnimationDateModePanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 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

  
20
package com.iver.ai2.animationgui.gui.toc;
21

  
22
import java.awt.Choice;
23
import java.awt.Dimension;
24
import java.awt.GridBagConstraints;
25
import java.awt.Insets;
26
import java.awt.event.ActionListener;
27
import java.awt.event.ItemEvent;
28
import java.awt.event.ItemListener;
29

  
30
import org.gvsig.gui.beans.swing.GridBagLayoutPanel;
31
import org.gvsig.gui.beans.swing.JButton;
32

  
33
import com.iver.andami.PluginServices;
34
import com.iver.andami.ui.mdiManager.SingletonWindow;
35
import com.iver.andami.ui.mdiManager.WindowInfo;
36
import com.iver.cit.gvsig.animation.IAnimationType;
37

  
38
/**
39
 * Dialogo donde se muestran las propiedades de una vista
40
 * 
41
 * @author Fernando Gonz?lez Cort?s
42
 */
43
public class AnimationDateModePanel extends GridBagLayoutPanel implements
44
		SingletonWindow, ItemListener{
45

  
46

  
47
	/**
48
	 * 
49
	 */
50
	private static final long serialVersionUID = 1L;
51

  
52
	private int width = 250;
53

  
54
	private int height = 100;
55

  
56
	private GridBagLayoutPanel okCancelPanel;
57

  
58
	private JButton okButton;
59
	
60
	private Choice choice = null;
61

  
62
	private int animationMode;
63

  
64
	private int operation;
65

  
66
	private IAnimationType animationDay;
67

  
68
	/**
69
	 * This is the default constructor
70
	 * @param animationType 
71
	 * 
72
	 */
73
	public AnimationDateModePanel(IAnimationType animationType) {
74

  
75
		animationDay = animationType;
76
		initialize();
77

  
78
	}
79

  
80
	/**
81
	 * This method initializes the panel
82
	 */
83
	private void initialize() {
84
		
85
		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
86
		gridBagConstraints1.fill = GridBagConstraints.VERTICAL;
87
		gridBagConstraints1.gridy = 2;
88
		gridBagConstraints1.weightx = 1.0;
89
		gridBagConstraints1.gridx = 1;
90
		GridBagConstraints gridBagConstraints = new GridBagConstraints();
91
		gridBagConstraints.gridx = 1;
92
		gridBagConstraints.gridheight = 2;
93
		gridBagConstraints.gridwidth = 2;
94
		gridBagConstraints.insets = new Insets(15, 0, 0, 0);
95
		gridBagConstraints.gridy = 3;
96
		
97
		this.add(getChoiceValue(), gridBagConstraints1);
98
		this.add(getOkCancelPanel(),gridBagConstraints);
99
		
100
		setName(PluginServices.getText(this, "Transparency"));
101
		this.setPreferredSize(new Dimension(width, height));
102
		this.setSize(new Dimension(width, height));
103

  
104
	}
105

  
106
	
107
	private Choice getChoiceValue() {
108
		// TODO Auto-generated method stub
109
		if (choice == null) {
110
			choice = new Choice();
111
			// choice.addItem( textopru );
112
			choice.addItem("Intervalo");
113
			choice.addItem("Incremental");
114
			choice.addItem("Decremental");
115
			// choice.addItem( "modo3" );
116
			// choice.addItem( "modo4" );
117
			choice.addItemListener(this);
118
		}
119
		return choice;
120
	}
121

  
122

  
123
	private GridBagLayoutPanel getOkCancelPanel() {
124
		if (okCancelPanel == null) {
125
			ActionListener okAction;
126
			okAction = new java.awt.event.ActionListener() {
127
				public void actionPerformed(java.awt.event.ActionEvent e) {
128
					
129
//					animationDay.setFilterMode(animationMode);
130
					PluginServices.getMDIManager().closeWindow(
131
							AnimationDateModePanel.this);
132
				}
133
			};
134
			okCancelPanel = new GridBagLayoutPanel();
135
			okCancelPanel.setAlignmentX(GridBagLayoutPanel.RIGHT_ALIGNMENT);
136
			okButton = new JButton();
137
			okButton.setText("Aceptar");
138
			okButton.addActionListener(okAction);
139

  
140
			okCancelPanel.addComponent(okButton);
141
		}
142
		return okCancelPanel;
143
	}
144

  
145
	
146
	/**
147
	 * 
148
	 * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
149
	 * @return WindowInfo: window parameters
150
	 */
151

  
152
	public WindowInfo getWindowInfo() {
153
		WindowInfo m_viewinfo = new WindowInfo();
154
		m_viewinfo.setTitle(PluginServices.getText(this, "Transparency"));
155
		m_viewinfo.setHeight(height);
156
		m_viewinfo.setWidth(width);
157
		return m_viewinfo;
158
	}
159

  
160
	public Object getWindowModel() {
161
		return null;
162
	}
163

  
164
	public void itemStateChanged(ItemEvent event) {
165
		Object obj = event.getSource();
166
		if (obj == choice) {
167
			operation = choice.getSelectedIndex(); // get select item.
168
			getMensaje(operation);
169
		} 
170
		
171
	}
172
	private void getMensaje(int option) {
173
		String mode = choice.getItem(option);
174
//		if (mode.equals("Intervalo")) {
175
//			animationMode = DateFilter.BOTH;
176
//		} else if (mode.equals("Incremental")) {
177
//			animationMode = DateFilter.BEFORE_BEGIN;
178
//		} else if (mode.equals("Decremental")) {
179
//			animationMode = DateFilter.AFTER_END;
180
//		}
181
		System.out.println("opcion: " + mode);
182
	}
183

  
184
	public Object getWindowProfile() {
185
		// TODO Auto-generated method stub
186
		return WindowInfo.TOOL_PROFILE;
187
	}
188

  
189

  
190
}
tags/3D_Animation_v1_0alpha_Build_7/extensions/extAnimationGUI/src/com/iver/ai2/animationgui/gui/toc/TocAnimationDate.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 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

  
20
package com.iver.ai2.animationgui.gui.toc;
21

  
22
import java.sql.Date;
23

  
24
import com.iver.andami.PluginServices;
25
import com.iver.andami.plugins.IExtension;
26
import com.iver.andami.ui.mdiManager.IWindow;
27
import com.iver.cit.gvsig.ProjectExtension;
28
import com.iver.cit.gvsig.animation.AnimationContainer;
29
import com.iver.cit.gvsig.animation.IAnimationType;
30
import com.iver.cit.gvsig.animation.interval.AnimationDatedInterval;
31
import com.iver.cit.gvsig.animation.traks.AnimationDatedTrack;
32
import com.iver.cit.gvsig.animation.traks.IAnimationTrack;
33
import com.iver.cit.gvsig.fmap.MapContext;
34
import com.iver.cit.gvsig.fmap.layers.FLayer;
35
import com.iver.cit.gvsig.project.Project;
36
import com.iver.cit.gvsig.project.documents.view.IProjectView;
37
import com.iver.cit.gvsig.project.documents.view.gui.BaseView;
38
import com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction;
39
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem;
40
import com.iver.utiles.extensionPoints.ExtensionPoint;
41
import com.iver.utiles.extensionPoints.ExtensionPoints;
42
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
43

  
44
public class TocAnimationDate extends AbstractTocContextMenuAction {
45

  
46
	private AnimationDatedTrack adt;
47
	
48
	FLayer layer;
49

  
50
	public String getGroup() {
51
		return "group6"; // FIXME
52
	}
53

  
54
	public int getGroupOrder() {
55
		return 60;
56
	}
57

  
58
	public int getOrder() {
59
		return 10;
60
	}
61

  
62
	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
63
		// return selectedItems.length == 1;
64

  
65
		// return true;
66

  
67
		boolean enable = false;
68

  
69
		if (selectedItems.length > 0)
70
			enable = true;
71

  
72
		return enable;
73

  
74
	}
75

  
76
	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
77
		// return true;
78
		com.iver.andami.ui.mdiManager.IWindow f = PluginServices
79
				.getMDIManager().getActiveWindow();
80

  
81
		if (f == null) {
82
			return false;
83
		}
84

  
85
		if (!isTocItemBranch(item))
86
			return false;
87

  
88
		BaseView vista = (BaseView) f;
89
		
90
		IProjectView model = vista.getModel();
91
		MapContext mapa = model.getMapContext();
92
	
93
		return mapa.getLayers().getLayersCount() > 0;
94
	}
95

  
96
	public void execute(ITocItem item, FLayer[] selectedItems) {
97
		System.out
98
				.println("MENU CONTEXTUAL DE GENERACION DE ANIMACIONES DE FECHAS");
99

  
100
//		// Getting view3
101
//		com.iver.andami.ui.mdiManager.IWindow view = PluginServices
102
//				.getMDIManager().getActiveWindow();
103
//		BaseView vista3D =  (BaseView) view;
104
//		 MapControl model = (MapControl)vista3D.getModel();
105
//		model.setEnabled(true);
106
		
107
		layer = selectedItems[0];
108
		
109
		// Generate animation using filters
110
		generateAniamtionDate();
111
		
112
		// introducir layer
113
		
114
//		this.adt.setAnimatedObject(layer);
115
		// Show the animation control player
116
//		AnimationDateModePanel = new AnimationDateModePanel();
117
//		AnimationDateModePanel.setModal(true);
118
//		AnimationDateModePanel.pack();
119
//		AnimationDateModePanel.setVisible(true);
120
		
121
		
122
		AnimationDateModePanel fp = new AnimationDateModePanel(adt.getAnimationType());
123
		PluginServices.getMDIManager().addWindow((IWindow) fp);
124
		
125
		
126
	}
127

  
128
	public String getText() {
129
		// Name that appears in toc menu
130
		return "Animacion de fecha";
131
	}
132

  
133
	private Project getProject() {
134
		IExtension extension = PluginServices
135
				.getExtension(com.iver.cit.gvsig.ProjectExtension.class);
136
		ProjectExtension pe = (ProjectExtension) extension;
137
		return pe.getProject();
138
	}
139

  
140
	private void generateAniamtionDate() {
141
		// TODO Auto-generated method stub
142
		// traerse el contenedor
143
		//Project project = this.getProject();
144
		AnimationContainer ac = null;//(AnimationContainer) project.getAnimationContainer();
145
		// desactivar los track existentes
146

  
147
		// crear el track
148
		adt = getAnimationDateTrack("Date-track", ac);
149
		// generar un intervalo por cada fecha
150

  
151
		// DEBUGGGGG!!!!
152
		System.out.println(ac);
153
	}
154

  
155
	private AnimationDatedTrack getAnimationDateTrack(String name,
156
			AnimationContainer ac) {
157
		AnimationDatedTrack at = null;
158
		IAnimationTrack aa = ac.findTrack(name);
159
		if (aa == null) {
160

  
161
			ExtensionPoints extensionPoints = ExtensionPointsSingleton
162
					.getInstance();
163
			ExtensionPoint extPoint = ((ExtensionPoint) extensionPoints
164
					.get("Animation"));
165

  
166
			// traerse el tipo de animacion
167
			IAnimationType animationDate3D = null;
168
			try {
169
				animationDate3D = (IAnimationType) extPoint
170
						.create("AnimationDate3D");
171
			} catch (InstantiationException e) {
172
				// TODO Auto-generated catch block
173
				e.printStackTrace();
174
			} catch (IllegalAccessException e) {
175
				// TODO Auto-generated catch block
176
				e.printStackTrace();
177
			}
178
			animationDate3D.setAnimatedObject(layer);
179
			at = (AnimationDatedTrack) ac.CreateDatedTrack(animationDate3D);
180
			at.setName(name);
181
			at.setEnable(true);
182
			
183
			//crear el intervalo
184
			AnimationDatedInterval adi = (AnimationDatedInterval) at.createInterval();
185
			adi.setBeginDateInterval(Date.valueOf("2000-01-01"));
186
			adi.setEndDateInterval(Date.valueOf("2000-01-04"));
187
			
188
			
189
//			at.setAnimatedObject(layer);
190
			// at.setAnimationType(animationDate3D);
191
		}
192

  
193
		return at;
194

  
195
	}
196

  
197
}
tags/3D_Animation_v1_0alpha_Build_7/extensions/extAnimationGUI/src/com/iver/ai2/animationgui/gui/WindowClosedListener.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 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
package com.iver.ai2.animationgui.gui;
20

  
21
import java.util.EventListener;
22
import java.util.EventObject;
23

  
24
public interface WindowClosedListener extends EventListener {
25
	/**
26
	 * Evento que se dispara cuando se cierra una ventana.
27
	 * @param e
28
	 */
29
	public void actionClosed(EventObject e);
30
}
tags/3D_Animation_v1_0alpha_Build_7/extensions/extAnimationGUI/src/com/iver/ai2/animationgui/gui/MenuAnimation3D.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 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

  
20
package com.iver.ai2.animationgui.gui;
21

  
22
import javax.swing.JOptionPane;
23

  
24
import com.iver.ai2.animationgui.gui.document.ProjectAnimationDocument;
25
import com.iver.ai2.animationgui.gui.toc.TocAnimationDate;
26
import com.iver.ai2.animationgui.gui.util.AnimationUtils;
27
import com.iver.ai2.gvsig3d.camera.ProjectCamera;
28
import com.iver.andami.PluginServices;
29
import com.iver.andami.plugins.Extension;
30
import com.iver.andami.plugins.IExtension;
31
import com.iver.andami.ui.mdiManager.IWindow;
32
import com.iver.cit.gvsig.ProjectExtension;
33
import com.iver.cit.gvsig.animation.AnimationContainer;
34
import com.iver.cit.gvsig.animation.AnimationPlayer;
35
import com.iver.cit.gvsig.project.Project;
36
import com.iver.cit.gvsig.project.documents.view.gui.BaseView;
37
import com.iver.utiles.extensionPoints.ExtensionPoints;
38
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
39

  
40
/**
41
 * @author
42
 * @since 1.1
43
 * 
44
 * Menu of animation toolbar's options.
45
 */
46

  
47
public class MenuAnimation3D extends Extension {
48

  
49
	// private variable that contains the project
50
	private Project project;
51
	// It is the project Document create to create a fast animation.
52
	private ProjectAnimationDocument pad;
53

  
54
	public void execute(String actionCommand) {
55

  
56
		AnimationContainer ac;
57
		String prefix = "Default-animation-document";
58
		// if the button pressed is animation control the animation panel is
59
		// created.
60
		if (actionCommand.equals("CONTROLES")) {
61
			// Getting the animation container.
62
			if (pad != null) {
63
				ac = pad.getAnimationContainer();
64
				AnimationPlayer ap = ac.getAnimationPlayer();
65
				ap.setAnimationContainer(ac);
66
				AnimationContol3D fp = new AnimationContol3D(ap);
67
				PluginServices.getMDIManager().addWindow((IWindow) fp);
68
			} else {
69
				if (AnimationUtils.exitsProject(prefix, project)){
70
					ac = AnimationUtils.getProjectDocument(prefix, project).getAnimationContainer();
71
					AnimationPlayer ap = ac.getAnimationPlayer();
72
					ap.setAnimationContainer(ac);
73
					AnimationContol3D fp = new AnimationContol3D(ap);
74
					PluginServices.getMDIManager().addWindow((IWindow) fp);
75
				}else{
76
					// Show a message that indicates why it is impossible to open
77
					// the player
78
					JOptionPane
79
					.showMessageDialog(null,
80
					"There is not any animation document. Please create one");
81
				}
82
			}
83

  
84
		} else if (actionCommand.equals("ENCUADRECAP")) {// button capture
85
			// if there is not create the default animation. we will create it.
86
			pad = AnimationUtils.createAnimationDocument(prefix, project);
87
			if (!AnimationUtils.exitsProject(prefix, project)){
88
				project.addDocument(pad);
89
			}
90

  
91
			// Getting the active windows
92
			IWindow w = PluginServices.getMDIManager().getActiveWindow();
93

  
94
			// Getting the animation container.
95
			ac = pad.getAnimationContainer();
96

  
97
			// Capture the new encuadrator
98
			AnimationUtils.captureEncuadrator((BaseView) w, ac, prefix);
99

  
100
		} else if (actionCommand.equals("CAPACAP")) {// button capture layer
101
			// pressed.
102
			System.out.println("pulsado boton de capturar capa!!!");
103
		} else if (actionCommand.equals("CLEAR_TRACK")) {
104
			//removeCameras(AnimationPrefix);
105
			// // AKFinterval = null;
106
			// cont = 0;
107
			// ac = this.getAnimationContainer();
108
			// ac.removeAllTrack();
109
		}
110

  
111
	}
112

  
113
	/**
114
	 * This method removes all the captures that there are in the encuadrator
115
	 * with the substring "substring"
116
	 * 
117
	 * @param substring
118
	 *            the method removes all the captures that contain this
119
	 *            substring.
120
	 * 
121
	 */
122
	void removeCameras(String substring) {
123
		// Remove all animation keyframe from the encuadrator.
124
		Object[] pcList = project.getCameras();
125
		int i = 0;
126
		while (i < pcList.length) {
127
			ProjectCamera projectCamera = (ProjectCamera) pcList[i];
128
			if (projectCamera.getDescription().contains(substring)) {
129
				project.removeCamera(i);
130
				pcList = project.getCameras();
131
			} else {
132
				i++;
133
			}
134
		}
135
	}
136

  
137
	public void postInitialize() {
138

  
139
		IExtension extension = PluginServices
140
				.getExtension(com.iver.cit.gvsig.ProjectExtension.class);
141
		ProjectExtension pe = (ProjectExtension) extension;
142
		project = pe.getProject();
143

  
144
		PluginServices.getIconTheme().registerDefault(
145
				"camera-link-icon",
146
				this.getClass().getClassLoader().getResource(
147
						"images/camera_link.png"));
148
		PluginServices.getIconTheme().registerDefault(
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff