Revision 38564 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/extension/ViewSelectionControls.java
ViewSelectionControls.java | ||
---|---|---|
95 | 95 |
*/ |
96 | 96 |
package org.gvsig.app.extension; |
97 | 97 |
|
98 |
import org.gvsig.andami.IconThemeHelper; |
|
98 | 99 |
import org.gvsig.andami.PluginServices; |
99 | 100 |
import org.gvsig.andami.plugins.Extension; |
100 | 101 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
... | ... | |
127 | 128 |
} |
128 | 129 |
|
129 | 130 |
private void registerIcons(){ |
130 |
|
|
131 |
PluginServices.getIconTheme().registerDefault( |
|
132 |
"view-select-geometry", |
|
133 |
this.getClass().getClassLoader().getResource("images/Select.png") |
|
134 |
); |
|
135 |
|
|
136 |
PluginServices.getIconTheme().registerDefault( |
|
137 |
"view-select-by-rectangle", |
|
138 |
this.getClass().getClassLoader().getResource("images/SelEspacial2b.png") |
|
139 |
); |
|
140 |
|
|
141 |
PluginServices.getIconTheme().registerDefault( |
|
142 |
"view-select-by-polygon", |
|
143 |
this.getClass().getClassLoader().getResource("images/SelectByPolygon.png") |
|
144 |
); |
|
145 |
|
|
146 |
PluginServices.getIconTheme().registerDefault( |
|
147 |
"view-select-invert", |
|
148 |
this.getClass().getClassLoader().getResource("images/invertSelection.png") |
|
149 |
); |
|
131 |
IconThemeHelper.registerIcon("action", "selection-simple-select", this); |
|
132 |
IconThemeHelper.registerIcon("action", "selection-select-by-rectangle", this); |
|
133 |
IconThemeHelper.registerIcon("action", "selection-select-by-polygon", this); |
|
134 |
IconThemeHelper.registerIcon("action", "selection-clear", this); |
|
150 | 135 |
} |
151 | 136 |
|
152 | 137 |
public void execute(String actionCommand) { |
153 | 138 |
MapControl mapCtrl = vista.getMapControl(); |
154 | 139 |
logger.debug("Comand : " + actionCommand); |
155 |
if (actionCommand.equals("SELRECT")) {
|
|
140 |
if (actionCommand.equalsIgnoreCase("selection-select-by-rectangle-view")) {
|
|
156 | 141 |
mapCtrl.setTool("rectSelection"); |
157 | 142 |
((AbstractDocument)vista.getModel()).setModified(true); |
158 |
} else if (actionCommand.equals("SELPOINT")) { |
|
143 |
|
|
144 |
} else if (actionCommand.equalsIgnoreCase("selection-simple-select-view")) { |
|
159 | 145 |
mapCtrl.setTool("pointSelection"); |
160 | 146 |
((AbstractDocument)vista.getModel()).setModified(true); |
161 |
} else if (actionCommand.equals("SELPOL")) { |
|
147 |
|
|
148 |
} else if (actionCommand.equalsIgnoreCase("selection-select-by-polygon")) { |
|
162 | 149 |
mapCtrl.setTool("polSelection"); |
163 | 150 |
((AbstractDocument)vista.getModel()).setModified(true); |
151 |
|
|
164 | 152 |
} |
165 | 153 |
} |
166 |
|
|
154 |
|
|
167 | 155 |
public boolean isEnabled() { |
168 | 156 |
ViewDocument model = vista.getModel(); |
169 | 157 |
MapContext mapa = model.getMapContext(); |
Also available in: Unified diff