Revision 4475
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/command/CommandStackDialog.java | ||
---|---|---|
153 | 153 |
} |
154 | 154 |
|
155 | 155 |
public ViewInfo getViewInfo() { |
156 |
ViewInfo m_viewinfo = new ViewInfo(ViewInfo.ICONIFIABLE | ViewInfo.MODELESSDIALOG | ViewInfo.RESIZABLE); |
|
156 |
ViewInfo m_viewinfo = new ViewInfo(ViewInfo.ICONIFIABLE | |
|
157 |
ViewInfo.MODELESSDIALOG | ViewInfo.RESIZABLE | ViewInfo.PALETTE); |
|
157 | 158 |
m_viewinfo.setTitle(PluginServices.getText(this, |
158 | 159 |
"pila_de_comandos")); |
159 | 160 |
return m_viewinfo; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/TableEditStartExtension.java | ||
---|---|---|
44 | 44 |
import com.iver.andami.plugins.Extension; |
45 | 45 |
import com.iver.andami.ui.mdiManager.View; |
46 | 46 |
import com.iver.cit.gvsig.fmap.edition.EditionException; |
47 |
import com.iver.cit.gvsig.fmap.edition.IEditableSource; |
|
47 | 48 |
import com.iver.cit.gvsig.gui.Table; |
48 | 49 |
|
49 | 50 |
|
... | ... | |
67 | 68 |
View v = PluginServices.getMDIManager().getActiveView(); |
68 | 69 |
|
69 | 70 |
try { |
70 |
((Table) v).startEditing(); |
|
71 |
Table table = (Table) v; |
|
72 |
table.startEditing(); |
|
73 |
IEditableSource edTable = (IEditableSource) table.getModel().getAssociatedTable(); |
|
74 |
edTable.getCommandRecord().addCommandListener(table); |
|
75 |
|
|
71 | 76 |
} catch (EditionException e) { |
72 | 77 |
// TODO Auto-generated catch block |
73 | 78 |
e.printStackTrace(); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/TableEditStopExtension.java | ||
---|---|---|
6 | 6 |
import com.iver.andami.messages.NotificationManager; |
7 | 7 |
import com.iver.andami.plugins.Extension; |
8 | 8 |
import com.iver.andami.ui.mdiManager.View; |
9 |
import com.iver.cit.gvsig.fmap.edition.IEditableSource; |
|
9 | 10 |
import com.iver.cit.gvsig.gui.Table; |
10 | 11 |
|
11 | 12 |
|
... | ... | |
25 | 26 |
* @see com.iver.andami.plugins.Extension#execute(java.lang.String) |
26 | 27 |
*/ |
27 | 28 |
public void execute(String actionCommand) { |
29 |
View v = PluginServices.getMDIManager().getActiveView(); |
|
30 |
Table table = (Table) v; |
|
28 | 31 |
if ("ROLLBACK".equals(actionCommand)) { |
29 |
View v = PluginServices.getMDIManager().getActiveView(); |
|
30 | 32 |
try { |
31 |
((Table) v).cancelEditing();
|
|
33 |
table.cancelEditing();
|
|
32 | 34 |
} catch (IOException e) { |
33 | 35 |
NotificationManager.addError("No se pudo cancelar la edici?n", e); |
34 | 36 |
} |
35 | 37 |
} else if ("COMMIT".equals(actionCommand)) { |
36 |
View v = PluginServices.getMDIManager().getActiveView(); |
|
37 |
((Table) v).stopEditing(); |
|
38 |
table.stopEditing(); |
|
38 | 39 |
|
39 | 40 |
} |
41 |
IEditableSource edTable = (IEditableSource) table.getModel().getAssociatedTable(); |
|
42 |
edTable.getCommandRecord().removeCommandListener(table); |
|
43 |
|
|
40 | 44 |
} |
41 | 45 |
|
42 | 46 |
/** |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FConverter.java | ||
---|---|---|
54 | 54 |
import java.lang.reflect.Array; |
55 | 55 |
import java.util.ArrayList; |
56 | 56 |
|
57 |
import com.iver.cit.gvsig.fmap.core.FArc2D; |
|
57 | 58 |
import com.iver.cit.gvsig.fmap.core.FPoint2D; |
58 | 59 |
import com.iver.cit.gvsig.fmap.core.FPolygon2D; |
59 | 60 |
import com.iver.cit.gvsig.fmap.core.FPolyline2D; |
... | ... | |
855 | 856 |
|
856 | 857 |
case FShape.LINE: |
857 | 858 |
case FShape.LINE + FShape.Z: |
859 |
case FShape.ARC: |
|
858 | 860 |
shp = new FPolyline2D(newGp); |
859 | 861 |
break; |
860 | 862 |
case FShape.POLYGON: |
861 | 863 |
case FShape.POLYGON + FShape.Z: |
864 |
case FShape.CIRCLE: |
|
865 |
case FShape.ELLIPSE: |
|
862 | 866 |
shp = new FPolygon2D(newGp); |
863 | 867 |
break; |
864 | 868 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FEllipse2D.java | ||
---|---|---|
404 | 404 |
AffineTransform mT = AffineTransform.getRotateInstance(angle, init.getX(), init.getY()); |
405 | 405 |
gp = new GeneralPathX(arc); |
406 | 406 |
gp.transform(mT); |
407 |
} |
|
407 |
}
|
|
408 | 408 |
} |
409 |
|
|
410 |
/* (non-Javadoc) |
|
411 |
* @see com.iver.cit.gvsig.fmap.core.FPolyline2D#intersects(java.awt.geom.Rectangle2D) |
|
412 |
*/ |
|
413 |
public boolean intersects(Rectangle2D r) { |
|
414 |
return gp.intersects(r); |
|
415 |
} |
|
416 |
|
|
409 | 417 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FCircle2D.java | ||
---|---|---|
258 | 258 |
} |
259 | 259 |
} |
260 | 260 |
|
261 |
/* (non-Javadoc) |
|
262 |
* @see com.iver.cit.gvsig.fmap.core.FPolyline2D#intersects(java.awt.geom.Rectangle2D) |
|
263 |
*/ |
|
264 |
public boolean intersects(Rectangle2D r) { |
|
265 |
return gp.intersects(r); |
|
266 |
} |
|
267 |
|
|
261 | 268 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FArc2D.java | ||
---|---|---|
430 | 430 |
gp=new GeneralPathX(arco); |
431 | 431 |
} |
432 | 432 |
} |
433 |
|
|
434 |
/* (non-Javadoc) |
|
435 |
* @see com.iver.cit.gvsig.fmap.core.FPolyline2D#intersects(java.awt.geom.Rectangle2D) |
|
436 |
*/ |
|
437 |
public boolean intersects(Rectangle2D r) { |
|
438 |
return gp.intersects(r); |
|
439 |
} |
|
433 | 440 |
|
441 |
|
|
434 | 442 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/commands/CommandCollection.java | ||
---|---|---|
70 | 70 |
} |
71 | 71 |
|
72 | 72 |
public String getType() { |
73 |
return "Complex"; //((Command)commands.get(0)).getType(); |
|
73 |
// assert(commands.size()>0); |
|
74 |
if (commands.size() == 0) return null; |
|
75 |
return ((Command)commands.get(0)).getType(); |
|
74 | 76 |
} |
75 | 77 |
} |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/EditingExtension.java | ||
---|---|---|
8 | 8 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
9 | 9 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
10 | 10 |
import com.iver.cit.gvsig.gui.View; |
11 |
import com.iver.cit.gvsig.layers.VectorialLayerEdited; |
|
11 | 12 |
import com.iver.cit.gvsig.project.ProjectView; |
12 | 13 |
|
13 | 14 |
/** |
... | ... | |
34 | 35 |
FMap mapa = model.getMapContext(); |
35 | 36 |
FLayers layers = mapa.getLayers(); |
36 | 37 |
if (s.equals("CANCELEDITING")) { |
38 |
EditionManager editionManager = CADExtension.getEditionManager(); |
|
39 |
|
|
37 | 40 |
for (int i = 0; i < layers.getLayersCount(); i++) { |
38 | 41 |
vista.hideConsole(); |
39 | 42 |
if (layers.getLayer(i) instanceof FLyrVect |
... | ... | |
43 | 46 |
// VectorialEditableAdapter vea = (VectorialEditableAdapter) ((FLyrVect) layers |
44 | 47 |
// .getLayer(i)).getSource(); |
45 | 48 |
// lv.setSource(vea.getOriginalAdapter()); |
49 |
VectorialLayerEdited lyrEdited = (VectorialLayerEdited) editionManager.getLayerEdited(lv); |
|
50 |
lyrEdited.clearSelection(); |
|
46 | 51 |
lv.setEditing(false); |
47 | 52 |
return; |
48 | 53 |
} |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/CADExtension.java | ||
---|---|---|
336 | 336 |
public boolean postProcessKeyEvent(KeyEvent e) { |
337 | 337 |
// System.out.println("KeyEvent e = " + e); |
338 | 338 |
if ((adapter==null) || (view == null)) return false; |
339 |
if (e.getID() != KeyEvent.KEY_RELEASED) return false; |
|
339 | 340 |
if (e.getKeyCode() == KeyEvent.VK_DELETE) |
340 | 341 |
adapter.keyPressed("eliminar"); |
341 | 342 |
else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/StopEditing.java | ||
---|---|---|
25 | 25 |
import com.iver.cit.gvsig.fmap.layers.VectorialAdapter; |
26 | 26 |
import com.iver.cit.gvsig.fmap.layers.VectorialFileAdapter; |
27 | 27 |
import com.iver.cit.gvsig.gui.View; |
28 |
import com.iver.cit.gvsig.layers.VectorialLayerEdited; |
|
28 | 29 |
import com.iver.cit.gvsig.project.ProjectView; |
29 | 30 |
import com.iver.utiles.SimpleFileFilter; |
30 | 31 |
|
... | ... | |
57 | 58 |
ProjectView model = vista.getModel(); |
58 | 59 |
FMap mapa = model.getMapContext(); |
59 | 60 |
FLayers layers = mapa.getLayers(); |
61 |
EditionManager edMan = CADExtension.getEditionManager(); |
|
60 | 62 |
if (s.equals("STOPEDITING")) { |
61 | 63 |
FLayer[] actives = layers.getActives(); |
62 | 64 |
// TODO: Comprobar que solo hay una activa, o al menos |
... | ... | |
65 | 67 |
if (actives[i] instanceof FLyrVect && actives[i].isEditing()) { |
66 | 68 |
FLyrVect lv = (FLyrVect) actives[i]; |
67 | 69 |
MapControl mapControl = (MapControl) vista.getMapControl(); |
70 |
VectorialLayerEdited lyrEd = (VectorialLayerEdited) edMan.getActiveLayerEdited(); |
|
71 |
lyrEd.clearSelection(); |
|
68 | 72 |
stopEditing(lv, mapControl); |
69 | 73 |
|
70 | 74 |
return; |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/smc/LineCADToolContext.java | ||
---|---|---|
191 | 191 |
|
192 | 192 |
} |
193 | 193 |
} |
194 |
else |
|
194 |
else if (s.equals(""))
|
|
195 | 195 |
{ |
196 |
boolean loopbackFlag = |
|
197 |
context.getState().getName().equals( |
|
198 |
Line.FirstPoint.getName()); |
|
199 |
|
|
200 |
if (loopbackFlag == false) |
|
201 |
{ |
|
202 |
(context.getState()).Exit(context); |
|
203 |
} |
|
204 |
|
|
205 |
context.clearState(); |
|
206 |
try |
|
207 |
{ |
|
208 |
ctxt.end(); |
|
209 |
} |
|
210 |
finally |
|
211 |
{ |
|
212 |
context.setState(Line.FirstPoint); |
|
213 |
|
|
214 |
if (loopbackFlag == false) |
|
215 |
{ |
|
216 |
(context.getState()).Entry(context); |
|
217 |
} |
|
218 |
|
|
219 |
} |
|
220 |
} else |
|
221 |
{ |
|
196 | 222 |
super.addOption(context, s); |
197 | 223 |
} |
198 | 224 |
|
trunk/extensions/extCAD/sm/LineCADTool.sm | ||
---|---|---|
71 | 71 |
FirstPoint{ |
72 | 72 |
end(); |
73 | 73 |
} |
74 |
addOption(s:String) |
|
75 |
[s.equals("")] |
|
76 |
FirstPoint{ |
|
77 |
end(); |
|
78 |
} |
|
79 |
|
|
74 | 80 |
} |
75 | 81 |
%% |
Also available in: Unified diff