Revision 42494
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.annotation.app/org.gvsig.annotation.app.mainplugin/src/main/java/org/gvsig/annotation/app/extension/AnnotationExtension.java | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
package org.gvsig.annotation.app.extension; |
25 | 25 |
|
26 |
import java.util.Locale; |
|
27 |
|
|
28 | 26 |
import org.gvsig.andami.IconThemeHelper; |
29 |
import org.gvsig.andami.PluginServices; |
|
30 | 27 |
import org.gvsig.andami.messages.NotificationManager; |
31 | 28 |
import org.gvsig.andami.plugins.Extension; |
32 | 29 |
import org.gvsig.annotation.AnnotationCreationService; |
... | ... | |
44 | 41 |
import org.gvsig.fmap.mapcontext.MapContext; |
45 | 42 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
46 | 43 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
47 |
import org.gvsig.i18n.Messages; |
|
48 | 44 |
import org.gvsig.tools.ToolsLocator; |
49 | 45 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
50 | 46 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
... | ... | |
52 | 48 |
|
53 | 49 |
/** |
54 | 50 |
* Andami extension to show Annotation in the application. |
55 |
*
|
|
51 |
* |
|
56 | 52 |
* @author gvSIG Team |
57 | 53 |
* @version $Id$ |
58 | 54 |
*/ |
... | ... | |
64 | 60 |
public static final String PERSIST_DEF_FONT_STYLE_KEY = "def_font_style"; |
65 | 61 |
public static final String PERSIST_DEF_FONT_HEIGHT_KEY = "def_font_height"; |
66 | 62 |
public static final String PERSIST_DEF_FONT_ROTATION_KEY = "def_font_rotation"; |
67 |
|
|
63 |
|
|
68 | 64 |
private AnnotationManager manager; |
69 | 65 |
private AnnotationSwingManager swingManager; |
70 | 66 |
|
71 | 67 |
public void initialize() { |
72 | 68 |
ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager(); |
73 | 69 |
ExtensionPoint ep = extensionPoints.add("AplicationPreferences", ""); |
74 |
|
|
70 |
|
|
75 | 71 |
ep.append("AnnotationPreferencesPage", "", new AnnotationPreferencesPage()); |
76 |
|
|
72 |
|
|
77 | 73 |
IconThemeHelper.registerIcon("preferences", "annotation-preferences", this); |
78 | 74 |
} |
79 | 75 |
|
... | ... | |
84 | 80 |
// Asignamos el locator e iniciamos la instancia |
85 | 81 |
swingManager = AnnotationSwingLocator.getSwingManager(); |
86 | 82 |
|
87 |
swingManager.registerWindowManager(new GvSIGAnnotationWindowManager());
|
|
88 |
|
|
83 |
swingManager.registerWindowManager(new GvSIGAnnotationWindowManager()); |
|
84 |
|
|
89 | 85 |
} |
90 | 86 |
|
91 | 87 |
private FLyrVect getCurrentLayer() { |
92 |
return this.getCurrentLayer(null);
|
|
88 |
return this.getCurrentLayer(null); |
|
93 | 89 |
} |
94 |
|
|
90 |
|
|
95 | 91 |
private FLyrVect getCurrentLayer(MapContext mapContext) { |
96 |
FLyrVect layer = null;
|
|
97 |
|
|
92 |
FLyrVect layer = null; |
|
93 |
|
|
98 | 94 |
if( mapContext == null ) { |
99 | 95 |
ApplicationManager application = ApplicationLocator.getManager(); |
100 | 96 |
|
... | ... | |
114 | 110 |
} |
115 | 111 |
return layer; |
116 | 112 |
} |
117 |
|
|
113 |
|
|
118 | 114 |
public void execute(String actionCommand) { |
119 | 115 |
ApplicationManager application = ApplicationLocator.getManager(); |
120 | 116 |
|
... | ... | |
126 | 122 |
FLyrVect layer = getCurrentLayer(mapContext); |
127 | 123 |
if (layer == null){ |
128 | 124 |
return; |
129 |
}
|
|
125 |
} |
|
130 | 126 |
showAnnotation(manager, layer.getFeatureStore(), mapContext); |
131 | 127 |
} |
132 | 128 |
|
Also available in: Unified diff