Class AxisTitlePainterDefault
- java.lang.Object
-
- info.monitorenter.gui.chart.axistitlepainters.AxisTitlePainterDefault
-
- All Implemented Interfaces:
IAxisTitlePainter,java.io.Serializable
public class AxisTitlePainterDefault extends java.lang.Object implements IAxisTitlePainter
Animplementation that will render titles in a default way while adapting to x or y axis use.IAxisTitlePainterFor x axis the title will be displayed centered below the axis. For y axis the title will be displayed rotated by 90 degrees centered left of the axis.
The y axis rotation will only be performed when the given
Object is of typeGraphics.Graphics2D- Version:
- $Revision: 1.14 $
- Author:
- Achim Westermann
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AxisTitlePainterDefault()Defcon.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHeight(IAxis<?> axis, java.awt.Graphics g2d)Returns the height of this axis title in px with respect to the current title of the given axis title.intgetWidth(IAxis<?> axis, java.awt.Graphics g2d)Returns the width of this axis title in px with respect to the current title of the given axis.voidpaintTitle(IAxis<?> axis, java.awt.Graphics g)TODO: This will not work for multiple axis in the same dimension and position (overwriting titles)!
-
-
-
Method Detail
-
getHeight
public int getHeight(IAxis<?> axis, java.awt.Graphics g2d)
Description copied from interface:IAxisTitlePainterReturns the height of this axis title in px with respect to the current title of the given axis title.- Specified by:
getHeightin interfaceIAxisTitlePainter- Parameters:
axis- the instance this title painter is working for.g2d- needed for size informations (e.g. font widths).- Returns:
- the height of this axis title in px with respect to the current title of the given axis.
- See Also:
IAxisTitlePainter.getHeight(info.monitorenter.gui.chart.IAxis, java.awt.Graphics)
-
getWidth
public int getWidth(IAxis<?> axis, java.awt.Graphics g2d)
Description copied from interface:IAxisTitlePainterReturns the width of this axis title in px with respect to the current title of the given axis.- Specified by:
getWidthin interfaceIAxisTitlePainter- Parameters:
axis- the instance this title painter is working for.g2d- needed for size informations (e.g. font widths).- Returns:
- the width of this axis title in px with respect to the current title of the given axis.
- See Also:
IAxisTitlePainter.getWidth(info.monitorenter.gui.chart.IAxis, java.awt.Graphics)
-
paintTitle
public void paintTitle(IAxis<?> axis, java.awt.Graphics g)
TODO: This will not work for multiple axis in the same dimension and position (overwriting titles)!- Specified by:
paintTitlein interfaceIAxisTitlePainter- Parameters:
axis- the axis to paint the title of.g- needed for size informations.- See Also:
IAxisTitlePainter.paintTitle(info.monitorenter.gui.chart.IAxis, java.awt.Graphics)
-
-