com.miginfocom.util.gfx.geometry
Interface PlaceRect

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbsRect, AlignRect, AspectRatioRect

public interface PlaceRect
extends java.io.Serializable

Interface describing a rectangle that relates to another rectangle in some way, optionally with a reference size.


Method Summary
 java.awt.Rectangle getRect(java.awt.Rectangle r)
          Returns a rectangle that might be translated, scaled and checked for max/min bounds.
 java.awt.Rectangle getRect(java.awt.Rectangle r, java.awt.Dimension refSize)
          Returns a rectangle that might be translated, scaled and checked for max/min bounds.
 

Method Detail

getRect

java.awt.Rectangle getRect(java.awt.Rectangle r)
Returns a rectangle that might be translated, scaled and checked for max/min bounds.

This method is normally just a transfer to getRect(java.awt.Rectangle, java.awt.Dimension) with refSize set ti null.

Parameters:
r - The rectangle that is to be used as the source. Not null. Will not be changed.
Returns:
A new rectangle. Never null.

getRect

java.awt.Rectangle getRect(java.awt.Rectangle r,
                           java.awt.Dimension refSize)
Returns a rectangle that might be translated, scaled and checked for max/min bounds.

Parameters:
r - The rectangle that is to be used as the source. Not null. Will not be changed.
refSize - If x1, y1, x2 and/or y2 is null (in this)) the horizontal/vertical size if taken from this dimension instead. If null the size is taken from r.
This can for instance be the size on an Image that you are trying to alighn within some bounds.
Returns:
A new rectangle. Never null.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.