Skip to content
Snippets Groups Projects
Commit d76c2f09 authored by Tim Molter's avatar Tim Molter
Browse files

trying to figure out ExceptionInInitializerError

parent d13e826a
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ public class AxisTitle implements IChartPart, IHideable { ...@@ -33,7 +33,7 @@ public class AxisTitle implements IChartPart, IHideable {
protected final static int AXIS_TITLE_PADDING = 10; protected final static int AXIS_TITLE_PADDING = 10;
/** parent */ /** parent */
private Axis axis; private final Axis axis;
/** the title text */ /** the title text */
protected String text = ""; // default to "" protected String text = ""; // default to ""
...@@ -48,7 +48,7 @@ public class AxisTitle implements IChartPart, IHideable { ...@@ -48,7 +48,7 @@ public class AxisTitle implements IChartPart, IHideable {
private Rectangle bounds; private Rectangle bounds;
/** /**
* Constructor. * Constructor
* *
* @param axis the axis * @param axis the axis
*/ */
...@@ -63,7 +63,7 @@ public class AxisTitle implements IChartPart, IHideable { ...@@ -63,7 +63,7 @@ public class AxisTitle implements IChartPart, IHideable {
return text; return text;
} }
protected void setText(String text) { public void setText(String text) {
if (text.trim().equalsIgnoreCase("")) { if (text.trim().equalsIgnoreCase("")) {
this.isVisible = false; this.isVisible = false;
...@@ -105,7 +105,14 @@ public class AxisTitle implements IChartPart, IHideable { ...@@ -105,7 +105,14 @@ public class AxisTitle implements IChartPart, IHideable {
Rectangle nonRotatedRectangle = nonRotatedTextLayout.getPixelBounds(null, 0, 0); Rectangle nonRotatedRectangle = nonRotatedTextLayout.getPixelBounds(null, 0, 0);
// System.out.println(nonRotatedRectangle); // System.out.println(nonRotatedRectangle);
TextLayout rotatedTextLayout = new TextLayout(text, font.deriveFont(AffineTransform.getRotateInstance(Math.PI / -2.0, 0, 0)), frc); AffineTransform at = new AffineTransform();
// Tx.translate(anchorx, anchory); // S3: final translation
double theta = Math.PI / -2.0;
at.rotate(theta); // S2: rotate around anchor
// Tx.translate(-anchorx, -anchory); // S1: translate anchor to origin
Font derivedFont = font.deriveFont(at);
TextLayout rotatedTextLayout = new TextLayout(text, derivedFont, frc);
// TextLayout rotatedTextLayout = new TextLayout(text, font.deriveFont(AffineTransform.getRotateInstance(Math.PI / -2.0, 0, 0)), frc);
// Rectangle rotatedRectangle = rotatedTextLayout.getPixelBounds(null, 0, 0); // Rectangle rotatedRectangle = rotatedTextLayout.getPixelBounds(null, 0, 0);
// System.out.println(rotatedRectangle); // System.out.println(rotatedRectangle);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment