Revision 15452
import/ext3D/branches/ext3D_v1.1/extAnimationGUI/src/com/iver/ai2/animationgui/gui/AnimationContol3D.java | ||
---|---|---|
22 | 22 |
import javax.swing.JButton; |
23 | 23 |
import javax.swing.JLabel; |
24 | 24 |
import javax.swing.JOptionPane; |
25 |
import javax.swing.JTextField; |
|
25 | 26 |
|
26 | 27 |
import org.gvsig.gui.beans.swing.GridBagLayoutPanel; |
27 | 28 |
|
... | ... | |
56 | 57 |
|
57 | 58 |
private JLabel label2 = null; |
58 | 59 |
|
59 |
private TextField textosegs = null; |
|
60 |
private JTextField textosegs = null;
|
|
60 | 61 |
|
61 | 62 |
private Choice choice = null; |
62 | 63 |
|
... | ... | |
80 | 81 |
|
81 | 82 |
private Checkbox checkbox = null; |
82 | 83 |
|
83 |
private boolean pulsadoPlay = false; |
|
84 |
|
|
85 |
private boolean pulsadoPause = false; |
|
86 |
|
|
87 | 84 |
private String buttonPath; |
88 | 85 |
|
89 | 86 |
private double globalTime; |
90 | 87 |
|
91 | 88 |
private AnimationPlayer animationPlayer; |
92 | 89 |
|
90 |
private int animationMode; |
|
93 | 91 |
|
94 | 92 |
/** |
95 | 93 |
* Default constructor. |
... | ... | |
97 | 95 |
* @param control |
98 | 96 |
*/ |
99 | 97 |
public AnimationContol3D(AnimationPlayer animationPlayer) { |
100 |
|
|
98 |
|
|
101 | 99 |
this.animationPlayer = animationPlayer; |
102 |
|
|
100 |
|
|
103 | 101 |
// Setting up the button path |
104 | 102 |
String oldPath = ResourcesFactory.getExtPath();// Save the path. |
105 | 103 |
ResourcesFactory |
... | ... | |
185 | 183 |
|
186 | 184 |
this.setPreferredSize(new Dimension(width, height)); |
187 | 185 |
this.setSize(new Dimension(width, height)); |
186 |
|
|
187 |
textosegs.setText("10"); |
|
188 | 188 |
} |
189 | 189 |
|
190 | 190 |
private JLabel getLabelMode() { |
... | ... | |
219 | 219 |
if (choice == null) { |
220 | 220 |
choice = new Choice(); |
221 | 221 |
// choice.addItem( textopru ); |
222 |
choice.addItem("modo1....................."); |
|
223 |
choice.addItem("modo2"); |
|
222 |
choice.addItem("Loop mode"); |
|
223 |
choice.addItem("Play once"); |
|
224 |
choice.addItem("Loop foward"); |
|
224 | 225 |
// choice.addItem( "modo3" ); |
225 | 226 |
// choice.addItem( "modo4" ); |
226 | 227 |
choice.addItemListener(this); |
... | ... | |
232 | 233 |
* @return TextField Return textfield where the user put the seconds of the |
233 | 234 |
* movie. |
234 | 235 |
*/ |
235 |
private TextField getSeconds() { |
|
236 |
private JTextField getSeconds() {
|
|
236 | 237 |
// TODO Auto-generated method stub |
237 | 238 |
if (textosegs == null) { |
238 |
textosegs = new TextField( |
|
239 |
textosegs = new JTextField(
|
|
239 | 240 |
PluginServices.getText(this, "Text_Secs"), 4); |
240 | 241 |
textosegs.setName("SECONDS"); |
242 |
textosegs.setHorizontalAlignment(JTextField.RIGHT); |
|
241 | 243 |
textosegs.addKeyListener(this); |
242 | 244 |
} |
243 | 245 |
return textosegs; |
... | ... | |
347 | 349 |
// "Estas viendo la animacion.......", |
348 | 350 |
// "Alertas de prueba", |
349 | 351 |
// JOptionPane.WARNING_MESSAGE); |
350 |
// if (AP == null) |
|
351 |
// AP = new AnimationPlayer(); |
|
352 |
this.animationPlayer.setAnimationPlayerState(AnimationPlayer.ANIMATION_STOP); |
|
352 |
// if (AP == null) |
|
353 |
// AP = new AnimationPlayer(); |
|
354 |
this.animationPlayer |
|
355 |
.setAnimationPlayerState(AnimationPlayer.ANIMATION_STOP); |
|
353 | 356 |
this.animationPlayer.setGlobalTime(globalTime); |
357 |
this.animationPlayer.setAnimationMode(animationMode); |
|
354 | 358 |
this.animationPlayer.play(); |
355 | 359 |
} else if (actionCommand.equals("PAUSE")) { // pause pressed |
356 | 360 |
// if (pulsadoPlay == true) { |
... | ... | |
366 | 370 |
// JOptionPane.WARNING_MESSAGE); |
367 | 371 |
// } |
368 | 372 |
this.animationPlayer.pause(); |
369 |
} else if (actionCommand.equals("STOP")){ |
|
370 |
// && ((pulsadoPlay == true) || pulsadoPause == true)) { // stop
|
|
373 |
} else if (actionCommand.equals("STOP")) {
|
|
374 |
// && ((pulsadoPlay == true) || pulsadoPause == true)) { // stop
|
|
371 | 375 |
// // pressed |
372 | 376 |
// if (pulsadoPlay == true) |
373 | 377 |
// pulsadoPlay = false; |
... | ... | |
382 | 386 |
// "Has parado la animacion.......", "Alertas de prueba", |
383 | 387 |
// JOptionPane.WARNING_MESSAGE); |
384 | 388 |
animationPlayer.stop(); |
385 |
|
|
386 |
|
|
389 |
|
|
387 | 390 |
} else if (actionCommand.equals("REC")) { |
388 | 391 |
image = new ImageIcon(buttonPath + "play.png"); |
389 | 392 |
buttonIcon.setIcon(image); |
... | ... | |
411 | 414 |
System.out.println("valor del campo segundos: " |
412 | 415 |
+ this.textosegs.getText()); |
413 | 416 |
globalTime = new Double(this.textosegs.getText()).doubleValue(); |
414 |
// if (AP == null)
|
|
415 |
// AP = new AnimationPlayer();
|
|
417 |
// if (AP == null)
|
|
418 |
// AP = new AnimationPlayer();
|
|
416 | 419 |
animationPlayer.setGlobalTime(globalTime); |
417 | 420 |
} |
418 | 421 |
|
... | ... | |
444 | 447 |
*/ |
445 | 448 |
private void getMensaje(int option) { |
446 | 449 |
// TODO Auto-generated method stub |
447 |
switch (option) { |
|
448 |
case 0: |
|
449 |
JOptionPane.showMessageDialog(null, "opcion1", "Alertas de prueba", |
|
450 |
JOptionPane.WARNING_MESSAGE); |
|
451 |
break; |
|
452 |
case 1: |
|
453 |
JOptionPane.showMessageDialog(null, "opcion2", "Alertas de prueba", |
|
454 |
JOptionPane.WARNING_MESSAGE); |
|
455 |
|
|
456 |
break; |
|
457 |
// case 2:JOptionPane.showMessageDialog(null, |
|
458 |
// "opcion3", |
|
459 |
// "Alertas de prueba", |
|
460 |
// JOptionPane.WARNING_MESSAGE); |
|
461 |
// break; |
|
462 |
// case 3:JOptionPane.showMessageDialog(null, |
|
463 |
// "opcion4", |
|
464 |
// "Alertas de prueba", |
|
465 |
// JOptionPane.WARNING_MESSAGE); |
|
466 |
// break; |
|
467 |
// case 4: JOptionPane.showMessageDialog(null, |
|
468 |
// "opcion5", |
|
469 |
// "Alertas de prueba", |
|
470 |
// JOptionPane.WARNING_MESSAGE); |
|
471 |
// break; |
|
450 |
String mode = choice.getItem(option); |
|
451 |
if (mode.equals("Play once")) { |
|
452 |
animationMode = AnimationPlayer.PLAY_ONCE; |
|
453 |
} else if (mode.equals("Loop mode")) { |
|
454 |
animationMode = AnimationPlayer.LOOP; |
|
455 |
} else if (mode.equals("Loop foward")) { |
|
456 |
animationMode = AnimationPlayer.LOOP_FORWARD; |
|
472 | 457 |
} |
473 |
} |
|
458 |
|
|
459 |
System.out.println("opcion: " + mode); |
|
474 | 460 |
|
461 |
// switch (option) { |
|
462 |
// case 0: |
|
463 |
// JOptionPane.showMessageDialog(null, "opcion1", "Alertas de prueba", |
|
464 |
// JOptionPane.WARNING_MESSAGE); |
|
465 |
// break; |
|
466 |
// case 1: |
|
467 |
// JOptionPane.showMessageDialog(null, "opcion2", "Alertas de prueba", |
|
468 |
// JOptionPane.WARNING_MESSAGE); |
|
469 |
// |
|
470 |
// break; |
|
471 |
// |
|
472 |
// } |
|
473 |
} |
|
475 | 474 |
} |
Also available in: Unified diff