/**
* creates a JPanel for getting the time offsets
*/
private void createPanel() {
CellConstraints cc = new CellConstraints();
PanelBuilder pb = new PanelBuilder(new FormLayout("5dlu,12dlu,pref:grow,5dlu,pref:grow,5dlu",
"pref,5dlu,pref,1dlu,pref,10dlu,pref,5dlu,pref,1dlu,"+
"pref,10dlu,pref,5dlu,pref,1dlu,pref,7dlu,pref,pref," +
"pref,pref,pref,7dlu,pref,pref,10dlu,pref"),this);
pb.setDefaultDialogBorder();
mPreTimeSpinner = new JSpinner(new SpinnerNumberModel(mData.getPreTime(), 0, null, 1));
mPostTimeTextField = new JSpinner(new SpinnerNumberModel(mData.getPostTime(), 0, null, 1));
mUserName.setText(mData.getUsername());
mUserPwd.setText(mData.getPassword());
mMaxSimult = new JSpinner(new SpinnerNumberModel(mData.getMaxSimultanious(), 1, null, 1));
mMaxTimeout = new JSpinner(new SpinnerNumberModel(mData.getTimeout(), -1, 999, 1));
mCheckReturn = new JCheckBox(mLocalizer.msg("CheckError", "Check if returns Error"), mData.useReturnValue());
mShowOnError = new JCheckBox(mLocalizer.msg("ShowResultOnError","Show Result-Dialog only on Error"), mData.getDialogOnlyOnError());
mShowTitleAndTimeDialog = new JCheckBox(mLocalizer.msg("showTitleAndTime", "Show title and time settings dialog"), mData.getShowTitleAndTimeDialog());
mDeleteRemovedPrograms = new JCheckBox(mLocalizer.msg("autoDeletePrograms", "Automatically delete programs that were removed during a data update"), mData.getDeleteRemovedPrograms());
mOldPrograms = new JCheckBox(mLocalizer.msg("OnlyFuture", "Only allow Programs that are in the future"), mData.getOnlyFuturePrograms());
mUseTime = new JCheckBox(mLocalizer.msg("useSystemTimezone","Use timezone provided by OS"), !mData.useTimeZone());
String[] zoneIds = new String[0];
try {
zoneIds = TimeZone.getAvailableIDs();
} catch (Exception e) {
e.printStackTrace();
}
mTimeZones = new JComboBox(zoneIds);
mTimeZones.setEnabled(mData.useTimeZone() && mTimeZones.getItemCount() > 0);
for (int i=0; i<zoneIds.length; i++) {
if (zoneIds[i].equals(mData.getTimeZone().getID())) {
mTimeZones.setSelectedIndex(i); break;
}
}
pb.addSeparator(mLocalizer.msg("TimeSettings", "Timesettings"), cc.xyw(1,1,6));
pb.addLabel(mLocalizer.msg("Earlier", "Number of minutes to start erlier"),cc.xyw(2,3,2));
pb.add(mPreTimeSpinner, cc.xy(5,3));
pb.addLabel(mLocalizer.msg("Later", "Number of minutes to stop later"),cc.xyw(2,5,2));
pb.add(mPostTimeTextField, cc.xy(5,5));
pb.addSeparator(mLocalizer.msg("User", "User"), cc.xyw(1,7,6));
pb.addLabel(mLocalizer.msg("Username", "Username") + ":", cc.xyw(2,9,2));
pb.add(mUserName, cc.xy(5,9));
pb.addLabel(mLocalizer.msg("Password", "Password") + ":", cc.xyw(2,11,2));
pb.add(mUserPwd, cc.xy(5,11));
pb.addSeparator(mLocalizer.msg("Additional", "Additional"), cc.xyw(1,13,6));
pb.addLabel(mLocalizer.msg("MaxSimult","Maximum simultaneous recordings")+ ":" , cc.xyw(2,15,2));
pb.add(mMaxSimult,cc.xy(5,15));
pb.addLabel(mLocalizer.msg("Timeout","Wait sec. until Timeout (-1 = disabled)")+ ":", cc.xyw(2,17,2));
pb.add(mMaxTimeout,cc.xy(5,17));
pb.add(mCheckReturn, cc.xyw(2,19,4));
pb.add(mShowOnError, cc.xyw(2,20,4));
pb.add(mShowTitleAndTimeDialog, cc.xyw(2,21,4));
pb.add(mDeleteRemovedPrograms, cc.xyw(2,22,4));
pb.add(mOldPrograms, cc.xyw(2,23,4));
pb.add(mUseTime, cc.xyw(2,25,4));
JPanel timeZonePanel = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0));
mTimeZoneLabel = new JLabel(mLocalizer.msg("Timezone","Timezone")+": ");
mTimeZoneLabel.setEnabled(mTimeZones.isEnabled());
timeZonePanel.add(mTimeZoneLabel);
timeZonePanel.add(mTimeZones);
pb.add(timeZonePanel, cc.xyw(3,26,3));
mProgramReceiveTargetSelection = new ProgramReceiveTargetSelectionPanel(UiUtilities.getLastModalChildOf(CapturePlugin.getInstance().getSuperFrame()),
mData.getProgramReceiveTargets(),null,CapturePlugin.getInstance(),true,mLocalizer.msg("sendToTitle","Send scheduled programs to:"));
mProgramReceiveTargetSelection.addChangeListener(this);
pb.add(mProgramReceiveTargetSelection, cc.xyw(1,28,5));
// add ChangeListener to the spinners
mPreTimeSpinner.addChangeListener(this);
mPostTimeTextField.addChangeListener(this);
mMaxSimult.addChangeListener(this);