gistoolkit.display
Class Layer

java.lang.Object
  extended bygistoolkit.display.Layer

public class Layer
extends java.lang.Object

Represents a layer of the rendered map.


Constructor Summary
Layer()
          Creates a new layer without a datasource.
Layer(DataSource inDataSource)
          Create the layer with a new datasource.
 
Method Summary
 void addLayerListener(LayerListener inListener)
          Add a Layer Listener to the vector of listeners.
 void commit()
          Commit any changes to this layer.
 void delete(Record inRecord)
          Deletes the data in the data source.
 void drawHighlight(Record inRecord, java.awt.Graphics inGraphics, Converter inConverter)
          Draw the layer on the map with the given bounds
 void drawLayer(java.awt.Graphics g, Converter inConverter)
          Draw the layer on the map with the given bounds
 java.lang.String[] getAttributeNames()
          Retrieve the array of attribute names
 AttributeType[] getAttributeTypes()
          Retrieve the array of attribute types
 GISDataset getDataset()
          Return the currently displayed dataset.
 DataSource getDataSource()
          Retrieve the data source from the layer
 Envelope getEnvelope()
          Returns the bounding rectangle of the layer
 Filter getFilter()
          Gets the filter in use with this datasource.
 Projection getFromProjection()
          Retrieve the from projection in use with this layer
 java.lang.String getLayerName()
          Returns the name of this layer.
 java.awt.image.BufferedImage getLegend()
          Retrieve the legend from the style
 double getMaxDistance()
          Gets the maximum distance this at which this layer is drawn.
 double getMaxLabelDistance()
          Get the maximum distance at which this layer should allow labeling.
 double getMinDistance()
          Gets the minimum distance at which this layer is drawn.
 double getMinLabelDistance()
          Get the minimum distance at which this layer should allow labeling.
 Node getNode()
          Retrieve the configuration information for this layer.
 Record getObjectContaining(Shape inShape)
          Returns the record of the shape containing this shape.
 Projection getProjection()
          Retrieve the projection in use with this layer
 Record[] getRecords()
          Returns all the currently displayed records
 Style getStyle()
          Insert the method's description here.
 void insert(Record inRecord)
          Inserts the data in the data source.
 boolean isDirty()
          Returns true if the layer has been updated and not committed or rolled back.
 boolean isUpdateable()
          Determines if this layer is currently updateable or not.
 boolean isVisible()
          returns true if the layer is currently visible.
 void labelLayer(java.awt.Graphics g, Converter inConverter)
          Draw the label on the map with the given bounds
 void removeLayerListener(LayerListener inListener)
          removes a Layer Listener from the vector of Lisetners.
 void rollback()
          Rollback any changes to this layer.
 void setDataSource(DataSource inDataSource)
          Set the data source for the layer
 void setFilter(Filter inFilter)
          Sets the filter to use with this dataset.
 void setFromProjection(Projection inProjection)
          Sets the projection to use when rendering this particular layer.
 void setLayerName(java.lang.String newLayerName)
          Sets the name of this layer.
 void setMaxDistance(double inMaxDistance)
          Sets the maximum distance at which this layer is drawn.
 void setMaxLabelDistance(double inMaxLabelDistance)
          Set the maximum distance at which this layer should allow labeling.
 void setMinDistance(double inMinDistance)
          Sets the minimum distance at which this layer is drawn.
 void setMinLabelDistance(double inMinLabelDistance)
          Set the minimum distance at which this layer should allow labeling.
 void setNode(Node inNode)
          Set the configuraiton information for this layer.
 void setProjection(Projection inProjection, boolean inCacheProjected)
          Sets the projection to use when rendering this particular layer.
 void setStyle(Style newStyle)
          Sets the style for this layer to use.
 void setUpdateable(boolean inUpdateable)
          Sets the flag to indicate that this layer is not updateable.
 void setVisible(boolean inVisible)
          Sets the value of the layer is visible flag.
 java.lang.String toString()
          Insert the method's description here.
 void update(Record inRecord)
          Updates the data in the data source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Layer

public Layer()
Creates a new layer without a datasource. This layer will be invalid until it receives or generates a datasource. This can be done with the load() method.


Layer

public Layer(DataSource inDataSource)
Create the layer with a new datasource.

Method Detail

isDirty

public boolean isDirty()
Returns true if the layer has been updated and not committed or rolled back.


addLayerListener

public void addLayerListener(LayerListener inListener)
Add a Layer Listener to the vector of listeners.


removeLayerListener

public void removeLayerListener(LayerListener inListener)
removes a Layer Listener from the vector of Lisetners.


getDataSource

public DataSource getDataSource()
Retrieve the data source from the layer


setDataSource

public void setDataSource(DataSource inDataSource)
Set the data source for the layer


isVisible

public boolean isVisible()
returns true if the layer is currently visible.


setVisible

public void setVisible(boolean inVisible)
Sets the value of the layer is visible flag. If set to false, the layer will not draw.


setMaxDistance

public void setMaxDistance(double inMaxDistance)
Sets the maximum distance at which this layer is drawn. If the Envelope of the map are between the maximum and minimum distances, then this layer will be drawn. Otherwise it will not be drawn. If this value is set to 0, then the layer is always drawn.


getMaxDistance

public double getMaxDistance()
Gets the maximum distance this at which this layer is drawn. If the Envelope of the map are between the maximum and minimum distances, then this layer will be drawn. Otherwise it will not be drawn. If this value is set to 0, then the layer is always drawn.


setMinDistance

public void setMinDistance(double inMinDistance)
Sets the minimum distance at which this layer is drawn. If the Envelope of the map are between the maximum and minimum distances, then this layer will be drawn. Otherwise it will not be drawn.


getMinDistance

public double getMinDistance()
Gets the minimum distance at which this layer is drawn. If the Envelope of the map are between the maximum and minimum distances, then this layer will be drawn. Otherwise it will not be drawn.


getMaxLabelDistance

public double getMaxLabelDistance()
Get the maximum distance at which this layer should allow labeling. If the Envelope of the map are between the maximum and minimum distances, then this layer will be labeled. Otherwise it will not be labeled. If this value is set to 0, then this layer is never labeled.


setMaxLabelDistance

public void setMaxLabelDistance(double inMaxLabelDistance)
Set the maximum distance at which this layer should allow labeling. If the Envelope of the map are between the maximum and minimum distances, then this layer will be labeled. Otherwise it will not be labeled. If this value is set to 0, then this layer is never labeled.


getMinLabelDistance

public double getMinLabelDistance()
Get the minimum distance at which this layer should allow labeling. If the Envelope of the map are between the maximum and minimum distances, then this layer will be labeled. Otherwise it will not be labeled.


setMinLabelDistance

public void setMinLabelDistance(double inMinLabelDistance)
Set the minimum distance at which this layer should allow labeling. If the Envelope of the map are between the maximum and minimum distances, then this layer will be labeled. Otherwise it will not be labeled.


delete

public void delete(Record inRecord)
            throws java.lang.Exception
Deletes the data in the data source.

Throws:
java.lang.Exception

drawHighlight

public void drawHighlight(Record inRecord,
                          java.awt.Graphics inGraphics,
                          Converter inConverter)
Draw the layer on the map with the given bounds


drawLayer

public void drawLayer(java.awt.Graphics g,
                      Converter inConverter)
Draw the layer on the map with the given bounds


labelLayer

public void labelLayer(java.awt.Graphics g,
                       Converter inConverter)
Draw the label on the map with the given bounds


getEnvelope

public Envelope getEnvelope()
                     throws java.lang.Exception
Returns the bounding rectangle of the layer

Throws:
java.lang.Exception

getLayerName

public java.lang.String getLayerName()
Returns the name of this layer.


getObjectContaining

public Record getObjectContaining(Shape inShape)
                           throws java.lang.Exception
Returns the record of the shape containing this shape. Returns a -1 if there are no points

Throws:
java.lang.Exception

getStyle

public Style getStyle()
Insert the method's description here.


insert

public void insert(Record inRecord)
            throws java.lang.Exception
Inserts the data in the data source.

Throws:
java.lang.Exception

setLayerName

public void setLayerName(java.lang.String newLayerName)
Sets the name of this layer.


setStyle

public void setStyle(Style newStyle)
Sets the style for this layer to use.


toString

public java.lang.String toString()
Insert the method's description here.


update

public void update(Record inRecord)
            throws java.lang.Exception
Updates the data in the data source.

Throws:
java.lang.Exception

commit

public void commit()
            throws java.lang.Exception
Commit any changes to this layer.

Throws:
java.lang.Exception

rollback

public void rollback()
              throws java.lang.Exception
Rollback any changes to this layer.

Throws:
java.lang.Exception

isUpdateable

public boolean isUpdateable()
Determines if this layer is currently updateable or not.


setUpdateable

public void setUpdateable(boolean inUpdateable)
Sets the flag to indicate that this layer is not updateable.


setProjection

public void setProjection(Projection inProjection,
                          boolean inCacheProjected)
                   throws java.lang.Exception
Sets the projection to use when rendering this particular layer. This layer just hands this off to the data source to request the data in that projection.

Throws:
java.lang.Exception

setFromProjection

public void setFromProjection(Projection inProjection)
                       throws java.lang.Exception
Sets the projection to use when rendering this particular layer. This layer just hands this off to the data source to request the data in that projection.

Throws:
java.lang.Exception

getProjection

public Projection getProjection()
Retrieve the projection in use with this layer


getFromProjection

public Projection getFromProjection()
Retrieve the from projection in use with this layer


getAttributeNames

public java.lang.String[] getAttributeNames()
Retrieve the array of attribute names


getAttributeTypes

public AttributeType[] getAttributeTypes()
Retrieve the array of attribute types


getLegend

public java.awt.image.BufferedImage getLegend()
Retrieve the legend from the style


getNode

public Node getNode()
Retrieve the configuration information for this layer.


setNode

public void setNode(Node inNode)
             throws java.lang.Exception
Set the configuraiton information for this layer.

Throws:
java.lang.Exception

getDataset

public GISDataset getDataset()
Return the currently displayed dataset.


setFilter

public void setFilter(Filter inFilter)
Sets the filter to use with this dataset.


getFilter

public Filter getFilter()
Gets the filter in use with this datasource.


getRecords

public Record[] getRecords()
Returns all the currently displayed records