ru.igis.omtab
Class Util

java.lang.Object
  extended by ru.igis.omtab.Util

public class Util
extends java.lang.Object

OpenMapTab utilities class

Author:
Ru

Constructor Summary
Util()
          Creates a new instance of Util
 
Method Summary
static void execScenario(java.lang.String scenario)
          Method of execution of scenario
static java.util.Collection filter(java.util.Collection col, edu.stanford.smi.protege.model.Cls cls)
          Filter instances of only one class
static MapOb findOrAdd(edu.stanford.smi.protege.model.Instance inst, RuNA runa)
          Search for MapOb with a name like a label of Protege Instance or create one from it and add to RuNA
static java.awt.Component getComponentOfClass(java.awt.Container container, java.lang.String className)
           
static edu.stanford.smi.protege.widget.TabWidget getTab(java.lang.String fullClassName)
           
static double[] intersectionPoint(double lat1, double lon1, int course, double[] llp, boolean givePoint)
          Intersection point with polygon along the course
static void printRadArrayInDeg(double[] rad_array, int how_many)
           
static double[] relPos(double lat, double lon, double azdeg, double dist)
          Point on some azimuth and distance from some point
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Creates a new instance of Util

Method Detail

filter

public static java.util.Collection filter(java.util.Collection col,
                                          edu.stanford.smi.protege.model.Cls cls)
Filter instances of only one class

Parameters:
col - - Collection of instances
cls - - Needed class
Returns:
- Collection of instances

intersectionPoint

public static double[] intersectionPoint(double lat1,
                                         double lon1,
                                         int course,
                                         double[] llp,
                                         boolean givePoint)
Intersection point with polygon along the course

Parameters:
lat1 - - Latitude of current point (degrees)
lon1 - - Longitude of current point (degrees)
course - - Current course (degrees)
llp - - Array of lat lon points of polygon (radians)
givePoint - - Flag if gives up point or only check fact of intersection
Returns:
[-1,-1,Float.MAX_VALUE,-1] -if there is not an intersection point, [0,-1,Float.MAX_VALUE,-1] -if there is an intersection point and givePoint=false, [lat(degrees),lon(degrees),distance(NM),-1] -if there is an intersection point and givePoint=true.

execScenario

public static void execScenario(java.lang.String scenario)
                         throws java.lang.Exception
Method of execution of scenario

Parameters:
scenario - - String in form "FULLCLASS METHOD PARAM1 PARAM2 ..."
Throws:
java.lang.Exception - -

relPos

public static double[] relPos(double lat,
                              double lon,
                              double azdeg,
                              double dist)
Point on some azimuth and distance from some point

Parameters:
lat - - latitude of initial point
lon - - longitude of initial point
azdeg - - azimuth of relative point
dist - - distance of relative point from initial point
Returns:
- array of two numbers - latitude and longitude

findOrAdd

public static MapOb findOrAdd(edu.stanford.smi.protege.model.Instance inst,
                              RuNA runa)
Search for MapOb with a name like a label of Protege Instance or create one from it and add to RuNA

Parameters:
inst - Protege Instance
runa - RuNA object
Returns:
Map Object

getTab

public static edu.stanford.smi.protege.widget.TabWidget getTab(java.lang.String fullClassName)

getComponentOfClass

public static java.awt.Component getComponentOfClass(java.awt.Container container,
                                                     java.lang.String className)

printRadArrayInDeg

public static void printRadArrayInDeg(double[] rad_array,
                                      int how_many)