if (teachers.length() > 0) teachers.append(" - "); teachers.append(user.getFirstName()).append(" ").append(user.getName());
if (user != null) { if (teachers.length() > 0) teachers.append(" - "); teachers.append(user.getFirstName()).append(" ").append(user.getName()); }
    protected void setValue(Object value) {        Course c = (Course)value;        if (value==null) {            setText(null);            setToolTipText(null);        } else {            StringBuffer prtScreen = new StringBuffer();            StringBuffer teachers = new StringBuffer();            StringBuffer rooms = new StringBuffer();            StringBuffer materials = new StringBuffer();            Subject subj=c.getSubject();            if (subj != null) {                prtScreen.append(subj.getHeading());                if (TimetableDao.TYPE_TD.equals(c.getIdCourseType().getNameCourseType()))                    prtScreen.append(" (TD)");                else if (TimetableDao.TYPE_TP.equals(c.getIdCourseType().getNameCourseType()))                    prtScreen.append(" (TP)");                                for (Iterator i = c.getTeachers().iterator(); i.hasNext(); ) {                    User user = (User) i.next();                    if (teachers.length() > 0)                        teachers.append(" - ");                    teachers.append(user.getFirstName()).append(" ").append(user.getName());                }                for (Iterator i = c.getRooms().iterator(); i.hasNext(); ) {                    Room room = (Room) i.next();                    if (rooms.length() > 0)                        rooms.append(" - ");                    rooms.append(room.getName());                }                for (Iterator i = c.getMaterials().iterator(); i.hasNext(); ) {                    Material material = (Material) i.next();                    if (materials.length() > 0)                        materials.append(" - ");                    materials.append(material.getName());                }            }            else {                prtScreen.append("Matire inconnue");            }            StringBuffer prtScreen1 = new StringBuffer();            prtScreen1.append("<html>");            prtScreen1.append(prtScreen);            if (teachers.length() > 0)                prtScreen1.append("<br>").append(teachers);            if (rooms.length() > 0)                prtScreen1.append("<br>").append(rooms);            prtScreen1.append("</html>");            setText(prtScreen1.toString());                        StringBuffer prtScreen2 = new StringBuffer();            prtScreen2.append("<html>");            prtScreen2.append("Matire: ").append(prtScreen);            prtScreen2.append("<br>").append("Horaires: ");            prtScreen2.append(FORMAT_HOUR.format(c.getBeginDate().getTime()));            prtScreen2.append(" / ").append(FORMAT_HOUR.format(c.getEndDate().getTime()));            if (teachers.length() > 0)                prtScreen2.append("<br>").append("Enseignant(s): ").append(teachers);            if (rooms.length() > 0)                prtScreen2.append("<br>").append("Salle(s): ").append(rooms);            if (materials.length() > 0)                prtScreen2.append("<br>").append("Matriel(s): ").append(materials);            prtScreen2.append("</html>");            setToolTipText(prtScreen2.toString());        }        this.setHorizontalAlignment(JLabel.CENTER);        this.setHorizontalTextPosition(JLabel.CENTER);        this.setVerticalAlignment(JLabel.CENTER);        this.setVerticalTextPosition(JLabel.CENTER);    }