Мелкие правки по оформлению.

This commit is contained in:
Programmist73 2022-11-17 23:34:35 +04:00
parent d16579ac96
commit a881f5389e
9 changed files with 20 additions and 23 deletions

View File

@ -60,6 +60,7 @@ public abstract class AbstractMap
int rightCell = (int)(cortege[2] / _size_x);
int step = (int)_drawingObject.Step();
boolean canMove = true;
switch (direction)
{
case Left:
@ -111,10 +112,12 @@ public abstract class AbstractMap
}
break;
}
if (canMove)
{
_drawingObject.MoveObject(direction);
}
return DrawMapWithObject();
}

View File

@ -8,7 +8,7 @@ public enum Direction
private final int DirectionCode;
private Direction(int directionCode)
Direction(int directionCode)
{
this.DirectionCode = directionCode;
}

View File

@ -38,18 +38,18 @@ public class DrawingAirbus extends DrawingPlane
if (airbus.AddСompartment)
{
g2d.setPaint(airbus.AddColor);
g.fillRect((int)_startPosX + 30, (int)_startPosY + 12, 14, 3);
g2d.fillRect((int)_startPosX + 30, (int)_startPosY + 12, 14, 3);
g2d.setPaint(Color.BLACK);
g.drawRect((int)_startPosX + 30, (int)_startPosY + 12, 14, 3);
g2d.drawRect((int)_startPosX + 30, (int)_startPosY + 12, 14, 3);
}
//дополнительный двигатель
if (airbus.AddEngine)
{
g2d.setPaint(airbus.AddColor);
g.fillOval((int)_startPosX + 24, (int)_startPosY + 22, 10, 5);
g2d.fillOval((int)_startPosX + 24, (int)_startPosY + 22, 10, 5);
g2d.setPaint(Color.BLACK);
g.drawOval((int)_startPosX + 24, (int)_startPosY + 22, 10, 5);
g2d.drawOval((int)_startPosX + 24, (int)_startPosY + 22, 10, 5);
}
}
}

View File

@ -18,7 +18,6 @@ public class DrawingPlane extends JPanel
public void SetFormEnum()
{
Random rnd = new Random();
int numbEnum = rnd.nextInt(1, 4);
if(numbEnum == 1)

View File

@ -4,13 +4,15 @@ public class EntityPlane
{
//скорость
public int Speed;
public int GetSpeed(){
public int GetSpeed()
{
return Speed;
}
//вес
public float Weight;
public float GetWeight(){
public float GetWeight()
{
return Weight;
}

View File

@ -44,12 +44,12 @@ public class FormMapWithSetPlanesGeneric {
public FormMapWithSetPlanesGeneric()
{
/*super("Хранилище");*/
CreateWindow();
_mapsCollection = new MapsCollection(730, 650);
ComboBoxSelectorMap.removeAllItems();
for (String elem : _mapsHashMap.keySet()) {
for (String elem : _mapsHashMap.keySet())
{
ComboBoxSelectorMap.addItem(elem);
}
}
@ -366,7 +366,8 @@ public class FormMapWithSetPlanesGeneric {
});
}
private void createUIComponents() {
private void createUIComponents()
{
DefaultListModel<String> defListMod = new DefaultListModel<String>();
ListBoxMaps = new JList(defListMod);
}

View File

@ -34,7 +34,6 @@ public class FormParam extends JFrame
return new DrawingTriangleAirplaneWindow();
}
//if r == 2
return new DrawingRectAirplaneWindow();
}

View File

@ -46,6 +46,7 @@ public class MapWithSetPlanesGeneric <T extends IDrawningObject, U extends Abstr
{
T temp = _setPlanes.Remove(position);
_deletePlane.add(temp);
return temp;
}
@ -56,6 +57,7 @@ public class MapWithSetPlanesGeneric <T extends IDrawningObject, U extends Abstr
Graphics gr = bmp.getGraphics();
DrawBackground(gr);
DrawPlanes(gr);
return bmp;
}
@ -124,7 +126,7 @@ public class MapWithSetPlanesGeneric <T extends IDrawningObject, U extends Abstr
//заливаем область в цвет бетона
g2d.setPaint(Color.LIGHT_GRAY);
g.fillRect(0, 0, _pictureWidth, _pictureHeight);
g2d.fillRect(0, 0, _pictureWidth, _pictureHeight);
g2d.setStroke(new BasicStroke(3));
g2d.setColor(Color.BLACK);
@ -171,21 +173,19 @@ public class MapWithSetPlanesGeneric <T extends IDrawningObject, U extends Abstr
g2d.setColor(new Color(0xFF, 0xB6, 0xC1));
int[] xPoint = {(i * 70 - 10) + 45, i * 70 - 10, i * 70 - 10};
int[] yPoint = {30, 50, 10};
g.fillPolygon(xPoint, yPoint, xPoint.length);
g2d.fillPolygon(xPoint, yPoint, xPoint.length);
g2d.setStroke(new BasicStroke(3));
g2d.setColor(Color.BLACK);
g2d.drawLine(i * 70 - 10, 10, i * 70 - 10, 80);
g2d.drawLine(i * 70 - 10, 10, (i * 70 - 10) + 45, 30);
g2d.drawLine(i * 70 - 10, 50, (i * 70 - 10) + 45, 30);
}
}
//метод прорисовки объеков
public void DrawPlanes(Graphics g)
{
int position = 0;
int currentWidth = 1;
int currentHeight = 6;

View File

@ -66,13 +66,6 @@ public class SetPlanesGeneric<T extends Object> implements Iterable<T>
return null;
}
/*
if (_places.get(position) == null)
{
return null;
}
*/
return _places.get(position);
}