com.bbn.openmap.omGraphics
Class OMAreaList

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.omGraphics.OMGeometryList
                  extended bycom.bbn.openmap.omGraphics.OMAreaList
All Implemented Interfaces:
java.lang.Cloneable, GraphicList, OMGeometry, OMGraphicConstants, java.io.Serializable

public class OMAreaList
extends OMGeometryList
implements GraphicList, java.io.Serializable

This class encapsulates a list of OMGeometries that are connected to form one area. Different types of vector OMGeometries can be combined and used to create a unique shape over the map. OMRasterObjects will contribute their shape/size, but not their images. The OMGeometries should be added in a clockwise format.

KNOWN ISSUES: OMAreaLists that wrap around the back of the earth and showing up on both edges of the map are not handled well - you'll end up with lines going horizonally across the map. It's on the todo list to fix this.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.bbn.openmap.omGraphics.OMGraphicList
OMGraphicList.OMDist
 
Field Summary
 
Fields inherited from class com.bbn.openmap.omGraphics.OMGeometryList
connectParts
 
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.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
OMAreaList()
          Construct an OMAreaList.
OMAreaList(int initialCapacity)
          Construct an OMAreaList with a capacity to be combined from an initial amount of OMGeometries.
OMAreaList(java.util.List list)
          Construct an OMAreaList around a List of OMGeometries.
 
Method Summary
protected  OMGraphicList.OMDist _findClosest(int x, int y, float limit, boolean resetSelect)
          Overrides the OMGeometryList and OMGraphicList methods to just call _distance() on the internal shape object.
 void generate(Projection p, boolean forceProjectAll)
          Create the GeneralPath used for the internal Shape objects held by the OMGeometries added.
protected  void init()
          Initialization that sets the OMAreaList, which is a modified OMGraphicList, to be vague and constructed in a first added, first used order.
protected  void updateShape(OMGeometry geometry, Projection p, boolean forceProject)
          Given a OMGeometry, it calls generate/regenerate on it, and then adds the GeneralPath shape within it to the OMGeometryList shape object.
 
Methods inherited from class com.bbn.openmap.omGraphics.OMGeometryList
_distance, add, doAction, findClosest, findClosestGeometry, findClosestGeometry, getAt, getConnectParts, getContains, getOMGraphicThatContains, getWithAppObject, indexOf, insertAt, readGraphics, remove, removeAt, render, renderAllAsSelected, renderGeometry, selectClosest, selectClosestGeometry, selectClosestGeometry, setAt, setConnectParts, setFillPaint, setLinePaint, setMatted, setMattingPaint, setSelectPaint, setStroke, setTextureMask
 
Methods inherited from class com.bbn.openmap.omGraphics.OMGraphicList
_add, _doAction, _findClosest, _getAt, _getContains, _getWithAppObject, _indexOf, _insert, _remove, _remove, _selectClosest, _setAt, add, addOMGraphic, checkForDuplicate, clear, clone, contains, deselect, deselectAll, distance, doAction, findAll, findAll, findAllTest, findClosest, findClosestTest, findIndexOfClosest, findIndexOfClosest, generate, getAllowDuplicates, getDescription, getDescription, getOMGraphicAt, getOMGraphicWithAppObject, getProcessAllGeometries, getTargets, getTraverseMode, indexOf, insertOMGraphicAt, isEmpty, isVague, isVisible, iterator, moveIndexedOneToBack, moveIndexedOneToBottom, moveIndexedOneToFront, moveIndexedOneToTop, moveIndexedToBottom, moveIndexedToFirst, moveIndexedToLast, moveIndexedToTop, objectToOMGraphic, project, project, readGraphics, remove, removeOMGraphicAt, select, selectAll, selectClosest, selectClosestTest, setAllowDuplicates, setGridGenerator, setOMGraphicAt, setProcessAllGeometries, setTargets, 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
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.omGraphics.OMGeometry
clearAttributes, contains, draw, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate
 

Constructor Detail

OMAreaList

public OMAreaList()
Construct an OMAreaList.


OMAreaList

public OMAreaList(int initialCapacity)
Construct an OMAreaList with a capacity to be combined from an initial amount of OMGeometries.

Parameters:
initialCapacity - the initial capacity of the list

OMAreaList

public OMAreaList(java.util.List list)
Construct an OMAreaList around a List of OMGeometries. The OMAreaList assumes that all the objects on the list are vector OMGeometries, and never does checking. Live with the consequences if you put other stuff in there.

Parameters:
list - List of vector OMGeometries.
Method Detail

init

protected void init()
Initialization that sets the OMAreaList, which is a modified OMGraphicList, to be vague and constructed in a first added, first used order. connectParts, a variable from OMGeometryList, is also set to true.


generate

public void generate(Projection p,
                     boolean forceProjectAll)
Create the GeneralPath used for the internal Shape objects held by the OMGeometries added. With the OMAreaList, all of the components are combined to make a single area. So updateShape, which is called from super.generate(), calls appendShapeEdge() instead of appending each part Shape to the main Shape. This method closes off the GeneralPath Shape, so it will be considered a polygon.

Overrides:
generate in class OMGeometryList
Parameters:
p - a Projection
forceProjectAll - if true, all the geometries on the list are generated with the new projection. If false they are only generated if getNeedToRegenerate() returns true
See Also:
OMGeometry.generate(com.bbn.openmap.proj.Projection), OMGeometry.regenerate(com.bbn.openmap.proj.Projection)

updateShape

protected void updateShape(OMGeometry geometry,
                           Projection p,
                           boolean forceProject)
Given a OMGeometry, it calls generate/regenerate on it, and then adds the GeneralPath shape within it to the OMGeometryList shape object. The edges of each part are combined to make one big polygon.

Overrides:
updateShape in class OMGeometryList

_findClosest

protected OMGraphicList.OMDist _findClosest(int x,
                                            int y,
                                            float limit,
                                            boolean resetSelect)
Overrides the OMGeometryList and OMGraphicList methods to just call _distance() on the internal shape object.

Overrides:
_findClosest in class OMGeometryList
Parameters:
x - x coord
y - y coord
limit - the max distance that a graphic has to be within to be returned, in pixels.
resetSelect - deselect any OMGraphic touched.
Returns:
OMDist


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