uk.ac.ebi.intact.application.hierarchView.business.image
Class ImageDimension

java.lang.Object
  |
  +--uk.ac.ebi.intact.application.hierarchView.business.image.ImageDimension
All Implemented Interfaces:
java.io.Serializable

public class ImageDimension
extends java.lang.Object
implements java.io.Serializable

Storage of the image dimension, allow to keep the heigth, width, border soze ...

Version:
$Id: ImageDimension.java,v 1.2 2003/03/18 10:38:36 skerrien Exp $
Author:
Samuel Kerrien (skerrien@ebi.ac.uk)
See Also:
Serialized Form

Field Summary
static float DEFAULT_BORDER
           
 
Constructor Summary
ImageDimension()
          initialize all coordinate to zero
 
Method Summary
 void adjust(float x, float y)
          Widen the size if the new coordinate is out of the usable space.
 void adjustCadre(float width, float height, float x, float y)
          Adjust width and height according to components size.
 float height()
           
 float length()
           
 float xmin()
           
 float ymin()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BORDER

public static float DEFAULT_BORDER
Constructor Detail

ImageDimension

public ImageDimension()
initialize all coordinate to zero

Method Detail

length

public float length()

height

public float height()

xmin

public float xmin()

ymin

public float ymin()

adjust

public void adjust(float x,
                   float y)
Widen the size if the new coordinate is out of the usable space. After adding a set of points we should have obtain something like below.
+-----------------------4-----+
+ +
+ 1 (x1,y1) +
+ +
+ +
+ +
+ +
5 +
+ 6 2 (x2,y2)
+ +
+ +
+ +
+------3----------------------+

Parameters:
x - the X coordinate
y - the Y coordinate

adjustCadre

public void adjustCadre(float width,
                        float height,
                        float x,
                        float y)
Adjust width and height according to components size. This is efficient only if node have already been set.

+------------------+ ^
+ + |
+ * (x,y) + | height
+ + |
+------------------+ -

<----- width ------>

Parameters:
width - width of the conponent
height - heigth of the component
x - the X coordinate
y - the Y coordinate


IntAct Project - EMBL-EBI 2004 - intact-help@ebi.ac.uk