Revision 723
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.app/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.animation3d</artifactId> |
|
6 |
<version>1.0.0</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.animation3d.app</artifactId> |
|
9 |
<packaging>pom</packaging> |
|
10 |
<name>org.gvsig.animation3d</name> |
|
11 |
<modules> |
|
12 |
<module>org.gvsig.animation3d.app.mainplugin</module> |
|
13 |
</modules> |
|
14 |
</project> |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.app/org.gvsig.animation3d.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Mon Aug 29 14:40:44 CEST 2016 |
|
2 |
buildNumber=2 |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.app/org.gvsig.animation3d.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2013 |
|
2 |
gvSIG Association. This program is free software; you can redistribute it |
|
3 |
and/or modify it under the terms of the GNU General Public License as published |
|
4 |
by the Free Software Foundation; either version 3 of the License, or (at |
|
5 |
your option) any later version. This program is distributed in the hope that |
|
6 |
it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
|
7 |
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
8 |
Public License for more details. You should have received a copy of the GNU |
|
9 |
General Public License along with this program; if not, write to the Free |
|
10 |
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
|
11 |
USA. For any additional information, do not hesitate to contact us at info |
|
12 |
AT gvsig.com, or visit our website www.gvsig.com. --> |
|
13 |
<assembly> |
|
14 |
<id>gvsig-plugin-package</id> |
|
15 |
<formats> |
|
16 |
<format>zip</format> |
|
17 |
</formats> |
|
18 |
<baseDirectory>${project.parent.artifactId}</baseDirectory> |
|
19 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
20 |
<files> |
|
21 |
<file> |
|
22 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
23 |
<outputDirectory>lib</outputDirectory> |
|
24 |
</file> |
|
25 |
<file> |
|
26 |
<source>target/package.info</source> |
|
27 |
</file> |
|
28 |
</files> |
|
29 |
|
|
30 |
<fileSets> |
|
31 |
<fileSet> |
|
32 |
<directory>src/main/resources-plugin</directory> |
|
33 |
<outputDirectory>.</outputDirectory> |
|
34 |
</fileSet> |
|
35 |
<fileSet> |
|
36 |
<directory>target/org.gvsig.view3d.app.common</directory> |
|
37 |
<outputDirectory>.</outputDirectory> |
|
38 |
<excludes> |
|
39 |
<exclude>package.info</exclude> |
|
40 |
</excludes> |
|
41 |
</fileSet> |
|
42 |
</fileSets> |
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
<dependencySets> |
|
48 |
<dependencySet> |
|
49 |
<useProjectArtifact>false</useProjectArtifact> |
|
50 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
51 |
<outputDirectory>lib</outputDirectory> |
|
52 |
<includes> |
|
53 |
<include>org.gvsig:org.gvsig.animation3d.swing.api</include> |
|
54 |
<include>org.gvsig:org.gvsig.animation3d.swing.impl</include> |
|
55 |
</includes> |
|
56 |
</dependencySet> |
|
57 |
</dependencySets> |
|
58 |
|
|
59 |
</assembly> |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.app/org.gvsig.animation3d.app.mainplugin/src/main/java/org/gvsig/animation3d/app/mainplugin/Animation3DExtension.java | ||
---|---|---|
1 |
package org.gvsig.animation3d.app.mainplugin; |
|
2 |
|
|
3 |
import java.awt.event.ComponentEvent; |
|
4 |
import java.awt.event.ComponentListener; |
|
5 |
import java.beans.PropertyChangeEvent; |
|
6 |
import java.beans.PropertyChangeListener; |
|
7 |
import java.util.LinkedHashMap; |
|
8 |
import java.util.List; |
|
9 |
import java.util.Map; |
|
10 |
|
|
11 |
import org.gvsig.andami.IconThemeHelper; |
|
12 |
import org.gvsig.andami.plugins.Extension; |
|
13 |
import org.gvsig.animation3d.swing.api.Animation3DPanel; |
|
14 |
import org.gvsig.animation3d.swing.api.Animation3DSwingLocator; |
|
15 |
import org.gvsig.app.ApplicationLocator; |
|
16 |
import org.gvsig.app.ApplicationManager; |
|
17 |
import org.gvsig.app.project.Project; |
|
18 |
import org.gvsig.app.project.documents.Document; |
|
19 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
20 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
21 |
import org.gvsig.app.project.documents.view.gui.IView; |
|
22 |
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport; |
|
23 |
import org.gvsig.tools.ToolsLocator; |
|
24 |
import org.gvsig.tools.i18n.I18nManager; |
|
25 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
26 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
27 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager.MODE; |
|
28 |
import org.gvsig.view3d.swing.api.MapControl3D; |
|
29 |
import org.gvsig.view3d.swing.api.View3DSwingLocator; |
|
30 |
|
|
31 |
/** |
|
32 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
|
33 |
* |
|
34 |
*/ |
|
35 |
public class Animation3DExtension extends Extension { |
|
36 |
|
|
37 |
private Animation3DPanel animationManager; |
|
38 |
private PropertyChangeListener projectPropertyChangeListener; |
|
39 |
private PropertyChangeListener documentPropertyChangeListener; |
|
40 |
|
|
41 |
@Override |
|
42 |
public void initialize() { |
|
43 |
IconThemeHelper.registerIcon("animation", "animation-3d", this); |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
public void execute(String actionCommand) { |
|
48 |
|
|
49 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
50 |
|
|
51 |
Project currentProject = application.getCurrentProject(); |
|
52 |
List<Document> documents = currentProject.getDocuments(ViewManager.TYPENAME); |
|
53 |
|
|
54 |
if (documents.isEmpty()) { |
|
55 |
return; |
|
56 |
} |
|
57 |
|
|
58 |
currentProject.addPropertyChangeListener(getProjectPropertyChangeListener()); |
|
59 |
|
|
60 |
Map<String, ExtendedPropertiesSupport> properties = |
|
61 |
new LinkedHashMap<String, ExtendedPropertiesSupport>(); |
|
62 |
for (Document document : documents) { |
|
63 |
document.addPropertyChangeListener(getDocumentPropertyChangeListener()); |
|
64 |
properties.put(document.getName(), (ExtendedPropertiesSupport) document); |
|
65 |
} |
|
66 |
|
|
67 |
animationManager = Animation3DSwingLocator.getManager().createAnimationPanel(properties); |
|
68 |
animationManager.asJComponent().addComponentListener(getComponentListener()); |
|
69 |
WindowManager windowManager = ToolsSwingLocator.getWindowManager(); |
|
70 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
71 |
windowManager.showWindow(animationManager.asJComponent(), |
|
72 |
i18nManager.getTranslation("animation_manager"), MODE.WINDOW); |
|
73 |
|
|
74 |
} |
|
75 |
|
|
76 |
@Override |
|
77 |
public boolean isEnabled() { |
|
78 |
if (animationManager == null && getActiveView() != null) { |
|
79 |
return true; |
|
80 |
} |
|
81 |
return false; |
|
82 |
} |
|
83 |
|
|
84 |
@Override |
|
85 |
public boolean isVisible() { |
|
86 |
IView view = getActiveView(); |
|
87 |
if (view != null) { |
|
88 |
return true; |
|
89 |
} |
|
90 |
return false; |
|
91 |
} |
|
92 |
|
|
93 |
private IView getActiveView() { |
|
94 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
95 |
IView view = (IView) application.getActiveComponent(ViewDocument.class); |
|
96 |
return view; |
|
97 |
} |
|
98 |
|
|
99 |
private ComponentListener getComponentListener() { |
|
100 |
return new ComponentListener() { |
|
101 |
|
|
102 |
@Override |
|
103 |
public void componentShown(ComponentEvent e) { |
|
104 |
} |
|
105 |
|
|
106 |
@Override |
|
107 |
public void componentResized(ComponentEvent e) { |
|
108 |
} |
|
109 |
|
|
110 |
@Override |
|
111 |
public void componentMoved(ComponentEvent e) { |
|
112 |
} |
|
113 |
|
|
114 |
@Override |
|
115 |
public void componentHidden(ComponentEvent e) { |
|
116 |
animationManager.dispose(); |
|
117 |
animationManager = null; |
|
118 |
} |
|
119 |
}; |
|
120 |
} |
|
121 |
|
|
122 |
private PropertyChangeListener getProjectPropertyChangeListener() { |
|
123 |
if (projectPropertyChangeListener == null) { |
|
124 |
projectPropertyChangeListener = new PropertyChangeListener() { |
|
125 |
|
|
126 |
@Override |
|
127 |
public void propertyChange(PropertyChangeEvent evt) { |
|
128 |
if (animationManager != null) { |
|
129 |
doProjectPropertyChangeListener(evt); |
|
130 |
} |
|
131 |
} |
|
132 |
}; |
|
133 |
} |
|
134 |
return projectPropertyChangeListener; |
|
135 |
} |
|
136 |
|
|
137 |
protected void doProjectPropertyChangeListener(PropertyChangeEvent event) { |
|
138 |
if ("addDocument".equals(event.getPropertyName())) { |
|
139 |
Document document = (Document) event.getNewValue(); |
|
140 |
if (document instanceof ViewDocument) { |
|
141 |
ViewDocument viewDocument = (ViewDocument) document; |
|
142 |
viewDocument.addPropertyChangeListener(getDocumentPropertyChangeListener()); |
|
143 |
animationManager.addExtendedPropertiesSupport(viewDocument.getName(), viewDocument); |
|
144 |
} |
|
145 |
} else if ("delDocument".equals(event.getPropertyName())) { |
|
146 |
Document document = (Document) event.getOldValue(); |
|
147 |
if (document instanceof ViewDocument) { |
|
148 |
ViewDocument viewDocument = (ViewDocument) document; |
|
149 |
animationManager.removeExtendedPropertiesSupport(viewDocument.getName()); |
|
150 |
} |
|
151 |
} |
|
152 |
} |
|
153 |
|
|
154 |
private PropertyChangeListener getDocumentPropertyChangeListener() { |
|
155 |
if (documentPropertyChangeListener == null) { |
|
156 |
documentPropertyChangeListener = new PropertyChangeListener() { |
|
157 |
|
|
158 |
@Override |
|
159 |
public void propertyChange(PropertyChangeEvent evt) { |
|
160 |
if (animationManager != null) { |
|
161 |
doDocumentPropertyChangeListener(evt); |
|
162 |
} |
|
163 |
} |
|
164 |
}; |
|
165 |
} |
|
166 |
return documentPropertyChangeListener; |
|
167 |
} |
|
168 |
|
|
169 |
protected void doDocumentPropertyChangeListener(PropertyChangeEvent event) { |
|
170 |
if ("name".equals(event.getPropertyName())) { |
|
171 |
animationManager.changeExtendedPropertiesSupportName((String) event.getOldValue(), |
|
172 |
(String) event.getNewValue()); |
|
173 |
} |
|
174 |
} |
|
175 |
} |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.app/org.gvsig.animation3d.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
1 |
animation = Animaci?n |
|
2 |
animation_manager = Gestor de animaciones |
|
3 |
animation_XxnumberxX = Animaci?n {0} |
|
4 |
error_getting_frame_of_3D_view = Error al obtener el encuadre del visor 3D |
|
5 |
frame = Encuadre |
|
6 |
frame_XxnumberxX= Encuadre {0} |
|
7 |
order= Orden |
|
8 |
play=Reproducir |
|
9 |
zoom_to_frame = Zoom al encuadre |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.app/org.gvsig.animation3d.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
1 |
animation = Animation |
|
2 |
animation_manager = Animation manager |
|
3 |
animation_XxnumberxX = Animation {0} |
|
4 |
error_getting_frame_of_3D_view = Error getting frame of view 3D |
|
5 |
frame = Frame |
|
6 |
frame_XxnumberxX= Frame {0} |
|
7 |
order= Order |
|
8 |
play=Play |
|
9 |
zoom_to_frame = Zoom to frame |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.app/org.gvsig.animation3d.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2013 |
|
3 |
gvSIG Association. This program is free software; you can redistribute it |
|
4 |
and/or modify it under the terms of the GNU General Public License as published |
|
5 |
by the Free Software Foundation; either version 3 of the License, or (at |
|
6 |
your option) any later version. This program is distributed in the hope that |
|
7 |
it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
|
8 |
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
9 |
Public License for more details. You should have received a copy of the GNU |
|
10 |
General Public License along with this program; if not, write to the Free |
|
11 |
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
|
12 |
USA. For any additional information, do not hesitate to contact us at info |
|
13 |
AT gvsig.com, or visit our website www.gvsig.com. --> |
|
14 |
<plugin-config> |
|
15 |
<depends plugin-name="org.gvsig.view3d.app" /> |
|
16 |
<resourceBundle name="text" /> |
|
17 |
<libraries library-dir="lib" /> |
|
18 |
<extensions> |
|
19 |
<extension |
|
20 |
class-name="org.gvsig.animation3d.app.mainplugin.Animation3DExtension" |
|
21 |
description="" active="true" priority="1"> |
|
22 |
|
|
23 |
<action name="animation-3d" label="animation_manager" |
|
24 |
tooltip="animation_manager" position="650400500" action-command="animation-3d" |
|
25 |
icon="animation-3d" accelerator="" /> |
|
26 |
|
|
27 |
<menu text="View/view_3d/animation_manager" name="animation-3d" /> |
|
28 |
|
|
29 |
<tool-bar name="view-3d" position="650400000"> |
|
30 |
<action-tool name="animation-3d" /> |
|
31 |
</tool-bar> |
|
32 |
|
|
33 |
</extension> |
|
34 |
</extensions> |
|
35 |
</plugin-config> |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.app/org.gvsig.animation3d.app.mainplugin/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.animation3d.app</artifactId> |
|
6 |
<version>1.0.0</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.animation3d.app.mainplugin</artifactId> |
|
9 |
<name>org.gvsig.animation3d.app.mainplugin</name> |
|
10 |
|
|
11 |
<properties> |
|
12 |
<gvsig.install.plugin>true</gvsig.install.plugin> |
|
13 |
<gvsig.package.info.state>testing</gvsig.package.info.state> |
|
14 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
15 |
<gvsig.package.info.name>3D Animation</gvsig.package.info.name> |
|
16 |
<gvsig.package.info.categories>3D</gvsig.package.info.categories> |
|
17 |
<gvsig.package.info.description>3D Animation: allows user to create, edit, remove and play 3D animations</gvsig.package.info.description> |
|
18 |
<gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge |
|
19 |
2.3.0, required: org.gvsig.view3d.app -ge ${org.gvsig.view3d.version}</gvsig.package.info.dependencies> |
|
20 |
<svn.tags.folder>https://devel.gvsig.org/svn/gvsig-3d/org.gvsig.animation3d/tags/</svn.tags.folder> |
|
21 |
<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-3d/pool/</gvsig.package.info.poolURL> |
|
22 |
</properties> |
|
23 |
|
|
24 |
<dependencies> |
|
25 |
<dependency> |
|
26 |
<groupId>org.gvsig</groupId> |
|
27 |
<artifactId>org.gvsig.animation3d.swing.api</artifactId> |
|
28 |
</dependency> |
|
29 |
<dependency> |
|
30 |
<groupId>org.gvsig</groupId> |
|
31 |
<artifactId>org.gvsig.animation3d.swing.impl</artifactId> |
|
32 |
</dependency> |
|
33 |
<dependency> |
|
34 |
<groupId>org.gvsig</groupId> |
|
35 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
36 |
</dependency> |
|
37 |
</dependencies> |
|
38 |
</project> |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.desktop</artifactId> |
|
6 |
<version>2.0.150</version> |
|
7 |
</parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.animation3d</artifactId> |
|
10 |
<version>1.0.0</version> |
|
11 |
<packaging>pom</packaging> |
|
12 |
<name>org.gvsig.animation3d</name> |
|
13 |
|
|
14 |
<url>https://devel.gvsig.org/sites/org.gvsig.view3d/${project.version}</url> |
|
15 |
<scm> |
|
16 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-3d/org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0</connection> |
|
17 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-3d/org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0</developerConnection> |
|
18 |
<url>https://redmine.gvsig.net/redmine/projects/gvsig-3d/repository/show/org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0</url> |
|
19 |
</scm> |
|
20 |
|
|
21 |
<distributionManagement> |
|
22 |
<site> |
|
23 |
<id>gvsig-repository</id> |
|
24 |
<url>dav:https://devel.gvsig.org/sites/org.gvsig.animation3d/${project.version}</url> |
|
25 |
</site> |
|
26 |
</distributionManagement> |
|
27 |
<build> |
|
28 |
<plugins> |
|
29 |
<plugin> |
|
30 |
<groupId>org.apache.maven.plugins</groupId> |
|
31 |
<artifactId>maven-release-plugin</artifactId> |
|
32 |
<configuration> |
|
33 |
<tagBase>https://devel.gvsig.org/svn/gvsig-3d/org.gvsig.animation3d/tags</tagBase> |
|
34 |
<goal>deploy</goal> |
|
35 |
</configuration> |
|
36 |
</plugin> |
|
37 |
</plugins> |
|
38 |
</build> |
|
39 |
|
|
40 |
<modules> |
|
41 |
<module>org.gvsig.animation3d.app</module> |
|
42 |
<module>org.gvsig.animation3d.swing</module> |
|
43 |
</modules> |
|
44 |
|
|
45 |
<properties> |
|
46 |
<org.gvsig.view3d.version>1.0.23</org.gvsig.view3d.version> |
|
47 |
</properties> |
|
48 |
|
|
49 |
<dependencyManagement> |
|
50 |
<dependencies> |
|
51 |
<dependency> |
|
52 |
<groupId>org.gvsig</groupId> |
|
53 |
<artifactId>org.gvsig.view3d</artifactId> |
|
54 |
<scope>import</scope> |
|
55 |
<type>pom</type> |
|
56 |
<version>${org.gvsig.view3d.version}</version> |
|
57 |
</dependency> |
|
58 |
<dependency> |
|
59 |
<groupId>org.gvsig</groupId> |
|
60 |
<artifactId>org.gvsig.animation3d.swing.api</artifactId> |
|
61 |
<version>1.0.0</version> |
|
62 |
</dependency> |
|
63 |
<dependency> |
|
64 |
<groupId>org.gvsig</groupId> |
|
65 |
<artifactId>org.gvsig.animation3d.swing.impl</artifactId> |
|
66 |
<version>1.0.0</version> |
|
67 |
</dependency> |
|
68 |
</dependencies> |
|
69 |
</dependencyManagement> |
|
70 |
</project> |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.swing/org.gvsig.animation3d.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.animation3d.swing.impl.DefaultAnimation3DSwingLibrary |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.swing/org.gvsig.animation3d.swing.impl/src/main/java/org/gvsig/animation3d/swing/impl/DefaultAnimation3DSwingManager.java | ||
---|---|---|
1 |
package org.gvsig.animation3d.swing.impl; |
|
2 |
|
|
3 |
import gov.nasa.worldwind.View; |
|
4 |
import gov.nasa.worldwind.WorldWind; |
|
5 |
import gov.nasa.worldwind.animation.AnimationSupport; |
|
6 |
import gov.nasa.worldwind.avlist.AVKey; |
|
7 |
import gov.nasa.worldwind.awt.WorldWindowGLJPanel; |
|
8 |
import gov.nasa.worldwind.geom.Angle; |
|
9 |
import gov.nasa.worldwind.geom.LatLon; |
|
10 |
import gov.nasa.worldwind.geom.Position; |
|
11 |
import gov.nasa.worldwind.globes.Globe; |
|
12 |
import gov.nasa.worldwind.view.orbit.FlyToOrbitViewAnimator; |
|
13 |
import gov.nasa.worldwind.view.orbit.OrbitView; |
|
14 |
|
|
15 |
import java.util.ArrayList; |
|
16 |
import java.util.Collection; |
|
17 |
import java.util.List; |
|
18 |
import java.util.Map; |
|
19 |
|
|
20 |
import org.gvsig.animation3d.swing.api.Animation3D; |
|
21 |
import org.gvsig.animation3d.swing.api.Animation3DPanel; |
|
22 |
import org.gvsig.animation3d.swing.api.Animation3DSwingManager; |
|
23 |
import org.gvsig.animation3d.swing.api.Animator; |
|
24 |
import org.gvsig.animation3d.swing.api.Frame3D; |
|
25 |
import org.gvsig.animation3d.swing.api.Frame3DCreationException; |
|
26 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
27 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
28 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
29 |
import org.gvsig.fmap.geom.primitive.Point; |
|
30 |
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport; |
|
31 |
import org.gvsig.tools.persistence.impl.DelegatedList; |
|
32 |
import org.gvsig.view3d.swing.api.MapControl3D; |
|
33 |
|
|
34 |
/** |
|
35 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
|
36 |
* |
|
37 |
*/ |
|
38 |
public class DefaultAnimation3DSwingManager implements Animation3DSwingManager { |
|
39 |
|
|
40 |
@SuppressWarnings("unchecked") |
|
41 |
@Override |
|
42 |
public List<Animation3D> getAnimations(ExtendedPropertiesSupport properties) { |
|
43 |
Object animationsList = properties.getProperty("animations"); |
|
44 |
if (animationsList == null) { |
|
45 |
List<Animation3D> animations = new ArrayList<Animation3D>(); |
|
46 |
setAnimations(properties, animations); |
|
47 |
return animations; |
|
48 |
} else { |
|
49 |
if (animationsList instanceof DelegatedList) { |
|
50 |
List<Animation3D> animations = new ArrayList<Animation3D>(); |
|
51 |
animations.addAll((Collection<? extends Animation3D>) animationsList); |
|
52 |
setAnimations(properties, animations); |
|
53 |
return animations; |
|
54 |
} else { |
|
55 |
return (List<Animation3D>) animationsList; |
|
56 |
} |
|
57 |
} |
|
58 |
} |
|
59 |
|
|
60 |
@Override |
|
61 |
public void setAnimations(ExtendedPropertiesSupport properties, List<Animation3D> animations) { |
|
62 |
properties.setProperty("animations", animations); |
|
63 |
} |
|
64 |
|
|
65 |
@Override |
|
66 |
public Frame3D createFrame3D(String name, MapControl3D mapControl3D) |
|
67 |
throws Frame3DCreationException { |
|
68 |
|
|
69 |
OrbitView orbitView = getOrbitView(mapControl3D); |
|
70 |
double heading = orbitView.getHeading().getDegrees(); |
|
71 |
double pitch = orbitView.getPitch().getDegrees(); |
|
72 |
double elevation = orbitView.getCenterPosition().getElevation(); |
|
73 |
double zoom = orbitView.getZoom(); |
|
74 |
|
|
75 |
Point position = null; |
|
76 |
double x = orbitView.getCenterPosition().getLongitude().getDegrees(); |
|
77 |
double y = orbitView.getCenterPosition().getLatitude().getDegrees(); |
|
78 |
try { |
|
79 |
position = GeometryLocator.getGeometryManager().createPoint(x, y, SUBTYPES.GEOM2D); |
|
80 |
} catch (CreateGeometryException e) { |
|
81 |
String msg = |
|
82 |
String.format("Can not create frame position [longitude: %1s latitude: %2s]", |
|
83 |
new Object[] { x, y }); |
|
84 |
throw new Frame3DCreationException(msg, e); |
|
85 |
} |
|
86 |
|
|
87 |
return createFrame3D(name, heading, pitch, elevation, position, zoom); |
|
88 |
} |
|
89 |
|
|
90 |
public Frame3D createFrame3D(String name, double heading, double pitch, double elevation, |
|
91 |
Point position, double zoom) { |
|
92 |
return new DefaultFrame3D(name, heading, pitch, elevation, position, zoom); |
|
93 |
} |
|
94 |
|
|
95 |
@Override |
|
96 |
public Animation3D createAnimation3D(String name, List<Frame3D> sphericalFrames, |
|
97 |
List<Frame3D> flatFrames) { |
|
98 |
return new DefaultAnimation3D(name, sphericalFrames, flatFrames); |
|
99 |
} |
|
100 |
|
|
101 |
@Override |
|
102 |
public Animation3DPanel createAnimationPanel(Map<String, ExtendedPropertiesSupport> properties) { |
|
103 |
return new DefaultAnimation3DPanelController(properties); |
|
104 |
} |
|
105 |
|
|
106 |
@Override |
|
107 |
public Animator createGoToAnimator(MapControl3D mapControl3D, Frame3D frame, |
|
108 |
final long minMillis, final long maxMillis) { |
|
109 |
|
|
110 |
OrbitView orbitView = getOrbitView(mapControl3D); |
|
111 |
Globe globe = orbitView.getGlobe(); |
|
112 |
double longitude = frame.getPosition().getX(); |
|
113 |
double latitude = frame.getPosition().getY(); |
|
114 |
Position endPos = |
|
115 |
new Position(LatLon.fromDegrees(latitude, longitude), globe.getElevation( |
|
116 |
Angle.fromDegrees(latitude), Angle.fromDegrees(longitude)) |
|
117 |
+ frame.getElevation()); |
|
118 |
|
|
119 |
Position beginPos = |
|
120 |
Position.fromDegrees(orbitView.getCenterPosition().getLatitude().getDegrees(), |
|
121 |
orbitView.getCenterPosition().getLongitude().getDegrees(), orbitView |
|
122 |
.getCenterPosition().getElevation()); |
|
123 |
long timeToMove = |
|
124 |
AnimationSupport.getScaledTimeMillisecs(beginPos, endPos, minMillis, maxMillis); |
|
125 |
|
|
126 |
gov.nasa.worldwind.animation.Animator animator = |
|
127 |
FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(orbitView, beginPos, endPos, |
|
128 |
orbitView.getHeading(), Angle.fromDegrees(frame.getHeading()), |
|
129 |
orbitView.getPitch(), Angle.fromDegrees(frame.getPitch()), orbitView.getZoom(), |
|
130 |
frame.getZoom(), timeToMove, WorldWind.ABSOLUTE); |
|
131 |
return new DefaultAnimatorWrapper(animator); |
|
132 |
} |
|
133 |
|
|
134 |
@Override |
|
135 |
public Animator createGoToAnimator(MapControl3D mapControl3D, List<Frame3D> frames, |
|
136 |
long minMillis, long maxMillis) { |
|
137 |
OrbitView orbitView = getOrbitView(mapControl3D); |
|
138 |
gov.nasa.worldwind.animation.Animator animator = |
|
139 |
new MultipleFlyToOrbitViewAnimator(orbitView, frames, minMillis, maxMillis); |
|
140 |
return new DefaultAnimatorWrapper(animator); |
|
141 |
} |
|
142 |
|
|
143 |
@Override |
|
144 |
public void addAnimator(MapControl3D mapControl3D, Animator animator) { |
|
145 |
OrbitView orbitView = getOrbitView(mapControl3D); |
|
146 |
orbitView.addAnimator(new DefaultWWAnimationWrapper(animator)); |
|
147 |
orbitView.firePropertyChange(AVKey.VIEW, null, orbitView); |
|
148 |
} |
|
149 |
|
|
150 |
@Override |
|
151 |
public boolean isAnimating(MapControl3D mapControl3D) { |
|
152 |
OrbitView orbitView = getOrbitView(mapControl3D); |
|
153 |
return orbitView.isAnimating(); |
|
154 |
} |
|
155 |
|
|
156 |
@Override |
|
157 |
public void stopAnimations(MapControl3D mapControl3D) { |
|
158 |
OrbitView orbitView = getOrbitView(mapControl3D); |
|
159 |
orbitView.stopAnimations(); |
|
160 |
} |
|
161 |
|
|
162 |
private OrbitView getOrbitView(MapControl3D mapControl3D) { |
|
163 |
Object underLineComponent = mapControl3D.getUnderLineComponent(); |
|
164 |
if (underLineComponent instanceof WorldWindowGLJPanel) { |
|
165 |
WorldWindowGLJPanel wwd = (WorldWindowGLJPanel) underLineComponent; |
|
166 |
View view = wwd.getView(); |
|
167 |
if (view instanceof OrbitView) { |
|
168 |
return (OrbitView) view; |
|
169 |
} |
|
170 |
} |
|
171 |
throw new IllegalArgumentException( |
|
172 |
"Can not get WorldWind view from under line MapControl3D component"); |
|
173 |
} |
|
174 |
} |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.swing/org.gvsig.animation3d.swing.impl/src/main/java/org/gvsig/animation3d/swing/impl/DefaultAnimation3DPanelController.java | ||
---|---|---|
1 |
package org.gvsig.animation3d.swing.impl; |
|
2 |
|
|
3 |
import java.awt.Dimension; |
|
4 |
import java.awt.event.ActionEvent; |
|
5 |
import java.awt.event.ActionListener; |
|
6 |
import java.util.ArrayList; |
|
7 |
import java.util.Collection; |
|
8 |
import java.util.List; |
|
9 |
import java.util.Locale; |
|
10 |
import java.util.Map; |
|
11 |
import java.util.Set; |
|
12 |
|
|
13 |
import javax.swing.JComponent; |
|
14 |
import javax.swing.JOptionPane; |
|
15 |
import javax.swing.JTable; |
|
16 |
import javax.swing.ListSelectionModel; |
|
17 |
import javax.swing.event.ListSelectionEvent; |
|
18 |
import javax.swing.event.ListSelectionListener; |
|
19 |
import javax.swing.table.DefaultTableModel; |
|
20 |
|
|
21 |
import org.apache.commons.lang3.StringUtils; |
|
22 |
import org.gvsig.animation3d.swing.api.Animation3D; |
|
23 |
import org.gvsig.animation3d.swing.api.Animation3DPanel; |
|
24 |
import org.gvsig.animation3d.swing.api.Animation3DSwingLocator; |
|
25 |
import org.gvsig.animation3d.swing.api.Animation3DSwingManager; |
|
26 |
import org.gvsig.animation3d.swing.api.Animator; |
|
27 |
import org.gvsig.animation3d.swing.api.Frame3D; |
|
28 |
import org.gvsig.animation3d.swing.api.Frame3DCreationException; |
|
29 |
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport; |
|
30 |
import org.gvsig.tools.ToolsLocator; |
|
31 |
import org.gvsig.tools.i18n.I18nManager; |
|
32 |
import org.gvsig.tools.observer.Notification; |
|
33 |
import org.gvsig.tools.observer.Observable; |
|
34 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
35 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
|
36 |
import org.gvsig.view3d.swing.api.MapControl3D; |
|
37 |
import org.gvsig.view3d.swing.api.View3DSwingLocator; |
|
38 |
import org.gvsig.view3d.swing.api.View3DSwingManager; |
|
39 |
import org.gvsig.view3d.swing.api.View3DSwingManager.TYPE; |
|
40 |
import org.slf4j.Logger; |
|
41 |
import org.slf4j.LoggerFactory; |
|
42 |
|
|
43 |
/** |
|
44 |
* |
|
45 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
|
46 |
* |
|
47 |
*/ |
|
48 |
public class DefaultAnimation3DPanelController extends DefaultAnimation3DPanelView implements |
|
49 |
Animation3DPanel { |
|
50 |
|
|
51 |
private static final Logger LOG = LoggerFactory |
|
52 |
.getLogger(DefaultAnimation3DPanelController.class); |
|
53 |
|
|
54 |
private static final long serialVersionUID = -142252066138365417L; |
|
55 |
|
|
56 |
private Map<String, ExtendedPropertiesSupport> views; |
|
57 |
|
|
58 |
/** |
|
59 |
* Default constructor |
|
60 |
* |
|
61 |
* @param views |
|
62 |
*/ |
|
63 |
public DefaultAnimation3DPanelController(Map<String, ExtendedPropertiesSupport> views) { |
|
64 |
super(); |
|
65 |
|
|
66 |
this.views = views; |
|
67 |
|
|
68 |
View3DSwingLocator.getManager().addObserver(this); |
|
69 |
|
|
70 |
initComponents(); |
|
71 |
} |
|
72 |
|
|
73 |
private void initComponents() { |
|
74 |
|
|
75 |
initViewsCombo(views.keySet()); |
|
76 |
initAnimationControlButtons(); |
|
77 |
initAnimationsTable(); |
|
78 |
initMapControl3DOptions(); |
|
79 |
initFrameControlButtons(); |
|
80 |
initCloseButton(); |
|
81 |
|
|
82 |
viewsCombo.setSelectedIndex(0); |
|
83 |
translate(); |
|
84 |
} |
|
85 |
|
|
86 |
private void initCloseButton() { |
|
87 |
close.addActionListener(new ActionListener() { |
|
88 |
|
|
89 |
@Override |
|
90 |
public void actionPerformed(ActionEvent e) { |
|
91 |
doClose(); |
|
92 |
|
|
93 |
} |
|
94 |
}); |
|
95 |
} |
|
96 |
|
|
97 |
protected void doClose() { |
|
98 |
this.dispose(); |
|
99 |
this.setVisible(false); |
|
100 |
} |
|
101 |
|
|
102 |
private void initMapControl3DOptions() { |
|
103 |
|
|
104 |
sphericalOption.addActionListener(new ActionListener() { |
|
105 |
|
|
106 |
@Override |
|
107 |
public void actionPerformed(ActionEvent e) { |
|
108 |
doOptionSelected(); |
|
109 |
|
|
110 |
} |
|
111 |
}); |
|
112 |
|
|
113 |
flatOption.addActionListener(new ActionListener() { |
|
114 |
|
|
115 |
@Override |
|
116 |
public void actionPerformed(ActionEvent e) { |
|
117 |
doOptionSelected(); |
|
118 |
|
|
119 |
} |
|
120 |
}); |
|
121 |
} |
|
122 |
|
|
123 |
protected void doOptionSelected() { |
|
124 |
|
|
125 |
if (!animations.getSelectionModel().isSelectionEmpty()) { |
|
126 |
// Add frames 3D to table |
|
127 |
int selectedRow = animations.getSelectedRow(); |
|
128 |
DefaultAnimation3DTableModel model = |
|
129 |
(DefaultAnimation3DTableModel) animations.getModel(); |
|
130 |
Animation3D animation = model.getAnimation(selectedRow); |
|
131 |
initFramesTable(animation); |
|
132 |
|
|
133 |
String viewName = (String) viewsCombo.getSelectedItem(); |
|
134 |
ExtendedPropertiesSupport propertiesSupport = views.get(viewName); |
|
135 |
View3DSwingManager manager = View3DSwingLocator.getManager(); |
|
136 |
if (sphericalOption.isSelected()) { |
|
137 |
MapControl3D mapControl3D = manager.getMapControl3D(propertiesSupport, TYPE.SPHERE); |
|
138 |
if (mapControl3D == null) { |
|
139 |
addFrame.setEnabled(false); |
|
140 |
playAnimation.setEnabled(false); |
|
141 |
} else { |
|
142 |
addFrame.setEnabled(true); |
|
143 |
if (animation.getSphericalFrames().isEmpty()) { |
|
144 |
playAnimation.setEnabled(false); |
|
145 |
} else { |
|
146 |
playAnimation.setEnabled(true); |
|
147 |
} |
|
148 |
} |
|
149 |
} else if (flatOption.isSelected()) { |
|
150 |
MapControl3D mapControl3D = manager.getMapControl3D(propertiesSupport, TYPE.FLAT); |
|
151 |
if (mapControl3D == null) { |
|
152 |
addFrame.setEnabled(false); |
|
153 |
playAnimation.setEnabled(false); |
|
154 |
} else { |
|
155 |
addFrame.setEnabled(true); |
|
156 |
if (animation.getFlatFrames().isEmpty()) { |
|
157 |
playAnimation.setEnabled(false); |
|
158 |
} else { |
|
159 |
playAnimation.setEnabled(true); |
|
160 |
} |
|
161 |
} |
|
162 |
} |
|
163 |
} |
|
164 |
} |
|
165 |
|
|
166 |
private void initFrameControlButtons() { |
|
167 |
|
|
168 |
frames.getSelectionModel().addListSelectionListener(new ListSelectionListener() { |
|
169 |
|
|
170 |
@Override |
|
171 |
public void valueChanged(ListSelectionEvent arg0) { |
|
172 |
doFrameSelected(); |
|
173 |
|
|
174 |
} |
|
175 |
}); |
|
176 |
|
|
177 |
addFrame.addActionListener(new ActionListener() { |
|
178 |
|
|
179 |
@Override |
|
180 |
public void actionPerformed(ActionEvent e) { |
|
181 |
doAddFrameAction(); |
|
182 |
} |
|
183 |
}); |
|
184 |
|
|
185 |
removeFrame.addActionListener(new ActionListener() { |
|
186 |
|
|
187 |
@Override |
|
188 |
public void actionPerformed(ActionEvent e) { |
|
189 |
doRemoveFrameAction(); |
|
190 |
|
|
191 |
} |
|
192 |
}); |
|
193 |
|
|
194 |
upFrame.addActionListener(new ActionListener() { |
|
195 |
|
|
196 |
@Override |
|
197 |
public void actionPerformed(ActionEvent e) { |
|
198 |
doUpFrameAction(); |
|
199 |
|
|
200 |
} |
|
201 |
}); |
|
202 |
|
|
203 |
downFrame.addActionListener(new ActionListener() { |
|
204 |
|
|
205 |
@Override |
|
206 |
public void actionPerformed(ActionEvent e) { |
|
207 |
doDownFrameAction(); |
|
208 |
|
|
209 |
} |
|
210 |
}); |
|
211 |
|
|
212 |
zoomToFrame.addActionListener(new ActionListener() { |
|
213 |
|
|
214 |
@Override |
|
215 |
public void actionPerformed(ActionEvent e) { |
|
216 |
doZoomToFrameAction(); |
|
217 |
|
|
218 |
} |
|
219 |
}); |
|
220 |
} |
|
221 |
|
|
222 |
protected void doFrameSelected() { |
|
223 |
|
|
224 |
if (frames.getSelectionModel().isSelectionEmpty()) { |
|
225 |
removeFrame.setEnabled(false); |
|
226 |
upFrame.setEnabled(false); |
|
227 |
downFrame.setEnabled(false); |
|
228 |
zoomToFrame.setEnabled(false); |
|
229 |
} else { |
|
230 |
|
|
231 |
if (frames.getRowCount() > 1 && frames.getSelectedRows().length == 1) { |
|
232 |
downFrame.setEnabled(true); |
|
233 |
upFrame.setEnabled(true); |
|
234 |
} else { |
|
235 |
downFrame.setEnabled(false); |
|
236 |
upFrame.setEnabled(false); |
|
237 |
} |
|
238 |
|
|
239 |
removeFrame.setEnabled(true); |
|
240 |
|
|
241 |
if (!sphericalOption.isSelected() && !flatOption.isSelected()) { |
|
242 |
addFrame.setEnabled(false); |
|
243 |
zoomToFrame.setEnabled(false); |
|
244 |
} else if (frames.getSelectedRows().length != 1) { |
|
245 |
zoomToFrame.setEnabled(false); |
|
246 |
} else { |
|
247 |
|
|
248 |
String viewName = (String) viewsCombo.getSelectedItem(); |
|
249 |
ExtendedPropertiesSupport propertiesSupport = views.get(viewName); |
|
250 |
View3DSwingManager manager = View3DSwingLocator.getManager(); |
|
251 |
|
|
252 |
if (sphericalOption.isSelected()) { |
|
253 |
MapControl3D mapControl3D = |
|
254 |
manager.getMapControl3D(propertiesSupport, TYPE.SPHERE); |
|
255 |
if (mapControl3D == null) { |
|
256 |
zoomToFrame.setEnabled(false); |
|
257 |
} else if (mapControl3D != null) { |
|
258 |
zoomToFrame.setEnabled(true); |
|
259 |
} |
|
260 |
} else if (flatOption.isSelected()) { |
|
261 |
MapControl3D mapControl3D = |
|
262 |
manager.getMapControl3D(propertiesSupport, TYPE.FLAT); |
|
263 |
if (mapControl3D == null) { |
|
264 |
zoomToFrame.setEnabled(false); |
|
265 |
} else if (mapControl3D != null) { |
|
266 |
zoomToFrame.setEnabled(true); |
|
267 |
} |
|
268 |
} |
|
269 |
} |
|
270 |
} |
|
271 |
} |
|
272 |
|
|
273 |
protected void doAddFrameAction() { |
|
274 |
|
|
275 |
MapControl3D mapControl3D; |
|
276 |
View3DSwingManager swingManager = View3DSwingLocator.getManager(); |
|
277 |
|
|
278 |
String viewName = (String) this.viewsCombo.getSelectedItem(); |
|
279 |
if (sphericalOption.isSelected()) { |
|
280 |
mapControl3D = swingManager.getMapControl3D(this.views.get(viewName), TYPE.SPHERE); |
|
281 |
} else if (flatOption.isSelected()) { |
|
282 |
mapControl3D = swingManager.getMapControl3D(this.views.get(viewName), TYPE.FLAT); |
|
283 |
} else { |
|
284 |
throw new IllegalStateException( |
|
285 |
"Can not add frame if any mapcontrol type option is selected"); |
|
286 |
} |
|
287 |
|
|
288 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
289 |
String name = |
|
290 |
i18nManager.getTranslation("frame_XxnumberxX", |
|
291 |
new String[] { String.valueOf(frames.getRowCount()) }); |
|
292 |
Frame3D newFrame3d = null; |
|
293 |
try { |
|
294 |
Animation3DSwingManager manager = Animation3DSwingLocator.getManager(); |
|
295 |
newFrame3d = manager.createFrame3D(name, mapControl3D); |
|
296 |
} catch (Frame3DCreationException e) { |
|
297 |
LOG.error("Error getting frame 3D", e); |
|
298 |
ThreadSafeDialogsManager dialogsManager = |
|
299 |
ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
300 |
dialogsManager.messageDialog( |
|
301 |
i18nManager.getTranslation("error_getting_frame_of_3D_view"), |
|
302 |
i18nManager.getTranslation("_error"), JOptionPane.ERROR_MESSAGE); |
|
303 |
return; |
|
304 |
} |
|
305 |
DefaultFrame3DTableModel model = (DefaultFrame3DTableModel) frames.getModel(); |
|
306 |
model.addFrame(newFrame3d); |
|
307 |
this.playAnimation.setEnabled(true); |
|
308 |
|
|
309 |
if (model.getRowCount() > 1 && !this.frames.getSelectionModel().isSelectionEmpty()) { |
|
310 |
upFrame.setEnabled(true); |
|
311 |
downFrame.setEnabled(true); |
|
312 |
} |
|
313 |
} |
|
314 |
|
|
315 |
protected void doRemoveFrameAction() { |
|
316 |
|
|
317 |
if (this.frames.getSelectionModel().isSelectionEmpty()) { |
|
318 |
return; |
|
319 |
} |
|
320 |
|
|
321 |
List<Frame3D> frames = getSelectedFrames(); |
|
322 |
DefaultFrame3DTableModel model = (DefaultFrame3DTableModel) this.frames.getModel(); |
|
323 |
for (Frame3D frame : frames) { |
|
324 |
model.removeFrame(frame); |
|
325 |
} |
|
326 |
|
|
327 |
if (model.getRowCount() == 0) { |
|
328 |
playAnimation.setEnabled(false); |
|
329 |
removeFrame.setEnabled(false); |
|
330 |
upFrame.setEnabled(false); |
|
331 |
downFrame.setEnabled(false); |
|
332 |
zoomToFrame.setEnabled(false); |
|
333 |
} |
|
334 |
} |
|
335 |
|
|
336 |
private List<Frame3D> getSelectedFrames() { |
|
337 |
List<Frame3D> selectedFrames = new ArrayList<Frame3D>(); |
|
338 |
int[] selectedRows = this.frames.getSelectedRows(); |
|
339 |
DefaultFrame3DTableModel model = (DefaultFrame3DTableModel) this.frames.getModel(); |
|
340 |
for (int selectedRow : selectedRows) { |
|
341 |
selectedFrames.add(model.getFrame(selectedRow)); |
|
342 |
} |
|
343 |
return selectedFrames; |
|
344 |
} |
|
345 |
|
|
346 |
protected void doUpFrameAction() { |
|
347 |
if (this.frames.getSelectionModel().isSelectionEmpty()) { |
|
348 |
return; |
|
349 |
} |
|
350 |
|
|
351 |
int minSelectionIndex = this.frames.getSelectionModel().getMinSelectionIndex(); |
|
352 |
int maxSelectionIndex = this.frames.getSelectionModel().getMaxSelectionIndex(); |
|
353 |
|
|
354 |
List<Frame3D> selectedFrames = getSelectedFrames(); |
|
355 |
DefaultFrame3DTableModel model = (DefaultFrame3DTableModel) this.frames.getModel(); |
|
356 |
for (Frame3D frame3d : selectedFrames) { |
|
357 |
model.upFrame(frame3d); |
|
358 |
} |
|
359 |
|
|
360 |
if (minSelectionIndex - 1 > -1 && maxSelectionIndex - 1 > -1) { |
|
361 |
this.frames.getSelectionModel().setSelectionInterval(minSelectionIndex - 1, |
|
362 |
maxSelectionIndex - 1); |
|
363 |
} |
|
364 |
} |
|
365 |
|
|
366 |
protected void doDownFrameAction() { |
|
367 |
if (this.frames.getSelectionModel().isSelectionEmpty()) { |
|
368 |
return; |
|
369 |
} |
|
370 |
|
|
371 |
int minSelectionIndex = this.frames.getSelectionModel().getMinSelectionIndex(); |
|
372 |
int maxSelectionIndex = this.frames.getSelectionModel().getMaxSelectionIndex(); |
|
373 |
|
|
374 |
List<Frame3D> selectedFrames = getSelectedFrames(); |
|
375 |
DefaultFrame3DTableModel model = (DefaultFrame3DTableModel) this.frames.getModel(); |
|
376 |
for (Frame3D frame3d : selectedFrames) { |
|
377 |
model.downFrame(frame3d); |
|
378 |
} |
|
379 |
|
|
380 |
if (minSelectionIndex + 1 < this.frames.getRowCount() |
|
381 |
&& maxSelectionIndex + 1 < this.frames.getRowCount()) { |
|
382 |
this.frames.getSelectionModel().setSelectionInterval(minSelectionIndex + 1, |
|
383 |
maxSelectionIndex + 1); |
|
384 |
} |
|
385 |
|
|
386 |
} |
|
387 |
|
|
388 |
protected void doZoomToFrameAction() { |
|
389 |
if (this.frames.getSelectionModel().isSelectionEmpty()) { |
|
390 |
return; |
|
391 |
} |
|
392 |
|
|
393 |
int selectedRow = this.frames.getSelectedRow(); |
|
394 |
DefaultFrame3DTableModel model = (DefaultFrame3DTableModel) this.frames.getModel(); |
|
395 |
Frame3D frame = model.getFrame(selectedRow); |
|
396 |
|
|
397 |
MapControl3D mapControl3D; |
|
398 |
View3DSwingManager swingManager = View3DSwingLocator.getManager(); |
|
399 |
|
|
400 |
String viewName = (String) this.viewsCombo.getSelectedItem(); |
|
401 |
if (sphericalOption.isSelected()) { |
|
402 |
mapControl3D = swingManager.getMapControl3D(this.views.get(viewName), TYPE.SPHERE); |
|
403 |
} else if (flatOption.isSelected()) { |
|
404 |
mapControl3D = swingManager.getMapControl3D(this.views.get(viewName), TYPE.FLAT); |
|
405 |
} else { |
|
406 |
return; |
|
407 |
} |
|
408 |
|
|
409 |
Animation3DSwingManager manager = Animation3DSwingLocator.getManager(); |
|
410 |
Animator goToAnimator = |
|
411 |
manager.createGoToAnimator(mapControl3D, frame, 4000, 16000); //TODO Make time configurable |
|
412 |
manager.addAnimator(mapControl3D, goToAnimator); |
|
413 |
} |
|
414 |
|
|
415 |
private void initAnimationsTable() { |
|
416 |
|
|
417 |
animations.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
|
418 |
animations.getSelectionModel().addListSelectionListener(new ListSelectionListener() { |
|
419 |
|
|
420 |
@Override |
|
421 |
public void valueChanged(ListSelectionEvent e) { |
|
422 |
doAnimationSelectedAction(); |
|
423 |
|
|
424 |
} |
|
425 |
}); |
|
426 |
|
|
427 |
} |
|
428 |
|
|
429 |
protected void doAnimationSelectedAction() { |
|
430 |
|
|
431 |
String viewName = (String) viewsCombo.getSelectedItem(); |
|
432 |
ExtendedPropertiesSupport viewProperties = views.get(viewName); |
|
433 |
if (StringUtils.isBlank(viewName) || viewProperties == null) { |
|
434 |
addAnimation.setEnabled(false); |
|
435 |
removeAnimation.setEnabled(false); |
|
436 |
sphericalOption.setEnabled(false); |
|
437 |
flatOption.setEnabled(false); |
|
438 |
playAnimation.setEnabled(false); |
|
439 |
frames.setModel(new DefaultTableModel()); |
|
440 |
addFrame.setEnabled(false); |
|
441 |
removeFrame.setEnabled(false); |
|
442 |
upFrame.setEnabled(false); |
|
443 |
downFrame.setEnabled(false); |
|
444 |
zoomToFrame.setEnabled(false); |
|
445 |
return; |
|
446 |
} |
|
447 |
|
|
448 |
// Enable remove button |
|
449 |
if (!animations.getSelectionModel().isSelectionEmpty()) { |
|
450 |
removeAnimation.setEnabled(true); |
|
451 |
} |
|
452 |
|
|
453 |
sphericalOption.setEnabled(true); |
|
454 |
flatOption.setEnabled(true); |
|
455 |
|
|
456 |
if (animations.getSelectionModel().isSelectionEmpty()) { |
|
457 |
return; |
|
458 |
} |
|
459 |
|
|
460 |
int selectedRow = animations.getSelectedRow(); |
|
461 |
DefaultAnimation3DTableModel model = (DefaultAnimation3DTableModel) animations.getModel(); |
|
462 |
Animation3D animation = model.getAnimation(selectedRow); |
|
463 |
|
|
464 |
if (sphericalOption.isSelected()) { |
|
465 |
MapControl3D mapControl3D = |
|
466 |
View3DSwingLocator.getManager().getMapControl3D(viewProperties, TYPE.SPHERE); |
|
467 |
if (mapControl3D != null) { |
|
468 |
addFrame.setEnabled(true); |
|
469 |
if (animation.getSphericalFrames().isEmpty()) { |
|
470 |
playAnimation.setEnabled(false); |
|
471 |
} else { |
|
472 |
playAnimation.setEnabled(true); |
|
473 |
} |
|
474 |
} else { |
|
475 |
addFrame.setEnabled(false); |
|
476 |
playAnimation.setEnabled(false); |
|
477 |
} |
|
478 |
|
|
479 |
} else if (flatOption.isSelected()) { |
|
480 |
MapControl3D mapControl3D = |
|
481 |
View3DSwingLocator.getManager().getMapControl3D(viewProperties, TYPE.FLAT); |
|
482 |
if (mapControl3D != null) { |
|
483 |
addFrame.setEnabled(true); |
|
484 |
if (animation.getFlatFrames().isEmpty()) { |
|
485 |
playAnimation.setEnabled(false); |
|
486 |
} else { |
|
487 |
playAnimation.setEnabled(true); |
|
488 |
} |
|
489 |
} else { |
|
490 |
addFrame.setEnabled(false); |
|
491 |
playAnimation.setEnabled(false); |
|
492 |
} |
|
493 |
} |
|
494 |
|
|
495 |
initFramesTable(animation); |
|
496 |
} |
|
497 |
|
|
498 |
private void initFramesTable(Animation3D animation) { |
|
499 |
|
|
500 |
List<Frame3D> frameList = null; |
|
501 |
if (sphericalOption.isSelected()) { |
|
502 |
frameList = animation.getSphericalFrames(); |
|
503 |
} else if (flatOption.isSelected()) { |
|
504 |
frameList = animation.getFlatFrames(); |
|
505 |
} else { |
|
506 |
return; |
|
507 |
} |
|
508 |
|
|
509 |
this.frames.getSelectionModel().setSelectionMode( |
|
510 |
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); |
|
511 |
DefaultFrame3DTableModel frameTableModel = new DefaultFrame3DTableModel(frameList); |
|
512 |
this.frames.setModel(frameTableModel); |
|
513 |
this.frames.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); |
|
514 |
this.frames.getColumnModel().getColumn(0).setMaxWidth(80); |
|
515 |
this.frames.getSelectionModel().addListSelectionListener(new ListSelectionListener() { |
|
516 |
|
|
517 |
@Override |
|
518 |
public void valueChanged(ListSelectionEvent e) { |
|
519 |
removeFrame.setEnabled(true); |
|
520 |
upFrame.setEnabled(true); |
|
521 |
downFrame.setEnabled(true); |
|
522 |
zoomToFrame.setEnabled(true); |
|
523 |
} |
|
524 |
}); |
|
525 |
} |
|
526 |
|
|
527 |
private void initAnimationControlButtons() { |
|
528 |
addAnimation.addActionListener(new ActionListener() { |
|
529 |
|
|
530 |
@Override |
|
531 |
public void actionPerformed(ActionEvent e) { |
|
532 |
doAddAnimation(); |
|
533 |
} |
|
534 |
}); |
|
535 |
removeAnimation.addActionListener(new ActionListener() { |
|
536 |
|
|
537 |
@Override |
|
538 |
public void actionPerformed(ActionEvent e) { |
|
539 |
doRemoveAnimation(); |
|
540 |
} |
|
541 |
}); |
|
542 |
|
|
543 |
playAnimation.addActionListener(new ActionListener() { |
|
544 |
|
|
545 |
@Override |
|
546 |
public void actionPerformed(ActionEvent e) { |
|
547 |
doPlay(); |
|
548 |
|
|
549 |
} |
|
550 |
}); |
|
551 |
} |
|
552 |
|
|
553 |
protected void doPlay() { |
|
554 |
|
|
555 |
MapControl3D mapControl3D = null; |
|
556 |
String viewName = (String) this.viewsCombo.getSelectedItem(); |
|
557 |
ExtendedPropertiesSupport viewProperties = this.views.get(viewName); |
|
558 |
if (sphericalOption.isSelected()) { |
|
559 |
mapControl3D = |
|
560 |
View3DSwingLocator.getManager().getMapControl3D(viewProperties, TYPE.SPHERE); |
|
561 |
} else if (flatOption.isSelected()) { |
|
562 |
mapControl3D = |
|
563 |
View3DSwingLocator.getManager().getMapControl3D(viewProperties, TYPE.FLAT); |
|
564 |
} |
|
565 |
|
|
566 |
int selectedRow = this.animations.getSelectedRow(); |
|
567 |
DefaultAnimation3DTableModel model = |
|
568 |
(DefaultAnimation3DTableModel) this.animations.getModel(); |
|
569 |
Animation3D animation = model.getAnimation(selectedRow); |
|
570 |
List<Frame3D> frames = null; |
|
571 |
if (sphericalOption.isSelected()) { |
|
572 |
frames = animation.getSphericalFrames(); |
|
573 |
} else { |
|
574 |
frames = animation.getFlatFrames(); |
|
575 |
} |
|
576 |
|
|
577 |
Animation3DSwingManager manager = Animation3DSwingLocator.getManager(); |
|
578 |
Animator goToAnimator = |
|
579 |
manager.createGoToAnimator(mapControl3D, frames, 4000, 16000); //TODO Make time configurable |
|
580 |
manager.stopAnimations(mapControl3D); |
|
581 |
manager.addAnimator(mapControl3D, goToAnimator); |
|
582 |
} |
|
583 |
|
|
584 |
protected void doAddAnimation() { |
|
585 |
Animation3DSwingManager manager = Animation3DSwingLocator.getManager(); |
|
586 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
587 |
String name = |
|
588 |
i18nManager.getTranslation("animation_XxnumberxX", |
|
589 |
new String[] { String.valueOf(animations.getRowCount()) }); |
|
590 |
Animation3D newAnimation = |
|
591 |
manager.createAnimation3D(name, new ArrayList<Frame3D>(), new ArrayList<Frame3D>()); |
|
592 |
DefaultAnimation3DTableModel tableModel = |
|
593 |
(DefaultAnimation3DTableModel) animations.getModel(); |
|
594 |
tableModel.addAnimation(newAnimation); |
|
595 |
} |
|
596 |
|
|
597 |
protected void doRemoveAnimation() { |
|
598 |
if (animations.getSelectionModel().isSelectionEmpty()) { |
|
599 |
return; |
|
600 |
} |
|
601 |
int selectedRow = animations.getSelectedRow(); |
|
602 |
DefaultAnimation3DTableModel tableModel = |
|
603 |
(DefaultAnimation3DTableModel) animations.getModel(); |
|
604 |
tableModel.removeAnimation(selectedRow); |
|
605 |
|
|
606 |
frames.setModel(new DefaultTableModel(0, 0)); |
|
607 |
addFrame.setEnabled(false); |
|
608 |
buttongroup1.clearSelection(); |
|
609 |
removeAnimation.setEnabled(false); |
|
610 |
sphericalOption.setEnabled(false); |
|
611 |
flatOption.setEnabled(false); |
|
612 |
playAnimation.setEnabled(false); |
|
613 |
} |
|
614 |
|
|
615 |
@SuppressWarnings("unchecked") |
|
616 |
private void initViewsCombo(Set<String> set) { |
|
617 |
for (String name : set) { |
|
618 |
viewsCombo.addItem(name); |
|
619 |
} |
|
620 |
|
|
621 |
viewsCombo.addActionListener(new ActionListener() { |
|
622 |
|
|
623 |
@Override |
|
624 |
public void actionPerformed(ActionEvent e) { |
|
625 |
doViewSelectedAction(); |
|
626 |
} |
|
627 |
}); |
|
628 |
} |
|
629 |
|
|
630 |
protected void doViewSelectedAction() { |
|
631 |
String viewName = (String) viewsCombo.getSelectedItem(); |
|
632 |
if (StringUtils.isNotBlank(viewName)) { |
|
633 |
ExtendedPropertiesSupport viewProperties = views.get(viewName); |
|
634 |
Animation3DSwingManager manager = Animation3DSwingLocator.getManager(); |
|
635 |
List<Animation3D> animations = manager.getAnimations(viewProperties); |
|
636 |
DefaultAnimation3DTableModel animationTableModel = |
|
637 |
new DefaultAnimation3DTableModel(animations); |
|
638 |
this.animations.setModel(animationTableModel); |
|
639 |
this.addAnimation.setEnabled(true); |
|
640 |
removeAnimation.setEnabled(false); |
|
641 |
sphericalOption.setEnabled(false); |
|
642 |
flatOption.setEnabled(false); |
|
643 |
playAnimation.setEnabled(false); |
|
644 |
frames.setModel(new DefaultTableModel()); |
|
645 |
addFrame.setEnabled(false); |
|
646 |
removeFrame.setEnabled(false); |
|
647 |
upFrame.setEnabled(false); |
|
648 |
downFrame.setEnabled(false); |
|
649 |
zoomToFrame.setEnabled(false); |
|
650 |
|
|
651 |
List<MapControl3D> mapControl3Ds = |
|
652 |
View3DSwingLocator.getManager().getMapControl3D(viewProperties); |
|
653 |
for (MapControl3D mapControl3D : mapControl3Ds) { |
|
654 |
mapControl3D.addObserver(this); |
|
655 |
} |
|
656 |
|
|
657 |
return; |
|
658 |
} else { |
|
659 |
removeAnimation.setEnabled(false); |
|
660 |
buttongroup1.clearSelection(); |
|
661 |
sphericalOption.setEnabled(false); |
|
662 |
flatOption.setEnabled(false); |
|
663 |
animations.setModel(new DefaultTableModel()); |
|
664 |
} |
|
665 |
} |
|
666 |
|
|
667 |
@Override |
|
668 |
public void setLocale(Locale l) { |
|
669 |
if (!getLocale().equals(l)) { |
|
670 |
translate(); |
|
671 |
} |
|
672 |
super.setLocale(l); |
|
673 |
} |
|
674 |
|
|
675 |
private void translate() { |
|
676 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
677 |
viewText.setText(i18nManager.getTranslation(viewText.getText())); |
|
678 |
addAnimation.setText(i18nManager.getTranslation(addAnimation.getText())); |
|
679 |
removeAnimation.setText(i18nManager.getTranslation(removeAnimation.getText())); |
|
680 |
playAnimation.setText(i18nManager.getTranslation(playAnimation.getText())); |
|
681 |
sphericalOption.setText(i18nManager.getTranslation(sphericalOption.getText())); |
|
682 |
flatOption.setText(i18nManager.getTranslation(flatOption.getText())); |
|
683 |
addFrame.setText(i18nManager.getTranslation(addFrame.getText())); |
|
684 |
removeFrame.setText(i18nManager.getTranslation(removeFrame.getText())); |
|
685 |
upFrame.setText(i18nManager.getTranslation(upFrame.getText())); |
|
686 |
downFrame.setText(i18nManager.getTranslation(downFrame.getText())); |
|
687 |
zoomToFrame.setText(i18nManager.getTranslation(zoomToFrame.getText())); |
|
688 |
close.setText(i18nManager.getTranslation(close.getText())); |
|
689 |
} |
|
690 |
|
|
691 |
@Override |
|
692 |
public JComponent asJComponent() { |
|
693 |
return this; |
|
694 |
} |
|
695 |
|
|
696 |
@Override |
|
697 |
public Dimension getPreferredSize() { |
|
698 |
return new Dimension(510, 530); |
|
699 |
} |
|
700 |
|
|
701 |
@SuppressWarnings("unchecked") |
|
702 |
@Override |
|
703 |
public void addExtendedPropertiesSupport(String name, ExtendedPropertiesSupport viewDocument) { |
|
704 |
this.views.put(name, viewDocument); |
|
705 |
this.viewsCombo.addItem(name); |
|
706 |
} |
|
707 |
|
|
708 |
@Override |
|
709 |
public void removeExtendedPropertiesSupport(String name) { |
|
710 |
this.views.remove(name); |
|
711 |
this.viewsCombo.removeItem(name); |
|
712 |
} |
|
713 |
|
|
714 |
@SuppressWarnings("unchecked") |
|
715 |
@Override |
|
716 |
public void changeExtendedPropertiesSupportName(String oldValue, String newValue) { |
|
717 |
ExtendedPropertiesSupport viewDocument = this.views.remove(oldValue); |
|
718 |
this.views.put(newValue, viewDocument); |
|
719 |
this.viewsCombo.removeItem(oldValue); |
|
720 |
this.viewsCombo.addItem(newValue); |
|
721 |
this.viewsCombo.setSelectedItem(newValue); |
|
722 |
} |
|
723 |
|
|
724 |
@Override |
|
725 |
public void update(Observable observable, Object object) { |
|
726 |
if (object instanceof Notification) { |
|
727 |
Notification notification = (Notification) object; |
|
728 |
if (observable instanceof View3DSwingManager || observable instanceof MapControl3D) { |
|
729 |
|
|
730 |
if (MapControl3D.AFTER_DISPOSE_MAPCONTEX3D_NOTIFICATION.equals(notification |
|
731 |
.getType())) { |
|
732 |
doAnimationSelectedAction(); |
|
733 |
doOptionSelected(); |
|
734 |
} else if (View3DSwingManager.AFTER_CREATE_MAPCONTROL3D.equals(notification |
|
735 |
.getType())) { |
|
736 |
|
|
737 |
MapControl3D mapControl3D = (MapControl3D) notification.getValue(); |
|
738 |
mapControl3D.addObserver(this); |
|
739 |
|
|
740 |
if (sphericalOption.isSelected() || flatOption.isSelected()) { |
|
741 |
doOptionSelected(); |
|
742 |
} |
|
743 |
} |
|
744 |
} |
|
745 |
} |
|
746 |
} |
|
747 |
|
|
748 |
@Override |
|
749 |
public void dispose() { |
|
750 |
View3DSwingManager manager = View3DSwingLocator.getManager(); |
|
751 |
manager.deleteObserver(this); |
|
752 |
|
|
753 |
Collection<ExtendedPropertiesSupport> properties = views.values(); |
|
754 |
for (ExtendedPropertiesSupport extendedProperties : properties) { |
|
755 |
|
|
756 |
List<MapControl3D> mapControl3Ds = manager.getMapControl3D(extendedProperties); |
|
757 |
for (MapControl3D mapControl3D : mapControl3Ds) { |
|
758 |
mapControl3D.deleteObserver(this); |
|
759 |
} |
|
760 |
} |
|
761 |
} |
|
762 |
|
|
763 |
@Override |
|
764 |
public ExtendedPropertiesSupport getSelectedExtendedProperties() { |
|
765 |
String name = (String) this.viewsCombo.getSelectedItem(); |
|
766 |
return this.views.get(name); |
|
767 |
} |
|
768 |
|
|
769 |
@Override |
|
770 |
public Animation3D getSelectedAnimation3D() { |
|
771 |
|
|
772 |
if(animations.getSelectionModel().isSelectionEmpty()){ |
|
773 |
return null; |
|
774 |
} |
|
775 |
|
|
776 |
int selectedRow = this.animations.getSelectedRow(); |
|
777 |
DefaultAnimation3DTableModel model = |
|
778 |
(DefaultAnimation3DTableModel) this.animations.getModel(); |
|
779 |
return model.getAnimation(selectedRow); |
|
780 |
} |
|
781 |
|
|
782 |
@Override |
|
783 |
public List<Frame3D> getSelectedFrames3D() { |
|
784 |
int[] selectedRows = frames.getSelectedRows(); |
|
785 |
DefaultFrame3DTableModel model = (DefaultFrame3DTableModel) frames.getModel(); |
|
786 |
List<Frame3D> selectedFrames = new ArrayList<Frame3D>(); |
|
787 |
for (int i : selectedRows) { |
|
788 |
selectedFrames.add(model.getFrame(i)); |
|
789 |
} |
|
790 |
return selectedFrames; |
|
791 |
} |
|
792 |
|
|
793 |
@Override |
|
794 |
public boolean isSphericalOptionSelected() { |
|
795 |
return sphericalOption.isSelected(); |
|
796 |
} |
|
797 |
|
|
798 |
@Override |
|
799 |
public boolean isFlatOptionSelected() { |
|
800 |
return flatOption.isSelected(); |
|
801 |
} |
|
802 |
} |
org.gvsig.animation3d/tags/org.gvsig.animation3d-1.0.0/org.gvsig.animation3d.swing/org.gvsig.animation3d.swing.impl/src/main/java/org/gvsig/animation3d/swing/impl/DefaultFrame3DTableModel.java | ||
---|---|---|
1 |
package org.gvsig.animation3d.swing.impl; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
|
|
5 |
import javax.swing.table.AbstractTableModel; |
|
6 |
|
|
7 |
import org.gvsig.animation3d.swing.api.Frame3D; |
|
8 |
import org.gvsig.tools.ToolsLocator; |
|
9 |
import org.gvsig.tools.dataTypes.CoercionException; |
|
10 |
import org.gvsig.tools.dataTypes.DataTypes; |
|
11 |
import org.gvsig.tools.i18n.I18nManager; |
|
12 |
import org.slf4j.Logger; |
|
13 |
import org.slf4j.LoggerFactory; |
|
14 |
|
|
15 |
/** |
|
16 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
|
17 |
* |
|
18 |
*/ |
|
19 |
public class DefaultFrame3DTableModel extends AbstractTableModel { |
|
20 |
|
|
21 |
private static final long serialVersionUID = -8595029429044669675L; |
|
22 |
|
|
23 |
private static final Logger LOG = LoggerFactory.getLogger(DefaultFrame3DTableModel.class); |
|
24 |
|
|
25 |
private List<Frame3D> frames; |
|
26 |
|
|
27 |
String[] columns = new String[] { "order", "frame" }; |
|
28 |
|
|
29 |
public DefaultFrame3DTableModel(List<Frame3D> frames) { |
|
30 |
this.frames = frames; |
|
31 |
} |
Also available in: Unified diff