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