Вторая лабораторная работа

This commit is contained in:
allllen4a 2023-12-05 13:19:54 +03:00
parent 27ffa4f629
commit da743af9ba
5 changed files with 0 additions and 10 deletions

View File

@ -2,7 +2,6 @@ package DoubleDeckerBus.DrawningObjects;
import DoubleDeckerBus.DirectionType; import DoubleDeckerBus.DirectionType;
import DoubleDeckerBus.Entities.EntityBus; import DoubleDeckerBus.Entities.EntityBus;
import java.util.Scanner;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.util.Random; import java.util.Random;
@ -16,8 +15,6 @@ public class DrawningBus {
protected int _startPosY; protected int _startPosY;
protected int _busWidth = 160; protected int _busWidth = 160;
protected int _busHeight = 100; protected int _busHeight = 100;
private IDraw DrawningDoor; private IDraw DrawningDoor;
public EntityBus EntityBus() { public EntityBus EntityBus() {
@ -28,7 +25,6 @@ public class DrawningBus {
if (width <= _busWidth || height <= _busHeight) { if (width <= _busWidth || height <= _busHeight) {
return; return;
} }
_startPosX = 0; _startPosX = 0;
_startPosY = 0; _startPosY = 0;
busPanel.setSize(width, height); busPanel.setSize(width, height);
@ -76,7 +72,6 @@ public class DrawningBus {
} }
DrawningDoor.ChangeDoorsNumber(random.nextInt(2, 6)); DrawningDoor.ChangeDoorsNumber(random.nextInt(2, 6));
} }
public void SetPosition(int x, int y){ public void SetPosition(int x, int y){
if (x < 0 || x + _busWidth > _pictureWidth) if (x < 0 || x + _busWidth > _pictureWidth)
{ {

View File

@ -22,7 +22,6 @@ public class DrawningDoor implements IDraw {
blackColor = Color.BLACK; blackColor = Color.BLACK;
BusPanel = busPanel; BusPanel = busPanel;
} }
public void ChangeX(int x){ public void ChangeX(int x){
CurX = x; CurX = x;
} }
@ -41,7 +40,6 @@ public class DrawningDoor implements IDraw {
DoorNumberType = DoorNumberType.Five; DoorNumberType = DoorNumberType.Five;
} }
} }
public DoorNumberType DoorNumberType() { public DoorNumberType DoorNumberType() {
return DoorNumberType; return DoorNumberType;
} }

View File

@ -50,7 +50,6 @@ public class DrawningDoorOval implements IDraw {
Graphics2D g2d = (Graphics2D)BusPanel.getGraphics(); Graphics2D g2d = (Graphics2D)BusPanel.getGraphics();
g2d.fillOval(x, y, 10, 20); g2d.fillOval(x, y, 10, 20);
} }
public void DrawDoors() { public void DrawDoors() {
Graphics2D g2d = (Graphics2D) BusPanel.getGraphics(); Graphics2D g2d = (Graphics2D) BusPanel.getGraphics();
g2d.setColor(blackColor); g2d.setColor(blackColor);

View File

@ -13,7 +13,6 @@ public class DrawningDoorTriangle implements IDraw {
private int Height; private int Height;
public int CurX; public int CurX;
public int CurY; public int CurY;
public DrawningDoorTriangle(int width, int height, int curX, int curY, JPanel busPanel) { public DrawningDoorTriangle(int width, int height, int curX, int curY, JPanel busPanel) {
Width = width; Width = width;
Height = height; Height = height;

View File

@ -13,7 +13,6 @@ import java.io.IOException;
import java.util.Random; import java.util.Random;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.swing.*; import javax.swing.*;
public class FormDoubleDeckerBus { public class FormDoubleDeckerBus {
static DrawningBus DrawningBus; static DrawningBus DrawningBus;
static AbstractStrategy _abstractStrategy; static AbstractStrategy _abstractStrategy;