Revision: 3944
Author: [email protected]
Date: Wed Sep 8 09:03:21 2010
Log: Added colour change functionality to Architect labels.
http://code.google.com/p/power-architect/source/detail?r=3944
Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenLabel.java
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenLabel.java
Wed Aug 25 12:55:34 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPenLabel.java
Wed Sep 8 09:03:21 2010
@@ -91,7 +91,7 @@
if (isSelected()) {
g2.setColor(ColourScheme.SQLPOWER_ORANGE);
} else {
- g2.setColor(Color.BLACK);
+ g2.setColor(label.getBorderColour());
}
g2.drawRect(0, 0, getWidth(), getHeight());
g2.translate(insets.left, insets.top);
@@ -102,6 +102,12 @@
FontMetrics fm = g2.getFontMetrics();
int textHeight = fm.getHeight() * textToRender.length;
+ if (label.getForegroundColour() == null) {
+ g2.setColor(Color.BLACK);
+ } else {
+ g2.setColor(label.getForegroundColour());
+ }
+
double y =
label.getVerticalAlignment().calculateStartY(getHeight(), textHeight, fm);
for (String text : textToRender) {
int textWidth = (int) fm.getStringBounds(text,
g2).getWidth();
@@ -223,5 +229,7 @@
public SPLabel getLabel() {
return label;
}
+
+
}