ar.edu.unr.fceia.bottallo
Class Dimension

java.lang.Object
  extended by ar.edu.unr.fceia.bottallo.Dimension

public class Dimension
extends java.lang.Object

Store graphical information (position & dimension) of graphical objects.

Dimension is definded by a positional corner point, width and height of an object


Constructor Summary
Dimension()
          Creates a new instance of Dimension
 
Method Summary
protected  float getHeight()
          Get the height of the graphical object
protected static float getMetric(Dimension s, Dimension t)
          Compute the inclusion-metric of a graphical object respect to other object (using the dimensions of the objects)
protected  Point getPointA()
          Get the A-point of the grafical object
protected  Point getPointB()
          Get the B-point of the grafical object
protected  Point getPointC()
          Get the C-point of the grafical object
protected  Point getPointD()
          Get the D-point of the grafical object
protected  float getPosX()
          Return the x-coordinate of the positional point of the graphical object
protected  float getPosY()
          Return the y-coordinate of the positional point of the graphical object
protected  float getWidth()
          Get the width of the graphical object
protected static boolean isIncluded(Dimension s, Dimension t)
          Check if a graphical object is included in other
protected static boolean pointIn(Point p, Dimension dim)
          Check if a point pertains to a grafical object (i.e. is inside the dimensio of a graphical object)
protected  void setHeight(float h)
          Set the height of the graphical object
protected  void setPointA(float x, float y)
          Set the A-point of the grafical object (left-top corner)
protected  void setPointB(float x, float y)
          Set the B-point of the grafical object (right-top corner)
protected  void setPointC(float x, float y)
          Set the C-point of the grafical object (left-bottom corner)
protected  void setPointD(float x, float y)
          Set the D-point of the grafical object (right-bottom corner)
protected  void setPosX(float x)
          Set the x coordinate of the positional point of the graphical object
protected  void setPosY(float y)
          Set the y coordinate of the positional point of the graphical object
protected  void setWidth(float w)
          Set the width of the graphical object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dimension

public Dimension()
Creates a new instance of Dimension

Method Detail

setPosX

protected void setPosX(float x)
Set the x coordinate of the positional point of the graphical object

Parameters:
x - coordinate

getPosX

protected float getPosX()
Return the x-coordinate of the positional point of the graphical object

Returns:
x coordinate

setPosY

protected void setPosY(float y)
Set the y coordinate of the positional point of the graphical object

Parameters:
y - coordinate

getPosY

protected float getPosY()
Return the y-coordinate of the positional point of the graphical object

Returns:
y coordinate

setWidth

protected void setWidth(float w)
Set the width of the graphical object

Parameters:
w - width of the object

getWidth

protected float getWidth()
Get the width of the graphical object

Returns:
width of the object

setHeight

protected void setHeight(float h)
Set the height of the graphical object

Parameters:
h - height of the object

getHeight

protected float getHeight()
Get the height of the graphical object

Returns:
height of the object

setPointA

protected void setPointA(float x,
                         float y)
Set the A-point of the grafical object (left-top corner)

Parameters:
x - coordinate of the point
y - coordinate of the point

getPointA

protected Point getPointA()
Get the A-point of the grafical object

Returns:
A-point

setPointB

protected void setPointB(float x,
                         float y)
Set the B-point of the grafical object (right-top corner)

Parameters:
x - coordinate of the point
y - coordinate of the point

getPointB

protected Point getPointB()
Get the B-point of the grafical object

Returns:
B-point

setPointC

protected void setPointC(float x,
                         float y)
Set the C-point of the grafical object (left-bottom corner)

Parameters:
x - coordinate of the point
y - coordinate of the point

getPointC

protected Point getPointC()
Get the C-point of the grafical object

Returns:
C-point

setPointD

protected void setPointD(float x,
                         float y)
Set the D-point of the grafical object (right-bottom corner)

Parameters:
x - coordinate of the point
y - coordinate of the point

getPointD

protected Point getPointD()
Get the D-point of the grafical object

Returns:
D-point

getMetric

protected static float getMetric(Dimension s,
                                 Dimension t)
Compute the inclusion-metric of a graphical object respect to other object (using the dimensions of the objects)

Parameters:
s - Dimension of the object chequed por inclusion
t - Dimension of the object eventually including the first object
Returns:
inclusion-metric of the graphical objects

pointIn

protected static boolean pointIn(Point p,
                                 Dimension dim)
Check if a point pertains to a grafical object (i.e. is inside the dimensio of a graphical object)

Parameters:
p - point
dim - dimension of a graphical object
Returns:
true if p pertains to dim, false otherwise

isIncluded

protected static boolean isIncluded(Dimension s,
                                    Dimension t)
Check if a graphical object is included in other

Parameters:
s - object being checked for "included in"
t - object being checked for "include the object"
Returns:
true if the first object is inside the second one, false otherwise