hope dies last...

This commit is contained in:
Галина Федоренко 2023-11-22 10:36:49 +04:00
parent 66e78a4fbf
commit 2b82b9c861
2 changed files with 12 additions and 14 deletions

View File

@ -37,12 +37,12 @@ public class Form4GenericDopClass extends JFrame {
canv.setBounds(0,0,pictureBoxWidth, pictureBoxHeight);
genericDopClass = new GenericDopClass<>(100, 100, pictureBoxWidth, pictureBoxHeight);
genericDopClass.addPlane(new EntityPlane(100, 100, Color.BLUE, 30));
genericDopClass.addPlane(new EntityPlane(100, 100, Color.RED, 10));
genericDopClass.addPlane(new EntityPlane(100, 100, Color.GRAY, 20));
genericDopClass.addPlane(new EntityHydroplane(100, 100, Color.BLUE, Color.ORANGE, true, true, 20));
genericDopClass.addWindow(new WindowDrawing());
genericDopClass.addWindow(new WindowDrawingTringle());
genericDopClass.Add(new EntityPlane(100, 100, Color.BLUE, 30));
genericDopClass.Add(new EntityPlane(100, 100, Color.RED, 10));
genericDopClass.Add(new EntityPlane(100, 100, Color.GRAY, 20));
genericDopClass.Add(new EntityHydroplane(100, 100, Color.BLUE, Color.ORANGE, true, true, 20));
genericDopClass.Add(new WindowDrawing());
genericDopClass.Add(new WindowDrawingTringle());
JButton creatButton = new JButton("createButton");
creatButton.addActionListener(

View File

@ -28,22 +28,20 @@ public class GenericDopClass<T extends EntityPlane, U extends IWindowDrawing> {
random = new Random();
}
public boolean addPlane(T plane){
public void Add(T plane){
if (plane == null)
return false;
return;
if (countPlanes > maxCountPlanes)
return false;
return;
Planes.add(countPlanes++, plane);
return true;
}
public boolean addWindow(U window){
public void Add(U window){
if (window == null)
return false;
return;
if (countWindows > maxCountWindows)
return false;
return;
Windows.add(countWindows++, window);
return true;
}
public DrawingPlane getRDrawingObject(){