1 | if (vertical) {↵ | | 1 | if (!vertical) {↵
|
2 | FontMetrics fm = g2.getFontMetrics(font);↵ | | 2 | FontMetrics fm = g2.getFontMetrics(font);↵
|
3 | Iterator iterator = ticks.iterator();↵ | | 3 | Iterator iterator = ticks.iterator();↵
|
4 | while (iterator.hasNext()) {↵ | | 4 | while (iterator.hasNext()) {↵
|
5 | Tick tick = (Tick) iterator.next();↵ | | 5 | Tick tick = (Tick) iterator.next();↵
|
6 | Rectangle2D labelBounds = TextUtilities.getTextBounds(↵ | | 6 | Rectangle2D labelBounds = TextUtilities.getTextBounds(↵
|
7 | tick.getText(), g2, fm);↵ | | 7 | tick.getText(), g2, fm);↵
|
8 | if (labelBounds.getWidth() + insets.getTop()↵ | | 8 | if (labelBounds.getWidth() + insets.getLeft()↵
|
9 | + insets.getBottom() > maxHeight) {↵ | | 9 | + insets.getRight() > maxWidth) {↵
|
10 | maxHeight = labelBounds.getWidth()↵ | | 10 | maxWidth = labelBounds.getWidth()↵
|
11 | + insets.getTop() + insets.getBottom();↵ | | 11 | + insets.getLeft() + insets.getRight();↵
|
12 | }↵ | | 12 | }↵
|
13 | }↵ | | 13 | }↵
|
14 | }↵ | | 14 | }↵
|
15 | else {↵ | | 15 | else {↵
|
16 | LineMetrics metrics = font.getLineMetrics("ABCxyz",↵ | | 16 | LineMetrics metrics = font.getLineMetrics("ABCxyz",↵
|
17 | g2.getFontRenderContext());↵ | | 17 | g2.getFontRenderContext());↵
|
18 | maxHeight = metrics.getHeight()↵ | | 18 | maxWidth = metrics.getHeight()↵
|
19 | + insets.getTop() + insets.getBottom();↵ | | 19 | + insets.getTop() + insets.getBottom();↵
|
20 | } | | 20 | }
|