MainPanel prototype

This commit is contained in:
gac-S_Changer
2018-01-23 14:56:50 +01:00
parent 4b85b05b9a
commit 983520f388
12 changed files with 1982 additions and 16 deletions

View File

@@ -118,8 +118,11 @@ public class Sample extends DeviceBase {
return ret;
}
int getNormalDrawSize() {
return (int)((getSize().getWidth() / getPuck().getSize().getWidth()) * getPuck().getDrawSize());
}
int getDrawSize() {
int ret = (int)((getSize().getWidth() / getPuck().getSize().getWidth()) * getPuck().getDrawSize());
int ret = getNormalDrawSize();
if (isSelected()) {
ret += 2;
}
@@ -138,11 +141,12 @@ public class Sample extends DeviceBase {
Color getLabelColor() {
return Color.BLACK;
return Color.DARK_GRAY;
}
Font getLabelFont() {
return new Font("Times New Roman", Font.PLAIN, 9);
//return new Font("Times New Roman", Font.PLAIN, 8);
return new Font("Courier New", Font.PLAIN, 8);
}
Point getLabelPosition(String text, Graphics g) {
@@ -170,10 +174,12 @@ public class Sample extends DeviceBase {
g.drawOval(position.x - size / 2, position.y - size / 2, size, size);
String text = String.valueOf(index + 1);
Point labelPosition = getLabelPosition(text, g);
g.setColor(getLabelColor());
g.setFont(getLabelFont());
g.drawString(text, labelPosition.x, labelPosition.y);
Point labelPosition = getLabelPosition(text, g);
if (getNormalDrawSize()>10){
g.setColor(getLabelColor());
g.setFont(getLabelFont());
g.drawString(text, labelPosition.x, labelPosition.y);
}
g.setPaintMode();
}