Revision 684 org.gvsig.animation3d/trunk/org.gvsig.animation3d/org.gvsig.animation3d.swing/org.gvsig.animation3d.swing.impl/src/main/java/org/gvsig/animation3d/swing/impl/DefaultAnimation3DPanelController.java
DefaultAnimation3DPanelController.java | ||
---|---|---|
23 | 23 |
import org.gvsig.animation3d.swing.api.Animation3DPanel; |
24 | 24 |
import org.gvsig.animation3d.swing.api.Animation3DSwingLocator; |
25 | 25 |
import org.gvsig.animation3d.swing.api.Animation3DSwingManager; |
26 |
import org.gvsig.animation3d.swing.api.Animator; |
|
26 | 27 |
import org.gvsig.animation3d.swing.api.Frame3D; |
27 | 28 |
import org.gvsig.animation3d.swing.api.Frame3DCreationException; |
28 | 29 |
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport; |
... | ... | |
124 | 125 |
if (!animations.getSelectionModel().isSelectionEmpty()) { |
125 | 126 |
// Add frames 3D to table |
126 | 127 |
int selectedRow = animations.getSelectedRow(); |
127 |
DefaultAnimation3DTableModel model = (DefaultAnimation3DTableModel) animations.getModel(); |
|
128 |
DefaultAnimation3DTableModel model = |
|
129 |
(DefaultAnimation3DTableModel) animations.getModel(); |
|
128 | 130 |
Animation3D animation = model.getAnimation(selectedRow); |
129 | 131 |
initFramesTable(animation); |
130 | 132 |
|
... | ... | |
211 | 213 |
|
212 | 214 |
@Override |
213 | 215 |
public void actionPerformed(ActionEvent e) { |
214 |
doCenterFrameAction();
|
|
216 |
doZoomToFrameAction();
|
|
215 | 217 |
|
216 | 218 |
} |
217 | 219 |
}); |
... | ... | |
290 | 292 |
Frame3D newFrame3d = null; |
291 | 293 |
try { |
292 | 294 |
Animation3DSwingManager manager = Animation3DSwingLocator.getManager(); |
293 |
newFrame3d = manager.getFrame3D(name, mapControl3D);
|
|
295 |
newFrame3d = manager.createFrame3D(name, mapControl3D);
|
|
294 | 296 |
} catch (Frame3DCreationException e) { |
295 | 297 |
LOG.error("Error getting frame 3D", e); |
296 | 298 |
ThreadSafeDialogsManager dialogsManager = |
... | ... | |
383 | 385 |
|
384 | 386 |
} |
385 | 387 |
|
386 |
protected void doCenterFrameAction() {
|
|
388 |
protected void doZoomToFrameAction() {
|
|
387 | 389 |
if (this.frames.getSelectionModel().isSelectionEmpty()) { |
388 | 390 |
return; |
389 | 391 |
} |
... | ... | |
404 | 406 |
return; |
405 | 407 |
} |
406 | 408 |
|
407 |
// mapControl3D.goTo(frame); |
|
408 |
//TODO |
|
409 |
Animation3DSwingManager manager = Animation3DSwingLocator.getManager(); |
|
410 |
Animator goToAnimator = |
|
411 |
manager.createGoToAnimator(mapControl3D, frame, 4000, 16000); |
|
412 |
manager.addAnimator(mapControl3D, goToAnimator); |
|
409 | 413 |
} |
410 | 414 |
|
411 | 415 |
private void initAnimationsTable() { |
... | ... | |
560 | 564 |
} |
561 | 565 |
|
562 | 566 |
int selectedRow = this.animations.getSelectedRow(); |
563 |
DefaultAnimation3DTableModel model = (DefaultAnimation3DTableModel) this.animations.getModel(); |
|
567 |
DefaultAnimation3DTableModel model = |
|
568 |
(DefaultAnimation3DTableModel) this.animations.getModel(); |
|
564 | 569 |
Animation3D animation = model.getAnimation(selectedRow); |
565 | 570 |
List<Frame3D> frames = null; |
566 | 571 |
if (sphericalOption.isSelected()) { |
... | ... | |
568 | 573 |
} else { |
569 | 574 |
frames = animation.getFlatFrames(); |
570 | 575 |
} |
571 |
//mapControl3D.goTo(new ArrayList<Frame3D>(frames)); |
|
572 |
//TODO |
|
576 |
|
|
577 |
Animation3DSwingManager manager = Animation3DSwingLocator.getManager(); |
|
578 |
Animator goToAnimator = |
|
579 |
manager.createGoToAnimator(mapControl3D, frames, 4000, 16000); |
|
580 |
manager.addAnimator(mapControl3D, goToAnimator); |
|
573 | 581 |
} |
574 | 582 |
|
575 | 583 |
protected void doAddAnimation() { |
... | ... | |
580 | 588 |
new String[] { String.valueOf(animations.getRowCount()) }); |
581 | 589 |
Animation3D newAnimation = |
582 | 590 |
manager.createAnimation3D(name, new ArrayList<Frame3D>(), new ArrayList<Frame3D>()); |
583 |
DefaultAnimation3DTableModel tableModel = (DefaultAnimation3DTableModel) animations.getModel(); |
|
591 |
DefaultAnimation3DTableModel tableModel = |
|
592 |
(DefaultAnimation3DTableModel) animations.getModel(); |
|
584 | 593 |
tableModel.addAnimation(newAnimation); |
585 | 594 |
} |
586 | 595 |
|
... | ... | |
589 | 598 |
return; |
590 | 599 |
} |
591 | 600 |
int selectedRow = animations.getSelectedRow(); |
592 |
DefaultAnimation3DTableModel tableModel = (DefaultAnimation3DTableModel) animations.getModel(); |
|
601 |
DefaultAnimation3DTableModel tableModel = |
|
602 |
(DefaultAnimation3DTableModel) animations.getModel(); |
|
593 | 603 |
tableModel.removeAnimation(selectedRow); |
594 | 604 |
|
595 | 605 |
frames.setModel(new DefaultTableModel(0, 0)); |
... | ... | |
622 | 632 |
ExtendedPropertiesSupport viewProperties = views.get(viewName); |
623 | 633 |
Animation3DSwingManager manager = Animation3DSwingLocator.getManager(); |
624 | 634 |
List<Animation3D> animations = manager.getAnimations(viewProperties); |
625 |
DefaultAnimation3DTableModel animationTableModel = new DefaultAnimation3DTableModel(animations); |
|
635 |
DefaultAnimation3DTableModel animationTableModel = |
|
636 |
new DefaultAnimation3DTableModel(animations); |
|
626 | 637 |
this.animations.setModel(animationTableModel); |
627 | 638 |
this.addAnimation.setEnabled(true); |
628 | 639 |
removeAnimation.setEnabled(false); |
... | ... | |
686 | 697 |
return new Dimension(510, 530); |
687 | 698 |
} |
688 | 699 |
|
700 |
@SuppressWarnings("unchecked") |
|
689 | 701 |
@Override |
690 | 702 |
public void addViewDocument(String name, ExtendedPropertiesSupport viewDocument) { |
691 | 703 |
this.views.put(name, viewDocument); |
... | ... | |
698 | 710 |
this.viewsCombo.removeItem(name); |
699 | 711 |
} |
700 | 712 |
|
713 |
@SuppressWarnings("unchecked") |
|
701 | 714 |
@Override |
702 | 715 |
public void changeViewDocumentName(String oldValue, String newValue) { |
703 | 716 |
ExtendedPropertiesSupport viewDocument = this.views.remove(oldValue); |
Also available in: Unified diff