Удалены лишние пробелы и комментарии. Сданная сложная Лаб 3

This commit is contained in:
Данила Мочалов 2022-10-25 16:59:53 +04:00
parent 55e0a35928
commit d66ca977a5
4 changed files with 0 additions and 15 deletions

View File

@ -20,8 +20,6 @@ public class FormEntityWithExtraGallery extends JComponent {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
add(statusPanel, BorderLayout.SOUTH); add(statusPanel, BorderLayout.SOUTH);
JButton showRandomEntity = new JButton("Create entity from parts"); JButton showRandomEntity = new JButton("Create entity from parts");
showRandomEntity.addActionListener(e -> { showRandomEntity.addActionListener(e -> {

View File

@ -56,7 +56,6 @@ public class FormLocomotive extends JComponent{
JButton selectLocomotiveButton = new JButton("Select"); JButton selectLocomotiveButton = new JButton("Select");
selectLocomotiveButton.addActionListener(e -> { selectLocomotiveButton.addActionListener(e -> {
SelectedLocomotive = _locomotive; SelectedLocomotive = _locomotive;
//TODO
caller.dispose(); caller.dispose();
}); });

View File

@ -16,7 +16,6 @@ public class FormMapWithSetLocomotives extends JComponent {
formFrame.setSize(750, 500); formFrame.setSize(750, 500);
formFrame.setLocationRelativeTo(null); formFrame.setLocationRelativeTo(null);
Panel statusPanel = new Panel(); Panel statusPanel = new Panel();
statusPanel.setBackground(Color.WHITE); statusPanel.setBackground(Color.WHITE);
statusPanel.setLayout(new GridLayout(0, 1, 20, 20)); statusPanel.setLayout(new GridLayout(0, 1, 20, 20));
@ -65,18 +64,13 @@ public class FormMapWithSetLocomotives extends JComponent {
{ {
return; return;
} }
// TODO
JDialog dialog = new JDialog(formFrame, "Dialog", true); JDialog dialog = new JDialog(formFrame, "Dialog", true);
FormLocomotive formLocomotive = new FormLocomotive(dialog); FormLocomotive formLocomotive = new FormLocomotive(dialog);
dialog.setSize(800, 500); dialog.setSize(800, 500);
dialog.setContentPane(formLocomotive); dialog.setContentPane(formLocomotive);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true); dialog.setVisible(true);
DrawningObjectLocomotive locomotive = new DrawningObjectLocomotive(formLocomotive.getSelectedLocomotive()); DrawningObjectLocomotive locomotive = new DrawningObjectLocomotive(formLocomotive.getSelectedLocomotive());
//TODO
if (_mapLocomotivesCollectionGeneric.Plus(locomotive) != -1) { if (_mapLocomotivesCollectionGeneric.Plus(locomotive) != -1) {
JOptionPane.showMessageDialog(formFrame, "Object added", "Success", JOptionPane.OK_CANCEL_OPTION); JOptionPane.showMessageDialog(formFrame, "Object added", "Success", JOptionPane.OK_CANCEL_OPTION);
bufferImg = _mapLocomotivesCollectionGeneric.ShowSet(); bufferImg = _mapLocomotivesCollectionGeneric.ShowSet();
@ -98,7 +92,6 @@ public class FormMapWithSetLocomotives extends JComponent {
catch (ParseException e) { catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
//Кнопка удаления локомотива //Кнопка удаления локомотива
JButton deleteLocomotiveButton = new JButton("Delete Locomotive"); JButton deleteLocomotiveButton = new JButton("Delete Locomotive");
JFormattedTextField finalMaskedTextFieldPosition = maskedTextFieldPosition; JFormattedTextField finalMaskedTextFieldPosition = maskedTextFieldPosition;
@ -122,7 +115,6 @@ public class FormMapWithSetLocomotives extends JComponent {
} }
}); });
statusPanel.add(deleteLocomotiveButton); statusPanel.add(deleteLocomotiveButton);
//Кнопка просмотра хранилища //Кнопка просмотра хранилища
JButton showStorageButton = new JButton("Show Storage"); JButton showStorageButton = new JButton("Show Storage");
showStorageButton.addActionListener(e -> { showStorageButton.addActionListener(e -> {
@ -135,7 +127,6 @@ public class FormMapWithSetLocomotives extends JComponent {
repaint(); repaint();
}); });
statusPanel.add(showStorageButton); statusPanel.add(showStorageButton);
//Кнопка просмотра карты //Кнопка просмотра карты
JButton showOnMapButton = new JButton("Show On Map"); JButton showOnMapButton = new JButton("Show On Map");
showOnMapButton.addActionListener(e -> { showOnMapButton.addActionListener(e -> {
@ -202,7 +193,6 @@ public class FormMapWithSetLocomotives extends JComponent {
formFrame.getContentPane().add(this); formFrame.getContentPane().add(this);
formFrame.setVisible(true); formFrame.setVisible(true);
//super.repaint();
} }
@Override @Override

View File

@ -29,7 +29,6 @@ public class MapWithSetLocomotivesGeneric
} }
/// Добавление /// Добавление
//TODO
public int Plus(T locomotive) public int Plus(T locomotive)
{ {
return this._setLocomotives.Insert(locomotive); return this._setLocomotives.Insert(locomotive);
@ -39,7 +38,6 @@ public class MapWithSetLocomotivesGeneric
{ {
return this._setLocomotives.Remove(position); return this._setLocomotives.Remove(position);
} }
/// Вывод всего набора объектов /// Вывод всего набора объектов
public BufferedImage ShowSet() public BufferedImage ShowSet()
{ {