Java Doc for CoordSystem.java in  » Chart » charting-0.94 » de » progra » charting » 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 » Chart » charting 0.94 » de.progra.charting 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   de.progra.charting.render.AbstractRenderer
      de.progra.charting.CoordSystem

CoordSystem
public class CoordSystem extends AbstractRenderer (Code)
This class defines a coordinate system. The CoordSystem class computes an AffineTransform for each y-axis, which translates the user space coordinates (ie. the data value coordinates) into pixel space coordinates. These AffineTransform classes make the PixelToPointTranslator obsolete, since it provides more flexibility. getDefaultTransform always computes the default transformation, whereas you can set another transformation via setTransform. This will be used to implement zooming and panning in the Swing classes.

All classes incl. this one, which render data will use the transformations to translate the coordinates. The transformations are not set up on instantiation of a CoordSystem, instead they're computed when setBounds is called, because they need this information of course. Afterwards you can set your own transformation or even better you can manipulate the existing ones by pre- or postconcatenating another AffineTransform.



Field Summary
final public  intARROWLENGTH
     The arrow length constant.
final public static  intFIRST_YAXIS
    
final public  intMINIMALMARGIN
     The minimal margin constant.
final public static  intSECOND_YAXIS
    
protected  intbottommargin
     The bottom margin.
protected  CoordSystemUtilitiesc
     The utilities class, which contains all the rendering methods etc.
protected  ChartDataModelConstraintsconstraints
     The ChartDataModel constraints of the first y-axis and the x-axis.
protected  ChartDataModelConstraintsconstraints2
     The ChartDataModel constraints of the second y-axis and the x-axis.
protected  DecimalFormatdfX
    
protected  DecimalFormatdfY
    
protected  Fontfont
     The Font used in the CoordSystem.
final protected  FontRenderContextfrc
    
protected  intleftmargin
    
protected  ChartDataModelmodel
     The DataModel class.
protected  intrightmargin
     The right margin.
protected  booleanshouldDrawArrows
    
protected  booleanshouldPaintAltTick
    
protected  booleanshouldPaintLabels
     If true, the labels will be painted.
protected  booleanshouldPaintOnlyTick
     if true only the tick will be painted on the yaxis.
protected  inttopmargin
     The top margin.
protected  Axisxaxis
     The xaxis.
protected  Stringxaxis_unit
     The x-axis caption string.
protected  AffineTransformy1transform
     The multiplication matrix for the first y-axis and the x-axis.
protected  AffineTransformy2transform
     The multiplication matrix for the second y-axis and the x-axis.
protected  Axisyaxis
     The first y-axis.
protected  Axisyaxis2
     The second y-axis.
protected  Stringyaxis_unit
     The y-axis caption string.

Constructor Summary
public  CoordSystem(ChartDataModel cdm)
     Creates a new CoordSystem using the given model constraints. Also creates default linear x and y-axis.
public  CoordSystem(ChartDataModel c, String xunit, String yunit)
     Creates a new CoordSystem using the given model constraints. Also creates default linear x and y-axis.
public  CoordSystem(ChartDataModel c, DecimalFormat yAxisFormat, boolean drawArrows, boolean paintAltYTick, boolean paintOnlyYTick)
     Create a new CoordSystem with alternate painting parameters.

Method Summary
protected  intgetBottomMargin()
     Returns the bottom margin.
public  ChartDataModelConstraintsgetChartDataModelConstraints(int axis)
     Returns the used ChartDataModelConstraints.
public  AffineTransformgetDefaultTransform(int axis)
     This method computes the default transform which transforms the user space coordinates of this coordinate system to the pixel space coordinates used in the Graphics object.
public  AxisgetFirstYAxis()
     Returns the first y-axis.
public  FontgetFont()
     Returns the font used for the axis labels.
public  FontRenderContextgetFontRenderContext()
    
public  RectanglegetInnerBounds()
     Returns the inner margin, ie the bounds minus the margins.
protected  intgetLeftMargin()
     Returns the left margin.
public  PointToPixelTranslatorgetPointToPixelTranslator(int yaxis)
     Returns a new PointToPixelTranslator for the given axis.
public  DimensiongetPreferredSize()
     Returns the preferred size needed for the renderer.
protected  intgetRightMargin()
     Returns the right margin.
public  AxisgetSecondYAxis()
     Returns the second y-axis.
protected  intgetTopMargin()
     Returns the top margin.
public  AffineTransformgetTransform(int axis)
     Returns the currently defined AffineTransform for any y-axis.
public  AxisgetXAxis()
     Returns the x axis.
public  StringgetXAxisUnit()
     Gets the x-axis unit string.
public  DecimalFormatgetXDecimalFormat()
    
public  StringgetYAxisUnit()
     Gets the y-axis label.
public  DecimalFormatgetYDecimalFormat()
    
public  booleanisDrawArrows()
    
public  booleanisPaintAltTick()
    
public  booleanisPaintLabels()
    
public  booleanisPaintOnlyTick()
     if true only the tick will be painted on the yaxis.
public  voidpaintDefault(Graphics2D g)
     This method is called by the paint method to do the actual painting. The painting is supposed to start at point (0,0) and the size is always the same as the preferred size.
public  voidrender(Graphics2D g)
     Overrides the method to just call paintDefault.
public  voidsetBottomMargin(int margin)
     Sets the bottom margin.
public  voidsetBounds(Rectangle bounds)
     Computes all margins, initializes the length of the Axis and calls super.setBounds.
public  voidsetFirstYAxis(Axis a)
     Sets the left y-axis and computes the matrix transformation.
public  voidsetFont(Font f)
     Sets the font for the axis labels.
protected  voidsetLeftMargin(int margin)
     Sets the left margin.
public  voidsetPaintLabels(boolean label)
    
protected  voidsetRightMargin(int margin)
     Sets the right margin.
public  voidsetSecondYAxis(Axis a)
     Sets the second y-axis and computes the matrix transformation.
protected  voidsetTopMargin(int margin)
     Sets the top margin.
public  voidsetTransform(AffineTransform at, int axis)
     Sets the coordinate transformation for any y-coordinate.
public  voidsetXAxis(Axis a)
     Sets the x-axis.
public  voidsetXAxisUnit(String xunit)
     Sets the x-axis unit string.
public  voidsetYAxisUnit(String yunit)
     Sets the y-axis unit string.

Field Detail
ARROWLENGTH
final public int ARROWLENGTH(Code)
The arrow length constant.



FIRST_YAXIS
final public static int FIRST_YAXIS(Code)
the axis binding constant for the first y-axis



MINIMALMARGIN
final public int MINIMALMARGIN(Code)
The minimal margin constant.



SECOND_YAXIS
final public static int SECOND_YAXIS(Code)
the axis binding constant for the second y-axis



bottommargin
protected int bottommargin(Code)
The bottom margin.



c
protected CoordSystemUtilities c(Code)
The utilities class, which contains all the rendering methods etc.



constraints
protected ChartDataModelConstraints constraints(Code)
The ChartDataModel constraints of the first y-axis and the x-axis.



constraints2
protected ChartDataModelConstraints constraints2(Code)
The ChartDataModel constraints of the second y-axis and the x-axis.



dfX
protected DecimalFormat dfX(Code)
DecimalFormat used throught on the Xaxis of the CoordSystem



dfY
protected DecimalFormat dfY(Code)
DecimalFormat used throught on the Yaxis of the CoordSystem



font
protected Font font(Code)
The Font used in the CoordSystem.



frc
final protected FontRenderContext frc(Code)
FontRenderContext used througout the CoordSystem



leftmargin
protected int leftmargin(Code)
The left margin



model
protected ChartDataModel model(Code)
The DataModel class.



rightmargin
protected int rightmargin(Code)
The right margin.



shouldDrawArrows
protected boolean shouldDrawArrows(Code)
if true, the arrows will be drawn at the end of the axi



shouldPaintAltTick
protected boolean shouldPaintAltTick(Code)
if true, the increment will be painted at each tick mark



shouldPaintLabels
protected boolean shouldPaintLabels(Code)
If true, the labels will be painted. If false, only the ticks will display.



shouldPaintOnlyTick
protected boolean shouldPaintOnlyTick(Code)
if true only the tick will be painted on the yaxis. Alternately, if false, a light grey line will paint across the background of the chart.



topmargin
protected int topmargin(Code)
The top margin.



xaxis
protected Axis xaxis(Code)
The xaxis.



xaxis_unit
protected String xaxis_unit(Code)
The x-axis caption string.



y1transform
protected AffineTransform y1transform(Code)
The multiplication matrix for the first y-axis and the x-axis.



y2transform
protected AffineTransform y2transform(Code)
The multiplication matrix for the second y-axis and the x-axis.



yaxis
protected Axis yaxis(Code)
The first y-axis.



yaxis2
protected Axis yaxis2(Code)
The second y-axis.



yaxis_unit
protected String yaxis_unit(Code)
The y-axis caption string.




Constructor Detail
CoordSystem
public CoordSystem(ChartDataModel cdm)(Code)
Creates a new CoordSystem using the given model constraints. Also creates default linear x and y-axis. Note that the length of the axis are set on the first call to setBounds().
Parameters:
  c - the ChartDataModel needed to compute the DataConstraints.



CoordSystem
public CoordSystem(ChartDataModel c, String xunit, String yunit)(Code)
Creates a new CoordSystem using the given model constraints. Also creates default linear x and y-axis. Note that the length of the axis are set on the first call to setBounds().
Parameters:
  c - the ChartDataModel needed to compute the DataConstraints.
Parameters:
  xtext - the x-axis unit
Parameters:
  ytext - the y-axis unit



CoordSystem
public CoordSystem(ChartDataModel c, DecimalFormat yAxisFormat, boolean drawArrows, boolean paintAltYTick, boolean paintOnlyYTick)(Code)
Create a new CoordSystem with alternate painting parameters.
Parameters:
  c - the ChartDataModel needed to compute the DataConstraints.
Parameters:
  drawArrows - if true the arrows will be drawn at the end of the axis
Parameters:
  paintAltYTick - if true the caption will paint on alternate ticks of the yaxis instead of on every one.
Parameters:
  paintOnlyYTick - if true the horizontal lightgray line will notappear behind the chart at each yaxis tick mark.




Method Detail
getBottomMargin
protected int getBottomMargin()(Code)
Returns the bottom margin.



getChartDataModelConstraints
public ChartDataModelConstraints getChartDataModelConstraints(int axis)(Code)
Returns the used ChartDataModelConstraints.



getDefaultTransform
public AffineTransform getDefaultTransform(int axis)(Code)
This method computes the default transform which transforms the user space coordinates of this coordinate system to the pixel space coordinates used in the Graphics object. All rendering in the CoordinateSystem and the ChartRenderers will rely on this transform.
Parameters:
  axis - defines which y-axis to use.



getFirstYAxis
public Axis getFirstYAxis()(Code)
Returns the first y-axis. the left y-axis



getFont
public Font getFont()(Code)
Returns the font used for the axis labels. the Font object



getFontRenderContext
public FontRenderContext getFontRenderContext()(Code)
Returns the FontRenderContext used througout the CoordSystem



getInnerBounds
public Rectangle getInnerBounds()(Code)
Returns the inner margin, ie the bounds minus the margins. a Rectangle object defining the inner bounds.



getLeftMargin
protected int getLeftMargin()(Code)
Returns the left margin.



getPointToPixelTranslator
public PointToPixelTranslator getPointToPixelTranslator(int yaxis)(Code)
Returns a new PointToPixelTranslator for the given axis. Please notice that this method is deprecated since release 0.92. The PointToPixelTranslator interface has been replaced with AffineTransforms.
Parameters:
  y - the y-axis identifier used to choose the right Point / Pixel ratio a PointToPixelTranslator object or null if the resultingPoint is not within the Bounds of the Coordinate System



getPreferredSize
public Dimension getPreferredSize()(Code)
Returns the preferred size needed for the renderer. a Dimension with the minimum Integer values.



getRightMargin
protected int getRightMargin()(Code)
Returns the right margin.



getSecondYAxis
public Axis getSecondYAxis()(Code)
Returns the second y-axis. the right y-axis



getTopMargin
protected int getTopMargin()(Code)
Returns the top margin.



getTransform
public AffineTransform getTransform(int axis)(Code)
Returns the currently defined AffineTransform for any y-axis.
Parameters:
  axis - the y-axis to be used.



getXAxis
public Axis getXAxis()(Code)
Returns the x axis. the x-axis



getXAxisUnit
public String getXAxisUnit()(Code)
Gets the x-axis unit string. the label String



getXDecimalFormat
public DecimalFormat getXDecimalFormat()(Code)
Returns the DecimalFormat used throught on the Xaxis of the CoordSystem



getYAxisUnit
public String getYAxisUnit()(Code)
Gets the y-axis label. the label String



getYDecimalFormat
public DecimalFormat getYDecimalFormat()(Code)
Returns the DecimalFormat used throught on the Yaxis of the CoordSystem



isDrawArrows
public boolean isDrawArrows()(Code)
if true, the arrows will be drawn at the end of the axis



isPaintAltTick
public boolean isPaintAltTick()(Code)
if true, the increment will be painted at each tick mark



isPaintLabels
public boolean isPaintLabels()(Code)



isPaintOnlyTick
public boolean isPaintOnlyTick()(Code)
if true only the tick will be painted on the yaxis. Alternately a light grey line will paint across the background of the chart.



paintDefault
public void paintDefault(Graphics2D g)(Code)
This method is called by the paint method to do the actual painting. The painting is supposed to start at point (0,0) and the size is always the same as the preferred size. The paint method performs the possible scaling.
Parameters:
  g - the Graphics2D object to paint in



render
public void render(Graphics2D g)(Code)
Overrides the method to just call paintDefault.
Parameters:
  g - the Graphics2D object to paint in



setBottomMargin
public void setBottomMargin(int margin)(Code)
Sets the bottom margin.
Parameters:
  margin - the new margin value



setBounds
public void setBounds(Rectangle bounds)(Code)
Computes all margins, initializes the length of the Axis and calls super.setBounds. Additionally, it sets the default AffineTransforms for every y-axis.
Parameters:
  bounds - Rectangle object defining the bounds



setFirstYAxis
public void setFirstYAxis(Axis a)(Code)
Sets the left y-axis and computes the matrix transformation.
Parameters:
  a - the left y-axis



setFont
public void setFont(Font f)(Code)
Sets the font for the axis labels.
Parameters:
  f - the Font to be used



setLeftMargin
protected void setLeftMargin(int margin)(Code)
Sets the left margin.
Parameters:
  margin - the new margin value



setPaintLabels
public void setPaintLabels(boolean label)(Code)



setRightMargin
protected void setRightMargin(int margin)(Code)
Sets the right margin.
Parameters:
  margin - the new margin value



setSecondYAxis
public void setSecondYAxis(Axis a)(Code)
Sets the second y-axis and computes the matrix transformation.
Parameters:
  a - the right y-axis



setTopMargin
protected void setTopMargin(int margin)(Code)
Sets the top margin.
Parameters:
  margin - the new margin value



setTransform
public void setTransform(AffineTransform at, int axis)(Code)
Sets the coordinate transformation for any y-coordinate.
Parameters:
  at - the AffineTransform that transforms the coordinates into pixelspace



setXAxis
public void setXAxis(Axis a)(Code)
Sets the x-axis.
Parameters:
  a - the x-axis



setXAxisUnit
public void setXAxisUnit(String xunit)(Code)
Sets the x-axis unit string.
Parameters:
  xtext - the unit string



setYAxisUnit
public void setYAxisUnit(String yunit)(Code)
Sets the y-axis unit string.
Parameters:
  ytext - the unit string



Methods inherited from de.progra.charting.render.AbstractRenderer
public Rectangle getBounds()(Code)(Java Doc)
abstract public void paintDefault(Graphics2D g)(Code)(Java Doc)
public void render(Graphics2D g)(Code)(Java Doc)
public void setBounds(Rectangle bounds)(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.