com.iver.cit.gvsig.fmap.layers
Class SelectableDataSource

java.lang.Object
  extended bycom.iver.cit.gvsig.fmap.layers.SelectableDataSource

public class SelectableDataSource
extends java.lang.Object

DataSource seleccionable.

Author:
Fernando González Cortés

Constructor Summary
SelectableDataSource(DataSource ds)
          Crea un nuevo SelectableDataSource.
 
Method Summary
 void addSelectionListener(SelectionListener listener)
          Añade un nuevo Listener al SelectionSupport.
 void clearSelection()
          Borra la selección.
 void fireSelectionEvents()
          Cuando ocurre un evento de cambio en la selección, éste puede ser uno de una gran cantidad de eventos.
 java.lang.String getDBMS()
          Devuelve el DBMS.
 ReadDriver getDriver()
          Devuelve el driver de la capa.
 int getFieldCount()
          Devuelve el número de campos.
 int getFieldIndexByName(java.lang.String arg0)
          Devuelve el índice del campo a partir de su nombre.
 java.lang.String getFieldName(int arg0)
          Devuelve el nombre del campo a partir del índice.
 Value getFieldValue(long arg0, int arg1)
          Devuelve el valor a partir del númro de fila y columna.
 java.lang.String getName()
          Devuelve el nombre del DataSource.
 long getRowCount()
          Devuelve el númro de filas en total.
 FBitSet getSelection()
          Develve un FBitSet con los índices de los elementos seleccionados.
 SelectionSupport getSelectionSupport()
          Devuelve el SelectionSupport.
 long[] getWhereFilter()
           
 XMLEntity getXMLEntity()
          Devuelve el XMLEntity con la información necesaria para reproducir el DataSource.
 boolean isSelected(int recordIndex)
          Devuelve true si el elemento está seleccionado.
 void removeSelectionListener(SelectionListener listener)
          Borra un Listener al SelectionSupport.
 void setName(java.lang.String name)
          Inserta un nuevo nombre para el dataSource.
 void setSelection(FBitSet selection)
          Inserta una nueva selección.
 void setSelectionSupport(SelectionSupport selectionSupport)
          Añade el soporte para la selección.
 void setXMLEntity(XMLEntity child)
          A partir del XMLEntity se rellenan los atributos del DataSource.
 void start()
          Inicializa el dataSource.
 void stop()
          Finaliza el DataSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectableDataSource

public SelectableDataSource(DataSource ds)
Crea un nuevo SelectableDataSource.

Parameters:
ds -
Method Detail

setSelectionSupport

public void setSelectionSupport(SelectionSupport selectionSupport)
Añade el soporte para la selección.

Parameters:
selectionSupport -

getDBMS

public java.lang.String getDBMS()
Devuelve el DBMS.

Returns:
String.

getDriver

public ReadDriver getDriver()
Devuelve el driver de la capa.

Returns:
ReadDriver.

getFieldCount

public int getFieldCount()
                  throws DriverException
Devuelve el número de campos.

Returns:
Número de campos.
Throws:
DriverException

getFieldIndexByName

public int getFieldIndexByName(java.lang.String arg0)
                        throws DriverException,
                               FieldNotFoundException
Devuelve el índice del campo a partir de su nombre.

Parameters:
arg0 - nombre del campo.
Returns:
índice.
Throws:
DriverException
FieldNotFoundException

getFieldName

public java.lang.String getFieldName(int arg0)
                              throws DriverException
Devuelve el nombre del campo a partir del índice.

Parameters:
arg0 - índice.
Returns:
nombre del campo.
Throws:
DriverException

getFieldValue

public Value getFieldValue(long arg0,
                           int arg1)
                    throws DriverException
Devuelve el valor a partir del númro de fila y columna.

Parameters:
arg0 - número de registro.
arg1 - número de campo.
Returns:
Valor.
Throws:
DriverException

getName

public java.lang.String getName()
Devuelve el nombre del DataSource.

Returns:
Nombre.

getRowCount

public long getRowCount()
                 throws DriverException
Devuelve el númro de filas en total.

Returns:
número de filas.
Throws:
DriverException

start

public void start()
           throws DriverException
Inicializa el dataSource.

Throws:
DriverException

stop

public void stop()
          throws DriverException
Finaliza el DataSource.

Throws:
DriverException

fireSelectionEvents

public void fireSelectionEvents()
Cuando ocurre un evento de cambio en la selección, éste puede ser uno de una gran cantidad de eventos. Con el fin de no propagar todos estos eventos, se realiza la propagación de manera manual al final de la "ráfaga" de eventos


addSelectionListener

public void addSelectionListener(SelectionListener listener)
Añade un nuevo Listener al SelectionSupport.

Parameters:
listener - SelectionListener.

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Borra un Listener al SelectionSupport.

Parameters:
listener - Listener a borrar.

clearSelection

public void clearSelection()
Borra la selección.


getSelection

public FBitSet getSelection()
Develve un FBitSet con los índices de los elementos seleccionados.

Returns:
FBitset con los elementos seleccionados.

getSelectionSupport

public SelectionSupport getSelectionSupport()
Devuelve el SelectionSupport.

Returns:
SelectinSuport.

isSelected

public boolean isSelected(int recordIndex)
Devuelve true si el elemento está seleccionado.

Parameters:
recordIndex - índice del registro.
Returns:
True si el registro está seleccionado.

setSelection

public void setSelection(FBitSet selection)
Inserta una nueva selección.

Parameters:
selection - FBitSet.

setName

public void setName(java.lang.String name)
Inserta un nuevo nombre para el dataSource.

Parameters:
name - Nuevo nombre del DataSource.
Throws:
java.lang.RuntimeException

getXMLEntity

public XMLEntity getXMLEntity()
Devuelve el XMLEntity con la información necesaria para reproducir el DataSource.

Returns:
XMLEntity.

setXMLEntity

public void setXMLEntity(XMLEntity child)
A partir del XMLEntity se rellenan los atributos del DataSource.

Parameters:
child -

getWhereFilter

public long[] getWhereFilter()
                      throws java.io.IOException
Throws:
java.io.IOException
See Also:
com.hardcode.gdbms.engine.data.DataSource#getWhereFilter()