com.bbn.openmap.dataAccess.shape
Class EsriGraphicList

java.lang.Object
  extended bycom.bbn.openmap.omGraphics.geom.BasicGeometry
      extended bycom.bbn.openmap.omGraphics.OMGraphic
          extended bycom.bbn.openmap.omGraphics.OMGraphicList
              extended bycom.bbn.openmap.dataAccess.shape.EsriGraphicList
All Implemented Interfaces:
java.lang.Cloneable, EsriGraphic, GraphicList, OMGeometry, OMGraphicConstants, java.io.Serializable, ShapeConstants
Direct Known Subclasses:
EsriPointList, EsriPolygonList, EsriPolylineList

public abstract class EsriGraphicList
extends OMGraphicList
implements ShapeConstants, EsriGraphic

EsriGraphicList ensures that only supported geometry types are added to its list. Each subclass of this EsriGraphicList list will hold polyline, polygon, or point geometry -- other types of geometry are not supported. As shapes are added to the list, EsriGraphicList will ensure that the type of geometry being added is the same type of geometry as specified by the subclass list type.

Author:
Doug Van Auken, Don Dietrick
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.bbn.openmap.omGraphics.OMGraphicList
OMGraphicList.OMDist
 
Field Summary
protected  float[] extents
           
protected  int type
           
 
Fields inherited from class com.bbn.openmap.omGraphics.OMGraphicList
allowDuplicates, FIRST_ADDED_ON_TOP, graphics, LAST_ADDED_ON_TOP, NONE, processAllGeometries, traverseMode, vague
 
Fields inherited from class com.bbn.openmap.omGraphics.OMGraphic
declutterType, displayPaint, edgeMatchesFill, fillPaint, hasLabel, linePaint, matted, mattingPaint, renderType, selected, selectPaint, showEditablePalette, stroke, textureMask
 
Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
APP_OBJECT_KEY, appObject, ATT_MAP_KEY, lineType, needToRegenerate, shape, visible
 
Fields inherited from interface com.bbn.openmap.dataAccess.shape.ShapeConstants
DBF_ATTRIBUTE, DBF_CHARACTER, DBF_DATE, DBF_LOGICAL, DBF_MEMO, DBF_NUMERIC, DBF_TYPE_CHARACTER, DBF_TYPE_DATE, DBF_TYPE_LOGICAL, DBF_TYPE_MEMO, DBF_TYPE_NUMERIC, PARAM_DBF, PARAM_SHP, PARAM_SHX, SHAPE_BOUNDS_ATTRIBUTE, SHAPE_DBF_DASHPATTERN, SHAPE_DBF_DASHPHASE, SHAPE_DBF_DESCRIPTION, SHAPE_DBF_FILLCOLOR, SHAPE_DBF_INFO_ATTRIBUTE, SHAPE_DBF_LINECOLOR, SHAPE_DBF_LINEWIDTH, SHAPE_DBF_SELECTCOLOR, SHAPE_FILE_HEADER_LENGTH, SHAPE_FILE_RECORD_HEADER_LENGTH, SHAPE_INDEX_ATTRIBUTE, SHAPE_MAX_MEASURE_ATTRIBUTE, SHAPE_MAX_Z_ATTRIBUTE, SHAPE_MEASURE_ATTRIBUTE, SHAPE_MIN_MEASURE_ATTRIBUTE, SHAPE_MIN_Z_ATTRIBUTE, SHAPE_TYPE_ARC, SHAPE_TYPE_MULTIPATCH, SHAPE_TYPE_MULTIPOINT, SHAPE_TYPE_MULTIPOINTM, SHAPE_TYPE_MULTIPOINTZ, SHAPE_TYPE_NULL, SHAPE_TYPE_POINT, SHAPE_TYPE_POINTM, SHAPE_TYPE_POINTZ, SHAPE_TYPE_POLYGON, SHAPE_TYPE_POLYGONM, SHAPE_TYPE_POLYGONZ, SHAPE_TYPE_POLYLINE, SHAPE_TYPE_POLYLINEM, SHAPE_TYPE_POLYLINEZ, SHAPE_Z_ATTRIBUTE
 
Fields inherited from interface com.bbn.openmap.omGraphics.OMGraphicConstants
ADD_GRAPHIC_MASK, BASIC_STROKE, CHANGE_APPEARANCE, clear, DECIMAL_DEGREES, DECLUTTERTYPE_LINE, DECLUTTERTYPE_MOVE, DECLUTTERTYPE_NONE, DECLUTTERTYPE_SPACE, DEFAULT_ROTATIONANGLE, DELETE_GRAPHIC_MASK, DESELECT_GRAPHIC_MASK, DESELECTALL_GRAPHIC_MASK, GRAPHICTYPE_ARC, GRAPHICTYPE_BITMAP, GRAPHICTYPE_CIRCLE, GRAPHICTYPE_ELLIPSE, GRAPHICTYPE_GRAPHIC, GRAPHICTYPE_GRID, GRAPHICTYPE_LINE, GRAPHICTYPE_POINT, GRAPHICTYPE_POLY, GRAPHICTYPE_RASTER, GRAPHICTYPE_RECTANGLE, GRAPHICTYPE_TEXT, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, RADIANS, RAISE_GRAPHIC_MASK, RAISE_TO_TOP_GRAPHIC_MASK, REMOVABLE, RENDERTYPE_LATLON, RENDERTYPE_OFFSET, RENDERTYPE_UNKNOWN, RENDERTYPE_XY, SELECT_GRAPHIC_MASK, SORT_GRAPHICS_MASK, TOOLTIP, UPDATE_GRAPHIC_MASK
 
Constructor Summary
EsriGraphicList()
          Construct an EsriGraphicList.
EsriGraphicList(int initialCapacity)
          Construct an EsriGraphicList with an initial capacity.
EsriGraphicList(int initialCapacity, int capacityIncrement)
          Deprecated. capacityIncrement doesn't do anything.
 
Method Summary
 void add(OMGraphic shape)
          Over-ride the add( ) method to trap for inconsistent shape geometry.
 void addExtents(float[] graphicExtents)
           
 void addOMGraphic(OMGraphic g)
          Add an OMGraphic to the GraphicList.
 void createTable()
          Create a generic DbfTableModel for the contents of this list, where the attributes hold rendering properties for the list contents.
static EsriGraphicList getEsriGraphicList(java.net.URL shp, DrawingAttributes drawingAttributes, DbfTableModel dbf)
          Reads the contents of the SHP files.
static EsriGraphicList getEsriGraphicList(java.net.URL shp, java.net.URL shx, DrawingAttributes drawingAttributes, DbfTableModel dbf)
          Deprecated. use getGraphicList(URL, DrawingAttributes, DbfTableModel)
 float[] getExtents()
          The lat/lon extent of the EsriGraphicList contents, returned as miny, minx, maxy maxx in order of the array.
 DbfTableModel getTable()
          Get the DbfTableModel object from the AppObject of this list.
 int getType()
          Get the list type in ESRI type number form
static void main(java.lang.String[] args)
           
 void setExtents(float[] extents)
          The lat/lon extent of the EsriGraphicList contents, assumed to contain miny, minx, maxy maxx in order of the array.
 void setTable(DbfTableModel dtm)
          Set the DbfTableModel in the AppObject of this list that holds the attribute information about this list's objects.
 void setType(int type)
          Set the type for the EsriGraphic.
 
Methods inherited from class com.bbn.openmap.omGraphics.OMGraphicList
_add, _doAction, _findClosest, _findClosest, _getAt, _getContains, _getWithAppObject, _indexOf, _insert, _remove, _remove, _selectClosest, _setAt, checkForDuplicate, clear, clone, contains, deselect, deselectAll, distance, doAction, findAll, findAll, findAllTest, findClosest, findClosest, findClosestTest, findIndexOfClosest, findIndexOfClosest, generate, generate, getAllowDuplicates, getDescription, getDescription, getOMGraphicAt, getOMGraphicThatContains, getOMGraphicWithAppObject, getProcessAllGeometries, getTargets, getTraverseMode, indexOf, insertOMGraphicAt, isEmpty, isVague, isVisible, iterator, moveIndexedOneToBack, moveIndexedOneToBottom, moveIndexedOneToFront, moveIndexedOneToTop, moveIndexedToBottom, moveIndexedToFirst, moveIndexedToLast, moveIndexedToTop, objectToOMGraphic, project, project, readGraphics, readGraphics, remove, removeOMGraphicAt, render, renderAllAsSelected, select, selectAll, selectClosest, selectClosest, selectClosestTest, setAllowDuplicates, setFillPaint, setGridGenerator, setLinePaint, setMatted, setMattingPaint, setOMGraphicAt, setProcessAllGeometries, setSelectPaint, setStroke, setTargets, setTextureMask, setTraverseMode, setVague, setVisible, shouldProcess, size, sort, writeGraphics, writeGraphics
 
Methods inherited from class com.bbn.openmap.omGraphics.OMGraphic
getDeclutterType, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, setDeclutterType, setEdgeMatchesFill, setFillColor, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setRenderType, setSelectColor, setSelected, setShape, setShowEditablePalette, shouldRenderEdge, shouldRenderFill
 
Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, checkAttributeMap, checkAttributeMap, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, draw, fill, getAppObject, getAppObject, getAttribute, getAttributeMap, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, putAttribute, removeAttribute, replaceAppObjectWithAttributeMap, setAppObject, setAppObject, setAttributes, setLineType, setNeedToRegenerate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bbn.openmap.dataAccess.shape.EsriGraphic
getAttribute, putAttribute, shallowCopy
 
Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry
clearAttributes, contains, draw, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate
 

Field Detail

extents

protected float[] extents

type

protected int type
Constructor Detail

EsriGraphicList

public EsriGraphicList()
Construct an EsriGraphicList.


EsriGraphicList

public EsriGraphicList(int initialCapacity)
Construct an EsriGraphicList with an initial capacity.

Parameters:
initialCapacity - the initial capacity of the list

EsriGraphicList

public EsriGraphicList(int initialCapacity,
                       int capacityIncrement)
Deprecated. capacityIncrement doesn't do anything.

Construct an EsriGraphicList with an initial capacity and a standard increment value.

Parameters:
initialCapacity - the initial capacity of the list
capacityIncrement - the capacityIncrement for resizing
Method Detail

add

public void add(OMGraphic shape)
Over-ride the add( ) method to trap for inconsistent shape geometry. If you are adding a OMGraphic that is not a list, make sure this list is a sub-list containing multiple geometry parts. Only add another list to a top level EsriGraphicList.

Overrides:
add in class OMGraphicList
Parameters:
shape - the non-null OMGraphic to add

addOMGraphic

public void addOMGraphic(OMGraphic g)
Add an OMGraphic to the GraphicList. The OMGraphic must not be null.

Overrides:
addOMGraphic in class OMGraphicList
Parameters:
g - the non-null OMGraphic to add
Throws:
java.lang.IllegalArgumentException - if OMGraphic is null

setType

public void setType(int type)
Description copied from interface: EsriGraphic
Set the type for the EsriGraphic.

Specified by:
setType in interface EsriGraphic
Parameters:
type -

getType

public int getType()
Get the list type in ESRI type number form

Specified by:
getType in interface EsriGraphic

setExtents

public void setExtents(float[] extents)
The lat/lon extent of the EsriGraphicList contents, assumed to contain miny, minx, maxy maxx in order of the array.

Specified by:
setExtents in interface EsriGraphic

getExtents

public float[] getExtents()
The lat/lon extent of the EsriGraphicList contents, returned as miny, minx, maxy maxx in order of the array.

Specified by:
getExtents in interface EsriGraphic

addExtents

public void addExtents(float[] graphicExtents)

setTable

public void setTable(DbfTableModel dtm)
Set the DbfTableModel in the AppObject of this list that holds the attribute information about this list's objects.


getTable

public DbfTableModel getTable()
Get the DbfTableModel object from the AppObject of this list.


createTable

public void createTable()
Create a generic DbfTableModel for the contents of this list, where the attributes hold rendering properties for the list contents. The table is stored in the AppObject member variable of the list.


getEsriGraphicList

public static EsriGraphicList getEsriGraphicList(java.net.URL shp,
                                                 java.net.URL shx,
                                                 DrawingAttributes drawingAttributes,
                                                 DbfTableModel dbf)
Deprecated. use getGraphicList(URL, DrawingAttributes, DbfTableModel)

Reads the contents of the SHX and SHP files. The SHX file will be read first by utilizing the ShapeIndex.open method. This method will return a list of offsets, which the AbstractSupport.open method will use to iterate through the contents of the SHP file.

Parameters:
shp - The url of the SHP file
shx - The url of the SHX file
drawingAttributes - a DrawingAttributes object containing the rendering parameters you might want on the OMGraphics. The OMGraphic default (black edge, clear fill) will be used if this is null.
dbf - a DbfTableModel, if you want each row of objects from the table (an array), inserted into their associated OMGraphic's appObject. The dbf will be added to the list appObject, so you can ask it questions later. If null, no problem. If the number of records doesn't match the OMGraphic list length, nothing will be done.
Returns:
A new EsriGraphicList, null if there is a problem.

getEsriGraphicList

public static EsriGraphicList getEsriGraphicList(java.net.URL shp,
                                                 DrawingAttributes drawingAttributes,
                                                 DbfTableModel dbf)
Reads the contents of the SHP files.

Parameters:
shp - The url of the SHP file
drawingAttributes - a DrawingAttributes object containing the rendering parameters you might want on the OMGraphics. The OMGraphic default (black edge, clear fill) will be used if this is null.
dbf - a DbfTableModel. The dbf will be added to the list appObject, so you can ask it questions later. If null, no problem. If the number of records doesn't match the OMGraphic list length, nothing will be done.
Returns:
A new EsriGraphicList, null if there is a problem.

main

public static void main(java.lang.String[] args)


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details