Java Doc for Star2D.java in  » Swing-Library » swingx » org » jdesktop » swingx » 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 » Swing Library » swingx » org.jdesktop.swingx.geom 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jdesktop.swingx.geom.Star2D

Star2D
public class Star2D implements Shape(Code)

This class provides a star shape. A star is defined by two radii and a number of branches. Each branch spans between the two radii. The inner radius is the distance between the center of the star and the origin of the branches. The outer radius is the distance between the center of the star and the tips of the branches.


author:
   Romain Guy



Constructor Summary
public  Star2D(double x, double y, double innerRadius, double outerRadius, int branchesCount)
    

Creates a new star whose center is located at the specified x and y coordinates.


Method Summary
public  booleancontains(double x, double y)
    
public  booleancontains(Point2D p)
    
public  booleancontains(double x, double y, double w, double h)
    
public  booleancontains(Rectangle2D r)
    
public  RectanglegetBounds()
    
public  Rectangle2DgetBounds2D()
    
public  intgetBranchesCount()
    
public  doublegetInnerRadius()
    
public  doublegetOuterRadius()
    
public  PathIteratorgetPathIterator(AffineTransform at)
    
public  PathIteratorgetPathIterator(AffineTransform at, double flatness)
    
public  doublegetX()
    
public  doublegetY()
    
public  booleanintersects(double x, double y, double w, double h)
    
public  booleanintersects(Rectangle2D r)
    
public  voidsetBranchesCount(int branchesCount)
    

Sets the number branches of the star.

public  voidsetInnerRadius(double innerRadius)
    

Sets the inner radius of the star, that is the distance between its center and the origin of the branches.

public  voidsetOuterRadius(double outerRadius)
    

Sets the outer radius of the star, that is the distance between its center and the tips of the branches.

public  voidsetX(double x)
    
public  voidsetY(double y)
    


Constructor Detail
Star2D
public Star2D(double x, double y, double innerRadius, double outerRadius, int branchesCount)(Code)

Creates a new star whose center is located at the specified x and y coordinates. The number of branches and their length can be specified.


Parameters:
  x - the location of the star center
Parameters:
  y - the location of the star center
Parameters:
  innerRadius - the distance between the center of the star and theorigin of the branches
Parameters:
  outerRadius - the distance between the center of the star and thetip of the branches
Parameters:
  branchesCount - the number of branches in this star; must be >= 3
throws:
  IllegalArgumentException - if branchesCount is < 3 orif innerRadius is >= outerRadius




Method Detail
contains
public boolean contains(double x, double y)(Code)



contains
public boolean contains(Point2D p)(Code)



contains
public boolean contains(double x, double y, double w, double h)(Code)



contains
public boolean contains(Rectangle2D r)(Code)



getBounds
public Rectangle getBounds()(Code)



getBounds2D
public Rectangle2D getBounds2D()(Code)



getBranchesCount
public int getBranchesCount()(Code)

Returns the number of branches of the star.

the number of branches, always >= 3



getInnerRadius
public double getInnerRadius()(Code)

Returns the distance between the center of the star and the origin of the branches.

the inner radius of the star



getOuterRadius
public double getOuterRadius()(Code)

Returns the distance between the center of the star and the tips of the branches.

the outer radius of the star



getPathIterator
public PathIterator getPathIterator(AffineTransform at)(Code)



getPathIterator
public PathIterator getPathIterator(AffineTransform at, double flatness)(Code)



getX
public double getX()(Code)

Returns the location of the center of star.

the x coordinate of the center of the star



getY
public double getY()(Code)

Returns the location of the center of star.

the y coordinate of the center of the star



intersects
public boolean intersects(double x, double y, double w, double h)(Code)



intersects
public boolean intersects(Rectangle2D r)(Code)



setBranchesCount
public void setBranchesCount(int branchesCount)(Code)

Sets the number branches of the star. A star must always have at least 3 branches.


Parameters:
  branchesCount - the number of branches
throws:
  IllegalArgumentException - if branchesCount is <=2



setInnerRadius
public void setInnerRadius(double innerRadius)(Code)

Sets the inner radius of the star, that is the distance between its center and the origin of the branches. The inner radius must always be lower than the outer radius.


Parameters:
  innerRadius - the distance between the center of the star and theorigin of the branches
throws:
  IllegalArgumentException - if the inner radius is >= outer radius



setOuterRadius
public void setOuterRadius(double outerRadius)(Code)

Sets the outer radius of the star, that is the distance between its center and the tips of the branches. The outer radius must always be greater than the inner radius.


Parameters:
  outerRadius - the distance between the center of the star and thetips of the branches
throws:
  IllegalArgumentException - if the inner radius is >= outer radius



setX
public void setX(double x)(Code)

Sets location of the center of the star.


Parameters:
  x - the x location of the center of the star



setY
public void setY(double y)(Code)

Sets the location of the center of the star.


Parameters:
  y - the x location of the center of the star



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.