shp_renderer.geometry
Class SHPPolygon

java.lang.Object
  extended by shp_renderer.geometry.SHPShape
      extended by shp_renderer.geometry.SHPPolyType
          extended by shp_renderer.geometry.SHPPolygon

public class SHPPolygon
extends SHPPolyType

SHPPolygon - This class is used to represent a shapefile polygon type, which means it stores a series of polygons, called parts.

Author:
Richard McKenna

Constructor Summary
SHPPolygon(double[] initBoundingBox, int initNumBytes, int initNumParts, int initNumPoints, int[] initParts, double[] initXPointsData, double[] initYPointsData)
          This constructor fully initializes all data needed for use.
 
Method Summary
 void render(java.awt.Graphics2D g2, double zoomScale, double viewportCenterX, double viewportCenterY, int panelWidth, int panelHeight)
          This method provides the implementation for rendering polygons.
 
Methods inherited from class shp_renderer.geometry.SHPPolyType
addBytes, calculateSize, fillData, getBoundingBox, getNumBytes, getNumParts, getNumPoints, getParts, getXPointsData, getXRenderData, getYPointsData, getYRenderData
 
Methods inherited from class shp_renderer.geometry.SHPShape
getFillColor, getLineColor, getRecordLength, getRecordNumber, setFillColor, setLineColor, setRecordLength, setRecordNumber
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SHPPolygon

public SHPPolygon(double[] initBoundingBox,
                  int initNumBytes,
                  int initNumParts,
                  int initNumPoints,
                  int[] initParts,
                  double[] initXPointsData,
                  double[] initYPointsData)
This constructor fully initializes all data needed for use.

Parameters:
initBoundingBox - The bounding box for the polygon.
initNumBytes - The number of bytes.
initNumParts - The number of parts.
initNumPoints - The number of points.
initParts - The Parts.
initXPointsData - The x point data.
initYPointsData - The y point data.
Method Detail

render

public void render(java.awt.Graphics2D g2,
                   double zoomScale,
                   double viewportCenterX,
                   double viewportCenterY,
                   int panelWidth,
                   int panelHeight)
This method provides the implementation for rendering polygons. Note that it will go through and render each part.

Specified by:
render in class SHPShape
Parameters:
g2 - The graphics used for rendering.
zoomScale - The level of zoom.
viewportCenterX - The viewport center x.
viewportCenterY - The viewport center y.
panelWidth - The width of the panel.
panelHeight - The height of the panel.