Statistics
| Revision:

svn-document-layout / trunk / org.gvsig.app.document.layout2.app / org.gvsig.app.document.layout2.app.mainplugin / src / main / java / org / gvsig / app / project / documents / layout / LayoutContext.java @ 433

History | View | Annotate | Download (7.82 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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
 */
22
package org.gvsig.app.project.documents.layout;
23

    
24
import java.awt.geom.AffineTransform;
25
import java.util.Iterator;
26

    
27
import org.gvsig.app.project.documents.layout.commands.FrameCommandsRecord;
28
import org.gvsig.app.project.documents.layout.fframes.IFFrame;
29
import org.gvsig.app.project.documents.layout.toc.TocModelObserver;
30
import org.gvsig.fmap.mapcontext.MapContext;
31
import org.gvsig.tools.observer.Observable;
32
import org.gvsig.tools.persistence.Persistent;
33

    
34
/**
35
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
36
 */
37
public interface LayoutContext extends Persistent, Observable {
38

    
39
    /**
40
     * Returns the AffineTransform that is applying in the Layout.
41
     *
42
     * @return AffineTransform
43
     */
44
    public AffineTransform getAT();
45

    
46
    /**
47
     * Call all LayoutDrawListeners.
48
     *
49
     */
50
    public void notifAllObservers();
51

    
52
    /**
53
     * It returns the print attributes of the Layout.
54
     *
55
     * @return Attributes.
56
     */
57
    public Attributes getAttributes();
58

    
59
    /**
60
     * Inserts the print attributes of Layout.
61
     *
62
     * @param attributes Attributes.
63
     */
64
    public void setAtributes(Attributes attributes);
65

    
66
    /**
67
     * It obtains the Array with all the FFrames that have been added al Layout.
68
     *
69
     * @return Array with all the FFrames that have been added al Layout.
70
     */
71
    public IFFrame[] getFFrames();
72

    
73
    /**
74
     * It obtains the FFrame from an index.
75
     *
76
     */
77
    public IFFrame getFFrame(int i);
78

    
79
    /**
80
     * It orders the FFrames depending on its position specified by level.
81
     *
82
     */
83
    public void updateFFrames();
84

    
85
    /**
86
     * Remove the fframes selected.
87
     *
88
     */
89
    public void delFFrameSelected();
90

    
91
    /**
92
     * Clear the selection of FFrames.
93
     *
94
     */
95
    public void clearSelection();
96

    
97
    /**
98
     * Remove the fframe of index.
99
     *
100
     */
101
    public void delFFrame(int index);
102

    
103
    /**
104
     * Remove the fframe of parameter.
105
     *
106
     * @param frame FFrame to remove.
107
     */
108
    public void delFFrame(IFFrame frame);
109

    
110
    /**
111
     * Returns the EditableFeatureSource, is the control of all change in the
112
     * FFrames of Layout.
113
     *
114
     * @return EditableFatureSource.
115
     */
116
    public FrameCommandsRecord getFrameCommandsRecord();
117

    
118
    /**
119
     * It adds a fframe to Arraylist of FFrames .
120
     *
121
     * @param frame fframe to add.
122
     * @param clearSelection True True if clean the selection of the fframes
123
     * already added and false if intends to maintain the same selection.
124
     * @param select Boolean that indicates if has to remain selected the FFrame
125
     * that is added or not.
126
     */
127
    public void addFFrame(IFFrame frame, boolean clearSelection, boolean select);
128

    
129
    /**
130
     * It adds a fframe to Arraylist of FFrames with the same properties.
131
     *
132
     * @param frame fframe to add.
133
     */
134
    public void addFFrameSameProperties(IFFrame frame);
135

    
136
    /**
137
     * Returns other number behind the current fframes.
138
     *
139
     * @return new Position behind.
140
     */
141
    public int getNumBehind();
142

    
143
    /**
144
     * Returns other number before the current fframes.
145
     *
146
     * @return new Position before.
147
     */
148
    public int getNumBefore();
149

    
150
    /**
151
     * It returns all the fframes included them erased and modified in all its
152
     * previous forms.
153
     *
154
     * @return IFFrame[] Array of FFrames.
155
     */
156
    public IFFrame[] getAllFFrames();
157

    
158
    /**
159
     * Gets the list of selected FFrames
160
     *
161
     * @return An Array of selected FFrames
162
     */
163
    public IFFrame[] getSelectedFFrames();
164

    
165
    /**
166
     * Gets the list of selected FFrames that are instance of the provided
167
     * Class.
168
     *
169
     * @param <T>
170
     *
171
     * @param clazz A class
172
     * @return An Array of selected FFrames
173
     */
174
    public <T> T[] getSelectedFFrames(Class<T> clazz);
175

    
176
    /**
177
     * It returns if the Layout is in edition.
178
     *
179
     * @return True if Layout is in edition.
180
     */
181
    public boolean isEditable();
182

    
183
    /**
184
     * It inserts if the Layout is in edition.
185
     *
186
     * @param b True if Layout is in edition.
187
     */
188
    public void setEditable(boolean b);
189

    
190
    /**
191
     * It returns if has been applying in the fframes that are added to Layout
192
     * the grid, or not.
193
     *
194
     * @return true if has been applying the grid.
195
     */
196
    public boolean isAdjustingToGrid();
197

    
198
    /**
199
     * It inserts if has been applying in the fframes that are added to Layout
200
     * the grid, or not.
201
     *
202
     * @param b true if has been applying the grid.
203
     */
204
    public void setAdjustToGrid(boolean b);
205

    
206
    /**
207
     * It inserts if is shown or not the rule of the Layout.
208
     *
209
     * @param b True if is shown or not the rule of the Layout.
210
     */
211
    public void setRuler(boolean b);
212

    
213
    /**
214
     * Returns if is shown or not the rule of the Layout.
215
     *
216
     * @return True si se muestra la regla.
217
     */
218
    public boolean getRuler();
219

    
220
    /**
221
     * It returns if has been showing the grid of Layout, or not.
222
     *
223
     * @return true if has been showing the grid of Layout.
224
     */
225
    public boolean isGridVisible();
226

    
227
    /**
228
     * It inserts if draws the Grid in the Layout or not.
229
     *
230
     * @param b True if draws the Grid in the Layout.
231
     */
232
    public void setGridVisible(boolean b);
233

    
234
    /**
235
     * Refresh all FFrames of Layout.
236
     */
237
    public void fullRefresh();
238

    
239
    public void setNumBehind(int numBehind);
240

    
241
    public void setNumBefore(int numBefore);
242

    
243
    /**
244
     * Sets the model of the TOC. The LayoutPanel will create a TOC in the user
245
     * interface if a tocModel has been set.
246
     */
247
    public void setTocModel(MapContext tocModel);
248

    
249
    /**
250
     * Gets the model of the TOC. The LayoutPanel will create a TOC in the user
251
     * interface if a tocModel has been set.
252
     */
253
    public MapContext getTocModel();
254

    
255
    /**
256
     * Triggers a notification to the TocModel observers of type
257
     * {@link TocModelChangedNotification#MODEL_CHANGED}
258
     */
259
    public void notifyTocUpdated(TocModelChangedNotification.Type notificationType);
260

    
261
    public void addTocObserver(TocModelObserver observer);
262

    
263
    public void removeTocObserver(TocModelObserver observer);
264

    
265
    public void removeTocObservers();
266

    
267
    /**
268
     * True when the document window has been opened at least once, false
269
     * otherwise. This is required to decide whether the page setting dialog has
270
     * to be shown to the user, otherwise it would be shown every time the
271
     * document is opened from project persistence
272
     */
273
    public boolean hasDocBeenOpened();
274

    
275
    /**
276
     * True when the document window has been opened at least once, false
277
     * otherwise. This is required to decide whether the page setting dialog has
278
     * to be shown to the user, otherwise it would be shown every time the
279
     * document is opened from project persistence
280
     */
281
    public void setHasDocBeenOpened(boolean hasBeenOpened);
282
    
283
    /**
284
     * Get an Iterator over al elements in the layout.
285
     * 
286
     * @return 
287
     */
288
    public Iterator deepiterator();
289
    
290
    public Iterator iterator();
291
}