root / branches / v2_0_0_prep / extensions / extEditing / src / org / gvsig / editing / LayerPropertiesExtension.java @ 31496
History | View | Annotate | Download (2.74 KB)
1 |
package org.gvsig.editing; |
---|---|
2 |
|
3 |
import org.gvsig.andami.PluginServices; |
4 |
import org.gvsig.andami.plugins.Extension; |
5 |
import org.gvsig.app.project.documents.view.ViewDocument; |
6 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
7 |
import org.gvsig.fmap.mapcontext.MapContext; |
8 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
9 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
10 |
import org.gvsig.fmap.mapcontrol.MapControl; |
11 |
|
12 |
|
13 |
|
14 |
public class LayerPropertiesExtension extends Extension{ |
15 |
|
16 |
public void initialize() { |
17 |
// TODO Auto-generated method stub
|
18 |
registerIcons(); |
19 |
} |
20 |
|
21 |
private void registerIcons(){ |
22 |
PluginServices.getIconTheme().register( |
23 |
"images-selected-icon",
|
24 |
this.getClass().getClassLoader().getResource("images/selected.png") |
25 |
); |
26 |
PluginServices.getIconTheme().register( |
27 |
"images-notselected-icon",
|
28 |
this.getClass().getClassLoader().getResource("images/notSelected.png") |
29 |
); |
30 |
PluginServices.getIconTheme().register( |
31 |
"images-blocked-icon",
|
32 |
this.getClass().getClassLoader().getResource("images/blocked.png") |
33 |
); |
34 |
PluginServices.getIconTheme().register( |
35 |
"images-unblocked-icon",
|
36 |
this.getClass().getClassLoader().getResource("images/unblocked.png") |
37 |
); |
38 |
PluginServices.getIconTheme().register( |
39 |
"images-defuse-icon",
|
40 |
this.getClass().getClassLoader().getResource("images/defuse.png") |
41 |
); |
42 |
PluginServices.getIconTheme().register( |
43 |
"images-active-icon",
|
44 |
this.getClass().getClassLoader().getResource("images/active.png") |
45 |
); |
46 |
PluginServices.getIconTheme().register( |
47 |
"images-disabled-icon",
|
48 |
this.getClass().getClassLoader().getResource("images/disabled.png") |
49 |
); |
50 |
PluginServices.getIconTheme().register( |
51 |
"images-notdisabled-icon",
|
52 |
this.getClass().getClassLoader().getResource("images/notdisabled.png") |
53 |
); |
54 |
PluginServices.getIconTheme().register( |
55 |
"images-fill-icon",
|
56 |
this.getClass().getClassLoader().getResource("images/fill.png") |
57 |
); |
58 |
PluginServices.getIconTheme().register( |
59 |
"images-notfill-icon",
|
60 |
this.getClass().getClassLoader().getResource("images/notfill.png") |
61 |
); |
62 |
} |
63 |
|
64 |
public void execute(String actionCommand) { |
65 |
org.gvsig.andami.ui.mdiManager.IWindow view = PluginServices.getMDIManager().getActiveWindow(); |
66 |
if (!(view instanceof DefaultViewPanel)) |
67 |
return;
|
68 |
DefaultViewPanel vista=(DefaultViewPanel)view; |
69 |
ViewDocument model = vista.getModel(); |
70 |
MapContext mapa = model.getMapContext(); |
71 |
MapControl mapCtrl = vista.getMapControl(); |
72 |
FLayer[] layers=mapa.getLayers().getActives();
|
73 |
//layers[0].
|
74 |
//REFACTORING
|
75 |
//LayerProperties layerProperties=new LayerProperties(layers[0],((FLyrVect)layers[0]).getLegend());
|
76 |
//PluginServices.getMDIManager().addWindow(layerProperties);
|
77 |
} |
78 |
|
79 |
public boolean isEnabled() { |
80 |
return true; |
81 |
} |
82 |
|
83 |
public boolean isVisible() { |
84 |
return true; |
85 |
} |
86 |
|
87 |
} |