com.bbn.openmap.layer.mif
Class OMSubtraction

java.lang.Object
  extended by com.bbn.openmap.omGraphics.geom.BasicGeometry
      extended by com.bbn.openmap.omGraphics.OMGraphicAdapter
          extended by com.bbn.openmap.layer.mif.OMSubtraction
All Implemented Interfaces:
OMGeometry, OMGraphic, OMGraphicConstants, java.io.Serializable, java.lang.Cloneable

public class OMSubtraction
extends OMGraphicAdapter
implements java.io.Serializable

Defines a Region of a MIF file where when one region encloses another the enclosed region is subtracted from the enclosing region in order to create a hole Computationally this can be expensive to do on a complex layout like a streetmap of city

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.bbn.openmap.omGraphics.OMGraphicAdapter
declutterType, displayPaint, edgeMatchesFill, fillPaint, hasLabel, linePaint, matted, mattingPaint, renderType, selected, selectPaint, showEditablePalette, stroke, textureMask
 
Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
attributes, lineType, needToRegenerate, shape, visible
 
Fields inherited from interface com.bbn.openmap.omGraphics.OMGraphicConstants
ADD_GRAPHIC_MASK, APP_OBJECT, 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, INDEX, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, NO_ROTATE, OMGRAPHIC_ELT, OMGRAPHIC_TYPE_ATTR, 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, UPDATED
 
Constructor Summary
OMSubtraction(double[] lat, double[] lon)
           
 
Method Summary
 float distance(double x, double y)
          Return the shortest distance from the line to an XY-point - not relevant to this class.
 boolean generate(Projection proj)
          Prepare the graphic for rendering.
 void render(java.awt.Graphics g)
          Paint the graphic.
 
Methods inherited from class com.bbn.openmap.omGraphics.OMGraphicAdapter
clone, deselect, getDeclutterType, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, readStroke, readTextureMask, regenerate, renderLabel, renderShape, restore, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, shouldRenderFill, writeStroke, writeTextureMask
 
Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible
 
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, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible
 

Constructor Detail

OMSubtraction

public OMSubtraction(double[] lat,
                     double[] lon)
Method Detail

generate

public boolean generate(Projection proj)
Description copied from class: OMGraphicAdapter
Prepare the graphic for rendering. This must be done before calling render()! If a vector graphic has lat-lon components, then we project these vertices into x-y space. For raster graphics we prepare in a different fashion.

If the generate is unsuccessful, it's usually because of some oversight, (for instance if proj is null), and if debugging is enabled, a message may be output to the controlling terminal.

Specified by:
generate in interface OMGeometry
Specified by:
generate in class OMGraphicAdapter
Parameters:
proj - Projection
Returns:
boolean true if successful, false if not.
See Also:
OMGraphicAdapter.regenerate(com.bbn.openmap.proj.Projection)

render

public void render(java.awt.Graphics g)
Description copied from class: OMGraphicAdapter
Paint the graphic. This paints the graphic into the Graphics context. This is similar to paint() function of java.awt.Components. Note that if the graphic has not been generated, it will not be rendered.

This method used to be abstract, but with the conversion of OMGraphics to internally represent themselves as java.awt.Shape objects, it's a more generic method. If the OMGraphic hasn't been updated to use Shape objects, it should have its own render method.

Specified by:
render in interface OMGeometry
Overrides:
render in class OMGraphicAdapter
Parameters:
g - Graphics2D context to render into.

distance

public float distance(double x,
                      double y)
Return the shortest distance from the line to an XY-point - not relevant to this class.

Specified by:
distance in interface OMGeometry
Overrides:
distance in class OMGraphicAdapter
Parameters:
x - X coordinate of the point.
y - Y coordinate fo the point.
Returns:
float always zero


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