Drawing over image

This commit is contained in:
2018-04-09 16:14:22 +02:00
parent ee310ea7bd
commit fd15d2cf48
6 changed files with 191 additions and 70 deletions

View File

@@ -255,19 +255,21 @@ public class Puck extends DeviceBase {
Rectangle plotRect;
void draw (Graphics2D g, Rectangle plotRect, boolean drawSamples, boolean drawId, BasePlate enclosingPlate){
void draw (Graphics2D g, Rectangle plotRect, boolean drawSamples, boolean drawId, boolean drawBackground, BasePlate enclosingPlate){
this.plotRect = plotRect;
Point position = getDrawPosition();
int size = getDrawSize();
g.setColor(getColor());
g.fillOval(position.x - size / 2, position.y - size / 2, size, size);
if (drawBackground){
g.setColor(getColor());
g.fillOval(position.x - size / 2, position.y - size / 2, size, size);
}
g.setColor(getBorderColor());
g.drawOval(position.x - size / 2, position.y - size / 2, size, size);
if (drawSamples){
//Draw samples
for (Sample sample: getSamples()) {
sample.draw(g);
sample.draw(g, drawBackground);
}
}