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

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