Statistics
| Revision:

root / branches / v2_0_0_prep / extensions / org.gvsig.app.document.layout.app / org.gvsig.app.document.layout.app.mainplugin / src / main / java / org / gvsig / app / project / documents / layout / LayoutControl.java @ 36648

History | View | Annotate | Download (7.87 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.Image;
25
import java.awt.Point;
26
import java.awt.Rectangle;
27
import java.awt.geom.AffineTransform;
28
import java.awt.geom.Rectangle2D;
29
import java.awt.image.BufferedImage;
30

    
31
import javax.swing.JComponent;
32

    
33
import org.gvsig.app.project.documents.layout.geometryadapters.GeometryAdapter;
34
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutBehavior;
35
import org.gvsig.fmap.dal.exception.ReadException;
36

    
37
/**
38
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
39
 */
40
public interface LayoutControl extends LayoutDrawListener {
41

    
42
    public static final int DESACTUALIZADO = 4;
43
    public static final int ACTUALIZADO = 5;
44

    
45
    /**
46
     * Returns the rectangle that represents the sheet.
47
     * In pixels.
48
     * 
49
     * @return Rectangle2D.Double Rectangle that represents the sheet.
50
     */
51
    public Rectangle2D.Double getRect();
52

    
53
    /**
54
     * Returns the name of the current selected tool on this Layout
55
     * 
56
     * @return A tool name.
57
     */
58
    public String getCurrentTool();
59

    
60
    /**
61
     * Add a new Layout tool.
62
     * 
63
     * @param name
64
     *            Name of tool.
65
     * @param tool
66
     *            LayoutBehavior
67
     */
68
    public void addLayoutTool(String name, LayoutBehavior tool);
69

    
70
    /**
71
     * Inserts the LayoutContext.
72
     * 
73
     * @param lc
74
     *            LayoutContext.
75
     */
76
    public void setLayoutContext(LayoutContext lc);
77

    
78
    /**
79
     * Inserts the status of Layout.
80
     * 
81
     * @param s
82
     *            Status of Layout.
83
     */
84
    public void setStatus(int s);
85

    
86
    /**
87
     * Returns the image with the ruler.
88
     * 
89
     * @return Ruler image.
90
     */
91
    public BufferedImage getImgRuler();
92

    
93
    /**
94
     * It obtains the rect that is adjusted to the size of the window,
95
     * to see the full extent of layout.
96
     */
97
    public void fullRect();
98

    
99
    /**
100
     * Inserts the rectangle that represents the sheet.
101
     * In pixels.
102
     * 
103
     */
104
    public void setRect(Rectangle2D r);
105

    
106
    /**
107
     * Returns the current image of Layout.
108
     * 
109
     * @return Current image of Layout.
110
     */
111
    public BufferedImage getImage();
112

    
113
    /**
114
     * Changes the pointer of the mouse by the image of parameter.
115
     * 
116
     * @param image
117
     *            Image
118
     */
119
    public void setMapCursor(Image image);
120

    
121
    /**
122
     * It establishes as selected to the tool from its name of identification.
123
     * 
124
     * @param toolName
125
     *            Name of identification tool.
126
     */
127
    public void setTool(String toolName);
128

    
129
    /**
130
     * Start the vertex edition of graphics.
131
     * 
132
     */
133
    public void startEdit();
134

    
135
    /**
136
     * Stop the vertex edition of graphics.
137
     * 
138
     */
139
    public void stopEdit();
140

    
141
    /**
142
     * It returns the point that represents the northwest corner of the Layout.
143
     * 
144
     * @return Point.
145
     */
146
    public Point getRectOrigin();
147

    
148
    /**
149
     * Returns the object to draw the Layout.
150
     * 
151
     * @return FLayoutDraw.
152
     */
153
    public FLayoutDraw getLayoutDraw();
154

    
155
    /**
156
     * Returns the current Layout tool.
157
     * 
158
     * @return LayoutBehavior Current Layout Tool.
159
     */
160
    public LayoutBehavior getCurrentLayoutTool();
161

    
162
    /**
163
     * It returns the first click point of mouse.
164
     * 
165
     * @return Point.
166
     */
167
    public Point getFirstPoint();
168

    
169
    /**
170
     * Returns the previous click of mouse.
171
     * 
172
     * @return Point.
173
     */
174
    public Point getPointAnt();
175

    
176
    /**
177
     * Returns the last click point of mouse.
178
     * 
179
     * @return Point.
180
     */
181
    public Point getLastPoint();
182

    
183
    /**
184
     * Inserts the first click point of mouse.
185
     * 
186
     * @param p
187
     *            Point.
188
     */
189
    public void setFirstPoint();
190

    
191
    /**
192
     * Inserts the previous click point of mouse.
193
     * 
194
     * @param p
195
     *            Point.
196
     */
197
    public void setPointAnt();
198

    
199
    /**
200
     * Inserts the last click point of mouse.
201
     * 
202
     * @param p
203
     *            Point.
204
     */
205
    public void setLastPoint();
206

    
207
    /**
208
     * Insert the position point and calculate the new position if the grid is
209
     * actived.
210
     * 
211
     * @param point2
212
     *            Position.
213
     */
214
    public void setPosition(Point point2);
215

    
216
    /**
217
     * Returns the position adjusted point.
218
     * 
219
     * @return
220
     */
221
    public Point getPosition();
222

    
223
    /**
224
     * Returns the AffineTransform that is applying in the Layout.
225
     * 
226
     * @return AffineTransform
227
     */
228
    public AffineTransform getAT();
229

    
230
    /**
231
     * It returns the current GeometryAdapter.
232
     * 
233
     * @return Current GeometryAdapter.
234
     */
235
    public GeometryAdapter getGeometryAdapter();
236

    
237
    /**
238
     * Remove last point of geometryAdapter.
239
     * 
240
     */
241
    public void delLastPoint();
242

    
243
    /**
244
     * Add a new point to geometryAdapter.
245
     * 
246
     * @return Number of points in the geometryAdapter.
247
     */
248
    public int addGeometryAdapterPoint();
249

    
250
    /**
251
     * Change the position of mousemoved point of geometryAdapter.
252
     */
253
    public void setGeometryAdapterPoinPosition();
254

    
255
    /**
256
     * Clear the image of pointer of mouse.
257
     */
258
    public void clearMouseImage();
259

    
260
    /**
261
     * Refres the Layout.
262
     */
263
    public void refresh();
264

    
265
    /**
266
     * It returns true if the drawing has been canceled.
267
     * 
268
     * @return true if the drawn has been canceled.
269
     */
270
    public boolean isDrawingCancelled();
271

    
272
    /**
273
     * It cancels the drawing if the parameter is true.
274
     * 
275
     * @param b
276
     *            true if the drawing wants to be canceled
277
     */
278
    public void setCancelDrawing(boolean b);
279

    
280
    /**
281
     * Returns the rectangle of selection.
282
     * 
283
     * @return Rectangle of selection.
284
     */
285
    public Rectangle getReSel();
286

    
287
    /**
288
     * It returns true if should draw the rectangle of selection and does the
289
     * selection.
290
     * 
291
     * @return true if should draw the rectangle of selection.
292
     */
293
    public boolean isReSel();
294

    
295
    /**
296
     * Insert true if should draw the rectangle of selection and does the
297
     * selection.
298
     * 
299
     * @param b
300
     *            boolean.
301
     */
302
    public void setIsReSel(boolean b);
303

    
304
    /**
305
     * It does a full extent of the layers that contains the view of the
306
     * FFrameView selected.
307
     * 
308
     * @throws ReadDriverException
309
     */
310
    public void viewFull() throws ReadException;
311

    
312
    /**
313
     * Returns the object to make zooms.
314
     * 
315
     * @return FLayoutZooms.
316
     */
317
    public FLayoutZooms getLayoutZooms();
318

    
319
    /**
320
     * Returns the object of FLayoutFunctions.
321
     * 
322
     * @return FLayoutFunctions
323
     */
324
    public FLayoutFunctions getLayoutFunctions();
325

    
326
    /**
327
     * Returns the LayoutContext.
328
     * 
329
     * @return LayoutContext.
330
     */
331
    public LayoutContext getLayoutContext();
332

    
333
    /**
334
     * Inserts the geometryAdapter.
335
     * 
336
     * @param adapter
337
     *            GeometryAdapter.
338
     */
339
    public void setGeometryAdapter(GeometryAdapter adapter);
340

    
341
    public JComponent getComponent();
342

    
343
    public int getWidth();
344

    
345
    public int getHeight();
346

    
347
    public void repaint();
348
}