Home » Eclipse-SWT-3.5.1 » org.eclipse.swt.graphics.custom » [javadoc | source]
org.eclipse.swt.graphics.custom
public class: DirtyRectangle [javadoc | source]
java.lang.Object
   org.eclipse.swt.graphics.custom.DirtyRectangle

All Implemented Interfaces:
    SerializableCompatibility

Custom version of org.eclipse.swt.graphics.Rectangle. Added method add(x,y,w,h) to avoid creating intermediate Rectangle objects. Instances of this class represent rectangular areas in an (x, y) coordinate system. The top left corner of the rectangle is specified by its x and y values, and the extent of the rectangle is specified by its width and height.

The coordinate space for rectangles and points is considered to have increasing values downward and to the right from its origin making this the normal, computer graphics oriented notion of (x, y) coordinates rather than the strict mathematical one.

Application code does not need to explicitly release the resources managed by each instance when those instances are no longer required, and thus no dispose() method is provided.

Field Summary
public  int x    the x coordinate of the rectangle 
public  int y    the y coordinate of the rectangle 
public  int width    the width of the rectangle 
public  int height    the height of the rectangle 
Constructor:
 public DirtyRectangle(int x,
    int y,
    int width,
    int height) 
Method from org.eclipse.swt.graphics.custom.DirtyRectangle Summary:
add,   add,   add,   clear,   contains,   contains,   equals,   hashCode,   init,   init,   intersection,   intersects,   isEmpty,   toString,   union
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.eclipse.swt.graphics.custom.DirtyRectangle Detail:
 public  void add(DirtyRectangle rect) 
    Destructively replaces the x, y, width and height values in the receiver with ones which represent the union of the rectangles specified by the receiver and the given rectangle.

    The union of two rectangles is the smallest single rectangle that completely covers both of the areas covered by the two given rectangles.

 public  void add(Rectangle rect) 
 public  void add(int xx,
    int yy,
    int ww,
    int hh) 
 public  void clear() 
 public boolean contains(Point pt) 
    Returns true if the given point is inside the area specified by the receiver, and false otherwise.
 public boolean contains(int x,
    int y) 
    Returns true if the point specified by the arguments is inside the area specified by the receiver, and false otherwise.
 public boolean equals(Object object) 
    Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
 public int hashCode() 
    Returns an integer hash code for the receiver. Any two objects which return true when passed to equals must return the same value for this method.
 public  void init(Rectangle rect) 
 public  void init(int x,
    int y,
    int w,
    int h) 
 public DirtyRectangle intersection(DirtyRectangle rect) 
    Returns a new rectangle which represents the intersection of the receiver and the given rectangle.

    The intersection of two rectangles is the rectangle that covers the area which is contained within both rectangles.

 public boolean intersects(DirtyRectangle rect) 
    Returns true if the given rectangle intersects with the receiver and false otherwise.

    Two rectangles intersect if the area of the rectangle representing their intersection is not empty.

 public boolean isEmpty() 
    Returns true if the receiver does not cover any area in the (x, y) coordinate plane, and false if the receiver does cover some area in the plane.

    A rectangle is considered to cover area in the (x, y) coordinate plane if both its width and height are non-zero.

 public String toString() 
    Returns a string containing a concise, human-readable description of the receiver.
 public DirtyRectangle union(DirtyRectangle rect) 
    Returns a new rectangle which represents the union of the receiver and the given rectangle.

    The union of two rectangles is the smallest single rectangle that completely covers both of the areas covered by the two given rectangles.