public class AxisTitlePainterDefault extends Object implements IAxisTitlePainter
IAxisTitlePainter
implementation that will render
titles in a default way while adapting to x or y axis use.
For 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 type
Graphics
.
Graphics2D
Constructor and Description |
---|
AxisTitlePainterDefault()
Defcon.
|
Modifier and Type | Method and Description |
---|---|
int |
getHeight(IAxis<?> axis,
Graphics2D g2d)
Returns the height of this axis title in px with respect to the current
title of the given axis title.
|
int |
getWidth(IAxis<?> axis,
Graphics2D g2d)
Returns the width of this axis title in px with respect to the current
title of the given axis.
|
void |
paintTitle(IAxis<?> axis,
Graphics2D g)
TODO: This will not work for multiple axis in the same dimension and
position (overwriting titles)!
|
public int getHeight(IAxis<?> axis, Graphics2D g2d)
IAxisTitlePainter
getHeight
in interface IAxisTitlePainter
axis
- the instance this title painter is working for.g2d
- needed for size informations (e.g. font widths).IAxisTitlePainter.getHeight(info.monitorenter.gui.chart.IAxis,
java.awt.Graphics2D)
public int getWidth(IAxis<?> axis, Graphics2D g2d)
IAxisTitlePainter
getWidth
in interface IAxisTitlePainter
axis
- the instance this title painter is working for.g2d
- needed for size informations (e.g. font widths).IAxisTitlePainter.getWidth(info.monitorenter.gui.chart.IAxis,
java.awt.Graphics2D)
public void paintTitle(IAxis<?> axis, Graphics2D g)
paintTitle
in interface IAxisTitlePainter
axis
- the axis to paint the title of.g
- needed for size informations.IAxisTitlePainter.paintTitle(info.monitorenter.gui.chart.IAxis,
java.awt.Graphics2D)
Copyright © 2019. All rights reserved.