Integer [] {singleItemBottomWeight, singleItemTopWeight}) ;. add (
new JLabel ( Вага одного об'єкта, max ( + singleItemBottomWeight + - + singleItemTopWeight + ): )) ;. add (weight);=
new JPanel (
new GridBagLayout ()) ;. add (itemsNumPanel,
new GridBagConstraints (0, 0, 1, 1, 0, 0, GridBagConstraints. NORTHWEST ,. NONE ,
new Insets (5, 5, 5,5), 0, 0)) ;. add (iVolumePanel,
new GridBagConstraints (0, 1, 1, 1, 0, 0, GridBagConstraints. NORTHWEST ,. NONE ,
new Insets (5, 5, 5,5), 0, 0)) ;. add (weightPanel,
new GridBagConstraints (0, 2, 1, 1, 0, 0, GridBagConstraints. NORTHWEST ,. NONE ,
new Insets (5, 5, 5,5), 0, 0)) ;. setBorder (BorderFactory. createTitledBorder ( Створення об'єктів ));=
new JButton ( Створити ) ;. addActionListener (
new ActionListener () {
@ Override
public void actionPerformed (ActionEvent arg0) {s=ObjectCreatorViewer. this . store ;. setEmpty () ;. createContainers (getSpinnerValue (containersNum), ObjectCreatorViewer. this . ct, getSpinnerValue (cVolume), getSpinnerValue (cargo));
//LayouterLauncher. printContainersSumParameters (s. getContainers ()) ;. createItems (getSpinnerValue (itemsNum), ObjectCreatorViewer. this . it, getSpinnerValue (iVolume), getSpinnerValue (weight));
//LayouterLauncher. printItemsSumParameters (s. getItems ()) ;. this . gui. refreshItemsViewer ();
}
});= new JPanel ( new GridBagLayout ()) ;. add (containersPanel, new GridBagConstraints (0, 0, 1, 1, 1, 1, GridBagConstraints. NORTHWEST , GridBagConstraints. < i align="justify"> VERTICAL , new Insets (5, 5, 5,5), 0, 0)) ;. add (itemsPanel, new GridBagConstraints (1, 0, 1, 1, 1, 1, GridBagConstraints. NORTHEAST , GridBagConstraints. < i align="justify"> VERTICAL , new Insets (5, 5, 5,5), 0, 0)) ;. add (createButton, new GridBagConstraints (1, 1, 1, 1, 0, 0, GridBagConstraints. SOUTHEAST , GridBagConstraints. < i align="justify"> NONE , new Insets (5, 5, 5,5), 0, 0));
}
/**
* @ return the viewer
*/
public JPanel getViewer () {
return viewer;
}
private int getSpinnerValue (JSpinner s) {
return ((SpinnerNumberModel) s. getModel ()). getNumber (). intValue ();
}
int getContainersNum () {
return getSpinnerValue (containersNum);
}
int getMaxContainerVolume () {
return getSpinnerValue (cVolume);
}
int getMaxCargo () {
return getSpinnerValue (cargo);
}
int getItemsNum () {
return getSpinnerValue (itemsNum);
}
int getMaxItemVolume () {
return getSpinnerValue (iVolume);
}
int getMaxWeight () {
return getSpinnerValue (weight);
}
/**
* @ return the topItemsNum
*/
public int getTopItemsNum () {
return topItemsNum;
}
/**