int remainingMinutesMax = 0;
ArrayList<ProgramPanel> panels = new ArrayList<ProgramPanel>(reminders.size());
for (ReminderListItem reminder : reminders) {
Program program = reminder.getProgram();
mGlobalReminderList.blockProgram(program);
// text label
String msg;
final int progMinutesAfterMidnight = program.getStartTime();
int remainingMinutes = 0;
if (today.compareTo(program.getDate()) >= 0
&& IOUtilities.getMinutesAfterMidnight() > progMinutesAfterMidnight) {
msg = updateRunningTime();
} else {
msg = mLocalizer.msg("soonStarts", "Soon starts");
remainingMinutes = ReminderPlugin.getTimeToProgramStart(program);
}
mHeader.setText(msg);
remainingMinutesMax = Math.max(remainingMinutesMax, remainingMinutes);
List<JComponent> componentList = new ArrayList<JComponent>();
mComponents.put(reminder, componentList);
final ProgramPanel panel = new ProgramPanel(program,
new ProgramPanelSettings(new PluginPictureSettings(
PluginPictureSettings.ALL_PLUGINS_SETTINGS_TYPE), false,
ProgramPanelSettings.X_AXIS));
componentList.add(panel);
panels.add(panel);
panel.setMinimumSize(new Dimension(300,50));
panel.setWidth(300);
// register panel with tooltip manager
panel.setToolTipText("");
panel.addPluginContextMenuMouseListener(ReminderPluginProxy
.getInstance());
final JPanel channelPanel = new JPanel(new BorderLayout());
componentList.add(channelPanel);
if (program.getLength() > 0) {
final JLabel endTime = new JLabel(mLocalizer.msg("endTime",
"until {0}", program.getEndTimeString()));
channelPanel.add(endTime, BorderLayout.PAGE_START);
}
String channelName = program.getChannel().getName();
JLabel channelLabel = new JLabel();
channelLabel.setToolTipText(channelName);
channelLabel.setIcon(UiUtilities.createChannelIcon(program.getChannel()
.getIcon()));
channelLabel.setHorizontalTextPosition(SwingConstants.RIGHT);
channelPanel.add(channelLabel, BorderLayout.CENTER);
channelLabel = new JLabel(channelName);
channelPanel.add(channelLabel, BorderLayout.PAGE_END);