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

History | View | Annotate | Download (8.43 KB)

1 5 jldominguez
/* 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 144 cmartinez
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
35 5 jldominguez
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 357 cmartinez
     * <p>Returns a copy of the rectangle that represents the size
46
     * and position of the layout sheet (in pixels), relative to
47
     * the containing LayoutControl.</p>
48 5 jldominguez
     *
49 357 cmartinez
     * <p>Note: you must use {@link #setRect(Rectangle2D)} to update
50
     * the rectangle, as this method only returns a copy of it.</p>
51 5 jldominguez
     * @return Rectangle2D.Double Rectangle that represents the sheet.
52 357 cmartinez
     * @see LayoutControl#setRect(Rectangle2D)
53 5 jldominguez
     */
54
    public Rectangle2D.Double getRect();
55
56
    /**
57 357 cmartinez
     * <p>Sets the size and position of the layout sheet in screen coordinates
58
     * (pixels), relative to the LayoutControl.</p>
59
     *
60
     * <p>The size of the sheet is usually different from the
61
     * bounds of the underlying UI control, for instance if we have zoomed in
62
     * an area of the sheet then the paper size in pixels will be bigger than
63
     * the actual control size.</p>
64
     *
65
     */
66
    public void setRect(Rectangle2D r);
67
68
    /**
69 5 jldominguez
     * Returns the name of the current selected tool on this Layout
70
     *
71
     * @return A tool name.
72
     */
73
    public String getCurrentTool();
74
75
    /**
76
     * Add a new Layout tool.
77
     *
78
     * @param name
79
     *            Name of tool.
80
     * @param tool
81
     *            LayoutBehavior
82
     */
83
    public void addLayoutTool(String name, LayoutBehavior tool);
84
85
    /**
86
     * Inserts the LayoutContext.
87
     *
88
     * @param lc
89
     *            LayoutContext.
90
     */
91
    public void setLayoutContext(LayoutContext lc);
92
93
    /**
94
     * Returns the image with the ruler.
95
     *
96
     * @return Ruler image.
97
     */
98
    public BufferedImage getImgRuler();
99
100
    /**
101
     * It obtains the rect that is adjusted to the size of the window,
102
     * to see the full extent of layout.
103
     */
104
    public void fullRect();
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 183 cmartinez
129
    /**
130
     * Changes the currently selected tool to the default tool
131
     */
132
    public void setDefaultTool();
133 5 jldominguez
134
    /**
135
     * Start the vertex edition of graphics.
136
     *
137
     */
138
    public void startEdit();
139
140
    /**
141
     * Stop the vertex edition of graphics.
142
     *
143
     */
144
    public void stopEdit();
145
146
    /**
147
     * It returns the point that represents the northwest corner of the Layout.
148
     *
149
     * @return Point.
150
     */
151
    public Point getRectOrigin();
152
153
    /**
154
     * Returns the object to draw the Layout.
155
     *
156
     * @return FLayoutDraw.
157
     */
158
    public FLayoutDraw getLayoutDraw();
159
160
    /**
161
     * Returns the current Layout tool.
162
     *
163
     * @return LayoutBehavior Current Layout Tool.
164
     */
165
    public LayoutBehavior getCurrentLayoutTool();
166
167
    /**
168
     * It returns the first click point of mouse.
169
     *
170
     * @return Point.
171
     */
172
    public Point getFirstPoint();
173
174
    /**
175
     * Returns the previous click of mouse.
176
     *
177
     * @return Point.
178
     */
179
    public Point getPointAnt();
180
181
    /**
182
     * Returns the last click point of mouse.
183
     *
184
     * @return Point.
185
     */
186
    public Point getLastPoint();
187
188
    /**
189
     * Inserts the first click point of mouse.
190
     *
191
     * @param p
192
     *            Point.
193
     */
194
    public void setFirstPoint();
195
196
    /**
197
     * Inserts the previous click point of mouse.
198
     *
199
     * @param p
200
     *            Point.
201
     */
202
    public void setPointAnt();
203
204
    /**
205
     * Inserts the last click point of mouse.
206
     *
207
     * @param p
208
     *            Point.
209
     */
210
    public void setLastPoint();
211
212
    /**
213
     * Insert the position point and calculate the new position if the grid is
214
     * actived.
215
     *
216
     * @param point2
217
     *            Position.
218
     */
219
    public void setPosition(Point point2);
220
221
    /**
222
     * Returns the position adjusted point.
223
     *
224
     * @return
225
     */
226
    public Point getPosition();
227
228
    /**
229
     * Returns the AffineTransform that is applying in the Layout.
230
     *
231
     * @return AffineTransform
232
     */
233
    public AffineTransform getAT();
234
235
    /**
236
     * It returns the current GeometryAdapter.
237
     *
238
     * @return Current GeometryAdapter.
239
     */
240
    public GeometryAdapter getGeometryAdapter();
241
242
    /**
243
     * Remove last point of geometryAdapter.
244
     *
245
     */
246
    public void delLastPoint();
247
248
    /**
249
     * Add a new point to geometryAdapter.
250
     *
251
     * @return Number of points in the geometryAdapter.
252
     */
253
    public int addGeometryAdapterPoint();
254
255
    /**
256
     * Change the position of mousemoved point of geometryAdapter.
257
     */
258
    public void setGeometryAdapterPoinPosition();
259
260
    /**
261
     * Clear the image of pointer of mouse.
262
     */
263
    public void clearMouseImage();
264
265
    /**
266
     * Refres the Layout.
267
     */
268
    public void refresh();
269
270
    /**
271
     * It returns true if the drawing has been canceled.
272
     *
273
     * @return true if the drawn has been canceled.
274
     */
275
    public boolean isDrawingCancelled();
276
277
    /**
278
     * It cancels the drawing if the parameter is true.
279
     *
280
     * @param b
281
     *            true if the drawing wants to be canceled
282
     */
283
    public void setCancelDrawing(boolean b);
284
285
    /**
286
     * Returns the rectangle of selection.
287
     *
288
     * @return Rectangle of selection.
289
     */
290
    public Rectangle getReSel();
291
292
    /**
293
     * It returns true if should draw the rectangle of selection and does the
294
     * selection.
295
     *
296
     * @return true if should draw the rectangle of selection.
297
     */
298
    public boolean isReSel();
299
300
    /**
301
     * Insert true if should draw the rectangle of selection and does the
302
     * selection.
303
     *
304
     * @param b
305
     *            boolean.
306
     */
307
    public void setIsReSel(boolean b);
308
309
    /**
310
     * It does a full extent of the layers that contains the view of the
311
     * FFrameView selected.
312
     *
313
     * @throws ReadDriverException
314
     */
315
    public void viewFull() throws ReadException;
316
317
    /**
318
     * Returns the object to make zooms.
319
     *
320
     * @return FLayoutZooms.
321
     */
322
    public FLayoutZooms getLayoutZooms();
323
324
    /**
325
     * Returns the object of FLayoutFunctions.
326
     *
327
     * @return FLayoutFunctions
328
     */
329
    public FLayoutFunctions getLayoutFunctions();
330
331
    /**
332
     * Returns the LayoutContext.
333
     *
334
     * @return LayoutContext.
335
     */
336
    public LayoutContext getLayoutContext();
337
338
    /**
339
     * Inserts the geometryAdapter.
340
     *
341
     * @param adapter
342
     *            GeometryAdapter.
343
     */
344
    public void setGeometryAdapter(GeometryAdapter adapter);
345
346
    public JComponent getComponent();
347
348
    public int getWidth();
349
350
    public int getHeight();
351
352
    public void repaint();
353
}