Готовая 6ая лаба

This commit is contained in:
Никита Потапов 2023-12-19 13:32:53 +04:00
parent 354f9a97d0
commit b8d9d10bd8
4 changed files with 10 additions and 5 deletions

View File

@ -68,7 +68,8 @@ public class DrawingPlane extends JPanel {
}
public void SetEnginesCount(int enginesCount) {
_drawingEngines.SetEnumEnginesCount(enginesCount);
if (_drawingEngines != null)
_drawingEngines.SetEnumEnginesCount(enginesCount);
}
public boolean CanMove(EnumDirectionType direction) {

View File

@ -2,7 +2,7 @@
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="ProjectStormtrooper.FormPlaneCollection">
<grid id="27dc6" binding="PanelWrapper" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="666" height="454"/>
<xy x="20" y="20" width="796" height="600"/>
</constraints>
<properties/>
<border type="none"/>
@ -10,7 +10,9 @@
<grid id="5f693" binding="PictureBoxCollection" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="Center"/>
<properties/>
<properties>
<minimumSize width="24" height="24"/>
</properties>
<border type="none"/>
<children/>
</grid>

View File

@ -37,8 +37,8 @@ public class FormPlaneCollection {
}
public FormPlaneCollection() {
PictureBoxCollection.setPreferredSize(new Dimension(600, 500));
_storage = new PlanesGenericStorage(600, 500);
PictureBoxCollection.setPreferredSize(new Dimension(800, 600));
_storage = new PlanesGenericStorage(800, 600);
_removedPlanes = new Stack<>();
buttonAddPlane.addActionListener(this::buttonAddPlaneClicked);
buttonRemovePlane.addActionListener(this::buttonRemovePlaneClicked);

View File

@ -107,6 +107,7 @@ public class PlanesGenericStorage {
);
if (plane == null || collection.Add(plane) == -1)
return false;
plane.SetDrawingBounds(1000, 1000);
}
_planeStorages.put(key, collection);
} catch (IOException e) {
@ -172,6 +173,7 @@ public class PlanesGenericStorage {
);
if (plane == null || collection.Add(plane) == -1)
return false;
plane.SetDrawingBounds(1000, 1000);
}
_planeStorages.put(record[0], collection);
}