Java Doc for Rectangle2D.java in  » Scripting » hecl » org » awt » geom » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » hecl » org.awt.geom 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.awt.geom.Rectangle2D

All known Subclasses:   org.awt.Rectangle,
Rectangle2D
abstract public class Rectangle2D (Code)
The Rectangle2D class describes a rectangle defined by a location (x, y) and dimension (w x h).

This class is only the abstract superclass for all objects that store a 2D rectangle. The actual storage representation of the coordinates is left to the subclass.


Inner Class :public static class Float extends Rectangle2D
Inner Class :public static class Double extends Rectangle2D

Field Summary
final public static  intOUT_BOTTOM
     The bitmask that indicates that a point lies below this Rectangle2D.
final public static  intOUT_LEFT
     The bitmask that indicates that a point lies to the left of this Rectangle2D.
final public static  intOUT_RIGHT
     The bitmask that indicates that a point lies to the right of this Rectangle2D.
final public static  intOUT_TOP
     The bitmask that indicates that a point lies above this Rectangle2D.

Constructor Summary
protected  Rectangle2D()
     This is an abstract class that cannot be instantiated directly.

Method Summary
public  voidadd(double newx, double newy)
     Adds a point, specified by the double precision arguments newx and newy, to this Rectangle2D.
public  voidadd(Point2D pt)
     Adds the Point2D object pt to this Rectangle2D. The resulting Rectangle2D is the smallest Rectangle2D that contains both the original Rectangle2D and the specified Point2D.

After adding a point, a call to contains with the added point as an argument does not necessarily return true.

public  voidadd(Rectangle2D r)
     Adds a Rectangle2D object to this Rectangle2D.
public  booleancontains(double x, double y)
     Tests if a specified coordinate is inside the boundary of this Rectangle2D.
public  booleancontains(double x, double y, double w, double h)
     Tests if the interior of this Rectangle2D entirely contains the specified set of rectangular coordinates.
abstract public  Rectangle2DcreateIntersection(Rectangle2D r)
     Returns a new Rectangle2D object representing the intersection of this Rectangle2D with the specified Rectangle2D.
abstract public  Rectangle2DcreateUnion(Rectangle2D r)
     Returns a new Rectangle2D object representing the union of this Rectangle2D with the specified Rectangle2D.
public  booleanequals(Object obj)
     Determines whether or not the specified Object is equal to this Rectangle2D.
public  Rectangle2DgetBounds2D()
     Returns the high precision bounding box of this Rectangle2D.
abstract public  Rectangle2DgetBounds2D()
    
abstract public  doublegetHeight()
    
public  doublegetMaxX()
    
public  doublegetMaxY()
    
public  doublegetMinX()
    
public  doublegetMinY()
    
public  PathIteratorgetPathIterator(AffineTransform at)
     Returns an iteration object that defines the boundary of this Rectangle2D.
public  PathIteratorgetPathIterator(AffineTransform at, double flatness)
     Returns an iteration object that defines the boundary of the flattened Rectangle2D.
abstract public  doublegetWidth()
    
abstract public  doublegetX()
    
abstract public  doublegetY()
    
public  inthashCode()
     Returns the hashcode for this Rectangle2D.
public static  voidintersect(Rectangle2D src1, Rectangle2D src2, Rectangle2D dest)
     Intersects the pair of specified source Rectangle2D objects and puts the result into the specified destination Rectangle2D object.
public  booleanintersects(double x, double y, double w, double h)
     Tests if the interior of this Rectangle2D intersects the interior of a specified set of rectangular coordinates.
public  booleanintersectsLine(double x1, double y1, double x2, double y2)
     Tests if the specified line segment intersects the interior of this Rectangle2D.
public  booleanintersectsLine(Line2D l)
     Tests if the specified line segment intersects the interior of this Rectangle2D.
abstract public  booleanisEmpty()
    
abstract public  intoutcode(double x, double y)
     Determines where the specified coordinates lie with respect to this Rectangle2D.
public  intoutcode(Point2D p)
     Determines where the specified Point2D lies with respect to this Rectangle2D.
public  voidsetFrame(double x, double y, double w, double h)
     Sets the location and size of the outer bounds of this Rectangle2D to the specified rectangular values.
public  voidsetFrameFromDiagonal(double x1, double y1, double x2, double y2)
    
abstract public  voidsetRect(double x, double y, double w, double h)
     Sets the location and size of this Rectangle2D to the specified double values.
public  voidsetRect(Rectangle2D r)
     Sets this Rectangle2D to be the same as the specified Rectangle2D.
public static  voidunion(Rectangle2D src1, Rectangle2D src2, Rectangle2D dest)
     Unions the pair of source Rectangle2D objects and puts the result into the specified destination Rectangle2D object.

Field Detail
OUT_BOTTOM
final public static int OUT_BOTTOM(Code)
The bitmask that indicates that a point lies below this Rectangle2D.



OUT_LEFT
final public static int OUT_LEFT(Code)
The bitmask that indicates that a point lies to the left of this Rectangle2D.



OUT_RIGHT
final public static int OUT_RIGHT(Code)
The bitmask that indicates that a point lies to the right of this Rectangle2D.



OUT_TOP
final public static int OUT_TOP(Code)
The bitmask that indicates that a point lies above this Rectangle2D.




Constructor Detail
Rectangle2D
protected Rectangle2D()(Code)
This is an abstract class that cannot be instantiated directly. Type-specific implementation subclasses are available for instantiation and provide a number of formats for storing the information necessary to satisfy the various accessor methods below.
See Also:   java.awt.geom.Rectangle2D.Float
See Also:   java.awt.geom.Rectangle2D.Double
See Also:   java.awt.Rectangle




Method Detail
add
public void add(double newx, double newy)(Code)
Adds a point, specified by the double precision arguments newx and newy, to this Rectangle2D. The resulting Rectangle2D is the smallest Rectangle2D that contains both the original Rectangle2D and the specified point.

After adding a point, a call to contains with the added point as an argument does not necessarily return true. The contains method does not return true for points on the right or bottom edges of a rectangle. Therefore, if the added point falls on the left or bottom edge of the enlarged rectangle, contains returns false for that point. newx, newy the coordinates of the new point




add
public void add(Point2D pt)(Code)
Adds the Point2D object pt to this Rectangle2D. The resulting Rectangle2D is the smallest Rectangle2D that contains both the original Rectangle2D and the specified Point2D.

After adding a point, a call to contains with the added point as an argument does not necessarily return true. The contains method does not return true for points on the right or bottom edges of a rectangle. Therefore, if the added point falls on the left or bottom edge of the enlarged rectangle, contains returns false for that point.
Parameters:
  pt - the new Point2D to add to thisRectangle2D.




add
public void add(Rectangle2D r)(Code)
Adds a Rectangle2D object to this Rectangle2D. The resulting Rectangle2D is the union of the two Rectangle2D objects.
Parameters:
  r - the Rectangle2D to add to thisRectangle2D.



contains
public boolean contains(double x, double y)(Code)
Tests if a specified coordinate is inside the boundary of this Rectangle2D. x, y the coordinates to test true if the specified coordinates areinside the boundary of this Rectangle2D;false otherwise.



contains
public boolean contains(double x, double y, double w, double h)(Code)
Tests if the interior of this Rectangle2D entirely contains the specified set of rectangular coordinates. x, y the coordinates of the upper left cornerof the specified set of rectangular coordinates
Parameters:
  w - the width of the specified set of rectangularcoordinates
Parameters:
  h - the height of the specified set of rectangularcoordinates true if this Rectangle2Dentirely contains specified set of rectangularcoordinates; false otherwise.



createIntersection
abstract public Rectangle2D createIntersection(Rectangle2D r)(Code)
Returns a new Rectangle2D object representing the intersection of this Rectangle2D with the specified Rectangle2D.
Parameters:
  r - the Rectangle2D to be intersected withthis Rectangle2D the largest Rectangle2D contained in both the specified Rectangle2D and in thisRectangle2D.



createUnion
abstract public Rectangle2D createUnion(Rectangle2D r)(Code)
Returns a new Rectangle2D object representing the union of this Rectangle2D with the specified Rectangle2D.
Parameters:
  r - the Rectangle2D to be combined withthis Rectangle2D the smallest Rectangle2D containing both the specified Rectangle2D and this Rectangle2D.



equals
public boolean equals(Object obj)(Code)
Determines whether or not the specified Object is equal to this Rectangle2D. The specified Object is equal to this Rectangle2D if it is an instance of Rectangle2D and if its location and size are the same as this Rectangle2D.
Parameters:
  obj - an Object to be compared with thisRectangle2D. true if obj is an instanceof Rectangle2D and hasthe same values; false otherwise.



getBounds2D
public Rectangle2D getBounds2D()(Code)
Returns the high precision bounding box of this Rectangle2D. the bounding box of this Rectangle2D.



getBounds2D
abstract public Rectangle2D getBounds2D()(Code)



getHeight
abstract public double getHeight()(Code)



getMaxX
public double getMaxX()(Code)



getMaxY
public double getMaxY()(Code)



getMinX
public double getMinX()(Code)



getMinY
public double getMinY()(Code)



getPathIterator
public PathIterator getPathIterator(AffineTransform at)(Code)
Returns an iteration object that defines the boundary of this Rectangle2D. The iterator for this class is multi-threaded safe, which means that this Rectangle2D class guarantees that modifications to the geometry of this Rectangle2D object do not affect any iterations of that geometry that are already in process.
Parameters:
  at - an optional AffineTransform to be applied tothe coordinates as they are returned in the iteration, ornull if untransformed coordinates are desired the PathIterator object that returns thegeometry of the outline of thisRectangle2D, one segment at a time.



getPathIterator
public PathIterator getPathIterator(AffineTransform at, double flatness)(Code)
Returns an iteration object that defines the boundary of the flattened Rectangle2D. Since rectangles are already flat, the flatness parameter is ignored. The iterator for this class is multi-threaded safe, which means that this Rectangle2D class guarantees that modifications to the geometry of this Rectangle2D object do not affect any iterations of that geometry that are already in process.
Parameters:
  at - an optional AffineTransform to be applied tothe coordinates as they are returned in the iteration, ornull if untransformed coordinates are desired
Parameters:
  flatness - the maximum distance that the line segments used toapproximate the curved segments are allowed to deviate from anypoint on the original curve. Since rectangles are already flat,the flatness parameter is ignored. the PathIterator object that returns thegeometry of the outline of thisRectangle2D, one segment at a time.



getWidth
abstract public double getWidth()(Code)



getX
abstract public double getX()(Code)



getY
abstract public double getY()(Code)



hashCode
public int hashCode()(Code)
Returns the hashcode for this Rectangle2D. the hashcode for this Rectangle2D.



intersect
public static void intersect(Rectangle2D src1, Rectangle2D src2, Rectangle2D dest)(Code)
Intersects the pair of specified source Rectangle2D objects and puts the result into the specified destination Rectangle2D object. One of the source rectangles can also be the destination to avoid creating a third Rectangle2D object, but in this case the original points of this source rectangle will be overwritten by this method.
Parameters:
  src1 - the first of a pair of Rectangle2D objects to be intersected with each other
Parameters:
  src2 - the second of a pair of Rectangle2Dobjects to be intersected with each other
Parameters:
  dest - the Rectangle2D that holds theresults of the intersection of src1 andsrc2



intersects
public boolean intersects(double x, double y, double w, double h)(Code)
Tests if the interior of this Rectangle2D intersects the interior of a specified set of rectangular coordinates. x, y the coordinates of the upper left cornerof the specified set of rectangular coordinates
Parameters:
  w - the width of the specified set of rectangularcoordinates
Parameters:
  h - the height of the specified set of rectangularcoordinates true if this Rectangle2Dintersects the interior of a specified set of rectangularcoordinates; false otherwise.



intersectsLine
public boolean intersectsLine(double x1, double y1, double x2, double y2)(Code)
Tests if the specified line segment intersects the interior of this Rectangle2D. x1, y1 the first endpoint of the specifiedline segment x2, y2 the second endpoint of the specifiedline segment true if the specified line segment intersectsthe interior of this Rectangle2D; falseotherwise.



intersectsLine
public boolean intersectsLine(Line2D l)(Code)
Tests if the specified line segment intersects the interior of this Rectangle2D.
Parameters:
  l - the specified Line2D to test for intersectionwith the interior of this Rectangle2D true if the specified Line2Dintersects the interior of this Rectangle2D;false otherwise.



isEmpty
abstract public boolean isEmpty()(Code)



outcode
abstract public int outcode(double x, double y)(Code)
Determines where the specified coordinates lie with respect to this Rectangle2D. This method computes a binary OR of the appropriate mask values indicating, for each side of this Rectangle2D, whether or not the specified coordinates are on the same side of the edge as the rest of this Rectangle2D. x, y the specified coordinates the logical OR of all appropriate out codes.
See Also:   Rectangle2D.OUT_LEFT
See Also:   Rectangle2D.OUT_TOP
See Also:   Rectangle2D.OUT_RIGHT
See Also:   Rectangle2D.OUT_BOTTOM



outcode
public int outcode(Point2D p)(Code)
Determines where the specified Point2D lies with respect to this Rectangle2D. This method computes a binary OR of the appropriate mask values indicating, for each side of this Rectangle2D, whether or not the specified Point2D is on the same side of the edge as the rest of this Rectangle2D.
Parameters:
  p - the specified Point2D the logical OR of all appropriate out codes.
See Also:   Rectangle2D.OUT_LEFT
See Also:   Rectangle2D.OUT_TOP
See Also:   Rectangle2D.OUT_RIGHT
See Also:   Rectangle2D.OUT_BOTTOM



setFrame
public void setFrame(double x, double y, double w, double h)(Code)
Sets the location and size of the outer bounds of this Rectangle2D to the specified rectangular values. x, y the coordinates to which to set thelocation of the upper left corner of the outer bounds of this Rectangle2D
Parameters:
  w - the value to use to set the width of the outerbounds of this Rectangle2D
Parameters:
  h - the value to use to set the height of the outerbounds of this Rectangle2D



setFrameFromDiagonal
public void setFrameFromDiagonal(double x1, double y1, double x2, double y2)(Code)



setRect
abstract public void setRect(double x, double y, double w, double h)(Code)
Sets the location and size of this Rectangle2D to the specified double values. x, y the coordinates to which to set thelocation of the upper left corner of thisRectangle2D
Parameters:
  w - the value to use to set the width of thisRectangle2D
Parameters:
  h - the value to use to set the height of thisRectangle2D



setRect
public void setRect(Rectangle2D r)(Code)
Sets this Rectangle2D to be the same as the specified Rectangle2D.
Parameters:
  r - the specified Rectangle2D



union
public static void union(Rectangle2D src1, Rectangle2D src2, Rectangle2D dest)(Code)
Unions the pair of source Rectangle2D objects and puts the result into the specified destination Rectangle2D object. One of the source rectangles can also be the destination to avoid creating a third Rectangle2D object, but in this case the original points of this source rectangle will be overwritten by this method.
Parameters:
  src1 - the first of a pair of Rectangle2Dobjects to be combined with each other
Parameters:
  src2 - the second of a pair of Rectangle2Dobjects to be combined with each other
Parameters:
  dest - the Rectangle2D that holds theresults of the union of src1 and src2



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.