ru.igis.omtab
Class NavOb

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.OMTRaster
                          extended by ru.igis.omtab.NavOb
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

public class NavOb
extends OMTRaster

Navigating Object class

Author:
Ru
See Also:
Serialized Form

Field Summary
static java.lang.String MAP_ERROR
           
static double Pi10800
          one arc minute in radians
 
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
NavOb()
          Creates a new instance of MapOb
NavOb(edu.stanford.smi.protege.model.Instance instance)
          Constructor that creates Navigating object from Protege Instance
 
Method Summary
 boolean abaft(double lat, double lon)
          Check if point abaft the beam
 boolean abaft(MapOb mo)
          Check if Map Object abaft the beam
 void addTow(Tow tow)
          Add new Tow object to this object.
 void clearTows()
          Remove all tows at once
 void control()
          Create NavObFrame for this object to control it
static NavOb createNavOb(java.lang.String label, java.lang.String type, java.lang.String latitude, java.lang.String longitude, java.lang.String course, java.lang.String speed, java.lang.String url)
          Fabric method that creates Navigating Object from String parameters
 void execTask()
          Call RuNA method execTask with this object as argument
 void fromSlotCOURSE(edu.stanford.smi.protege.model.Instance instance)
           
 void fromSlotICON_SCALE(edu.stanford.smi.protege.model.Instance instance)
           
 void fromSlotSPEED(edu.stanford.smi.protege.model.Instance instance)
           
 void fromSlotTOW(edu.stanford.smi.protege.model.Instance instance)
           
 void fromSlotTYPE(edu.stanford.smi.protege.model.Instance instance)
           
 int getCourse()
          Return current course
 double getCourseRad()
          Return current course
 java.util.Collection<Link> getLinks()
          Return current links
 double getSpeed()
          Return current speed
 java.util.Collection<Tow> getTows()
          Return all current tows
 java.lang.Object getType()
          Return type of this object
 boolean linked(MapOb mo)
          Check if Map Object linked to this NavOb
 boolean linkMapOb(MapOb mo, java.lang.String color, RuNA runa)
          Link Map Object with this navob Both objects must be on a map
 void mapFromProtege(edu.stanford.smi.protege.model.Instance instance)
          Setting main attributies of this object from slot values of corresponding Protege Instance
 void mapToProtege(edu.stanford.smi.protege.model.Instance instance)
          Returning Back to Protege changed attributies of this Navigatin object
 void move(double currentTime)
          Move this object for one step.
 boolean near(double lat, double lon, double radius)
          Check if point near then radius
 boolean near(MapOb mo, double radius)
          Check if Map Object near then radius
 boolean onTow(MapOb mo, double angle, double distance, boolean relative, RuNA runa)
          Get Map Object on tow by this navob Both objects must be on a map
 void reflect()
           
 void removeTow(MapOb mo)
          Remove Tow object for Map Object from this Navigating Object
 void setCourse(int deg)
          Set Course from int
 void setCourse(java.lang.String course)
          Set Course from String
 void setLatitude(double deglat)
          Set Latitude from double
 void setLatitude(java.lang.String dmlat)
          Set Latitude from String
 void setLocation(java.lang.String dmlat, java.lang.String dmlon)
          Change coordinates of this Nav object from the string representation in degrees and minutes: "deg min"
 void setLongitude(double deglon)
          Set Longitude from double
 void setLongitude(java.lang.String dmlon)
          Set Longitude from String
 void setSpeed(double knots)
          Set Speed from double
 void setSpeed(java.lang.String speed)
          Set Speed from String
 void setTowAngle(MapOb mo, double a)
          Put Map Object on tow in new position relative to this object that is defined by angle
 void setTowDistance(MapOb mo, double d)
          Put Map Object on tow in new position relative to this object that is defined by distance
 void unlinkMapOb(MapOb mo, RuNA runa)
          Link Map Object with this navob
 void updateNavObFrame()
          Update NavObFrame by refreshing its fields: latitude, longitude, course, speed
 
Methods inherited from class ru.igis.omtab.OMTRaster
createOMTRaster, fromSlotANGLE, fromSlotURL, setGraphicLocations
 
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, offTow, position, removeLinkToMe, setDescription, setLabelText, setLeftPanel, 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, 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

Pi10800

public static double Pi10800
one arc minute in radians


MAP_ERROR

public static final java.lang.String MAP_ERROR
See Also:
Constant Field Values
Constructor Detail

NavOb

public NavOb()
Creates a new instance of MapOb


NavOb

public NavOb(edu.stanford.smi.protege.model.Instance instance)
      throws java.lang.Exception
Constructor that creates Navigating object from Protege Instance

Parameters:
instance - - Instance of this Navigating object
Throws:
java.lang.Exception - -
Method Detail

createNavOb

public static NavOb createNavOb(java.lang.String label,
                                java.lang.String type,
                                java.lang.String latitude,
                                java.lang.String longitude,
                                java.lang.String course,
                                java.lang.String speed,
                                java.lang.String url)
                         throws java.lang.Exception
Fabric method that creates Navigating Object from String parameters

Parameters:
label - -
type - -
latitude - -
longitude - -
course - -
speed - -
url - - path to Navigating Object Image Icon file
Returns:
- created new Navigating Object
Throws:
java.lang.Exception - -

setLatitude

public void setLatitude(java.lang.String dmlat)
Set Latitude from String

Parameters:
dmlat - - latitude string in form "degrees minutes"

setLongitude

public void setLongitude(java.lang.String dmlon)
Set Longitude from String

Parameters:
dmlon - - longitude string in form "degrees minutes"

setCourse

public void setCourse(java.lang.String course)
Set Course from String

Parameters:
course - - course in form "degrees"

setSpeed

public void setSpeed(java.lang.String speed)
Set Speed from String

Parameters:
speed - - speed in form "knots"

setLatitude

public void setLatitude(double deglat)
Set Latitude from double

Parameters:
deglat - - latitude in degrees

setLongitude

public void setLongitude(double deglon)
Set Longitude from double

Parameters:
deglon - - longitude in degrees

setLocation

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

Overrides:
setLocation in class MapOb
Parameters:
dmlat - - Latitude as "deg min"
dmlon - - Longitude as "deg min"
Throws:
java.lang.Exception

setCourse

public void setCourse(int deg)
Set Course from int

Overrides:
setCourse in class OMTRaster
Parameters:
deg - - course in degrees

setSpeed

public void setSpeed(double knots)
Set Speed from double

Overrides:
setSpeed in class MapOb
Parameters:
knots - - speed in knots (nautical miles per hour)

getCourse

public int getCourse()
Return current course

Returns:
- current course in degrees

getCourseRad

public double getCourseRad()
Return current course

Returns:
- current course in radians

getSpeed

public double getSpeed()
Return current speed

Returns:
- current speed in knots

move

public void move(double currentTime)
Move this object for one step. Calculate time elapsed from last change of course/speed and corresponding way. After that calculate new coordinates of this object and remove it in this location. Simaltaniously move objects that this object is towing

Parameters:
currentTime - - Current Time in hours

control

public void control()
Create NavObFrame for this object to control it


updateNavObFrame

public void updateNavObFrame()
Update NavObFrame by refreshing its fields: latitude, longitude, course, speed


mapFromProtege

public void mapFromProtege(edu.stanford.smi.protege.model.Instance instance)
                    throws java.lang.Exception
Setting main attributies of this object from slot values of corresponding Protege Instance

Specified by:
mapFromProtege in interface Protegian
Overrides:
mapFromProtege in class OMTRaster
Parameters:
instance - - Protege Instance representing this Navigating Object
Throws:
java.lang.Exception - -

fromSlotICON_SCALE

public void fromSlotICON_SCALE(edu.stanford.smi.protege.model.Instance instance)

fromSlotTYPE

public void fromSlotTYPE(edu.stanford.smi.protege.model.Instance instance)

fromSlotCOURSE

public void fromSlotCOURSE(edu.stanford.smi.protege.model.Instance instance)

fromSlotSPEED

public void fromSlotSPEED(edu.stanford.smi.protege.model.Instance instance)

fromSlotTOW

public void fromSlotTOW(edu.stanford.smi.protege.model.Instance instance)

mapToProtege

public void mapToProtege(edu.stanford.smi.protege.model.Instance instance)
                  throws java.lang.Exception
Returning Back to Protege changed attributies of this Navigatin object

Specified by:
mapToProtege in interface Protegian
Overrides:
mapToProtege in class MapOb
Parameters:
instance - - Protege Instance describing this object
Throws:
java.lang.Exception - -

execTask

public void execTask()
Call RuNA method execTask with this object as argument


addTow

public void addTow(Tow tow)
Add new Tow object to this object. Set its course and coordinates to those of this object

Parameters:
tow - - Tow object

removeTow

public void removeTow(MapOb mo)
Remove Tow object for Map Object from this Navigating Object

Parameters:
mo - - Map Object on tow just now

setTowAngle

public void setTowAngle(MapOb mo,
                        double a)
Put Map Object on tow in new position relative to this object that is defined by angle

Parameters:
mo - - Map object on tow
a - - angle in degrees

setTowDistance

public void setTowDistance(MapOb mo,
                           double d)
Put Map Object on tow in new position relative to this object that is defined by distance

Parameters:
mo - - Map Object on tow
d - - distance in nautical miles

clearTows

public void clearTows()
Remove all tows at once


getTows

public java.util.Collection<Tow> getTows()
Return all current tows

Returns:
- Collection of current tows

getLinks

public java.util.Collection<Link> getLinks()
Return current links

Returns:
- Collection of current links

onTow

public boolean onTow(MapOb mo,
                     double angle,
                     double distance,
                     boolean relative,
                     RuNA runa)
Get Map Object on tow by this navob Both objects must be on a map

Parameters:
mo - - Map Object
angle - - tow angle
distance - - tow distance
relative - - if tow relative to this navov course

linkMapOb

public boolean linkMapOb(MapOb mo,
                         java.lang.String color,
                         RuNA runa)
Link Map Object with this navob Both objects must be on a map

Parameters:
runa - - RuNA Object
mo - - Map Object
color - - color of Link line in a form "AARRGGBB"

unlinkMapOb

public void unlinkMapOb(MapOb mo,
                        RuNA runa)
Link Map Object with this navob

Parameters:
runa - - RuNA Object
mo - - Map Object

getType

public java.lang.Object getType()
Return type of this object

Returns:
- String containing type

reflect

public void reflect()

abaft

public boolean abaft(double lat,
                     double lon)
Check if point abaft the beam

Parameters:
lat - - latitude of point in degrees
lon - - longitude of point in degrees

abaft

public boolean abaft(MapOb mo)
Check if Map Object abaft the beam

Parameters:
mo - - Map Object

near

public boolean near(double lat,
                    double lon,
                    double radius)
Check if point near then radius

Parameters:
lat - - latitude of point in degrees
lon - - longitude of point in degrees
radius - - radius in nautical miles

near

public boolean near(MapOb mo,
                    double radius)
Check if Map Object near then radius

Parameters:
mo - - Map Object
radius - - radius in nautical miles

linked

public boolean linked(MapOb mo)
Check if Map Object linked to this NavOb

Parameters:
mo - - Map Object