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 @ 43215

History | View | Annotate | Download (5.3 KB)

1 40558 jjdelcerro
/**
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 40435 jjdelcerro
package org.gvsig.app.project.documents;
25
26
import java.util.Iterator;
27
28
import javax.swing.ImageIcon;
29 41248 jjdelcerro
import javax.swing.JComponent;
30 40435 jjdelcerro
31
import org.gvsig.andami.ui.mdiManager.IWindow;
32 41248 jjdelcerro
import org.gvsig.app.project.DocumentsContainer;
33 40435 jjdelcerro
import org.gvsig.app.project.Project;
34
import org.gvsig.app.project.documents.gui.IDocumentWindow;
35
import org.gvsig.app.project.documents.gui.WindowLayout;
36
import org.gvsig.tools.extensionpoint.ExtensionBuilder;
37 41634 jjdelcerro
import org.gvsig.tools.observer.WeakReferencingObservable;
38 40435 jjdelcerro
import org.gvsig.tools.persistence.PersistenceFactory;
39
40 41634 jjdelcerro
public interface DocumentManager extends ExtensionBuilder, PersistenceFactory, WeakReferencingObservable {
41 40435 jjdelcerro
42 41634 jjdelcerro
        public static String NOTIFY_AFTER_CREATEDOCUMENT = "DocumentManager.CreateDocument";
43
        public static String NOTIFY_AFTER_GETMAINWINDOW = "DocumentManager.getMainWindow";
44
        public static String NOTIFY_AFTER_GETPROPERTIESWINDOW = "DocumentManager.getPropertiesWindow";
45
46 40435 jjdelcerro
        /**
47
         * Returns the type of document priority.
48
         *
49
         * @return Priority.
50
         */
51
        public int getPriority();
52
53
        /**
54
         * Returns tdocumenthe icon for the type of document.
55
         *
56
         * @return Image.
57
         */
58
        public ImageIcon getIcon();
59
60
        /**
61
         * Returns the icon for the type of document when is selected
62
         *
63
         * @return Image.
64
         */
65
        public ImageIcon getIconSelected();
66
67
        /**
68
         * Create a new ProjectDocument.
69
         *
70
         * @param project Opened project.
71
         *
72
         * @return ProjectDocument.
73
         */
74
        public AbstractDocument createDocument();
75
76
                /**
77
     * Uses a gui to be able from the characteristics that we want a
78
     * ProjectDocument
79
     *
80
     * @return a new Document
81
     *
82
     * @deprecated user {@link #createDocumentsByUser()} instead
83
     */
84
        public AbstractDocument createDocumentByUser();
85
86
    /**
87
     * Uses a gui to be able from the characteristics that we want a
88
     * ProjectDocument
89
     *
90
     * @return the created documents
91
     */
92
    public Iterator<? extends Document> createDocumentsByUser();
93
94
        /**
95
         * Returns the title of type of document.
96
         *
97
         * @return String title for type of document
98
         */
99
        public String getTitle();
100
101
        /**
102
         * Returns the type name of the document factory.
103
         *
104
         * @return Name of registration
105
         */
106
        public String getTypeName();
107
108
        /**
109
         * Return the main window asociated to the passed document.
110
         * If the window alreade exists return it. If not, a new
111
         * window is created.
112
         *
113
         * @param doc
114
         * @return Window asociated to document
115
         */
116
        public IWindow getMainWindow(Document doc) ;
117
118
        /**
119
         * Return the main window asociated to the document.
120
         *
121
         * @param doc, layout
122
         * @return Window asociated to document
123
         */
124
        public IWindow getMainWindow(Document doc, WindowLayout layout) ;
125 41248 jjdelcerro
126
        /**
127
         * Create a new JComponent for the document or if already exists
128
         * in the specified container, return this.
129
         *
130
         * @param container
131
         * @param doc
132
         * @return
133
         */
134
        public JComponent getMainComponent(DocumentsContainer container, Document doc);
135 40435 jjdelcerro
136 41248 jjdelcerro
        /**
137
         * Devuelbe el JComponent que se corresponde con el documento indicado.
138
         * Si la ventana activa se corresponde con este documento, devuelbe el
139
         * JComponent asociado a esa ventana. Si no se corresponde con la ventana
140
         * activa, pero esta es un contenedor de documentos le pide a este el componente
141
         * asociado al documento requerido y si lo encuentra lo devuelve. En
142
         * otro caso develbe null.
143
         * @param doc
144
         * @return el JComponent asociado a doc
145
         */
146
        public JComponent getMainComponent(Document doc);
147
148
        public void unregisterMainComponent(DocumentsContainer container, Document document);
149
150
        public void registerMainComponent(DocumentsContainer container, Document document, JComponent component);
151
152 40435 jjdelcerro
        /**
153
         * Return the windows properties asociated to the document.
154
         * @param doc
155
         * @return
156
         */
157
        public IWindow getPropertiesWindow(Document doc) ;
158
159
        /**
160
         * Return true if the name exists to another document.
161
         *
162
         * @param project
163
         * @param documentName
164
         *
165
         * @return True if the name exists.
166
         * @deprecated use instead  project.getDocument
167
         */
168
        public boolean existName(Project project, String documentName);
169
170
        /**
171
         * Return the class that implement the main window for this type of
172
         * documents.
173
         *
174
         * @return the class of main window
175
         */
176
    public Class<? extends IDocumentWindow> getMainWindowClass();
177
178
}