gvsig-3d / 2.1 / trunk / org.gvsig.gvsig3d / org.gvsig.gvsig3d.app / org.gvsig.gvsig3d.app.commons / src / main / java / org / gvsig / gvsig3d / app / gui / toc / Properties3DManager.java @ 385
History | View | Annotate | Download (2.92 KB)
1 |
/* gvSIG 3D extension for gvSIG
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2012 Prodevelop.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Prodevelop, S.L.
|
22 |
* Pza. Don Juan de Villarrasa, 14 - 5
|
23 |
* 46001 Valencia
|
24 |
* Spain
|
25 |
*
|
26 |
* +34 963 510 612
|
27 |
* +34 963 510 968
|
28 |
* prode@prodevelop.es
|
29 |
* http://www.prodevelop.es
|
30 |
*/
|
31 |
/*
|
32 |
* AUTHORS:
|
33 |
* 2012 AI2 - Instituto Universitario de Automatica e Informatica Industrial.
|
34 |
* Universitat Politecnica de Valencia (UPV)
|
35 |
* http://www.ai2.upv.es
|
36 |
*/
|
37 |
|
38 |
|
39 |
package org.gvsig.gvsig3d.app.gui.toc; |
40 |
|
41 |
import java.awt.BorderLayout; |
42 |
import java.awt.event.ActionEvent; |
43 |
import java.awt.event.ActionListener; |
44 |
|
45 |
import org.gvsig.app.project.documents.view.legend.gui.AbstractThemeManagerPage; |
46 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
47 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
48 |
import org.gvsig.gui.beans.panelGroup.PanelGroupManager; |
49 |
import org.gvsig.gvsig3d.app.gui.panels.Vectorial3DPanel; |
50 |
|
51 |
/**
|
52 |
*
|
53 |
* @author Jesus Zarzoso- jzarzoso@ai2.upv.es
|
54 |
*
|
55 |
*/
|
56 |
public class Properties3DManager extends AbstractThemeManagerPage implements |
57 |
ActionListener {
|
58 |
|
59 |
private static final long serialVersionUID = 856162295998595717L; |
60 |
|
61 |
private FLayer layer;
|
62 |
private Vectorial3DPanel panel;
|
63 |
|
64 |
public Properties3DManager() {
|
65 |
super();
|
66 |
setLayout(new BorderLayout()); |
67 |
|
68 |
} |
69 |
|
70 |
public void actionPerformed(ActionEvent arg0) { |
71 |
// TODO Auto-generated method stub
|
72 |
|
73 |
} |
74 |
|
75 |
@Override
|
76 |
public String getName() { |
77 |
// TODO Auto-generated method stub
|
78 |
return "3D"; |
79 |
} |
80 |
|
81 |
@Override
|
82 |
public void acceptAction() { |
83 |
if (panel != null) |
84 |
panel.accept(); |
85 |
|
86 |
} |
87 |
|
88 |
@Override
|
89 |
public void cancelAction() { |
90 |
if (panel != null) |
91 |
panel.cancel(); |
92 |
} |
93 |
|
94 |
@Override
|
95 |
public void applyAction() { |
96 |
if (panel != null) |
97 |
panel.apply(); |
98 |
|
99 |
} |
100 |
|
101 |
@Override
|
102 |
public void setModel(FLayer layer) { |
103 |
|
104 |
this.layer = (FLyrVect) layer;
|
105 |
PanelGroupManager manager = PanelGroupManager.getManager(); |
106 |
manager.registerPanelGroup(Vectorial3DPanel.class); |
107 |
manager.setDefaultType(Vectorial3DPanel.class); |
108 |
|
109 |
try {
|
110 |
|
111 |
boolean firstExecution = (panel == null); |
112 |
panel = (Vectorial3DPanel) manager.getPanelGroup(layer); |
113 |
panel.setVisible(true);
|
114 |
if (firstExecution) {
|
115 |
add(panel, BorderLayout.NORTH);
|
116 |
} |
117 |
|
118 |
} catch (Exception e) { |
119 |
// LOG.error("Error loading the layer", e);
|
120 |
} |
121 |
|
122 |
} |
123 |
} |