align="justify"> *
@ return the topContainersNum
*/
public int getTopContainersNum () {
return topContainersNum;
}
private void addStandardWheelListener ( final JSpinner spinner) {. addMouseWheelListener ( new MouseWheelListener () {
@ Override
public void mouseWheelMoved (MouseWheelEvent e) {
int value=getSpinnerValue (spinner) + ((Integer) e. getWheelRotation () * - 1); [] values ??= spinnersTopValues. get (spinner);
int bottom=values ??[0];
int top=values ??[1];
if (bottom lt;=value amp; amp; value lt;=top) {
((JSpinner) e. getComponent ()). setValue (value);
}
}
});
}
}. 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. MouseAdapter;
import java. awt. event. MouseEvent;
import java. util. HashSet;
import java. util. List;
import java. util. Set;
import javax. swing. JButton;
import javax. swing. JLabel;
import javax. swing. JPanel;
import javax. swing. JScrollPane;
import javax. swing. JTable;
import javax. swing. event. TableModelEvent;
import javax. swing. event. TableModelListener;
import javax. swing. table. TableModel;
import javax. swing. table. TableRowSorter;
import core. Boss;
import core. Container;
import core. Item;
import core. Packer;
class ItemsViewer {
class ContainerTableModel implements TableModel {
private List lt; Container gt; containers;
private Set lt; TableModelListener gt; listeners= new HashSet lt; TableModelListener gt; ();
public ContainerTableModel (List lt; Container gt; containers) {
this . containers=containers;
}
@ Override
public void addTableModelListener (TableModelListener columnIndex) {. add (columnIndex);
}
@ Override
public Class lt ;? gt; getColumnClass ( int columnIndex) {
return Integer. class ;
}
@ Override
public int getColumnCount () {
return 3;
}
@ Override
public String getColumnName ( int columnIndex) {
switch (columnIndex) {
case 0:
return ID raquo ;;
case 1:
return Обсяг raquo ;;
case 2:
return Вантажопідйомність raquo ;;
}
return col...