com.miginfocom.util.gfx.geometry
Class Range

java.lang.Object
  extended by com.miginfocom.util.gfx.geometry.Range
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Range.RectRange

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

Simple data holder for a start and end value. Effectively spans a line in one dimension.
Can also be used to wrap a Rectangle as a range for one of its dimensions.

See Also:
wrap(java.awt.Rectangle, int), Serialized Form

Nested Class Summary
static class Range.RectRange
           
 
Constructor Summary
Range()
          No-arg constructor.
Range(float start, float end)
          Constructor.
 
Method Summary
protected  java.lang.Object clone()
           
 boolean equals(java.lang.Object o)
           
 float getEnd()
           
 float getStart()
           
 void setEnd(float end)
           
 void setStart(float start)
           
static Range wrap(java.awt.Rectangle r, int dimension)
          Returns a Range that actually is a wrapper to one of a Rectangle's dimension.
The range has all vales casted to int without rounding.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Range

public Range()
No-arg constructor. Sets start and end to 0.0f.


Range

public Range(float start,
             float end)
Constructor.

Parameters:
start - Start value
end - End value.
Method Detail

getStart

public float getStart()

setStart

public void setStart(float start)

getEnd

public float getEnd()

setEnd

public void setEnd(float end)

clone

protected java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

wrap

public static Range wrap(java.awt.Rectangle r,
                         int dimension)
Returns a Range that actually is a wrapper to one of a Rectangle's dimension.
The range has all vales casted to int without rounding.

Parameters:
r - The rectanlge ro wrap.
dimension - SwingConstants.HORIZONTAL or SwingConstants.VERTICAL
Returns:
A Range that passes all operations thought to the Rectangle.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.