svn-gvsig-desktop / tags / v1_1_Build_1015 / extensions / extCAD / src / com / iver / cit / gvsig / gui / cad / DefaultCADTool.java @ 13679
History | View | Annotate | Download (13.1 KB)
1 | 3831 | caballero | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
4 | *
|
||
5 | * This program is free software; you can redistribute it and/or
|
||
6 | * modify it under the terms of the GNU General Public License
|
||
7 | * as published by the Free Software Foundation; either version 2
|
||
8 | * of the License, or (at your option) any later version.
|
||
9 | *
|
||
10 | * This program is distributed in the hope that it will be useful,
|
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | * GNU General Public License for more details.
|
||
14 | *
|
||
15 | * You should have received a copy of the GNU General Public License
|
||
16 | * along with this program; if not, write to the Free Software
|
||
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
18 | *
|
||
19 | * For more information, contact:
|
||
20 | *
|
||
21 | * Generalitat Valenciana
|
||
22 | * Conselleria d'Infraestructures i Transport
|
||
23 | * Av. Blasco Ib??ez, 50
|
||
24 | * 46010 VALENCIA
|
||
25 | * SPAIN
|
||
26 | *
|
||
27 | * +34 963862235
|
||
28 | * gvsig@gva.es
|
||
29 | * www.gvsig.gva.es
|
||
30 | *
|
||
31 | * or
|
||
32 | *
|
||
33 | * IVER T.I. S.A
|
||
34 | * Salamanca 50
|
||
35 | * 46005 Valencia
|
||
36 | * Spain
|
||
37 | *
|
||
38 | * +34 963163400
|
||
39 | * dac@iver.es
|
||
40 | */
|
||
41 | package com.iver.cit.gvsig.gui.cad; |
||
42 | |||
43 | 3997 | fjp | import java.awt.Color; |
44 | 3883 | caballero | import java.awt.Graphics; |
45 | import java.awt.Graphics2D; |
||
46 | import java.awt.geom.AffineTransform; |
||
47 | import java.awt.geom.Point2D; |
||
48 | import java.awt.image.BufferedImage; |
||
49 | import java.io.IOException; |
||
50 | 4144 | fjp | import java.util.ArrayList; |
51 | 3883 | caballero | |
52 | 5893 | fjp | import org.apache.log4j.Logger; |
53 | |||
54 | 4024 | caballero | import com.hardcode.driverManager.DriverLoadException; |
55 | import com.hardcode.gdbms.engine.data.driver.DriverException; |
||
56 | 3831 | caballero | import com.hardcode.gdbms.engine.values.Value; |
57 | 4118 | caballero | import com.hardcode.gdbms.engine.values.ValueFactory; |
58 | 3883 | caballero | import com.iver.andami.PluginServices; |
59 | 5923 | fjp | import com.iver.andami.messages.NotificationManager; |
60 | 3883 | caballero | import com.iver.cit.gvsig.CADExtension; |
61 | 3831 | caballero | import com.iver.cit.gvsig.fmap.ViewPort; |
62 | import com.iver.cit.gvsig.fmap.core.DefaultFeature; |
||
63 | 3952 | fjp | import com.iver.cit.gvsig.fmap.core.FShape; |
64 | 3831 | caballero | import com.iver.cit.gvsig.fmap.core.GeneralPathX; |
65 | import com.iver.cit.gvsig.fmap.core.Handler; |
||
66 | 4144 | fjp | import com.iver.cit.gvsig.fmap.core.IFeature; |
67 | 3831 | caballero | import com.iver.cit.gvsig.fmap.core.IGeometry; |
68 | 11436 | caballero | import com.iver.cit.gvsig.fmap.core.ISymbol; |
69 | 3831 | caballero | import com.iver.cit.gvsig.fmap.core.ShapeFactory; |
70 | 11427 | caballero | import com.iver.cit.gvsig.fmap.core.v02.FConstant; |
71 | 3831 | caballero | import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities; |
72 | 11427 | caballero | import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
73 | 3831 | caballero | import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
74 | 4550 | caballero | import com.iver.cit.gvsig.fmap.edition.DefaultRowEdited; |
75 | 5184 | caballero | import com.iver.cit.gvsig.fmap.edition.EditionEvent; |
76 | 4144 | fjp | import com.iver.cit.gvsig.fmap.edition.IRowEdited; |
77 | 3831 | caballero | import com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter; |
78 | 4584 | caballero | import com.iver.cit.gvsig.fmap.layers.FBitSet; |
79 | 10656 | caballero | import com.iver.cit.gvsig.fmap.layers.FLayer; |
80 | 5170 | caballero | import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
81 | 5735 | caballero | import com.iver.cit.gvsig.gui.cad.exception.CommandException; |
82 | 4465 | caballero | import com.iver.cit.gvsig.layers.VectorialLayerEdited; |
83 | 8765 | jjdelcerro | import com.iver.cit.gvsig.project.documents.view.gui.View; |
84 | 4892 | caballero | import com.iver.utiles.console.JConsole; |
85 | 3831 | caballero | |
86 | /**
|
||
87 | * DOCUMENT ME!
|
||
88 | 5985 | caballero | *
|
89 | 3831 | caballero | * @author Vicente Caballero Navarro
|
90 | */
|
||
91 | public abstract class DefaultCADTool implements CADTool { |
||
92 | 11436 | caballero | public static FSymbol selectionSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT, |
93 | 11427 | caballero | new Color(255, 0,0, 100)); // Le ponemos una transparencia |
94 | 11436 | caballero | public static FSymbol axisReferencesSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT, |
95 | 11427 | caballero | new Color(100, 100, 100, 100)); |
96 | 11436 | caballero | public static FSymbol geometrySelectSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT, |
97 | Color.RED);
|
||
98 | public static FSymbol handlerSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT, |
||
99 | 11427 | caballero | Color.ORANGE);
|
100 | 5923 | fjp | private static Logger logger = Logger.getLogger(DefaultCADTool.class |
101 | .getName()); |
||
102 | |||
103 | 11436 | caballero | |
104 | 4445 | fjp | private CADToolAdapter cadToolAdapter;
|
105 | 3831 | caballero | |
106 | 4445 | fjp | private String question; |
107 | 3831 | caballero | |
108 | 4445 | fjp | private String[] currentdescriptions; |
109 | 3831 | caballero | |
110 | 4708 | caballero | private String tool = "selection"; |
111 | |||
112 | 9065 | caballero | private DefaultCADTool previousTool;
|
113 | 4445 | fjp | /**
|
114 | * DOCUMENT ME!
|
||
115 | */
|
||
116 | public void draw(IGeometry geometry) { |
||
117 | if (geometry != null) { |
||
118 | BufferedImage img = getCadToolAdapter().getMapControl().getImage();
|
||
119 | Graphics2D gImag = (Graphics2D) img.getGraphics(); |
||
120 | ViewPort vp = getCadToolAdapter().getMapControl().getViewPort(); |
||
121 | 11436 | caballero | geometry.draw(gImag, vp, DefaultCADTool.selectionSymbol); |
122 | 4445 | fjp | } |
123 | } |
||
124 | 3831 | caballero | |
125 | 4445 | fjp | /**
|
126 | * DOCUMENT ME!
|
||
127 | 5985 | caballero | *
|
128 | 4445 | fjp | * @param cta
|
129 | * DOCUMENT ME!
|
||
130 | */
|
||
131 | public void setCadToolAdapter(CADToolAdapter cta) { |
||
132 | cadToolAdapter = cta; |
||
133 | } |
||
134 | 3831 | caballero | |
135 | 4445 | fjp | /**
|
136 | * DOCUMENT ME!
|
||
137 | 5985 | caballero | *
|
138 | 4445 | fjp | * @return DOCUMENT ME!
|
139 | */
|
||
140 | public CADToolAdapter getCadToolAdapter() {
|
||
141 | return cadToolAdapter;
|
||
142 | } |
||
143 | 5923 | fjp | |
144 | public VectorialLayerEdited getVLE() {
|
||
145 | return (VectorialLayerEdited) CADExtension.getEditionManager()
|
||
146 | .getActiveLayerEdited(); |
||
147 | 4637 | caballero | } |
148 | 3831 | caballero | |
149 | 4445 | fjp | /**
|
150 | * DOCUMENT ME!
|
||
151 | 5985 | caballero | *
|
152 | 4445 | fjp | * @param g
|
153 | * DOCUMENT ME!
|
||
154 | * @param firstPoint
|
||
155 | * DOCUMENT ME!
|
||
156 | * @param endPoint
|
||
157 | * DOCUMENT ME!
|
||
158 | */
|
||
159 | 11436 | caballero | public void drawLine(Graphics2D g, Point2D firstPoint, Point2D endPoint, ISymbol symbol) { |
160 | 4445 | fjp | GeneralPathX elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD, 2); |
161 | elShape.moveTo(firstPoint.getX(), firstPoint.getY()); |
||
162 | elShape.lineTo(endPoint.getX(), endPoint.getY()); |
||
163 | ShapeFactory.createPolyline2D(elShape).draw(g, |
||
164 | getCadToolAdapter().getMapControl().getViewPort(), |
||
165 | 11436 | caballero | symbol); |
166 | 4445 | fjp | } |
167 | |||
168 | /**
|
||
169 | * DOCUMENT ME!
|
||
170 | 5985 | caballero | *
|
171 | 4445 | fjp | * @param geometry
|
172 | * DOCUMENT ME!
|
||
173 | */
|
||
174 | public void addGeometry(IGeometry geometry) { |
||
175 | 4971 | caballero | VectorialEditableAdapter vea = getVLE().getVEA(); |
176 | 4445 | fjp | try {
|
177 | 5893 | fjp | // Deber?amos comprobar que lo que escribimos es correcto:
|
178 | // Lo hacemos en el VectorialAdapter, justo antes de
|
||
179 | // a?adir, borrar o modificar una feature
|
||
180 | |||
181 | 4971 | caballero | int numAttr = vea.getRecordset().getFieldCount();
|
182 | 4445 | fjp | Value[] values = new Value[numAttr]; |
183 | for (int i = 0; i < numAttr; i++) { |
||
184 | values[i] = ValueFactory.createNullValue(); |
||
185 | } |
||
186 | 12134 | caballero | String newFID;
|
187 | 5923 | fjp | try {
|
188 | 12134 | caballero | newFID = vea.getNewFID(); |
189 | DefaultFeature df = new DefaultFeature(geometry, values, newFID);
|
||
190 | 5923 | fjp | int index = vea.addRow(df, getName(), EditionEvent.GRAPHIC);
|
191 | VectorialLayerEdited vle = getVLE(); |
||
192 | 5985 | caballero | clearSelection(); |
193 | 5923 | fjp | ArrayList selectedRow = vle.getSelectedRow();
|
194 | 4637 | caballero | |
195 | 5985 | caballero | |
196 | 6881 | cesar | ViewPort vp = vle.getLayer().getMapContext().getViewPort(); |
197 | 5923 | fjp | BufferedImage selectionImage = new BufferedImage(vp |
198 | .getImageWidth(), vp.getImageHeight(), |
||
199 | BufferedImage.TYPE_INT_ARGB);
|
||
200 | Graphics2D gs = selectionImage.createGraphics();
|
||
201 | 5985 | caballero | int inversedIndex=vea.getInversedIndex(index);
|
202 | 5923 | fjp | selectedRow.add(new DefaultRowEdited(df,
|
203 | 5985 | caballero | IRowEdited.STATUS_ADDED, inversedIndex )); |
204 | vea.getSelection().set(inversedIndex); |
||
205 | 5923 | fjp | IGeometry geom = df.getGeometry(); |
206 | 11436 | caballero | geom.cloneGeometry().draw(gs, vp, DefaultCADTool.selectionSymbol); |
207 | 5923 | fjp | vle.drawHandlers(geom.cloneGeometry(), gs, vp); |
208 | vea.setSelectionImage(selectionImage); |
||
209 | } catch (IOException e) { |
||
210 | logger.debug(e); |
||
211 | NotificationManager.addError(e); |
||
212 | return;
|
||
213 | } |
||
214 | 4637 | caballero | |
215 | 4445 | fjp | } catch (DriverIOException e) {
|
216 | 12643 | caballero | NotificationManager.addError(e.getMessage(), e); |
217 | 4445 | fjp | } catch (DriverException e) {
|
218 | 12643 | caballero | NotificationManager.addError(e.getMessage(), e); |
219 | 4024 | caballero | } catch (DriverLoadException e) {
|
220 | 12643 | caballero | NotificationManager.addError(e.getMessage(), e); |
221 | 4024 | caballero | } |
222 | 3831 | caballero | |
223 | 4445 | fjp | draw(geometry.cloneGeometry()); |
224 | } |
||
225 | |||
226 | /**
|
||
227 | * DOCUMENT ME!
|
||
228 | 5985 | caballero | *
|
229 | 4445 | fjp | * @param geometry
|
230 | * DOCUMENT ME!
|
||
231 | */
|
||
232 | public void modifyFeature(int index, IFeature row) { |
||
233 | try {
|
||
234 | 5923 | fjp | getVLE().getVEA().modifyRow(index, row, getName(), |
235 | EditionEvent.GRAPHIC); |
||
236 | 3831 | caballero | } catch (IOException e1) { |
237 | 12643 | caballero | NotificationManager.addError(e1.getMessage(), e1); |
238 | 3831 | caballero | } catch (DriverIOException e1) {
|
239 | 12643 | caballero | NotificationManager.addError(e1.getMessage(), e1); |
240 | 3831 | caballero | } |
241 | 4445 | fjp | draw(row.getGeometry().cloneGeometry()); |
242 | } |
||
243 | 3831 | caballero | |
244 | 4445 | fjp | /**
|
245 | * DOCUMENT ME!
|
||
246 | 5985 | caballero | *
|
247 | 4445 | fjp | * @param geometry
|
248 | * DOCUMENT ME!
|
||
249 | * @param values
|
||
250 | * DOCUMENT ME!
|
||
251 | */
|
||
252 | 5884 | caballero | public int addGeometry(IGeometry geometry, Value[] values) { |
253 | 5923 | fjp | int index = 0; |
254 | 5884 | caballero | VectorialEditableAdapter vea = getVLE().getVEA(); |
255 | try {
|
||
256 | 12134 | caballero | String newFID = vea.getNewFID();
|
257 | DefaultFeature df = new DefaultFeature(geometry, values, newFID);
|
||
258 | 5923 | fjp | index = vea.addRow(df, getName(), EditionEvent.GRAPHIC); |
259 | 5884 | caballero | } catch (DriverIOException e) {
|
260 | 12042 | caballero | NotificationManager.addError(e); |
261 | 5884 | caballero | } catch (IOException e) { |
262 | 12042 | caballero | NotificationManager.addError(e); |
263 | 5884 | caballero | } catch (DriverLoadException e) {
|
264 | 12042 | caballero | NotificationManager.addError(e); |
265 | 5884 | caballero | } |
266 | 5985 | caballero | return vea.getInversedIndex(index);
|
267 | 4445 | fjp | } |
268 | 3831 | caballero | |
269 | 4445 | fjp | /**
|
270 | * Devuelve la cadena que corresponde al estado en el que nos encontramos.
|
||
271 | 5985 | caballero | *
|
272 | 4445 | fjp | * @return Cadena para mostrar por consola.
|
273 | */
|
||
274 | public String getQuestion() { |
||
275 | return question;
|
||
276 | } |
||
277 | 3831 | caballero | |
278 | 4445 | fjp | /**
|
279 | * Actualiza la cadena que corresponde al estado actual.
|
||
280 | 5985 | caballero | *
|
281 | 4445 | fjp | * @param s
|
282 | * Cadena que aparecer? en consola.
|
||
283 | */
|
||
284 | public void setQuestion(String s) { |
||
285 | question = s; |
||
286 | 5923 | fjp | // ConsoleToken.addQuestion(s);
|
287 | 4445 | fjp | } |
288 | 3831 | caballero | |
289 | 4445 | fjp | /**
|
290 | 5923 | fjp | * Provoca un repintado "soft" de la capa activa en edici?n. Las capas por
|
291 | * debajo de ella no se dibujan de verdad, solo se dibuja la que est? en
|
||
292 | * edici?n y las que est?n por encima de ella en el TOC.
|
||
293 | 4445 | fjp | */
|
294 | public void refresh() { |
||
295 | 10656 | caballero | FLayer layer=getVLE().getLayer(); |
296 | layer.setDirty(true);
|
||
297 | 5923 | fjp | getCadToolAdapter().getMapControl().rePaintDirtyLayers(); |
298 | 4445 | fjp | } |
299 | |||
300 | 5923 | fjp | /*
|
301 | * public void drawHandlers(Graphics g, FBitSet sel, AffineTransform at)
|
||
302 | * throws DriverIOException { for (int i = sel.nextSetBit(0); i >= 0; i =
|
||
303 | * sel.nextSetBit(i + 1)) { IGeometry ig =
|
||
304 | * getCadToolAdapter().getVectorialAdapter() .getShape(i).cloneGeometry();
|
||
305 | * if (ig == null) continue; Handler[] handlers =
|
||
306 | * ig.getHandlers(IGeometry.SELECTHANDLER);
|
||
307 | * FGraphicUtilities.DrawHandlers((Graphics2D) g, at, handlers); } }
|
||
308 | */
|
||
309 | 4445 | fjp | public void drawHandlers(Graphics g, ArrayList selectedRows, |
310 | AffineTransform at) {
|
||
311 | for (int i = 0; i < selectedRows.size(); i++) { |
||
312 | IRowEdited edRow = (IRowEdited) selectedRows.get(i); |
||
313 | IFeature feat = (IFeature) edRow.getLinkedRow(); |
||
314 | // IFeature feat = (IFeature) selectedRows.get(i);
|
||
315 | 4144 | fjp | IGeometry ig = feat.getGeometry().cloneGeometry(); |
316 | 4445 | fjp | if (ig == null) |
317 | continue;
|
||
318 | Handler[] handlers = ig.getHandlers(IGeometry.SELECTHANDLER); |
||
319 | 11436 | caballero | FGraphicUtilities.DrawHandlers((Graphics2D) g, at, handlers,DefaultCADTool.handlerSymbol);
|
320 | 4445 | fjp | } |
321 | } |
||
322 | 3883 | caballero | |
323 | public void setDescription(String[] currentdescriptions) { |
||
324 | this.currentdescriptions = currentdescriptions;
|
||
325 | } |
||
326 | 4445 | fjp | |
327 | public String[] getDescriptions() { |
||
328 | 3883 | caballero | return currentdescriptions;
|
329 | } |
||
330 | |||
331 | 4445 | fjp | /*
|
332 | * (non-Javadoc)
|
||
333 | 5985 | caballero | *
|
334 | 4445 | fjp | * @see com.iver.cit.gvsig.gui.cad.CADTool#end()
|
335 | */
|
||
336 | public void end() { |
||
337 | 5923 | fjp | CADExtension.setCADTool("_selection", true); |
338 | 5016 | caballero | PluginServices.getMainFrame().setSelectedTool("_selection");
|
339 | 9065 | caballero | CADTool cadtool=CADExtension.getCADTool(); |
340 | cadtool.setPreviosTool(this);
|
||
341 | 4445 | fjp | } |
342 | |||
343 | 3997 | fjp | public void init() { |
344 | 11436 | caballero | // DefaultCADTool.drawingSymbol.setOutlined(true);
|
345 | // DefaultCADTool.drawingSymbol.setOutlineColor(Color.GREEN);
|
||
346 | 4024 | caballero | |
347 | 3997 | fjp | } |
348 | 5923 | fjp | |
349 | protected ArrayList getSelectedRows() { |
||
350 | 4637 | caballero | VectorialLayerEdited vle = getVLE(); |
351 | 5923 | fjp | ArrayList selectedRow = vle.getSelectedRow();
|
352 | return selectedRow;
|
||
353 | 4465 | caballero | } |
354 | 5923 | fjp | |
355 | protected ArrayList getSelectedHandlers() { |
||
356 | 4637 | caballero | VectorialLayerEdited vle = getVLE(); |
357 | 5923 | fjp | ArrayList selectedHandlers = vle.getSelectedHandler();
|
358 | return selectedHandlers;
|
||
359 | 4584 | caballero | } |
360 | 5923 | fjp | |
361 | public void clearSelection() { |
||
362 | 4637 | caballero | VectorialLayerEdited vle = getVLE(); |
363 | 4584 | caballero | ArrayList selectedRow = vle.getSelectedRow();
|
364 | 5923 | fjp | ArrayList selectedHandlers = vle.getSelectedHandler();
|
365 | selectedRow.clear(); |
||
366 | selectedHandlers.clear(); |
||
367 | VectorialEditableAdapter vea = vle.getVEA(); |
||
368 | FBitSet selection = vea.getSelection(); |
||
369 | selection.clear(); |
||
370 | 12042 | caballero | vea.setSelectionImage(null);
|
371 | vea.setHandlersImage(null);
|
||
372 | 4637 | caballero | |
373 | 4584 | caballero | } |
374 | 5923 | fjp | |
375 | 4708 | caballero | public String getNextTool() { |
376 | return tool;
|
||
377 | } |
||
378 | |||
379 | public void setNextTool(String tool) { |
||
380 | this.tool = tool;
|
||
381 | } |
||
382 | 5923 | fjp | |
383 | public boolean changeCommand(String name) throws CommandException { |
||
384 | CADTool[] cadtools = CADExtension.getCADTools();
|
||
385 | for (int i = 0; i < cadtools.length; i++) { |
||
386 | CADTool ct = cadtools[i]; |
||
387 | if (name.equalsIgnoreCase(ct.getName())
|
||
388 | || name.equalsIgnoreCase(ct.toString())) { |
||
389 | int type = FShape.POINT;
|
||
390 | 5170 | caballero | try {
|
391 | 5923 | fjp | type = ((FLyrVect) getVLE().getLayer()).getShapeType(); |
392 | 5170 | caballero | } catch (com.iver.cit.gvsig.fmap.DriverException e) {
|
393 | 12643 | caballero | throw new CommandException(e); |
394 | 5170 | caballero | } |
395 | if (ct.isApplicable(type)) {
|
||
396 | getCadToolAdapter().setCadTool(ct); |
||
397 | ct.init(); |
||
398 | View vista = (View) PluginServices.getMDIManager() |
||
399 | 6880 | cesar | .getActiveWindow(); |
400 | 5170 | caballero | vista.getConsolePanel().addText("\n" + ct.getName(),
|
401 | JConsole.COMMAND); |
||
402 | return true; |
||
403 | 5923 | fjp | } else {
|
404 | 5735 | caballero | throw new CommandException(name); |
405 | 5170 | caballero | } |
406 | 4892 | caballero | } |
407 | } |
||
408 | return false; |
||
409 | } |
||
410 | 5923 | fjp | |
411 | 5170 | caballero | public boolean isApplicable(int shapeType) { |
412 | return true; |
||
413 | } |
||
414 | 5923 | fjp | |
415 | 4892 | caballero | public abstract String toString(); |
416 | 5735 | caballero | |
417 | 5923 | fjp | public void throwValueException(String s, double d) { |
418 | 6880 | cesar | View vista = (View) PluginServices.getMDIManager().getActiveWindow(); |
419 | 5923 | fjp | vista.getConsolePanel().addText(s + " : " + d, JConsole.ERROR);
|
420 | 5735 | caballero | } |
421 | 5923 | fjp | |
422 | public void throwOptionException(String s, String o) { |
||
423 | 6880 | cesar | View vista = (View) PluginServices.getMDIManager().getActiveWindow(); |
424 | 5923 | fjp | vista.getConsolePanel().addText(s + " : " + o, JConsole.ERROR);
|
425 | 5735 | caballero | } |
426 | 5923 | fjp | |
427 | public void throwPointException(String s, double x, double y) { |
||
428 | 6880 | cesar | View vista = (View) PluginServices.getMDIManager().getActiveWindow(); |
429 | 5923 | fjp | vista.getConsolePanel().addText(s + " : " + " X = " + x + ", Y = " + y, |
430 | JConsole.ERROR); |
||
431 | 5735 | caballero | } |
432 | |||
433 | 9065 | caballero | public void setPreviosTool(DefaultCADTool tool) { |
434 | previousTool=tool; |
||
435 | } |
||
436 | public void restorePreviousTool() { |
||
437 | CADExtension.setCADTool(previousTool.toString(), true);
|
||
438 | PluginServices.getMainFrame().setSelectedTool(previousTool.toString()); |
||
439 | } |
||
440 | |||
441 | 3831 | caballero | } |