PIbd-21_Bakalskaya_E.D._Ele.../ProjectElectricLocomotive/DrawingWheel.java

27 lines
689 B
Java

package ProjectElectricLocomotive;
import java.awt.*;
public class DrawingWheel implements IDrawingWheels {
private WheelsCount _wheelsCount;
public void SetWheelsCount(int wheelsCount) {
for (WheelsCount val : WheelsCount.values()) {
if (val.count == wheelsCount) {
_wheelsCount = val;
return;
}
}
this._wheelsCount = WheelsCount.Three;
}
@Override
public WheelsCount GetWheelsCount() {
return _wheelsCount;
}
public void DrawWheel(Graphics2D g2d, Color color, int x, int y, int w, int h) {
g2d.setColor(Color.BLACK);
g2d.fillOval(x, y, w, h);
}
}