Statistics
| Revision:

svn-document-layout / branches / usability_v2 / org.gvsig.app.document.layout.app / org.gvsig.app.document.layout.app.mainplugin / src / main / java / org / gvsig / app / project / documents / layout / LayoutContext.java @ 140

History | View | Annotate | Download (6.33 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

    
26
import org.gvsig.app.project.documents.layout.commands.FrameCommandsRecord;
27
import org.gvsig.app.project.documents.layout.fframes.IFFrame;
28
import org.gvsig.tools.observer.Observable;
29
import org.gvsig.tools.persistence.Persistent;
30

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

    
36
    /**
37
     * Returns the AffineTransform that is applying in the Layout.
38
     * 
39
     * @return AffineTransform
40
     */
41
    public AffineTransform getAT();
42

    
43
    /**
44
     * Call all LayoutDrawListeners.
45
     * 
46
     */
47
    public void notifAllObservers();
48

    
49
    /**
50
     * It returns the print attributes of the Layout.
51
     * 
52
     * @return Attributes.
53
     */
54
    public Attributes getAttributes();
55

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

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

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

    
76
    /**
77
     * It orders the FFrames depending on its position specified by level.
78
     * 
79
     */
80
    public void updateFFrames();
81

    
82
    /**
83
     * Remove the fframes selected.
84
     * 
85
     */
86
    public void delFFrameSelected();
87

    
88
    /**
89
     * Clear the selection of FFrames.
90
     * 
91
     */
92
    public void clearSelection();
93

    
94
    /**
95
     * Remove the fframe of index.
96
     * 
97
     */
98
    public void delFFrame(int index);
99

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

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

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

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

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

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

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

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

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

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

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

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

    
210
    /**
211
     * It inserts if is shown or not the rule of the Layout.
212
     * 
213
     * @param b
214
     *            True if is shown or not the rule of the Layout.
215
     */
216
    public void setRuler(boolean b);
217

    
218
    /**
219
     * Returns if is shown or not the rule of the Layout.
220
     * 
221
     * @return True si se muestra la regla.
222
     */
223
    public boolean getRuler();
224

    
225
    /**
226
     * It returns if has been showing the grid of Layout, or not.
227
     * 
228
     * @return true if has been showing the grid of Layout.
229
     */
230
    public boolean isGridVisible();
231

    
232
    /**
233
     * It inserts if draws the Grid in the Layout or not.
234
     * 
235
     * @param b
236
     *            True if draws the Grid in the Layout.
237
     */
238
    public void setGridVisible(boolean b);
239

    
240
    /**
241
     * Refresh all FFrames of Layout.
242
     */
243
    public void fullRefresh();
244

    
245
    public void setNumBehind(int numBehind);
246

    
247
    public void setNumBefore(int numBefore);
248

    
249
}