drawables
Class DrawableSpatialSearchTreeObject

java.lang.Object
  |
  +--drawables.DrawableSpatialSearchTreeObject
All Implemented Interfaces:
LayerSpatialSearchTreeObject, MovingSpatialSearchTreeObject, SpatialSearchTreeEntry, SpatialSearchTreeObject, VisualizedSpatialSearchTreeObject

public class DrawableSpatialSearchTreeObject
extends java.lang.Object
implements VisualizedSpatialSearchTreeObject, MovingSpatialSearchTreeObject, LayerSpatialSearchTreeObject

Wrapper class for drawable primitives.


Field Summary
protected  MBR mbr
          Its minimum bounding rectangle.
protected  Drawable prim
          The drawable primitive.
 
Constructor Summary
DrawableSpatialSearchTreeObject(Drawable prim)
          DrawableSpatialSearchTreeObject constructor comment.
 
Method Summary
 double computeDistanceTo(int[] point)
          Computes the distance to a given point.
 boolean contains(MBR rect)
          Tests whether the object contains a given rectangle or not.
 void draw(java.awt.Graphics g, int scale)
          Draws the object.
 boolean equals(java.lang.Object obj)
          Test whether the wrapped primitives are equal or not.
 Drawable getDrawable()
          Returns the drawable primitive.
 long getId()
          Returns the identifier of the object.
 int getLayer()
          Returns the layer of the object.
 MBR getMBR()
          Returns the minimum bounding rectangle.
 int getNumOfDimensions()
          Returns the number of dimensions.
 java.lang.Object getType()
          Returns the type of the object.
 boolean interacts(int x, int y, int scale)
          Tests whether an object is selected by a point or not.
 boolean intersects(MBR r)
          Tests whether the object intersects a given rectangle.
 boolean intersects(java.lang.Object obj)
          Tests whether the object intersects another object.
 boolean isContainedBy(MBR rect)
          Tests whether the object is contained by a given rectangle or not.
 boolean isContainedBy(SpatialSearchTreeEntry entry)
          Tests whether the object is contained by a given entry or not.
 boolean isOfSameType(SpatialSearchTreeObject obj)
          Tests whether the object is of the same type as the given object or not.
 boolean isVisible(int scale)
          Tests whether the object is visible at a given scale or not.
 void setMBR(MBR newMBR)
          Sets the MBR of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prim

protected Drawable prim
The drawable primitive.


mbr

protected MBR mbr
Its minimum bounding rectangle.

Constructor Detail

DrawableSpatialSearchTreeObject

public DrawableSpatialSearchTreeObject(Drawable prim)
DrawableSpatialSearchTreeObject constructor comment.

Parameters:
prim - the drawable primitive
Method Detail

computeDistanceTo

public double computeDistanceTo(int[] point)
Computes the distance to a given point.

Specified by:
computeDistanceTo in interface SpatialSearchTreeObject
Parameters:
point - coordinates of the point
Returns:
distance

contains

public boolean contains(MBR rect)
Tests whether the object contains a given rectangle or not.

Specified by:
contains in interface SpatialSearchTreeObject
Parameters:
rect - the rectangle
Returns:
contains?

draw

public void draw(java.awt.Graphics g,
                 int scale)
Draws the object.

Specified by:
draw in interface SpatialSearchTreeObject
Parameters:
g - graphic context
scale - actual scale

equals

public boolean equals(java.lang.Object obj)
Test whether the wrapped primitives are equal or not.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the other object
Returns:
equal?

getDrawable

public Drawable getDrawable()
Returns the drawable primitive.

Returns:
the drawable primitive

getId

public long getId()
Returns the identifier of the object.

Specified by:
getId in interface SpatialSearchTreeObject
Returns:
the ID

getLayer

public int getLayer()
Returns the layer of the object.

Specified by:
getLayer in interface LayerSpatialSearchTreeObject
Returns:
layer

getMBR

public MBR getMBR()
Returns the minimum bounding rectangle.

Specified by:
getMBR in interface SpatialSearchTreeEntry
Returns:
minimum bounding rectangle

getNumOfDimensions

public int getNumOfDimensions()
Returns the number of dimensions.

Specified by:
getNumOfDimensions in interface SpatialSearchTreeEntry
Returns:
dimensions

getType

public java.lang.Object getType()
Returns the type of the object.

Returns:
type

interacts

public boolean interacts(int x,
                         int y,
                         int scale)
Tests whether an object is selected by a point or not.

Specified by:
interacts in interface VisualizedSpatialSearchTreeObject
Parameters:
x - x-coordinate of the point
y - y-coordinate of the point
scale - scale
Returns:
selected?

intersects

public boolean intersects(java.lang.Object obj)
Tests whether the object intersects another object.

Specified by:
intersects in interface SpatialSearchTreeObject
Parameters:
obj - the object
Returns:
intersects?

intersects

public boolean intersects(MBR r)
Tests whether the object intersects a given rectangle.

Specified by:
intersects in interface SpatialSearchTreeObject
Parameters:
r - the rectangle
Returns:
intersects?

isContainedBy

public boolean isContainedBy(MBR rect)
Tests whether the object is contained by a given rectangle or not.

Specified by:
isContainedBy in interface SpatialSearchTreeObject
Parameters:
rect - the rectangle
Returns:
is contained?

isContainedBy

public boolean isContainedBy(SpatialSearchTreeEntry entry)
Tests whether the object is contained by a given entry or not.

Specified by:
isContainedBy in interface SpatialSearchTreeObject
Parameters:
entry - the entry
Returns:
is contained?

isOfSameType

public boolean isOfSameType(SpatialSearchTreeObject obj)
Tests whether the object is of the same type as the given object or not.

Specified by:
isOfSameType in interface SpatialSearchTreeObject
Parameters:
obj - the other object
Returns:
is of same type?

isVisible

public boolean isVisible(int scale)
Tests whether the object is visible at a given scale or not.

Specified by:
isVisible in interface VisualizedSpatialSearchTreeObject
Parameters:
scale - scale
Returns:
visible?

setMBR

public void setMBR(MBR newMBR)
Sets the MBR of the object.

Specified by:
setMBR in interface MovingSpatialSearchTreeObject
Parameters:
newMBR - the new MNR
Returns:
the layer