ru.igis.omtab
Class MapOb

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
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:
Link, OMTArc, OMTCircle, OMTPoint, OMTPoly, OMTRaster, OMTRect, OMTText

public class MapOb
extends com.bbn.openmap.layer.location.BasicLocation
implements Protegian

Base class for all Map Objects

Author:
Ru
See Also:
Serialized Form

Field Summary
static java.text.DecimalFormat df
          Decimal format for representation of minutes
 
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
MapOb()
          Creates a new instance of MapOb
MapOb(edu.stanford.smi.protege.model.Instance instance)
          Creates Map Object from the Protege Instance
 
Method Summary
 void addLinkToMe(Link link)
           
 double bearingsDeg(double lat, double lon)
          Bearings from this Map object on the some point
static double bearingsDeg(double lat1, double lon1, double lat2, double lon2)
          Bearings from the first point onto the second point in degrees
 double bearingsDeg(MapOb mo)
          Bearings in degrees from this Map Object on the other Map Object
static double bearingsRad(double lat1, double lon1, double lat2, double lon2)
          Bearings from the first point onto the second point in radians
 void coordFromProtege(edu.stanford.smi.protege.model.Instance instance)
          Set location of this Map Object to coordinates from Protege Instance
static MapOb createMapOb(java.lang.String label, java.lang.String latitude, java.lang.String longitude)
          Fabric method for the Map Object creation
 double distanceNM(double lat, double lon)
          Distance from this Map Object to the some point
static double distanceNM(double lat1, double lon1, double lat2, double lon2)
          Distance in nautical miles beetwin to points
 double distanceNM(MapOb mo)
          Distance in nautical miles from this Map Object on the other Map Object
static double getDeg(java.lang.String degmin)
          Convert string "deg min" in double degrees
static java.lang.String getDegMin(double deg)
          Convert double degrees to "deg min" representation
 java.lang.String getDescription()
           
 edu.stanford.smi.protege.model.Instance getInstance()
          Corresponding to this Map Object Protege Instance
 double getLatitude()
          Latitude of this Map Object as double value
 java.lang.String getLatitudeDM()
          Get string representation of Latitude in degrees and minutes
 edu.stanford.smi.protege.model.Instance getLeftPanel()
           
 java.util.Collection<Link> getLinksToMe()
           
 double getLongitude()
          Longitude of this Map Object as double value
 java.lang.String getLongitudeDM()
          Get string representation of Longitude in degrees and minutes
 java.lang.String getToolTip()
           
 NavOb getWhoTows()
           
 void hideLabel()
           
 void mapFromProtege(edu.stanford.smi.protege.model.Instance instance)
          Rewrite information from Protege Instance to this object.
 void mapToProtege(edu.stanford.smi.protege.model.Instance instance)
          Send back to Protege Instance information from this Map Object
 void offTow()
           
 com.bbn.openmap.proj.coords.LatLonPoint position(double az, double dist)
          Position near (or far) from this Map Object
 void removeLinkToMe(Link link)
           
 void setCourse(int crs)
          Method for setting direction of movement for this object
 void setDescription(java.lang.String d)
           
 void setGraphicLocations(double latitude, double longitude)
          Standard Openmap method for setting location of this Map Object
 void setLabelText(java.lang.String text)
           
 void setLeftPanel(edu.stanford.smi.protege.model.Instance lp)
           
 void setLocation(java.lang.String dmlat, java.lang.String dmlon)
          Change coordinates of this Map object from the string representation in degrees and minutes: "deg min"
 void setSpeed(double spd)
          Method for setting speed of movement for this object Only stub here, must be implemented in subclasses if appropriate
 void setToolTip(java.lang.String d)
           
 void setWhoTows(NavOb whoTows)
           
 void showLabel()
           
 javax.swing.JFrame 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, contains, 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, contains, distanceToEdge, draw, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setVisible
 

Field Detail

df

public static java.text.DecimalFormat df
Decimal format for representation of minutes

Constructor Detail

MapOb

public MapOb()
Creates a new instance of MapOb


MapOb

public MapOb(edu.stanford.smi.protege.model.Instance instance)
      throws java.lang.Exception
Creates Map Object from the Protege Instance

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

setLabelText

public void setLabelText(java.lang.String text)

createMapOb

public static MapOb createMapOb(java.lang.String label,
                                java.lang.String latitude,
                                java.lang.String longitude)
                         throws java.lang.Exception
Fabric method for the Map Object creation

Parameters:
label - - name of Map Object
latitude - -
longitude - -
Returns:
- created Map Object
Throws:
java.lang.Exception - -

getInstance

public edu.stanford.smi.protege.model.Instance getInstance()
Corresponding to this Map Object Protege Instance

Returns:
- Protege Instance

coordFromProtege

public void coordFromProtege(edu.stanford.smi.protege.model.Instance instance)
                      throws java.lang.Exception
Set location of this Map Object to coordinates from Protege Instance

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

mapFromProtege

public void mapFromProtege(edu.stanford.smi.protege.model.Instance instance)
                    throws java.lang.Exception
Rewrite information from Protege Instance to this object. In this base case only coordinates.

Specified by:
mapFromProtege in interface Protegian
Parameters:
instance - - Protege Instance
Throws:
java.lang.Exception - -

mapToProtege

public void mapToProtege(edu.stanford.smi.protege.model.Instance instance)
                  throws java.lang.Exception
Send back to Protege Instance information from this Map Object

Specified by:
mapToProtege in interface Protegian
Parameters:
instance - - Protege Instance
Throws:
java.lang.Exception - -

getLatitude

public double getLatitude()
Latitude of this Map Object as double value

Returns:
- Latitude in degrees

getLongitude

public double getLongitude()
Longitude of this Map Object as double value

Returns:
- Longitude in degrees

setLocation

public void setLocation(java.lang.String dmlat,
                        java.lang.String dmlon)
                 throws java.lang.Exception
Change coordinates of this Map object from the string representation in degrees and minutes: "deg min"

Parameters:
dmlat - - Latitude as "deg min"
dmlon - - Longitude as "deg min"
Throws:
java.lang.Exception

getLatitudeDM

public java.lang.String getLatitudeDM()
Get string representation of Latitude in degrees and minutes

Returns:
- Latitude as "deg min"

getLongitudeDM

public java.lang.String getLongitudeDM()
Get string representation of Longitude in degrees and minutes

Returns:
- Longitude as "deg min"

distanceNM

public static double distanceNM(double lat1,
                                double lon1,
                                double lat2,
                                double lon2)
Distance in nautical miles beetwin to points

Parameters:
lat1 - - Latitude 1 in degrees
lon1 - - Longitude 1 in degrees
lat2 - - Latitude 2 in degrees
lon2 - - Longitude 2 in degrees
Returns:
- Distance in nautical miles

bearingsRad

public static double bearingsRad(double lat1,
                                 double lon1,
                                 double lat2,
                                 double lon2)
Bearings from the first point onto the second point in radians

Parameters:
lat1 - - Latitude 1 in degrees
lon1 - - Longitude 1 in degrees
lat2 - - Latitude 2 in degrees
lon2 - - Longitude 2 in degrees
Returns:
- Bearings in radians

bearingsDeg

public static double bearingsDeg(double lat1,
                                 double lon1,
                                 double lat2,
                                 double lon2)
Bearings from the first point onto the second point in degrees

Parameters:
lat1 - - Latitude 1 in degrees
lon1 - - Longitude 1 in degrees
lat2 - - Latitude 2 in degrees
lon2 - - Longitude 2 in degrees
Returns:
- Bearings in degrees

distanceNM

public double distanceNM(MapOb mo)
Distance in nautical miles from this Map Object on the other Map Object

Parameters:
mo - - other Map Object
Returns:
- distance in NM

bearingsDeg

public double bearingsDeg(MapOb mo)
Bearings in degrees from this Map Object on the other Map Object

Parameters:
mo - - other Map Object
Returns:
- Bearings in degrees

distanceNM

public double distanceNM(double lat,
                         double lon)
Distance from this Map Object to the some point

Parameters:
lat - - Latitude of thr point in degrees
lon - - Longitude of thr point in degrees
Returns:
- Distance in nautical miles

bearingsDeg

public double bearingsDeg(double lat,
                          double lon)
Bearings from this Map object on the some point

Parameters:
lat - - Latitude of the point in degrees
lon - - Longitude of the point in degrees
Returns:
- Bearings in degrees

position

public com.bbn.openmap.proj.coords.LatLonPoint position(double az,
                                                        double dist)
Position near (or far) from this Map Object

Parameters:
az - - azimuth of the position in degrees
dist - - Distance of the position in NM
Returns:
- instance of Openmap class LatLonPoint

getDeg

public static double getDeg(java.lang.String degmin)
                     throws java.lang.Exception
Convert string "deg min" in double degrees

Parameters:
degmin - - "deg min"
Returns:
- Degrees
Throws:
java.lang.Exception - - if format is'nt correct

getDegMin

public static java.lang.String getDegMin(double deg)
Convert double degrees to "deg min" representation

Parameters:
deg - - degrees
Returns:
- string in format "deg min"

setGraphicLocations

public void setGraphicLocations(double latitude,
                                double longitude)
Standard Openmap method for setting location of this Map Object

Overrides:
setGraphicLocations in class com.bbn.openmap.layer.location.BasicLocation
Parameters:
latitude - - Latitude in degrees
longitude - - Longitude in degrees

setCourse

public void setCourse(int crs)
Method for setting direction of movement for this object

Parameters:
crs - - Course in degrees

setSpeed

public void setSpeed(double spd)
Method for setting speed of movement for this object Only stub here, must be implemented in subclasses if appropriate

Parameters:
spd - - Speed in knots (miles per hour)

hideLabel

public void hideLabel()

showLabel

public void showLabel()

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface com.bbn.openmap.omGraphics.OMGeometry
Overrides:
getDescription in class com.bbn.openmap.omGraphics.geom.BasicGeometry

setDescription

public void setDescription(java.lang.String d)

getWhoTows

public NavOb getWhoTows()

setWhoTows

public void setWhoTows(NavOb whoTows)

offTow

public void offTow()

addLinkToMe

public void addLinkToMe(Link link)

removeLinkToMe

public void removeLinkToMe(Link link)

getLinksToMe

public java.util.Collection<Link> getLinksToMe()

showLeftPanel

public javax.swing.JFrame showLeftPanel()

getLeftPanel

public edu.stanford.smi.protege.model.Instance getLeftPanel()

setLeftPanel

public void setLeftPanel(edu.stanford.smi.protege.model.Instance lp)

getToolTip

public java.lang.String getToolTip()

setToolTip

public void setToolTip(java.lang.String d)