AxisLocation rangeAxisLocation = plot.getRangeAxisLocation();
RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
domainAxisLocation, orientation);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
rangeAxisLocation, orientation);
Range xRange = domainAxis.getRange();
Range yRange = rangeAxis.getRange();
double anchorX = 0.0;
double anchorY = 0.0;
if (this.coordinateType == XYCoordinateType.RELATIVE) {
anchorX = xRange.getLowerBound() + (this.x * xRange.getLength());
anchorY = yRange.getLowerBound() + (this.y * yRange.getLength());
}
else {
anchorX = domainAxis.valueToJava2D(this.x, dataArea, domainEdge);
anchorY = rangeAxis.valueToJava2D(this.y, dataArea, rangeEdge);
}
float j2DX = (float) domainAxis.valueToJava2D(anchorX, dataArea,
domainEdge);
float j2DY = (float) rangeAxis.valueToJava2D(anchorY, dataArea,
rangeEdge);
float xx = 0.0f;
float yy = 0.0f;
if (orientation == PlotOrientation.HORIZONTAL) {
xx = j2DY;
yy = j2DX;
}
else if (orientation == PlotOrientation.VERTICAL) {
xx = j2DX;
yy = j2DY;
}
double maxW = dataArea.getWidth();
double maxH = dataArea.getHeight();
if (this.coordinateType == XYCoordinateType.RELATIVE) {
if (this.maxWidth > 0.0) {
maxW = maxW * this.maxWidth;
}
if (this.maxHeight > 0.0) {
maxH = maxH * this.maxHeight;
}
}
if (this.coordinateType == XYCoordinateType.DATA) {
maxW = this.maxWidth;
maxH = this.maxHeight;
}
RectangleConstraint rc = new RectangleConstraint(
new Range(0, maxW), new Range(0, maxH));
Size2D size = this.title.arrange(g2, rc);
Rectangle2D titleRect = new Rectangle2D.Double(0, 0, size.width,
size.height);
Point2D anchorPoint = RectangleAnchor.coordinates(titleRect,