Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / DocumentManager.java @ 40558

History | View | Annotate | Download (3.73 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.app.project.documents;
25

    
26
import java.util.Iterator;
27

    
28
import javax.swing.ImageIcon;
29

    
30
import org.gvsig.andami.ui.mdiManager.IWindow;
31
import org.gvsig.app.project.Project;
32
import org.gvsig.app.project.documents.gui.IDocumentWindow;
33
import org.gvsig.app.project.documents.gui.WindowLayout;
34
import org.gvsig.tools.extensionpoint.ExtensionBuilder;
35
import org.gvsig.tools.persistence.PersistenceFactory;
36

    
37
public interface DocumentManager extends ExtensionBuilder, PersistenceFactory{
38

    
39
        /**
40
         * Returns the type of document priority.
41
         *
42
         * @return Priority.
43
         */
44
        public int getPriority();
45

    
46
        /**
47
         * Returns tdocumenthe icon for the type of document.
48
         *
49
         * @return Image.
50
         */
51
        public ImageIcon getIcon();
52

    
53
        /**
54
         * Returns the icon for the type of document when is selected
55
         *
56
         * @return Image.
57
         */
58
        public ImageIcon getIconSelected();
59

    
60
        /**
61
         * Create a new ProjectDocument.
62
         *
63
         * @param project Opened project.
64
         *
65
         * @return ProjectDocument.
66
         */
67
        public AbstractDocument createDocument();
68

    
69
                /**
70
     * Uses a gui to be able from the characteristics that we want a
71
     * ProjectDocument
72
     * 
73
     * @return a new Document
74
     * 
75
     * @deprecated user {@link #createDocumentsByUser()} instead
76
     */
77
        public AbstractDocument createDocumentByUser();
78

    
79
    /**
80
     * Uses a gui to be able from the characteristics that we want a
81
     * ProjectDocument
82
     * 
83
     * @return the created documents
84
     */
85
    public Iterator<? extends Document> createDocumentsByUser();
86

    
87
        /**
88
         * Returns the title of type of document.
89
         *
90
         * @return String title for type of document
91
         */
92
        public String getTitle();
93

    
94
        /**
95
         * Returns the type name of the document factory.
96
         *
97
         * @return Name of registration
98
         */
99
        public String getTypeName();
100

    
101
        /**
102
         * Return the main window asociated to the passed document. 
103
         * If the window alreade exists return it. If not, a new
104
         * window is created.
105
         * 
106
         * @param doc
107
         * @return Window asociated to document
108
         */
109
        public IWindow getMainWindow(Document doc) ;
110
        
111
        /**
112
         * Return the main window asociated to the document.
113
         * 
114
         * @param doc, layout
115
         * @return Window asociated to document
116
         */
117
        public IWindow getMainWindow(Document doc, WindowLayout layout) ;
118
        
119
        /**
120
         * Return the windows properties asociated to the document.
121
         * @param doc
122
         * @return
123
         */
124
        public IWindow getPropertiesWindow(Document doc) ;
125
        
126
        /**
127
         * Return true if the name exists to another document.
128
         *
129
         * @param project
130
         * @param documentName
131
         *
132
         * @return True if the name exists.
133
         * @deprecated use instead  project.getDocument
134
         */
135
        public boolean existName(Project project, String documentName);
136
        
137
        /**
138
         * Return the class that implement the main window for this type of
139
         * documents.
140
         * 
141
         * @return the class of main window 
142
         */
143
    public Class<? extends IDocumentWindow> getMainWindowClass();
144

    
145
}