Revision 7787 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/ProjectViewFactory.java
ProjectViewFactory.java | ||
---|---|---|
84 | 84 |
* @return ProjectView. |
85 | 85 |
*/ |
86 | 86 |
private static ProjectView createView(String viewName) { |
87 |
ProjectView v = new ProjectView();
|
|
88 |
v.setMapContext(new MapContext(
|
|
89 |
new ViewPort(Project.getDefaultProjection())));
|
|
90 |
v.setMapOverViewContext(new MapContext(null));
|
|
91 |
v.getMapOverViewContext().setProjection(v.getMapContext().getProjection());
|
|
92 |
v.setName(viewName);
|
|
93 |
v.setCreationDate(DateFormat.getInstance().format(new Date()));
|
|
87 |
ProjectView v = new ProjectView();
|
|
88 |
MapContext viewMapContext = new MapContext(new ViewPort(Project
|
|
89 |
.getDefaultProjection()));
|
|
90 |
ViewPort vp = viewMapContext.getViewPort();
|
|
91 |
vp.setBackColor(Project.getDefaultViewBackColor());
|
|
92 |
vp.setDistanceUnits(Project.getDefaultDistanceUnits());
|
|
93 |
vp.setMapUnits(Project.getDefaultMapUnits());
|
|
94 | 94 |
|
95 |
v.setMapContext(viewMapContext); |
|
96 |
v.setMapOverViewContext(new MapContext(null)); |
|
97 |
|
|
98 |
/* |
|
99 |
* jaume. ?no puedo definir color de fondo en localizador? |
|
100 |
* |
|
101 |
* v.getMapOverViewContext().setProjection(v.getMapContext().getProjection()); |
|
102 |
* v.getMapOverViewContext(). getViewPort(). setBackColor( |
|
103 |
* Project.getDefaultMapOverViewBackColor() ); |
|
104 |
* |
|
105 |
*/ |
|
106 |
v.setName(viewName); |
|
107 |
v.setCreationDate(DateFormat.getInstance().format(new Date())); |
|
108 |
|
|
95 | 109 |
return v; |
96 | 110 |
} |
97 | 111 |
|
... | ... | |
143 | 157 |
public static void register() { |
144 | 158 |
register(registerName, new ProjectViewFactory(), |
145 | 159 |
"com.iver.cit.gvsig.project.ProjectView"); |
146 |
|
|
160 |
|
|
147 | 161 |
registerAction(registerName,"copy",new CopyDocumentContextMenuAction()); |
148 | 162 |
registerAction(registerName,"cut",new CutDocumentContextMenuAction()); |
149 | 163 |
registerAction(registerName,"paste",new PasteDocumentContextMenuAction()); |
... | ... | |
162 | 176 |
Hashtable viewsConflits = (Hashtable)conflicts.get(this.getRegisterName()); |
163 | 177 |
Hashtable tablesConflits = (Hashtable)conflicts.get(ProjectTableFactory.registerName); |
164 | 178 |
XMLEntity xmlTables = root.firstChild("type",ProjectTableFactory.registerName); |
165 |
|
|
166 |
|
|
179 |
|
|
180 |
|
|
167 | 181 |
if (viewsConflits != null && viewsConflits.size() > 0) { |
168 | 182 |
int option = JOptionPane.showConfirmDialog( |
169 | 183 |
(Component)PluginServices.getMainFrame(), |
... | ... | |
230 | 244 |
} |
231 | 245 |
xmlTables.removeAllChildren(); |
232 | 246 |
} |
233 |
|
|
247 |
|
|
234 | 248 |
return true; |
235 | 249 |
} |
236 | 250 |
} |
Also available in: Unified diff