>
private Store store;
private Packer packer;
public ParetoLayersViewer (GUI gui, Store store, Packer packer) {
this . store=store;
this . packer=packer;
this . viewer= new JPanel ( new GridBagLayout ());
this . byUtilityBox= new JCheckBox ( За корисності raquo ;, false ) ;. addActionListener ( new ActionListener () {
@ Override
public void actionPerformed (ActionEvent arg0) {();
}
});
this . byVolumeBox= new JCheckBox ( За обсягом raquo ;, false );
this . byWeightBox= new JCheckBox ( За вагою raquo ;, false );
this . recountButton= new JButton ( Перерахувати ) ;. addActionListener ( new ActionListener () {
@ Override
public void actionPerformed (ActionEvent e) {(ParetoLayersViewer. this . store. getItemsClones ());
}
});= new JCheckBox ( Обробляти парні об'єкти raquo ;, true ); checkBoxesPanel = new JPanel () ;. add (byVolumeBox) ;. add (byWeightBox) ;. add (byUtilityBox) ;. add (processPairsBox) ;. add (recountButton);= new JTable () ;. add ( new JScrollPane (paretoLayersTable), new GridBagConstraints (0, 0, 1, 1, 1, 1, GridBagConstraints. < i align="justify"> NORTHWEST , GridBagConstraints. BOTH , new Insets (5, 5, 0, 0), 0, 0)) ;. add (checkBoxesPanel, new GridBagConstraints (0, 1, 1, 1, 1, 1, GridBagConstraints. SOUTHWEST , GridBagConstraints. < i align="justify"> NONE , new Insets (5, 0, 5, 0), 0, 0)); ();
}
public void recountLayers (List lt; Item gt; sourceSet) {
if (processPairsBox. isSelected ()) {= packer. processPairs (sourceSet);
} lt; List lt; Item gt; gt; paretoSet=packer. createParetoSet (sourceSet);
if (byUtilityBox. isSelected ()) {
for (List lt; Item gt; paretoLayer: paretoSet) {. sort (paretoLayer, Packer. SORT_TYPE. UTILITY );
}
} else {
if (byVolumeBox. isSelected () amp; amp; byWeightBox. isSelected ()) {
for (List lt; Item gt; paretoLayer: paretoSet) {. sort (paretoLayer, Packer. SORT_TYPE. VOLUME , Packer. SORT_TYPE. WEIGHT );
}
} else {
if (byVolumeBox. isSelected ()) {
for (List lt; Item gt; paretoLayer: paretoSet) {. sort (paretoLayer, Packer. SORT_TYPE. VOLUME );
}
} else if (byWeightBox. isSelected ()) {
for (List lt; Item gt; paretoLayer: paretoSet) {. sort (paretoLayer, Packer. SORT_TYPE. WEIGHT );
}
}
}
}. setParetoSet (paretoSet) ;. setModel ( new ParetoLayersTableModel (paretoSet));
for ( int i=0; i lt; paretoLayersTable. getColumnCount (); i ++) {column=paretoLayersTable. getColumn ((i + 1) + ) ;. setMinWidth (35);
}
}
/**
* @ return the paretoLayersPanel
*/
public JPanel getViewer () {
return viewe...