Revision 10666 branches/v10/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/ProjectMapFactory.java
ProjectMapFactory.java | ||
---|---|---|
58 | 58 |
* @return ProjectDocument. |
59 | 59 |
*/ |
60 | 60 |
public ProjectDocument create(Project project) { |
61 |
ProjectMap map = createMap(PluginServices.getText(this, "untitled")); |
|
61 |
String mapName = ""; |
|
62 |
String aux = PluginServices.getText(this, "untitled"); |
|
63 |
int numMaps=((Integer)ProjectDocument.NUMS.get(registerName)).intValue(); |
|
64 |
mapName = aux + " - " + numMaps++; |
|
65 |
if (project != null) { |
|
66 |
while (existName(project, mapName)) { |
|
67 |
mapName = aux + " - " + numMaps++; |
|
68 |
} |
|
69 |
} |
|
70 |
ProjectDocument.NUMS.put(registerName,new Integer(numMaps)); |
|
71 |
ProjectMap map = createMap(mapName); |
|
62 | 72 |
map.setModel(new Layout()); |
63 | 73 |
map.getModel().setProjectMap(map); |
64 | 74 |
map.setProject(project, 0); |
... | ... | |
93 | 103 |
* @return ProjectMap. |
94 | 104 |
*/ |
95 | 105 |
public static ProjectMap createMap(String baseName) { |
96 |
ProjectMap m = new ProjectMap();
|
|
97 |
m.setName(baseName + " - " + ProjectMap.numMaps);
|
|
106 |
ProjectMap m = new ProjectMap(); |
|
107 |
m.setName(baseName); |
|
98 | 108 |
m.setCreationDate(DateFormat.getInstance().format(new Date())); |
99 |
ProjectMap.numMaps++; |
|
100 | 109 |
return m; |
101 | 110 |
} |
102 | 111 |
|
Also available in: Unified diff