44 lines
1.4 KiB
Java
44 lines
1.4 KiB
Java
package Drawnings;
|
|
|
|
import Entities.EntityPlane;
|
|
|
|
import java.awt.*;
|
|
|
|
public class DrawningPlane extends DrawningAirbus {
|
|
|
|
public DrawningPlane(int speed, float weight, Color bodyColor, int countPortholes, Color additionalColor, boolean isCompartment, boolean isAdditionalEngine, int width, int height)
|
|
{
|
|
super(speed, weight, bodyColor, countPortholes, width, height);
|
|
if (entityAirbus != null) {
|
|
entityAirbus = new EntityPlane(speed, weight, bodyColor, additionalColor, isCompartment, isAdditionalEngine);
|
|
}
|
|
}
|
|
@Override
|
|
public void DrawTransport(Graphics2D g) {
|
|
|
|
if (entityAirbus == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
Color additionalColor = ((EntityPlane)entityAirbus).getAdditionalColor();
|
|
// пассажирский отсек
|
|
if (((EntityPlane)entityAirbus).IsCompartment()) {
|
|
g.setColor(additionalColor);
|
|
g.fillOval(_startPosX + 57, _startPosY + 11, 39, 9);
|
|
g.setColor(Color.BLACK);
|
|
g.drawOval(_startPosX + 57, _startPosY + 11, 39, 9);
|
|
}
|
|
|
|
super.DrawTransport(g);
|
|
|
|
// доп двигатель
|
|
if (((EntityPlane)entityAirbus).IsAdditionalEngine()) {
|
|
g.setColor(additionalColor);
|
|
g.fillOval(_startPosX, _startPosY + 25, 11, 5);
|
|
g.setColor(Color.BLACK);
|
|
g.drawOval(_startPosX, _startPosY + 25, 11, 5);
|
|
}
|
|
}
|
|
}
|