es.udc.cartolab.gvsig.navtable
Class ToggleEditing

java.lang.Object
  extended by es.udc.cartolab.gvsig.navtable.ToggleEditing

public class ToggleEditing
extends java.lang.Object

Class for start, stop or toggle the editing on a vector layer. Based on the StartingEditing Extension of gvSIG

Author:
Nacho Varela, Javier Estevez

Constructor Summary
ToggleEditing()
           
 
Method Summary
 void modifyValue(com.iver.cit.gvsig.fmap.layers.FLyrVect layer, int rowIdx, int attrIdx, java.lang.Object newValue)
          Deprecated. It'll be replaced by modifyValue2
 void modifyValue2(com.iver.cit.gvsig.fmap.layers.FLyrVect layer, int rowPos, int colPos, java.lang.String newValue)
          Modidify a single value of a register.
 void modifyValue2(com.iver.cit.gvsig.fmap.layers.FLyrVect layer, int rowPos, int colPos, com.hardcode.gdbms.engine.values.Value newValue)
          Modidify a single value of a register.
 void startEditing(com.iver.cit.gvsig.fmap.layers.FLayer layer)
           
 void startEditing(java.lang.String layerName)
          Checks the layers from the TOC and get the layer to be edited with its name.
 void stopEditing(com.iver.cit.gvsig.fmap.layers.FLayer layer, boolean cancel)
           
 void stopEditing(java.lang.String layerName, boolean cancel)
           
 boolean toggle(com.iver.cit.gvsig.fmap.layers.FLayer layer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToggleEditing

public ToggleEditing()
Method Detail

toggle

public boolean toggle(com.iver.cit.gvsig.fmap.layers.FLayer layer)

startEditing

public void startEditing(com.iver.cit.gvsig.fmap.layers.FLayer layer)
Parameters:
layer - The vectorial layer to be edited.

startEditing

public void startEditing(java.lang.String layerName)
Checks the layers from the TOC and get the layer to be edited with its name.

Parameters:
layerName - The name of the layer to be edited.

stopEditing

public void stopEditing(com.iver.cit.gvsig.fmap.layers.FLayer layer,
                        boolean cancel)
Parameters:
layer - The layer wich edition will be stoped.
cancel - false if we want to save the layer, true if we don't.

stopEditing

public void stopEditing(java.lang.String layerName,
                        boolean cancel)
Parameters:
layer - The name of the layer wich edition will be stoped.
cancel - false if we want to save the layer, true if we don't.

modifyValue

public void modifyValue(com.iver.cit.gvsig.fmap.layers.FLyrVect layer,
                        int rowIdx,
                        int attrIdx,
                        java.lang.Object newValue)
Deprecated. It'll be replaced by modifyValue2

Modidify a single value of a register. IMPORTANT: StartEditing and StopEditing is required before and after call this method.

Parameters:
layer - the layer that contains the feature to be changed.
rowIdx - the data row to be changed.
attrIdx - the attribute to be changed.
newValue - the value to be stored on the table.

modifyValue2

public void modifyValue2(com.iver.cit.gvsig.fmap.layers.FLyrVect layer,
                         int rowPos,
                         int colPos,
                         java.lang.String newValue)
                  throws java.lang.Exception
Modidify a single value of a register. It creates the new value from its String representation. IMPORTANT: StartEditing and StopEditing is required before and after call this method.

Parameters:
layer - the layer that contains the feature to be changed.
rowPos - the data row to be changed.
colPos - the data column position to be changed.
newValue - the String representation of the value to be saved.
Throws:
java.lang.Exception

modifyValue2

public void modifyValue2(com.iver.cit.gvsig.fmap.layers.FLyrVect layer,
                         int rowPos,
                         int colPos,
                         com.hardcode.gdbms.engine.values.Value newValue)
                  throws java.lang.Exception
Modidify a single value of a register. IMPORTANT: StartEditing and StopEditing is required before and after call this method.

Parameters:
layer - the layer that contains the feature to be changed.
rowPos - the data row to be changed.
colPos - the data column position to be changed.
newValue - the value to be saved.
Throws:
com.iver.cit.gvsig.fmap.DriverException
java.io.IOException
java.lang.Exception