Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
XChart
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Brady James Garvin
XChart
Commits
d76c2f09
Commit
d76c2f09
authored
12 years ago
by
Tim Molter
Browse files
Options
Downloads
Patches
Plain Diff
trying to figure out ExceptionInInitializerError
parent
d13e826a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/xeiam/xchart/internal/chartpart/AxisTitle.java
+11
-4
11 additions, 4 deletions
...n/java/com/xeiam/xchart/internal/chartpart/AxisTitle.java
with
11 additions
and
4 deletions
src/main/java/com/xeiam/xchart/internal/chartpart/AxisTitle.java
+
11
−
4
View file @
d76c2f09
...
@@ -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
;
}
}
p
rotected
void
setText
(
String
text
)
{
p
ublic
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);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment