ru.igis.omtab
Class OMTPoly

java.lang.Object
  extended by com.bbn.openmap.omGraphics.geom.BasicGeometry
      extended by com.bbn.openmap.omGraphics.OMGraphicAdapter
          extended by com.bbn.openmap.layer.location.Location
              extended by com.bbn.openmap.layer.location.BasicLocation
                  extended by ru.igis.omtab.MapOb
                      extended by ru.igis.omtab.OMTPoly
All Implemented Interfaces:
com.bbn.openmap.omGraphics.OMGeometry, com.bbn.openmap.omGraphics.OMGraphic, com.bbn.openmap.omGraphics.OMGraphicConstants, java.io.Serializable, java.lang.Cloneable, Protegian
Direct Known Subclasses:
OMTSpline

public class OMTPoly
extends MapOb

Class for creation and store Openmap OMPoly object from Protege Instance

Author:
Ru
See Also:
Serialized Form

Field Summary
 
Fields inherited from class ru.igis.omtab.MapOb
df
 
Fields inherited from class com.bbn.openmap.layer.location.Location
DECLUTTER_ANYWHERE, DECLUTTER_LOCALLY, DEFAULT_SPACING, handler, lat, lon, name, origXLabelOffset, origYLabelOffset, x, xOffset, y, yOffset
 
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, 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
OMTPoly()
          Creates a new instance of MapOb
OMTPoly(edu.stanford.smi.protege.model.Instance instance)
          Constructor of OMTPoly object from Protege instance
 
Method Summary
 boolean contains(double lat, double lon)
          Method to determine if Poly contains some point
 boolean contains(MapOb mo)
          Method to determine if Poly contains some Map Object
static OMTPoly createOMTPoly(java.lang.String label, java.lang.String latitude, java.lang.String longitude, java.lang.String lcolor, java.lang.String fcolor, java.lang.String ispolygon, java.lang.String relative, java.util.Collection<java.lang.String> points)
          Factory method for creating OMTPoly object from string parameters
 double[] getLLPoints()
          Return LatLonArray of corresponding OMPoly object
static double[] getLLPoints(java.util.Collection<java.lang.String> points)
          Create array of points's coordinates in degrees from Collection of Strings in form "DD MM.M DD MM.M" (latitude longitude)
 void mapFromProtege(edu.stanford.smi.protege.model.Instance instance)
          Rewrite information from Protege Instance to this object.
 void setLine(edu.stanford.smi.protege.model.Instance linst)
           
 void tow(double center_lat, double center_lon, double direction)
          Towing polygon to new (weight) center and turning it on new direction by recalculating its points
 
Methods inherited from class ru.igis.omtab.MapOb
addLinkToMe, bearingsDeg, bearingsDeg, bearingsDeg, bearingsRad, coordFromProtege, createMapOb, distanceNM, distanceNM, distanceNM, getDeg, getDegMin, getDescription, getInstance, getLatitude, getLatitudeDM, getLeftPanel, getLinksToMe, getLongitude, getLongitudeDM, getToolTip, getWhoTows, hideLabel, mapToProtege, offTow, position, removeLinkToMe, setCourse, setDescription, setGraphicLocations, setLabelText, setLeftPanel, setLocation, setSpeed, setToolTip, setWhoTows, showLabel, showLeftPanel
 
Methods inherited from class com.bbn.openmap.layer.location.BasicLocation
setGraphicLocations, setGraphicLocations
 
Methods inherited from class com.bbn.openmap.layer.location.Location
convertCoordinateString, distance, generate, generate, getDeclutterLimit, getDetails, getHorizontalLabelBuffer, getLabel, getLocationHandler, getLocationMarker, getName, isAllowDecluttering, isShowLocation, isShowName, main, render, renderLocation, renderName, setAllowDecluttering, setDeclutterLimit, setDetails, setHorizontalLabelBuffer, setLabel, setLocation, setLocation, setLocation, setLocation, setLocationHandler, setLocationMarker, setLocationPaint, setName, setShowLocation, setShowName, showDetails
 
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, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, restore, select, setDeclutterType, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShape, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, shouldRenderFill
 
Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, clearAttributes, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, draw, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry
clearAttributes, distanceToEdge, draw, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setVisible
 

Constructor Detail

OMTPoly

public OMTPoly()
Creates a new instance of MapOb


OMTPoly

public OMTPoly(edu.stanford.smi.protege.model.Instance instance)
        throws java.lang.Exception
Constructor of OMTPoly object from Protege instance

Parameters:
instance - - Protege Instance
Throws:
java.lang.Exception - -
Method Detail

createOMTPoly

public static OMTPoly createOMTPoly(java.lang.String label,
                                    java.lang.String latitude,
                                    java.lang.String longitude,
                                    java.lang.String lcolor,
                                    java.lang.String fcolor,
                                    java.lang.String ispolygon,
                                    java.lang.String relative,
                                    java.util.Collection<java.lang.String> points)
                             throws java.lang.Exception
Factory method for creating OMTPoly object from string parameters

Parameters:
label - - name of OMTPoly object
latitude - - latitude in form "DD MM.M"
longitude - - longitude in form "DD MM.M"
lcolor - - line color in form "AARRGGBB"
fcolor - - fill color in form "AARRGGBB"
ispolygon - - "true",if this is closed polygon, "false", if this is polyline
relative - - "true",if this is "towable" polygon, "false", if not
points - - collection of Strings each in form "DD MM.M DD MM.M" (latitude longitude)
Returns:
new OMTPoly object
Throws:
java.lang.Exception - -

mapFromProtege

public void mapFromProtege(edu.stanford.smi.protege.model.Instance instance)
Rewrite information from Protege Instance to this object.

Specified by:
mapFromProtege in interface Protegian
Overrides:
mapFromProtege in class MapOb
Parameters:
instance - - Protege Instance

contains

public boolean contains(MapOb mo)
Method to determine if Poly contains some Map Object

Parameters:
mo - - Map Object
Returns:
- true, if OMTPoly contains this Map Object, else false

contains

public boolean contains(double lat,
                        double lon)
Method to determine if Poly contains some point

Specified by:
contains in interface com.bbn.openmap.omGraphics.OMGeometry
Overrides:
contains in class com.bbn.openmap.omGraphics.geom.BasicGeometry
Parameters:
lat - - latitude in degrees
lon - - longitude in degrees
Returns:
- true, if OMTPoly contains this point, else false

getLLPoints

public double[] getLLPoints()
Return LatLonArray of corresponding OMPoly object

Returns:
array of coordinates

getLLPoints

public static double[] getLLPoints(java.util.Collection<java.lang.String> points)
Create array of points's coordinates in degrees from Collection of Strings in form "DD MM.M DD MM.M" (latitude longitude)

Parameters:
points - - Collection of Strings in form "DD MM.M DD MM.M" (latitude longitude)
Returns:
array of points

tow

public void tow(double center_lat,
                double center_lon,
                double direction)
Towing polygon to new (weight) center and turning it on new direction by recalculating its points

Parameters:
center_lat - - latitude of new center (degrees)
center_lon - - longitude of new center (degrees)
direction - - new direction (degrees) in a sense that initial direction was 0 (north)

setLine

public void setLine(edu.stanford.smi.protege.model.Instance linst)