gnu.gnustep.base
Class NSRect

java.lang.Object
  |
  +--gnu.gnustep.base.NSRect
All Implemented Interfaces:
java.lang.Cloneable

public final class NSRect
extends java.lang.Object
implements java.lang.Cloneable

This class wraps the Objective-C struct NSRect. Instances of this class in Java contain four public fields: x, y, width, height. You are required to set and read these variables directly.


Field Summary
 float height
           
 float width
           
 float x
           
 float y
           
static NSRect ZeroRect
           
 
Constructor Summary
NSRect()
           
NSRect(float anX, float anY, float aWidth, float aHeight)
           
NSRect(NSPoint origin, NSSize size)
           
NSRect(java.lang.String string)
           
 
Method Summary
 java.lang.Object clone()
           
 boolean containsPoint(NSPoint aPoint)
           
 boolean containsPoint(NSPoint aPoint, boolean flipped)
           
 boolean containsRect(NSRect aRect)
           
 boolean equals(java.lang.Object otherObject)
           
 int hashCode()
           
 void insetRect(float dx, float dy)
           
 void intersectRect(NSRect aRect)
           
 boolean intersectsRect(NSRect aRect)
           
 boolean isEmpty()
           
 boolean isEqualToRect(NSRect aRect)
           
 void makeIntegral()
           
 float maxX()
           
 float maxY()
           
 float midX()
           
 float midY()
           
 void offsetRect(float dx, float dy)
           
 NSPoint origin()
           
 NSRect rectByInsettingRect(float dx, float dy)
           
 NSRect rectByIntersectingRect(NSRect aRect)
           
 NSRect rectByMakingIntegral()
           
 NSRect rectByOffsettingRect(float dx, float dy)
           
 NSRect rectByUnioningRect(NSRect aRect)
           
 void setOrigin(NSPoint newOrigin)
           
 void setSize(NSSize newSize)
           
 NSSize size()
           
 java.lang.String toString()
           
 void unionRect(NSRect aRect)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZeroRect

public static NSRect ZeroRect

x

public float x

y

public float y

width

public float width

height

public float height
Constructor Detail

NSRect

public NSRect()

NSRect

public NSRect(float anX,
              float anY,
              float aWidth,
              float aHeight)

NSRect

public NSRect(NSPoint origin,
              NSSize size)

NSRect

public NSRect(java.lang.String string)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

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

isEqualToRect

public boolean isEqualToRect(NSRect aRect)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

intersectsRect

public boolean intersectsRect(NSRect aRect)

isEmpty

public boolean isEmpty()

containsRect

public boolean containsRect(NSRect aRect)

containsPoint

public boolean containsPoint(NSPoint aPoint)

containsPoint

public boolean containsPoint(NSPoint aPoint,
                             boolean flipped)

insetRect

public void insetRect(float dx,
                      float dy)

intersectRect

public void intersectRect(NSRect aRect)

makeIntegral

public void makeIntegral()

offsetRect

public void offsetRect(float dx,
                       float dy)

unionRect

public void unionRect(NSRect aRect)

rectByInsettingRect

public NSRect rectByInsettingRect(float dx,
                                  float dy)

rectByIntersectingRect

public NSRect rectByIntersectingRect(NSRect aRect)

rectByMakingIntegral

public NSRect rectByMakingIntegral()

rectByOffsettingRect

public NSRect rectByOffsettingRect(float dx,
                                   float dy)

rectByUnioningRect

public NSRect rectByUnioningRect(NSRect aRect)

origin

public NSPoint origin()

setOrigin

public void setOrigin(NSPoint newOrigin)

size

public NSSize size()

setSize

public void setSize(NSSize newSize)

maxX

public float maxX()

midX

public float midX()

maxY

public float maxY()

midY

public float midY()