Statistics
| Revision:

svn-document-layout / trunk / org.gvsig.app.document.layout.app / org.gvsig.app.document.layout.app.mainplugin / src / main / java / org / gvsig / app / project / documents / layout / LayoutControl.java @ 5

History | View | Annotate | Download (7.66 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
import org.gvsig.tools.observer.Observer;
37

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

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

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

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

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

    
76
    /**
77
     * Returns the image with the ruler.
78
     * 
79
     * @return Ruler image.
80
     */
81
    public BufferedImage getImgRuler();
82

    
83
    /**
84
     * It obtains the rect that is adjusted to the size of the window,
85
     * to see the full extent of layout.
86
     */
87
    public void fullRect();
88

    
89
    /**
90
     * Inserts the rectangle that represents the sheet.
91
     * In pixels.
92
     * 
93
     */
94
    public void setRect(Rectangle2D r);
95

    
96
    /**
97
     * Returns the current image of Layout.
98
     * 
99
     * @return Current image of Layout.
100
     */
101
    public BufferedImage getImage();
102

    
103
    /**
104
     * Changes the pointer of the mouse by the image of parameter.
105
     * 
106
     * @param image
107
     *            Image
108
     */
109
    public void setMapCursor(Image image);
110

    
111
    /**
112
     * It establishes as selected to the tool from its name of identification.
113
     * 
114
     * @param toolName
115
     *            Name of identification tool.
116
     */
117
    public void setTool(String toolName);
118

    
119
    /**
120
     * Start the vertex edition of graphics.
121
     * 
122
     */
123
    public void startEdit();
124

    
125
    /**
126
     * Stop the vertex edition of graphics.
127
     * 
128
     */
129
    public void stopEdit();
130

    
131
    /**
132
     * It returns the point that represents the northwest corner of the Layout.
133
     * 
134
     * @return Point.
135
     */
136
    public Point getRectOrigin();
137

    
138
    /**
139
     * Returns the object to draw the Layout.
140
     * 
141
     * @return FLayoutDraw.
142
     */
143
    public FLayoutDraw getLayoutDraw();
144

    
145
    /**
146
     * Returns the current Layout tool.
147
     * 
148
     * @return LayoutBehavior Current Layout Tool.
149
     */
150
    public LayoutBehavior getCurrentLayoutTool();
151

    
152
    /**
153
     * It returns the first click point of mouse.
154
     * 
155
     * @return Point.
156
     */
157
    public Point getFirstPoint();
158

    
159
    /**
160
     * Returns the previous click of mouse.
161
     * 
162
     * @return Point.
163
     */
164
    public Point getPointAnt();
165

    
166
    /**
167
     * Returns the last click point of mouse.
168
     * 
169
     * @return Point.
170
     */
171
    public Point getLastPoint();
172

    
173
    /**
174
     * Inserts the first click point of mouse.
175
     * 
176
     * @param p
177
     *            Point.
178
     */
179
    public void setFirstPoint();
180

    
181
    /**
182
     * Inserts the previous click point of mouse.
183
     * 
184
     * @param p
185
     *            Point.
186
     */
187
    public void setPointAnt();
188

    
189
    /**
190
     * Inserts the last click point of mouse.
191
     * 
192
     * @param p
193
     *            Point.
194
     */
195
    public void setLastPoint();
196

    
197
    /**
198
     * Insert the position point and calculate the new position if the grid is
199
     * actived.
200
     * 
201
     * @param point2
202
     *            Position.
203
     */
204
    public void setPosition(Point point2);
205

    
206
    /**
207
     * Returns the position adjusted point.
208
     * 
209
     * @return
210
     */
211
    public Point getPosition();
212

    
213
    /**
214
     * Returns the AffineTransform that is applying in the Layout.
215
     * 
216
     * @return AffineTransform
217
     */
218
    public AffineTransform getAT();
219

    
220
    /**
221
     * It returns the current GeometryAdapter.
222
     * 
223
     * @return Current GeometryAdapter.
224
     */
225
    public GeometryAdapter getGeometryAdapter();
226

    
227
    /**
228
     * Remove last point of geometryAdapter.
229
     * 
230
     */
231
    public void delLastPoint();
232

    
233
    /**
234
     * Add a new point to geometryAdapter.
235
     * 
236
     * @return Number of points in the geometryAdapter.
237
     */
238
    public int addGeometryAdapterPoint();
239

    
240
    /**
241
     * Change the position of mousemoved point of geometryAdapter.
242
     */
243
    public void setGeometryAdapterPoinPosition();
244

    
245
    /**
246
     * Clear the image of pointer of mouse.
247
     */
248
    public void clearMouseImage();
249

    
250
    /**
251
     * Refres the Layout.
252
     */
253
    public void refresh();
254

    
255
    /**
256
     * It returns true if the drawing has been canceled.
257
     * 
258
     * @return true if the drawn has been canceled.
259
     */
260
    public boolean isDrawingCancelled();
261

    
262
    /**
263
     * It cancels the drawing if the parameter is true.
264
     * 
265
     * @param b
266
     *            true if the drawing wants to be canceled
267
     */
268
    public void setCancelDrawing(boolean b);
269

    
270
    /**
271
     * Returns the rectangle of selection.
272
     * 
273
     * @return Rectangle of selection.
274
     */
275
    public Rectangle getReSel();
276

    
277
    /**
278
     * It returns true if should draw the rectangle of selection and does the
279
     * selection.
280
     * 
281
     * @return true if should draw the rectangle of selection.
282
     */
283
    public boolean isReSel();
284

    
285
    /**
286
     * Insert true if should draw the rectangle of selection and does the
287
     * selection.
288
     * 
289
     * @param b
290
     *            boolean.
291
     */
292
    public void setIsReSel(boolean b);
293

    
294
    /**
295
     * It does a full extent of the layers that contains the view of the
296
     * FFrameView selected.
297
     * 
298
     * @throws ReadDriverException
299
     */
300
    public void viewFull() throws ReadException;
301

    
302
    /**
303
     * Returns the object to make zooms.
304
     * 
305
     * @return FLayoutZooms.
306
     */
307
    public FLayoutZooms getLayoutZooms();
308

    
309
    /**
310
     * Returns the object of FLayoutFunctions.
311
     * 
312
     * @return FLayoutFunctions
313
     */
314
    public FLayoutFunctions getLayoutFunctions();
315

    
316
    /**
317
     * Returns the LayoutContext.
318
     * 
319
     * @return LayoutContext.
320
     */
321
    public LayoutContext getLayoutContext();
322

    
323
    /**
324
     * Inserts the geometryAdapter.
325
     * 
326
     * @param adapter
327
     *            GeometryAdapter.
328
     */
329
    public void setGeometryAdapter(GeometryAdapter adapter);
330

    
331
    public JComponent getComponent();
332

    
333
    public int getWidth();
334

    
335
    public int getHeight();
336

    
337
    public void repaint();
338
}