if (index == 0) { position[1] = -0.1; axisLabel = new BaseLabel(label, 0.5, 1.0, position); } else { position[0] = -0.15; axisLabel = new BaseLabel(label, 0.5, 0.5, -Math.PI / 2, position); position[2] = 1.0; position[index] = 0.5; axisLabel = new BaseLabel(label, 0.5, -2.0, position); } else if (index == 1) { position[0] = 1.0; position[index] = 0.5; axisLabel = new BaseLabel(label, 0.5, 3.0, position); } else if (index == 2) { position[1] = 1.0; position[index] = 1.0; axisLabel = new BaseLabel(label, -0.5, -1.0, position); axisLabel.setFont(axisLabelFont);
/** * Returns the label of the axis. */ public String getAxisLabel() { if (axisLabel == null) { return null; } else { return axisLabel.getText(); } }
@Override public void paint(Graphics g) { Font f = g.getFont(); if (font != null) { g.setFont(font); } Color c = g.getColor(); g.setColor(getColor()); g.drawTextBaseRatio(text, horizontalReference, verticalReference, rotation, coord); g.setColor(c); if (font != null) { g.setFont(f); } } }
axisLabel.paint(g);