class PatientOrRoomIcon implements Icon {

        private static final int EQUIPMENT_ICON_WIDTH = 8;

        private final ImageIcon genderIcon;
        private final List<Color> equipmentColorList;

        private PatientOrRoomIcon(Patient patient) {
            genderIcon = determinePatientGenderIcon(patient.getGender());
            List<RequiredPatientEquipment> equipmentList = patient.getRequiredPatientEquipmentList();
            equipmentColorList = new ArrayList<>(equipmentList.size());
            for (RequiredPatientEquipment equipment : equipmentList) {
                equipmentColorList.add(equipmentTangoColorFactory.pickColor(equipment.getEquipment()));
            }
        }

        private PatientOrRoomIcon(Room room) {
            genderIcon = determineRoomGenderIcon(room.getGenderLimitation());
            List<RoomEquipment> equipmentList = room.getRoomEquipmentList();
            equipmentColorList = new ArrayList<>(equipmentList.size());
            for (RoomEquipment equipment : equipmentList) {
                equipmentColorList.add(equipmentTangoColorFactory.pickColor(equipment.getEquipment()));
            }
        }

        @Override
        public int getIconWidth() {
            return genderIcon.getIconWidth() + equipmentColorList.size() * EQUIPMENT_ICON_WIDTH;
        }

        @Override
        public int getIconHeight() {
            return genderIcon.getIconHeight();
        }

        @Override
        public void paintIcon(Component c, Graphics g, int x, int y) {<FILL_FUNCTION_BODY>}

    }

            genderIcon.paintIcon(c, g, x, y);
            int innerX = x + genderIcon.getIconWidth();
            int equipmentIconHeight = genderIcon.getIconHeight();
            for (int i = 0; i < equipmentColorList.size(); i++) {
                g.setColor(equipmentColorList.get(i));
                g.fillRect(innerX + 1, y + 1, EQUIPMENT_ICON_WIDTH - 2, equipmentIconHeight - 2);
                g.setColor(TangoColorFactory.ALUMINIUM_5);
                g.drawRect(innerX + 1, y + 1, EQUIPMENT_ICON_WIDTH - 2, equipmentIconHeight - 2);
                innerX += EQUIPMENT_ICON_WIDTH;
            }
        
<methods>public non-sealed void <init>() ,public java.awt.Color determinePlanningEntityColor(java.lang.Object, java.lang.Object) ,public java.lang.String determinePlanningEntityTooltip(java.lang.Object) ,public void doProblemChange(ProblemChange<org.optaplanner.examples.pas.domain.PatientAdmissionSchedule>) ,public void doProblemChange(ProblemChange<org.optaplanner.examples.pas.domain.PatientAdmissionSchedule>, boolean) ,public java.awt.Dimension getPreferredScrollableViewportSize() ,public int getScrollableBlockIncrement(java.awt.Rectangle, int, int) ,public boolean getScrollableTracksViewportHeight() ,public boolean getScrollableTracksViewportWidth() ,public int getScrollableUnitIncrement(java.awt.Rectangle, int, int) ,public org.optaplanner.examples.pas.domain.PatientAdmissionSchedule getSolution() ,public SolutionBusiness<org.optaplanner.examples.pas.domain.PatientAdmissionSchedule,?> getSolutionBusiness() ,public SolverAndPersistenceFrame<org.optaplanner.examples.pas.domain.PatientAdmissionSchedule> getSolverAndPersistenceFrame() ,public java.lang.String getUsageExplanationPath() ,public boolean isIndictmentHeatMapEnabled() ,public boolean isUseIndictmentColor() ,public boolean isWrapInScrollPane() ,public abstract void resetPanel(org.optaplanner.examples.pas.domain.PatientAdmissionSchedule) ,public void setSolutionBusiness(SolutionBusiness<org.optaplanner.examples.pas.domain.PatientAdmissionSchedule,?>) ,public void setSolverAndPersistenceFrame(SolverAndPersistenceFrame<org.optaplanner.examples.pas.domain.PatientAdmissionSchedule>) ,public void setUseIndictmentColor(boolean) ,public void updatePanel(org.optaplanner.examples.pas.domain.PatientAdmissionSchedule) <variables>protected static final java.awt.Color[][] INDICTMENT_COLORS,public static final java.awt.Dimension PREFERRED_SCROLLABLE_VIEWPORT_SIZE,protected static final java.lang.String USAGE_EXPLANATION_PATH,protected double[] indictmentMinimumLevelNumbers,protected final transient Logger logger,protected org.optaplanner.swing.impl.TangoColorFactory normalColorFactory,protected SolutionBusiness<org.optaplanner.examples.pas.domain.PatientAdmissionSchedule,?> solutionBusiness,protected SolverAndPersistenceFrame<org.optaplanner.examples.pas.domain.PatientAdmissionSchedule> solverAndPersistenceFrame,protected boolean useIndictmentColor