root / branches / v10 / extensions / extPublish / src / org / gvsig / publish / PublicationFactory.java @ 17788
History | View | Annotate | Download (2.93 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Iba?ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
package org.gvsig.publish; |
42 |
|
43 |
import java.text.DateFormat; |
44 |
import java.util.Date; |
45 |
import java.util.Hashtable; |
46 |
|
47 |
import javax.swing.ImageIcon; |
48 |
|
49 |
import com.iver.andami.PluginServices; |
50 |
import com.iver.cit.gvsig.project.Project; |
51 |
import com.iver.cit.gvsig.project.documents.ProjectDocument; |
52 |
import com.iver.cit.gvsig.project.documents.ProjectDocumentFactory; |
53 |
import com.iver.utiles.XMLEntity; |
54 |
|
55 |
public class PublicationFactory extends ProjectDocumentFactory { |
56 |
/**
|
57 |
* @return a string which identifies the type of document
|
58 |
*/
|
59 |
public String getNameType() { |
60 |
return PluginServices.getText(this, "publication"); |
61 |
} |
62 |
|
63 |
public static String registerName="publication"; |
64 |
private int numDocument = 0; |
65 |
public static void register(){ |
66 |
register(registerName, new PublicationFactory());
|
67 |
} |
68 |
public ProjectDocument create(Project project) {
|
69 |
//get information about the project
|
70 |
//IProjectInfo prjInfo = ProjectInfoFactory.getProjectInfo(project);
|
71 |
ProjectPublication m = new ProjectPublication();
|
72 |
m.setName(PluginServices.getText(this, "publication") + " - " + |
73 |
numDocument); |
74 |
m.setCreationDate(DateFormat.getInstance().format(new Date())); |
75 |
numDocument++; |
76 |
// m.setProject(project, 0);
|
77 |
return m;
|
78 |
} |
79 |
|
80 |
public ImageIcon getButtonIcon() { |
81 |
return new ImageIcon(ProjectPublication.class.getClassLoader().getResource("images/publication.png")); |
82 |
} |
83 |
|
84 |
public String getRegisterName() { |
85 |
return registerName;
|
86 |
} |
87 |
|
88 |
public ImageIcon getSelectedButtonIcon() { |
89 |
return new ImageIcon(ProjectPublication.class.getClassLoader().getResource("images/publication-sel.png")); |
90 |
} |
91 |
|
92 |
public boolean resolveImportXMLConflicts(XMLEntity root, Project project, |
93 |
Hashtable conflicts) {
|
94 |
// TODO Auto-generated method stub
|
95 |
return false; |
96 |
} |
97 |
|
98 |
} |