| |
|
| 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.
|
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. |
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.
|
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.
|
leftmargin | protected int leftmargin(Code) | | The left margin
|
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_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.
|
yaxis2 | protected Axis yaxis2(Code) | | The second y-axis.
|
yaxis_unit | protected String yaxis_unit(Code) | | The y-axis caption string.
|
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. |
getBottomMargin | protected int getBottomMargin()(Code) | | Returns the bottom margin.
|
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 |
|
|
|