ome.util.math.geom2D
Class RectangleArea

java.lang.Object
  extended by ome.util.mem.Handle
      extended by ome.util.math.geom2D.RectangleArea
All Implemented Interfaces:
Shape, Cloneable, PlaneArea, Copiable

public class RectangleArea
extends Handle
implements PlaneArea

Represents a rectangle in the Euclidean space R2.

Since:
OME2.2
Version:
2.2 (Internal version: $Revision: 1167 $ $Date: 2005/06/09 15:01:32 $)
Author:
Jean-Marie Burel      j.burel@dundee.ac.uk,
Andrea Falconi      a.falconi@dundee.ac.uk

Constructor Summary
RectangleArea()
          Constructs a new RectangleAreaAdapter whose top-left corner is (0, 0) and whose width and height are both zero.
RectangleArea(int x, int y, int width, int height)
          Constructs a new RectangleAreaAdapter whose top-left corner is specified as (x, y) and whose width and height are specified by the arguments of the same name.
 
Method Summary
 boolean contains(double x, double y)
          Required by the Shape I/F.
 boolean contains(double x, double y, double w, double h)
          Required by the Shape I/F.
 boolean contains(Point2D p)
          Required by the Shape I/F.
 boolean contains(Rectangle2D r)
          Required by the Shape I/F.
 Rectangle getBounds()
          Required by the Shape I/F.
 Rectangle2D getBounds2D()
          Required by the Shape I/F.
 PathIterator getPathIterator(AffineTransform at)
          Required by the Shape I/F.
 PathIterator getPathIterator(AffineTransform at, double flatness)
          Required by the Shape I/F.
 PlanePoint[] getPoints()
          Implemented as specified by the PlaneArea I/F.
 boolean intersects(double x, double y, double w, double h)
          Required by the Shape I/F.
 boolean intersects(Rectangle2D r)
          Required by the Shape I/F.
 boolean onBoundaries(double x, double y)
          Implemented as specified by the PlaneArea I/F.
 void scale(double factor)
          Implemented as specified by the PlaneArea I/F.
 void setBounds(int x, int y, int width, int height)
          Implemented as specified by the PlaneArea I/F.
 
Methods inherited from class ome.util.mem.Handle
breakSharing, copy, getBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ome.util.mem.Copiable
copy
 

Constructor Detail

RectangleArea

public RectangleArea()
Constructs a new RectangleAreaAdapter whose top-left corner is (0, 0) and whose width and height are both zero.


RectangleArea

public RectangleArea(int x,
                     int y,
                     int width,
                     int height)
Constructs a new RectangleAreaAdapter whose top-left corner is specified as (x, y) and whose width and height are specified by the arguments of the same name.

Parameters:
x - The x-coordinate of the top-left corner.
y - The y-coordinate of the top-left corner.
width - The width of the rectangle.
height - The height of the rectangle.
Method Detail

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Implemented as specified by the PlaneArea I/F.

Specified by:
setBounds in interface PlaneArea
Parameters:
x - The x-coordinate of the top-left corner.
y - The y-coordinate of the top-left corner.
width - The width of the area.
height - The height of the area.
See Also:
PlaneArea.setBounds(int, int, int, int)

scale

public void scale(double factor)
Implemented as specified by the PlaneArea I/F.

Specified by:
scale in interface PlaneArea
Parameters:
factor - The scaling factor.
See Also:
PlaneArea.scale(double)

getPoints

public PlanePoint[] getPoints()
Implemented as specified by the PlaneArea I/F.

Specified by:
getPoints in interface PlaneArea
Returns:
See above.
See Also:
PlaneArea.getPoints()

onBoundaries

public boolean onBoundaries(double x,
                            double y)
Implemented as specified by the PlaneArea I/F.

Specified by:
onBoundaries in interface PlaneArea
Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.
Returns:
true if the point is on the boundary, false otherwise.
See Also:
PlaneArea.onBoundaries(double, double)

contains

public boolean contains(double x,
                        double y)
Required by the Shape I/F.

Specified by:
contains in interface Shape
See Also:
Shape.contains(double, double)

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Required by the Shape I/F.

Specified by:
contains in interface Shape
See Also:
Shape.contains(double, double, double, double)

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Required by the Shape I/F.

Specified by:
intersects in interface Shape
See Also:
Shape.intersects(double, double, double, double)

getBounds

public Rectangle getBounds()
Required by the Shape I/F.

Specified by:
getBounds in interface Shape
See Also:
Shape.getBounds()

contains

public boolean contains(Point2D p)
Required by the Shape I/F.

Specified by:
contains in interface Shape
See Also:
Shape.contains(Point2D)

getBounds2D

public Rectangle2D getBounds2D()
Required by the Shape I/F.

Specified by:
getBounds2D in interface Shape
See Also:
Shape.getBounds2D()

contains

public boolean contains(Rectangle2D r)
Required by the Shape I/F.

Specified by:
contains in interface Shape
See Also:
Shape.contains(Rectangle2D)

intersects

public boolean intersects(Rectangle2D r)
Required by the Shape I/F.

Specified by:
intersects in interface Shape
See Also:
Shape.intersects(Rectangle2D)

getPathIterator

public PathIterator getPathIterator(AffineTransform at)
Required by the Shape I/F.

Specified by:
getPathIterator in interface Shape
See Also:
Shape.getPathIterator(AffineTransform)

getPathIterator

public PathIterator getPathIterator(AffineTransform at,
                                    double flatness)
Required by the Shape I/F.

Specified by:
getPathIterator in interface Shape
See Also:
Shape.getPathIterator(AffineTransform, double)


OmeroJava Api

Version: Beta-4.1.1-r5927-b91

Copyright © 2009 The University of Dundee. All Rights Reserved.