gn="justify">
import util. ItemTemplate;
import core. Boss;
import core. Packer;
import core. Store;
/**
* Графічний інтерфейс.
* @ author AtemB
*
*/
public class GUI {
private JFrame mainFrame;
private ObjectCreatorViewer oViewer;
private ParetoLayersViewer pViewer;
private ItemsViewer iViewer;
private ResultViewer rViewer;
private Store store;
public GUI (Store store, Packer packer, Boss boss, ContainerTemplate ct, ItemTemplate it) {
this . store=store; tabbedPane= new JTabbedPane ();= new ObjectCreatorViewer ( this , this . store, ct, it, 40,8);= new ItemsViewer (store. getContainers (), store. getItemsInstance (), packer, boss);= new ParetoLayersViewer ( this , store, packer);= new ResultViewer ( this , store, packer, boss);
this . mainFrame= new JFrame ( Упаковка об'єктів ) ;. addTab ( Завдання вихідних даних raquo ;, oViewer. getViewer ()) ;. addTab ( Об'єкти і контейнери raquo ;, iViewer. getViewer ()) ;. addTab ( Шари Парето raquo ;, pViewer. getViewer ()) ;. addTab ( Результати упаковки raquo ;, rViewer. getViewer ());
this . mainFrame. setSize (1000, 550);
this . mainFrame. add (tabbedPane);
this . mainFrame. setDefaultCloseOperation (JFrame. EXIT_ON_CLOSE );
this . mainFrame. setVisible ( true );
}
public void refreshItemsViewer () {. refreshTables (store. getContainers (), store. getItemsInstance ());
}
}. java
package gui;
import java. awt. GridBagConstraints;
import java. awt. GridBagLayout;
import java. awt. Insets;
import java. awt. event. ActionEvent;
import java. awt. event. ActionListener;
import java. awt. event. MouseWheelEvent;
import java. awt. event. MouseWheelListener;
import java. util. HashMap;
import java. util. Map;
import javax. swing. BorderFactory;
import javax. swing. JButton;
import javax. swing. JLabel;
import javax. swing. JPanel;
import javax. swing. JSpinner;
import javax. swing. SpinnerNumberModel;
import util. ContainerTemplate;
import util. ItemTemplate;
import core. Store;
class ObjectCreatorViewer {
private JPanel viewer;
private JPanel containersPanel;
private JSpinner containersNum;
private JSpinner cVolume;
private JSpinner cargo;
private JPanel itemsPanel;
private JSpinner itemsNum;
private JSpinner iVolume;
private JSpinner weight;
private JButton createButton;
private Store store;
private ContainerTemplate ct;
private ItemTemplate it;
private int topItemsNum;
private int topContai...