ПИбд-23 Кислица Егор Дмитриевич Лабораторная работа №1 (усложненная) #1

Closed
Egor wants to merge 16 commits from Laba1 into main
Showing only changes of commit fad7731fa2 - Show all commits

View File

@ -4,13 +4,10 @@ import javax.swing.*;
import java.awt.*;
public class DrawningEngines {
private int WheelSz;
JPanel AirFighterPanel;
private NumberType EnginesNumb;
private Color EngineColor;
public int CurX, CurY;
boolean Init( int curX, int curY, JPanel airfighterPanel){
CurX = curX;
@ -20,7 +17,6 @@ public class DrawningEngines {
return true;
}
public void ChangeEnginesNumb(int x){
if(x <= 1)
EnginesNumb = NumberType.Two;
@ -29,19 +25,15 @@ public class DrawningEngines {
if(x >= 3)
EnginesNumb = NumberType.Six;
}
public NumberType WheelsNumb(){
return EnginesNumb;
}
public void DrawEngines(){
Graphics2D g2d = (Graphics2D) AirFighterPanel.getGraphics();
g2d.setColor(EngineColor);
g2d.fillOval(CurX + 92,CurY - 15,25,10 );
g2d.fillOval(CurX + 92,CurY + 34,25,10 );
if (EnginesNumb == NumberType.Four || EnginesNumb == NumberType.Six)
{
g2d.fillOval(CurX + 86,CurY - 40,25,10 );
@ -49,13 +41,10 @@ public class DrawningEngines {
g2d.fillOval(CurX + 86,CurY +59,25,10 );
}
if (EnginesNumb == NumberType.Six)
{
g2d.fillOval(CurX + 128,CurY -7,25,10 );
g2d.fillOval(CurX + 128,CurY +25,25,10 );
}
}
}