MainPanel prototype

This commit is contained in:
gac-S_Changer
2018-04-10 09:50:23 +02:00
parent fd15d2cf48
commit 1e2fee44d0
7 changed files with 75 additions and 37 deletions

View File

@@ -206,8 +206,8 @@ public class Puck extends DeviceBase {
);
}
Color getLabelColor() {
return Color.BLACK;
Color getLabelColor(boolean drawBackground) {
return drawBackground ? Color.BLACK : new Color (0,196,0);
}
Font getLabelFont() {
@@ -230,13 +230,16 @@ public class Puck extends DeviceBase {
return new Point(center.x - textSize.width / 2, center.y + (g.getFontMetrics().getAscent()/2));
}
Color getBorderColor() {
if (!isEnabled()){
Color getBorderColor(boolean drawBackground) {
if (drawBackground){
if (!isEnabled()){
return Color.GRAY;
} else if (isSelected()){
return new Color(32,32,32);
}
return Color.GRAY;
} else if (isSelected()){
return new Color(32,32,32);
}
return Color.GRAY;
}
return isSelected() ? new Color(0,32,0) : new Color(0,128,0);
}
int getReferenceDrawSize() {
@@ -263,7 +266,7 @@ public class Puck extends DeviceBase {
g.setColor(getColor());
g.fillOval(position.x - size / 2, position.y - size / 2, size, size);
}
g.setColor(getBorderColor());
g.setColor(getBorderColor(drawBackground));
g.drawOval(position.x - size / 2, position.y - size / 2, size, size);
if (drawSamples){
@@ -287,7 +290,7 @@ public class Puck extends DeviceBase {
//Draw text
String text = String.valueOf(getIndex() + 1);
Point labelPosition = getLabelPosition(text, g);
g.setColor(getLabelColor());
g.setColor(getLabelColor(drawBackground));
if (drawId){
String id = getId();
if (id!=null) {