Revision 24
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
38 | 38 |
label="Start_edit" |
39 | 39 |
tooltip="Strat_edit" |
40 | 40 |
action-command="start_edit" |
41 |
icon="tools-show-fortune-cookie"
|
|
42 |
position="001009000000"
|
|
41 |
icon="vector-editing"
|
|
42 |
position="302001000"
|
|
43 | 43 |
accelerator="" |
44 | 44 |
/> |
45 | 45 |
|
... | ... | |
63 | 63 |
label="Insert_point" |
64 | 64 |
tooltip="insert_point" |
65 | 65 |
action-command="insert_point" |
66 |
icon="tools-show-fortune-cookie"
|
|
67 |
position="001009000100"
|
|
66 |
icon="layer-insert-point"
|
|
67 |
position="302001000"
|
|
68 | 68 |
accelerator="" |
69 | 69 |
/> |
70 | 70 |
|
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/vectorediting/app/mainplugin/extensions/InsertPointExtension.java | ||
---|---|---|
6 | 6 |
*/ |
7 | 7 |
package org.gvsig.vectorediting.app.mainplugin.extensions; |
8 | 8 |
|
9 |
import org.gvsig.andami.IconThemeHelper; |
|
9 | 10 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
11 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
10 | 12 |
import org.gvsig.vectorediting.app.mainplugin.BaseEditingServiceExtension; |
11 | 13 |
|
12 | 14 |
public class InsertPointExtension extends BaseEditingServiceExtension { |
... | ... | |
17 | 19 |
private static final long serialVersionUID = 5284754862994440445L; |
18 | 20 |
|
19 | 21 |
public void execute(String arg0) { |
20 |
|
|
22 |
|
|
21 | 23 |
DefaultViewPanel view = getActiveView(); |
22 | 24 |
manager.activateTool("InsertPoint", view.getMapControl()); |
23 | 25 |
|
26 |
registerIcons(); |
|
24 | 27 |
} |
25 | 28 |
|
29 |
private void registerIcons() { |
|
30 |
IconThemeHelper.registerIcon("action", "layer-insert-point", this); |
|
31 |
} |
|
32 |
|
|
26 | 33 |
public void initialize() { |
27 | 34 |
// TODO Auto-generated method stub |
28 | 35 |
|
... | ... | |
34 | 41 |
} |
35 | 42 |
|
36 | 43 |
public boolean isVisible() { |
37 |
// TODO Auto-generated method stub |
|
38 |
return true; |
|
44 |
DefaultViewPanel view = getActiveView(); |
|
45 |
if (view != null) { |
|
46 |
FLyrVect layer = getActiveLayer(view); |
|
47 |
if (layer != null && layer.isEditing()) { |
|
48 |
return true; |
|
49 |
} |
|
50 |
} |
|
51 |
return false; |
|
39 | 52 |
} |
40 | 53 |
|
41 | 54 |
} |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/vectorediting/app/mainplugin/extensions/EditingExtension.java | ||
---|---|---|
6 | 6 |
*/ |
7 | 7 |
package org.gvsig.vectorediting.app.mainplugin.extensions; |
8 | 8 |
|
9 |
import org.gvsig.andami.IconThemeHelper; |
|
9 | 10 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
10 | 11 |
import org.gvsig.fmap.dal.exception.DataException; |
11 | 12 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
... | ... | |
17 | 18 |
* |
18 | 19 |
*/ |
19 | 20 |
private static final long serialVersionUID = -5586086889681840048L; |
20 |
|
|
21 |
|
|
21 | 22 |
public void execute(String arg0) { |
22 | 23 |
|
23 | 24 |
DefaultViewPanel vista = getActiveView(); |
... | ... | |
34 | 35 |
e.printStackTrace(); |
35 | 36 |
} |
36 | 37 |
} |
37 |
|
|
38 |
|
|
38 | 39 |
} |
39 | 40 |
} |
40 | 41 |
|
41 |
public void initialize() {}
|
|
42 |
public void initialize() { |
|
42 | 43 |
|
44 |
registerIcons(); |
|
45 |
} |
|
46 |
|
|
47 |
private void registerIcons() { |
|
48 |
IconThemeHelper.registerIcon("action", "vector-editing", this); |
|
49 |
} |
|
50 |
|
|
43 | 51 |
public boolean isEnabled() { |
44 | 52 |
DefaultViewPanel vista = getActiveView(); |
45 | 53 |
FLyrVect activeLayer = getActiveLayer(vista); |
46 |
|
|
54 |
|
|
47 | 55 |
return (canBeEdited(activeLayer) ? true : false); |
48 | 56 |
|
49 | 57 |
} |
50 | 58 |
|
51 | 59 |
public boolean isVisible() { |
52 |
return true; |
|
60 |
DefaultViewPanel vista = getActiveView(); |
|
61 |
return (vista != null) ? true : false; |
|
53 | 62 |
} |
54 | 63 |
|
55 | 64 |
} |
Also available in: Unified diff