org.eclipse.ohf.stem.ui.ge.kml
Class BBoxInfo

java.lang.Object
  extended by org.eclipse.ohf.stem.ui.ge.kml.BBoxInfo
All Implemented Interfaces:
java.lang.Runnable

public class BBoxInfo
extends java.lang.Object
implements java.lang.Runnable

Obtain the BoundingBox info for GoogleEarth from the Servlet. GoogleEarth sends the current Screen viewing area to the servlet as a BBOX parameter. The SlideShowServlet saves this BBOX string each time it is sent. This class runs as a thread and every N seconds makes a request to the BBoxServlet to access the latest BBOX string and return it. We then convert it to a bounding box rectangle and make it available for access. KMLDisplay will access it and use it to filter out display of Admin areas that are not within the screen Bounding box.


Constructor Summary
BBoxInfo(java.lang.String url, java.lang.String id)
          constructor
 
Method Summary
static java.awt.Rectangle getBBox()
           
 java.awt.Rectangle readBBox()
          readBBox read the GoogleEarth BBox info from the servlet.
 void run()
          This thread will sit in a loop and every N seconds it will send a request to the SlideShowServlet to give it the latest BBox info that was sent from GoogleEarth
static void setBBox(java.awt.Rectangle box)
           
static boolean testContainment(java.awt.Rectangle r1, java.awt.Rectangle r2)
          Test containment of bounding box 1 in Bounding box 2 If any corner of BBox 1 is contained in BBox 2 or any corner of BBox 2 is contained in BBox 1 then they are adjacent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BBoxInfo

public BBoxInfo(java.lang.String url,
                java.lang.String id)
constructor

Parameters:
url - URL for the servlet server
id - Id to identify the servlet session.
Method Detail

run

public void run()
This thread will sit in a loop and every N seconds it will send a request to the SlideShowServlet to give it the latest BBox info that was sent from GoogleEarth

Specified by:
run in interface java.lang.Runnable

readBBox

public java.awt.Rectangle readBBox()
readBBox read the GoogleEarth BBox info from the servlet. GoogleEarth sends the viewport bounding box to the servlet which stores it. This will request the servelet to forward it to us.

Returns:
BBox Rectangle

getBBox

public static java.awt.Rectangle getBBox()
Returns:
the bBox

setBBox

public static void setBBox(java.awt.Rectangle box)
Parameters:
box - the bBox to set

testContainment

public static boolean testContainment(java.awt.Rectangle r1,
                                      java.awt.Rectangle r2)
Test containment of bounding box 1 in Bounding box 2 If any corner of BBox 1 is contained in BBox 2 or any corner of BBox 2 is contained in BBox 1 then they are adjacent.

Parameters:
r1 - bounding box 1
r2 - bounding box 2
Returns:
true if adjacent or containment true