int nr = Configuration.GetInstance().GetNumberOfRooms();
Set<Map.Entry<CourseClass, Integer>> kvpSet = classes.entrySet();
for (Iterator<Map.Entry<CourseClass, Integer>> it = kvpSet.iterator(); it.hasNext(); ci += 5)
{
Map.Entry<CourseClass, Integer> kvp = it.next();
CourseClass c = kvp.getKey();
int p = kvp.getValue();
int t = p % ( nr * Schedule.DAY_HOURS );
int d = p / ( nr * Schedule.DAY_HOURS ) + 1;
int r = t / Schedule.DAY_HOURS;
if(r != roomId) continue;
t = t % Schedule.DAY_HOURS + 1;
Rectangle rect = new Rectangle(
offsetX + d * ROOM_CELL_WIDTH,
offsetY + t * ROOM_CELL_HEIGHT,
ROOM_CELL_WIDTH,
ROOM_CELL_HEIGHT * c.GetDuration());
g.setColor(Color.BLACK);
g.drawRect(rect.x, rect.y, rect.width, rect.height);
str = String.format("%s\n%s\n/", c.GetCourse().GetName(), c.GetLecturer().GetName());
for(Iterator<StudentsGroup> it2 = c.GetGroups().iterator();
it2.hasNext();)
{
str += it2.next().GetName();
str += "/";
}
if(c.IsLabRequired())
str += "\nLab";
rect.y += 5;
rect.height -= 5;
rect.x += 5;