back compatibility

This commit is contained in:
bancika
2012-08-30 09:42:42 +00:00
parent 894f070fee
commit 6d79b453de
@@ -51,7 +51,7 @@ public class Label extends AbstractComponent<Void> {
int x = point.x; int x = point.x;
int y = point.y; int y = point.y;
switch (verticalAlignment) { switch (getVerticalAlignment()) {
case CENTER: case CENTER:
y = point.y - textHeight / 2 + fontMetrics.getAscent(); y = point.y - textHeight / 2 + fontMetrics.getAscent();
break; break;
@@ -63,9 +63,9 @@ public class Label extends AbstractComponent<Void> {
break; break;
default: default:
throw new RuntimeException("Unexpected alignment: " throw new RuntimeException("Unexpected alignment: "
+ verticalAlignment); + getVerticalAlignment());
} }
switch (horizontalAlignment) { switch (getHorizontalAlignment()) {
case CENTER: case CENTER:
x = point.x - textWidth / 2; x = point.x - textWidth / 2;
break; break;
@@ -77,7 +77,7 @@ public class Label extends AbstractComponent<Void> {
break; break;
default: default:
throw new RuntimeException("Unexpected alignment: " throw new RuntimeException("Unexpected alignment: "
+ horizontalAlignment); + getHorizontalAlignment());
} }
g2d.drawString(text, x, y); g2d.drawString(text, x, y);