updatePanel(solution);
}
@Override
public void updatePanel(Solution solution) {
MachineReassignment machineReassignment = (MachineReassignment) solution;
List<MrResource> resourceList = machineReassignment.getResourceList();
unassignedPanel.setResourceList(resourceList);
if (machineReassignment.getMachineList().size() > 1000) {
if (tooBigLabel == null) {
tooBigLabel = new JLabel("The dataset is too big to show.");
machineListPanel.add(tooBigLabel);
}
} else {
if (tooBigLabel != null) {
machineListPanel.remove(tooBigLabel);
tooBigLabel = null;
}
Set<MrMachine> deadMachineSet = new LinkedHashSet<MrMachine>(machineToPanelMap.keySet());
deadMachineSet.remove(null);
for (MrMachine machine : machineReassignment.getMachineList()) {
deadMachineSet.remove(machine);
MrMachinePanel machinePanel = machineToPanelMap.get(machine);
if (machinePanel == null) {
machinePanel = new MrMachinePanel(this, resourceList, machine);
machineListPanel.add(machinePanel);
machineToPanelMap.put(machine, machinePanel);
}
}
Set<MrProcessAssignment> deadProcessAssignmentSet = new LinkedHashSet<MrProcessAssignment>(
processAssignmentToPanelMap.keySet());
for (MrProcessAssignment processAssignment : machineReassignment.getProcessAssignmentList()) {
deadProcessAssignmentSet.remove(processAssignment);
MrMachinePanel machinePanel = processAssignmentToPanelMap.get(processAssignment);
MrMachine machine = processAssignment.getMachine();
if (machinePanel != null
&& !ObjectUtils.equals(machinePanel.getMachine(), machine)) {