com.bbn.openmap.layer.shape.areas
Class PoliticalArea

java.lang.Object
  extended by com.bbn.openmap.layer.shape.areas.PoliticalArea

public class PoliticalArea
extends java.lang.Object

A PoliticalArea is a region that has a name (like "Oklahoma"), an identifier (like "OK"), and a list of OMGraphics that define its geography (ie: the polygons that define it's borders).

NOTE: The name of this class is somewhat misleading - the graphic doesn't have to represent an area - the graphic can be any graphic created from the shapefile. This class just provides a way to associate an id with the graphic.


Field Summary
protected  DrawingAttributes drawingAttributes
           
protected  OMGeometryList geometry
           
 java.lang.String id
           
 java.lang.String name
           
 
Constructor Summary
PoliticalArea(java.lang.String identifier)
           
PoliticalArea(java.lang.String name, java.lang.String identifier)
          Create a political area with a name, and an identifier which is used as a key by the AreaHandler.
 
Method Summary
 void addGraphic(OMGraphic g)
          Add a new omgraphic to the list of graphics in this area
 DrawingAttributes getDrawingAttributes()
           
 java.awt.Paint getFillPaint()
          Get the paint used for the fill paint for all the graphics in the political area, if one was set.
 java.awt.TexturePaint getFillPattern()
          Get the TexturePaint used as fill for all the graphics in the political area, if one was set.
 OMGeometryList getGeometry()
          Get the value of geometry.
 java.awt.Paint getLinePaint()
          Get the paint used for the line paint for all the graphics in the political area, if one was set.
 java.awt.Paint getSelectPaint()
          Get the paint used for the select paint for all the graphics in the political area, if one was set.
 void setDrawingAttributes(DrawingAttributes da)
           
 void setFillPaint(java.awt.Paint c)
          Set the fill-paint of all the graphics in the List
 void setFillPattern(java.awt.TexturePaint texture)
          Set the fill pattern of all the graphics in the List.
 void setFillPattern(java.net.URL fillPatternURL)
          Set the fill pattern of all the graphics in the List.
 void setGeometry(OMGeometryList v)
          Set the value of geometry.
 void setLinePaint(java.awt.Paint c)
          Set the line-paint of all the graphics in the List
 void setSelectPaint(java.awt.Paint c)
          Set the select-paint of all the graphics in the List
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public final java.lang.String id

name

public java.lang.String name

geometry

protected OMGeometryList geometry

drawingAttributes

protected DrawingAttributes drawingAttributes
Constructor Detail

PoliticalArea

public PoliticalArea(java.lang.String identifier)

PoliticalArea

public PoliticalArea(java.lang.String name,
                     java.lang.String identifier)
Create a political area with a name, and an identifier which is used as a key by the AreaHandler.

Method Detail

setDrawingAttributes

public void setDrawingAttributes(DrawingAttributes da)

getDrawingAttributes

public DrawingAttributes getDrawingAttributes()

setFillPaint

public void setFillPaint(java.awt.Paint c)
Set the fill-paint of all the graphics in the List

Parameters:
c - java.awt.Paint

getFillPaint

public java.awt.Paint getFillPaint()
Get the paint used for the fill paint for all the graphics in the political area, if one was set.

Returns:
Paint if set, null if it wasn't.

setFillPattern

public void setFillPattern(java.net.URL fillPatternURL)
Set the fill pattern of all the graphics in the List. This will override the fill paint, if you've set that as well. There are sections of code in this method that need to be commented out if you are not using jdk 1.2.x.

Parameters:
fillPatternURL - url of image file to use as fill.

setFillPattern

public void setFillPattern(java.awt.TexturePaint texture)
Set the fill pattern of all the graphics in the List. This will override the fill paint, if you've set that as well. There are sections of code in this method that need to be commented out if you are not using jdk 1.2.x.

Parameters:
texture - TexturePaint object to use as fill.

getFillPattern

public java.awt.TexturePaint getFillPattern()
Get the TexturePaint used as fill for all the graphics in the political area, if one was set.

Returns:
TexturePaint if set, null if it wasn't.

setLinePaint

public void setLinePaint(java.awt.Paint c)
Set the line-paint of all the graphics in the List

Parameters:
c - java.awt.Paint

getLinePaint

public java.awt.Paint getLinePaint()
Get the paint used for the line paint for all the graphics in the political area, if one was set.

Returns:
Paint if set, null if it wasn't.

setSelectPaint

public void setSelectPaint(java.awt.Paint c)
Set the select-paint of all the graphics in the List

Parameters:
c - java.awt.Paint

getSelectPaint

public java.awt.Paint getSelectPaint()
Get the paint used for the select paint for all the graphics in the political area, if one was set.

Returns:
Paint if set, null if it wasn't.

getGeometry

public OMGeometryList getGeometry()
Get the value of geometry.

Returns:
Value of geometry.

setGeometry

public void setGeometry(OMGeometryList v)
Set the value of geometry.

Parameters:
v - Value to assign to geometry.

addGraphic

public void addGraphic(OMGraphic g)
Add a new omgraphic to the list of graphics in this area



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