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 / LayoutControl.java @ 144

History | View | Annotate | Download (7.72 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.gui.LayoutPanel;
35
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutBehavior;
36
import org.gvsig.fmap.dal.exception.ReadException;
37
import org.gvsig.tools.observer.Observer;
38

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
332
    public JComponent getComponent();
333

    
334
    public int getWidth();
335

    
336
    public int getHeight();
337

    
338
    public void repaint();
339
}