Editable BOM color

This commit is contained in:
bancika
2012-08-23 16:00:50 +00:00
parent 0aea4c6eed
commit 34c9648b47
@@ -35,6 +35,7 @@ public class BOM extends AbstractComponent<Void> {
private Size size = DEFAULT_SIZE; private Size size = DEFAULT_SIZE;
private Point point = new Point(0, 0); private Point point = new Point(0, 0);
private Color color = COLOR;
@Override @Override
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode,
@@ -50,7 +51,7 @@ public class BOM extends AbstractComponent<Void> {
} }
g2d.setFont(LABEL_FONT); g2d.setFont(LABEL_FONT);
g2d.setColor(componentState == ComponentState.DRAGGING g2d.setColor(componentState == ComponentState.DRAGGING
|| componentState == ComponentState.SELECTED ? SELECTION_COLOR : COLOR); || componentState == ComponentState.SELECTED ? SELECTION_COLOR : color);
// Determine maximum name length and maximum value length to calculate // Determine maximum name length and maximum value length to calculate
// number of columns. // number of columns.
FontMetrics fontMetrics = g2d.getFontMetrics(); FontMetrics fontMetrics = g2d.getFontMetrics();
@@ -175,6 +176,18 @@ public class BOM extends AbstractComponent<Void> {
this.size = size; this.size = size;
} }
@EditableProperty
public Color getColor() {
if (color == null) {
color = COLOR;
}
return color;
}
public void setColor(Color color) {
this.color = color;
}
@Override @Override
public Void getValue() { public Void getValue() {
return null; return null;