nl.tudelft.simulation.language.d2
Class Shape

java.lang.Object
  extended bynl.tudelft.simulation.language.d2.Shape

public final class Shape
extends java.lang.Object

Shape utilities.

(c) copyright 2003 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public License (GPL) , no warranty

Since:
1.4
Version:
1.2 Jun 17, 2004
Author:
Peter Jacobs

Method Summary
static boolean contains(java.awt.geom.Rectangle2D r1, java.awt.geom.Rectangle2D r2)
          is r1 completely in r2
static boolean intersects(java.awt.geom.Rectangle2D r1, java.awt.geom.Rectangle2D r2)
           
static boolean overlaps(java.awt.geom.Rectangle2D extent, java.awt.geom.Rectangle2D shape)
          overlaps extent and shape.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

overlaps

public static boolean overlaps(java.awt.geom.Rectangle2D extent,
                               java.awt.geom.Rectangle2D shape)
overlaps extent and shape. Overlap = Intersect + Contain

Parameters:
extent - the extent
shape - the shape
Returns:
whether extent overlaps shape

intersects

public static boolean intersects(java.awt.geom.Rectangle2D r1,
                                 java.awt.geom.Rectangle2D r2)
Parameters:
r1 - the first rectangle
r2 - the second rectangle
Returns:
whether r1 intersects r2

contains

public static boolean contains(java.awt.geom.Rectangle2D r1,
                               java.awt.geom.Rectangle2D r2)
is r1 completely in r2

Parameters:
r1 - the first rectangle
r2 - the second rectangle
Returns:
whether r1 in r2


Copyright © 2002-2004 Delft University of Technology, the Netherlands. All Rights Reserved.