gistoolkit.features
Class RasterShape

java.lang.Object
  extended bygistoolkit.features.Shape
      extended bygistoolkit.features.RasterShape

public class RasterShape
extends Shape

Allows Bitmaps to be displayed on the screen.


Field Summary
 
Fields inherited from class gistoolkit.features.Shape
EQUAL_LIMIT, LINEARRING, LINESTRING, MULTILINESTRING, MULTIPOINT, MULTIPOLYGON, myEnvelope, NULLSHAPE, POINT, POLYGON, RASTER
 
Constructor Summary
RasterShape()
          Creates new RastorShape
RasterShape(Envelope inEnvelope, java.awt.image.BufferedImage inImage)
          Creates new RastorShape
 
Method Summary
 int add(double inX, double inY)
          Adds a point to this raster shape.
 boolean add(int inIndex, double inX, double inY)
          Adds a point to this raster shape at the given index.
 java.lang.Object clone()
          clone this shape
 int getClosestIndex(double inX, double inY)
          Get the index of the point within the shape nearest this location.
 double getDistanceToPoint(double inX, double inY)
          Get the distance from this shape to the given point.
 Envelope getEnvelope()
          Return the envelope.
 java.awt.image.BufferedImage getImage()
          return the image to the calling routine
 int getNumPoints()
          Returns the number of points in the shape.
 Point getPoint(int inIndex)
          Returns the point at the given index.
 Point[] getPoints()
          Returns the points that comprise the object.
 java.lang.String getShapeType()
          Return the type of shape this is
 java.lang.String getWKT()
          Returns the OGIS Well Know Text Representation of this shape
 boolean intersects(Shape inShape)
          Determines if the two shapes intersect
 boolean remove(int inIndex)
          Removes the point at the given index.
 void setImage(Envelope inEnvelope, java.awt.image.BufferedImage inImage)
          Set the image to be used with this shape.
 void setPoint(int inIndex, double inXCoordinate, double inYCoordinate)
          Sets the point at the given index to the given value.
 void translate(double inXDistance, double inYDistance)
          Translate the shape the given distance in the X and Y directions
 
Methods inherited from class gistoolkit.features.Shape
calculateEnvelope, contains, distance, getDistance, getDistanceToEnvelope, getDistanceToLine, getDistanceToLine, getLinesIntersect, linesIntersect, linesIntersect, pointOnLine, pointOnLine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RasterShape

public RasterShape()
Creates new RastorShape


RasterShape

public RasterShape(Envelope inEnvelope,
                   java.awt.image.BufferedImage inImage)
Creates new RastorShape

Method Detail

getShapeType

public java.lang.String getShapeType()
Return the type of shape this is

Specified by:
getShapeType in class Shape

getEnvelope

public Envelope getEnvelope()
Return the envelope.

Specified by:
getEnvelope in class Shape

getNumPoints

public int getNumPoints()
Returns the number of points in the shape.

Specified by:
getNumPoints in class Shape

getPoint

public Point getPoint(int inIndex)
Returns the point at the given index.

Specified by:
getPoint in class Shape

setPoint

public void setPoint(int inIndex,
                     double inXCoordinate,
                     double inYCoordinate)
Sets the point at the given index to the given value.

Specified by:
setPoint in class Shape

add

public int add(double inX,
               double inY)
Adds a point to this raster shape. This is always illegal and will return -1.

Specified by:
add in class Shape

add

public boolean add(int inIndex,
                   double inX,
                   double inY)
Adds a point to this raster shape at the given index. This is always illegal and will return false.

Specified by:
add in class Shape

remove

public boolean remove(int inIndex)
Removes the point at the given index. This is always illegal and will return false.

Specified by:
remove in class Shape

getImage

public java.awt.image.BufferedImage getImage()
return the image to the calling routine


setImage

public void setImage(Envelope inEnvelope,
                     java.awt.image.BufferedImage inImage)
Set the image to be used with this shape.


clone

public java.lang.Object clone()
clone this shape

Specified by:
clone in class Shape

getPoints

public Point[] getPoints()
Description copied from class: Shape
Returns the points that comprise the object. This is an expensive operation as all the points must be generated to be returned. As a result, the points returned are not owned by the shape. They are copies of the data contained in the shape.

Specified by:
getPoints in class Shape

getWKT

public java.lang.String getWKT()
Description copied from class: Shape
Returns the OGIS Well Know Text Representation of this shape

Specified by:
getWKT in class Shape

translate

public void translate(double inXDistance,
                      double inYDistance)
Translate the shape the given distance in the X and Y directions

Specified by:
translate in class Shape

getClosestIndex

public int getClosestIndex(double inX,
                           double inY)
Get the index of the point within the shape nearest this location. Always returns -1.

Specified by:
getClosestIndex in class Shape

getDistanceToPoint

public double getDistanceToPoint(double inX,
                                 double inY)
Get the distance from this shape to the given point. In the case of rastors, this is the same as the distance to the extents.

Specified by:
getDistanceToPoint in class Shape

intersects

public boolean intersects(Shape inShape)
Determines if the two shapes intersect

Specified by:
intersects in class Shape