ign="justify">}
else if (userObject
instanceof Item) {=
new ImageIcon (ResultViewer.
class . getResource ( images/Item. png )) ;. setText ( Об'єкт, ID: + ((Item) userObject). getId ());
} else if (userObject instanceof String) {
if (node. getParent () == null ||. getParent () == value) {= < b align="justify"> new ImageIcon (ResultViewer. class . getResource ( images/Containers. png ));
} else {= new ImageIcon (ResultViewer. class . getResource ( images/Field. png ));
}. setText ((String) node. getUserObject ());
}. setOpaque ( true );
if (selected) {. setBackground ( new DefaultTreeCellRenderer (). getBackgroundSelectionColor ());
} else {. setBackground ( new DefaultTreeCellRenderer (). getBackgroundNonSelectionColor ());
}. setIcon (icon);
}
return label;
}
}
private JPanel viewer;
private JTree tree;
private JPanel treePanel;
private JPanel cBoxPanel;
private JButton packButton;
private JButton clearConsoleButton;
private ConsoleLogTextPane resumeLoggerPane;
private JSplitPane splitPane;
private JComboBox lt; String gt; algorythmsBox;
private Hashtable lt; String, Packer. ALGORYTHM gt; table;
private final String NO_ALGORYTHM_CHOSEN= Виберіть алгоритм raquo ;;
private final String FIRST= У перший підходящий raquo ;;
private final String BEST= У кращий з відповідних raquo ;;
private Resume resume;
public ResultViewer ( final GUI gui, final Store store, final Packer packer, final Boss boss) {= new ConsoleLogTextPane () ;. setEditable ( false );= new Resume (); top= new DefaultMutableTreeNode ( [пусто] );= new Hashtable lt; String, Packer. ALGORYTHM gt; () ;. put (FIRST, ALGORYTHM. FIRST ) ;. put (BEST, ALGORYTHM. BEST );= new JComboBox lt; String gt; ( new AlgorythmsComboBoxModel (NO_ALGORYTHM_CHOSEN, FIRST, BEST)) ;. setSelectedIndex (0) ;. addItemListener ( new ItemListener () {
@ SuppressWarnings ( unchecked )
@ Override
public void itemStateChanged (ItemEvent arg0) {. setEnabled (((JComboBox lt; String gt;) arg0. getSource ()). getModel (). getSelectedItem ()!=NO_ALGORYTHM_CHOSEN amp; amp ;. getParetoSetInstance ()!= null amp ; amp;
! store. getParetoSetInstance (). isEmpty ());
}
});= new JButton ( Запакувати ) ;. setEnabled ( false ) ;. addActionListener ( new ActionListener () {
@ Override
public void actionPerformed (ActionEvent arg0) {
if (store!= null ) {. getRest (). clear ();
if (store. getParetoSetInstance ()!= null ) { lt; List lt; Integer gt; gt; templates=store. getTemplates ();
double maxUtilityRate=0;
int maxUtilityIndex=0; lt; Container, List lt; Item gt; gt; map= null ;
for ...