Java Doc for VectorField.java in  » Science » jcm1-source » edu » hws » jcm » draw » 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 » Science » jcm1 source » edu.hws.jcm.draw 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.hws.jcm.draw.Drawable
      edu.hws.jcm.draw.VectorField

VectorField
public class VectorField extends Drawable implements Computable(Code)
A VectorField displays lines or arrows on a grid of points where the direction and/or lengths are given by two functions (f1(x,y),f2(x,y)). This is probably more useful as a "direction field" than as a "vector field."


Field Summary
final public static  intARROWS
     One of the possible styles for displaying a VectorField: as a direction field shown as arrows of equal length.
final public static  intCLAMPED_VECTORS
     One of the possible styles for displaying a VectorField: as a vector field where a vector is shown as an arrow from (x,y) to (x+xFunc(x,y),y+xFunc(x,y)), except that a maximum length is imposed.
final public static  intLINES
     One of the possible styles for displaying a VectorField: as a direction field shown as tangent lines.
final public static  intSCALED_LINES
     One of the possible styles for displaying a VectorField: as a field of tangent lines where the length of the line is proportional to the length of the vector.
final public static  intSCALED_VECTORS
     One of the possible styles for displaying a VectorField: as a vector field where a vector is shown as an arrow with length proportional to the length of the vector.

Constructor Summary
public  VectorField()
     Create a VectorField object with nothing to graph.
public  VectorField(Function xFunc, Function yFunc)
     Create a VectorField that will be displayed using the default style, as a direction field of equal-length arrows.
public  VectorField(Function xFunc, Function yFunc, int style)
     Create a VectorField with the specified functions and style.
Parameters:
  xFunc - A Function of two variables giving the x-component of the vector field.

Method Summary
public synchronized  voidcompute()
     Recompute data for the vector field and make sure that the area of the display canvas that shows the vector field is redrawn.
public synchronized  voiddraw(Graphics g, boolean coordsChanged)
     Draw the vector field (possibly recomputing the data if the CoordinateRect has changed).
public  ColorgetColor()
     Get the color that is used to draw the vector field.
public  intgetPixelSpacing()
     Get the value of the pixelSpacing property, which determines the grid spacing for the vector field.
public  intgetStyle()
     Get the style in which the vector field is displayed.
public  FunctiongetXFunction()
     Get the (possibly null) function that gives the x-component of the vector field.
public  FunctiongetYFunction()
     Get the (possibly null) function that gives the y-component of the vector field.
public  voidsetColor(Color c)
     Set the color to be used for drawing the vector field.
public synchronized  voidsetFunctions(Function dx, Function dy)
     Sets the functions that give the components of the vector field.
public  voidsetPixelSpacing(int spacing)
     Set the value of the pixelSpacing property, which determines the grid spacing for the vector field. The value will be clamped to the range from 5 to 200.
public  voidsetStyle(int style)
     Set the style in which the vector field is displayed.
public synchronized  voidsetXFunction(Function dx)
     Set the function that gives the x-component of the vector field.
public synchronized  voidsetYFunction(Function dy)
     Set the function that gives the y-component of the vector field.

Field Detail
ARROWS
final public static int ARROWS(Code)
One of the possible styles for displaying a VectorField: as a direction field shown as arrows of equal length. The point where the vector is computed is the tail of the arrow.



CLAMPED_VECTORS
final public static int CLAMPED_VECTORS(Code)
One of the possible styles for displaying a VectorField: as a vector field where a vector is shown as an arrow from (x,y) to (x+xFunc(x,y),y+xFunc(x,y)), except that a maximum length is imposed.



LINES
final public static int LINES(Code)
One of the possible styles for displaying a VectorField: as a direction field shown as tangent lines. The point where the vector is computed is the center of the line.



SCALED_LINES
final public static int SCALED_LINES(Code)
One of the possible styles for displaying a VectorField: as a field of tangent lines where the length of the line is proportional to the length of the vector.



SCALED_VECTORS
final public static int SCALED_VECTORS(Code)
One of the possible styles for displaying a VectorField: as a vector field where a vector is shown as an arrow with length proportional to the length of the vector. The lengths are scaled so that the longest arrow has length equal to the grid spacing.




Constructor Detail
VectorField
public VectorField()(Code)
Create a VectorField object with nothing to graph. The functions and other values can be set later. The default display style is as a direction field of equal-length arrows.



VectorField
public VectorField(Function xFunc, Function yFunc)(Code)
Create a VectorField that will be displayed using the default style, as a direction field of equal-length arrows. If either of the functions is null, nothing will be displayed. If non-null, the functions must be functions of two variables.



VectorField
public VectorField(Function xFunc, Function yFunc, int style)(Code)
Create a VectorField with the specified functions and style.
Parameters:
  xFunc - A Function of two variables giving the x-component of the vector field. If thisis null, then nothing will be drawn.
Parameters:
  yFunc - A Function of two variables giving the y-component of the vector field. If thisis null, then nothing will be drawn.
Parameters:
  style - The style in which the direction field is drawn. This can be one of theconstants ARROWS (a direction field of equal-lenth arrows), LINES (equal length lines),CLAMPED_VECTORS (vectors drawn at actual length, unless too long), SCALED_VECTORS (vectors scaled so longest haslength equal to the grid spacing), or SCALED_LINES (lines scaled so longest has lengthequal to the grid spacing).




Method Detail
compute
public synchronized void compute()(Code)
Recompute data for the vector field and make sure that the area of the display canvas that shows the vector field is redrawn. This method is ordinarily called by a Controller.



draw
public synchronized void draw(Graphics g, boolean coordsChanged)(Code)
Draw the vector field (possibly recomputing the data if the CoordinateRect has changed).



getColor
public Color getColor()(Code)
Get the color that is used to draw the vector field.



getPixelSpacing
public int getPixelSpacing()(Code)
Get the value of the pixelSpacing property, which determines the grid spacing for the vector field.



getStyle
public int getStyle()(Code)
Get the style in which the vector field is displayed.



getXFunction
public Function getXFunction()(Code)
Get the (possibly null) function that gives the x-component of the vector field.



getYFunction
public Function getYFunction()(Code)
Get the (possibly null) function that gives the y-component of the vector field.



setColor
public void setColor(Color c)(Code)
Set the color to be used for drawing the vector field. The default color is light gray.



setFunctions
public synchronized void setFunctions(Function dx, Function dy)(Code)
Sets the functions that give the components of the vector field. If either function is null, then nothing is drawn. If non-null, each function must be a function of two variables.



setPixelSpacing
public void setPixelSpacing(int spacing)(Code)
Set the value of the pixelSpacing property, which determines the grid spacing for the vector field. The value will be clamped to the range from 5 to 200. The default value is 30.



setStyle
public void setStyle(int style)(Code)
Set the style in which the vector field is displayed. This should be one of the constants ARROWS, LINES, CLAMPED_VECTORS, SCALED_LINES, or SCALED_VECTORS.



setXFunction
public synchronized void setXFunction(Function dx)(Code)
Set the function that gives the x-component of the vector field. If this is null, then nothing is drawn. If non-null, it must be a function of two variables.



setYFunction
public synchronized void setYFunction(Function dy)(Code)
Set the function that gives the y-component of the vector field. If this is null, then nothing is drawn. If non-null, it must be a function of two variables.



Fields inherited from edu.hws.jcm.draw.Drawable
protected DisplayCanvas canvas(Code)(Java Doc)
protected CoordinateRect coords(Code)(Java Doc)

Methods inherited from edu.hws.jcm.draw.Drawable
abstract public void draw(Graphics g, boolean coordsChanged)(Code)(Java Doc)
public boolean getVisible()(Code)(Java Doc)
public void needsRedraw()(Code)(Java Doc)
protected void setOwnerData(DisplayCanvas canvas, CoordinateRect coords)(Code)(Java Doc)
public void setVisible(boolean show)(Code)(Java Doc)

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.