Revision 498
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.main/src/main/java/org/gvsig/view3d/main/PaletteActions.java | ||
---|---|---|
246 | 246 |
View3DSwingManager manager = View3DSwingLocator.getManager(); |
247 | 247 |
View3DPanel view3dPanel = |
248 | 248 |
manager.createView3DPanel(main.getMapContext(), |
249 |
TYPE.SPHERE, new DummieExtendedPropertiesSupport()); |
|
249 |
"Main",TYPE.SPHERE, new DummieExtendedPropertiesSupport());
|
|
250 | 250 |
view3dPanel.show(); |
251 | 251 |
} |
252 | 252 |
}; |
... | ... | |
291 | 291 |
public void actionPerformed(ActionEvent e) { |
292 | 292 |
View3DSwingManager manager = View3DSwingLocator.getManager(); |
293 | 293 |
View3DPanel view3dPanel = |
294 |
manager.createView3DPanel(main.getMapContext(), TYPE.FLAT, |
|
294 |
manager.createView3DPanel(main.getMapContext(),"Main", TYPE.FLAT,
|
|
295 | 295 |
new DummieExtendedPropertiesSupport()); |
296 | 296 |
// Change value for constant key |
297 | 297 |
view3dPanel.show(); |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.api/src/main/java/org/gvsig/view3d/swing/api/View3DSwingManager.java | ||
---|---|---|
55 | 55 |
* @param theMapContext |
56 | 56 |
* associated <code>MapContext</code> of |
57 | 57 |
* <code>MapControl3D</code> |
58 |
* @param title |
|
59 |
* Title of window |
|
58 | 60 |
* @param type |
59 | 61 |
* Type of <code>MapControl3D</code>. See {@link TYPE}. |
60 | 62 |
* @param viewProperties |
... | ... | |
62 | 64 |
* @see View3DSwingManager#createMapControl3D(MapContext, TYPE) |
63 | 65 |
* @return |
64 | 66 |
*/ |
65 |
public View3DPanel createView3DPanel(MapContext theMapContext, TYPE type, |
|
67 |
public View3DPanel createView3DPanel(MapContext theMapContext,String title, TYPE type,
|
|
66 | 68 |
ExtendedPropertiesSupport viewProperties); |
67 | 69 |
|
68 | 70 |
/** |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultView3DPanel.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
import org.gvsig.fmap.mapcontext.MapContext; |
35 | 35 |
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport; |
36 |
import org.gvsig.tools.ToolsLocator; |
|
37 |
import org.gvsig.tools.i18n.I18nManager; |
|
36 | 38 |
import org.gvsig.tools.observer.ObservableHelper; |
37 | 39 |
import org.gvsig.tools.observer.Observer; |
38 | 40 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
... | ... | |
53 | 55 |
private static final long serialVersionUID = -87105248886531868L; |
54 | 56 |
|
55 | 57 |
private ObservableHelper observableHelper; |
58 |
|
|
59 |
private String title; |
|
56 | 60 |
|
57 | 61 |
private MapControl3D mapControl3D; |
58 | 62 |
|
... | ... | |
67 | 71 |
* @param viewProperties |
68 | 72 |
* View properties to register a <code>MapControl3D</code> |
69 | 73 |
*/ |
70 |
public DefaultView3DPanel(MapContext theMapContext, TYPE type, |
|
74 |
public DefaultView3DPanel(MapContext theMapContext,String title, TYPE type,
|
|
71 | 75 |
ExtendedPropertiesSupport viewProperties) { |
72 | 76 |
|
73 | 77 |
super(new BorderLayout()); |
78 |
|
|
79 |
this.title = composeTitle(title); |
|
74 | 80 |
|
75 | 81 |
View3DSwingManager swingManager = View3DSwingLocator.getManager(); |
76 | 82 |
this.mapControl3D = |
... | ... | |
96 | 102 |
}); |
97 | 103 |
} |
98 | 104 |
|
105 |
private String composeTitle(String title) { |
|
106 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
107 |
StringBuilder stb = new StringBuilder(); |
|
108 |
stb.append(i18nManager.getTranslation("view_3d")); |
|
109 |
stb.append(" "); |
|
110 |
stb.append(":"); |
|
111 |
stb.append(" "); |
|
112 |
stb.append(title); |
|
113 |
return stb.toString(); |
|
114 |
} |
|
115 |
|
|
99 | 116 |
public JComponent asJComponent() { |
100 | 117 |
return this; |
101 | 118 |
} |
... | ... | |
106 | 123 |
|
107 | 124 |
public void show() { |
108 | 125 |
WindowManager wm = ToolsSwingLocator.getWindowManager(); |
109 |
wm.showWindow(this, "_View3D_window", WindowManager.MODE.WINDOW);
|
|
126 |
wm.showWindow(this, title, WindowManager.MODE.WINDOW);
|
|
110 | 127 |
} |
111 | 128 |
|
112 | 129 |
public void addObserver(Observer o) { |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultView3DSwingManager.java | ||
---|---|---|
74 | 74 |
return mapControl3D; |
75 | 75 |
} |
76 | 76 |
|
77 |
public View3DPanel createView3DPanel(MapContext theMapContext, TYPE type, |
|
77 |
public View3DPanel createView3DPanel(MapContext theMapContext,String title, TYPE type,
|
|
78 | 78 |
ExtendedPropertiesSupport viewProperties) { |
79 | 79 |
|
80 | 80 |
if(theMapContext == null || type == null){ |
... | ... | |
82 | 82 |
throw new IllegalArgumentException(); |
83 | 83 |
} |
84 | 84 |
|
85 |
return new DefaultView3DPanel(theMapContext, type, viewProperties); |
|
85 |
return new DefaultView3DPanel(theMapContext,title, type, viewProperties);
|
|
86 | 86 |
} |
87 | 87 |
|
88 | 88 |
public LayerProperties3DPanel createLayerProperties3DPanel(FLayer layer) { |
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.app/org.gvsig.view3d.app.common/src/main/java/org/gvsig/view3d/app/mainplugin/View3DExtension.java | ||
---|---|---|
101 | 101 |
if (view != null && type != null) { |
102 | 102 |
View3DSwingManager manager = View3DSwingLocator.getManager(); |
103 | 103 |
|
104 |
ViewDocument viewDocument = view.getViewDocument(); |
|
104 | 105 |
MapControl3D mapControl3D = |
105 | 106 |
manager.getMapControl3D( |
106 |
(ExtendedPropertiesSupport) view.getViewDocument(), type);
|
|
107 |
(ExtendedPropertiesSupport) viewDocument, type);
|
|
107 | 108 |
if (mapControl3D == null || mapControl3D.getType() != type) { |
108 | 109 |
View3DPanel view3DPanel = |
109 | 110 |
manager.createView3DPanel(view.getMapControl() |
110 |
.getMapContext(), type, |
|
111 |
(ExtendedPropertiesSupport) view.getViewDocument());
|
|
111 |
.getMapContext(), viewDocument.getName(), type,
|
|
112 |
(ExtendedPropertiesSupport) viewDocument);
|
|
112 | 113 |
view3DPanel.getMapControl3D().addObserver(this); |
113 | 114 |
view3DPanel.show(); |
114 | 115 |
} |
Also available in: Unified diff