0001: /*
0002: This file is part of BORG.
0003:
0004: BORG is free software; you can redistribute it and/or modify
0005: it under the terms of the GNU General Public License as published by
0006: the Free Software Foundation; either version 2 of the License, or
0007: (at your option) any later version.
0008:
0009: BORG is distributed in the hope that it will be useful,
0010: but WITHOUT ANY WARRANTY; without even the implied warranty of
0011: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0012: GNU General Public License for more details.
0013:
0014: You should have received a copy of the GNU General Public License
0015: along with BORG; if not, write to the Free Software
0016: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0017:
0018: Copyright 2003 by Mike Berger
0019: */
0020:
0021: package net.sf.borg.ui;
0022:
0023: import java.awt.BorderLayout;
0024: import java.awt.Color;
0025: import java.awt.FlowLayout;
0026: import java.awt.Font;
0027: import java.awt.GridBagConstraints;
0028: import java.awt.GridBagLayout;
0029: import java.awt.GridLayout;
0030: import java.awt.event.ActionEvent;
0031: import java.awt.event.ActionListener;
0032: import java.awt.event.KeyEvent;
0033: import java.io.File;
0034: import java.io.InputStream;
0035: import java.net.URL;
0036: import java.util.Calendar;
0037: import java.util.Date;
0038: import java.util.GregorianCalendar;
0039: import java.util.Iterator;
0040: import java.util.Locale;
0041: import java.util.TreeSet;
0042:
0043: import javax.swing.ImageIcon;
0044: import javax.swing.JButton;
0045: import javax.swing.JCheckBox;
0046: import javax.swing.JComboBox;
0047: import javax.swing.JFileChooser;
0048: import javax.swing.JLabel;
0049: import javax.swing.JOptionPane;
0050: import javax.swing.JPanel;
0051: import javax.swing.JPasswordField;
0052: import javax.swing.JRadioButton;
0053: import javax.swing.JSpinner;
0054: import javax.swing.JTextArea;
0055: import javax.swing.JTextField;
0056: import javax.swing.SpinnerDateModel;
0057: import javax.swing.SpinnerNumberModel;
0058: import javax.swing.SwingUtilities;
0059: import javax.swing.UIManager;
0060: import javax.swing.UIManager.LookAndFeelInfo;
0061:
0062: import net.sf.borg.common.Errmsg;
0063: import net.sf.borg.common.PrefName;
0064: import net.sf.borg.common.Prefs;
0065: import net.sf.borg.common.Resource;
0066: import net.sf.borg.model.AppointmentModel;
0067: import net.sf.borg.ui.popup.ReminderTimePanel;
0068: import net.sf.borg.ui.util.JButtonKnowsBgColor;
0069: import net.sf.borg.ui.util.NwFontChooserS;
0070: import net.sf.borg.ui.util.StripedTable;
0071:
0072: import java.awt.Dimension;
0073: import java.awt.Insets;
0074: import javax.swing.SwingConstants;
0075:
0076: // propgui displays the edit preferences window
0077: public class OptionsView extends View {
0078:
0079: /**
0080: *
0081: */
0082: private static final long serialVersionUID = 4743111117071445783L;
0083:
0084: // to break a dependency with the contol package
0085: public interface RestartListener {
0086: public void restart();
0087: }
0088:
0089: static private RestartListener rl_ = null; // someone to call to
0090:
0091: // request a
0092:
0093: private static OptionsView singleton = null;
0094:
0095: // restart
0096:
0097: static {
0098: int rgb = Prefs.getIntPref(PrefName.UCS_STRIPE);
0099: StripedTable.setStripeColor(new Color(rgb));
0100: }
0101:
0102: public void chooseBackupDir() {
0103:
0104: String s = "";
0105: while (true) {
0106: JFileChooser chooser = new JFileChooser();
0107:
0108: chooser.setCurrentDirectory(new File("."));
0109: chooser
0110: .setDialogTitle(Resource
0111: .getResourceString("Please_choose_directory_to_place_XML_files"));
0112: chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
0113: chooser.setApproveButtonText(Resource
0114: .getResourceString("select_export_dir"));
0115:
0116: int returnVal = chooser.showOpenDialog(null);
0117: if (returnVal != JFileChooser.APPROVE_OPTION)
0118: return;
0119:
0120: s = chooser.getSelectedFile().getAbsolutePath();
0121: File dir = new File(s);
0122: String err = null;
0123: if (!dir.exists()) {
0124: err = Resource.getResourceString("Directory_[")
0125: + s
0126: + Resource
0127: .getResourceString("]_does_not_exist");
0128: } else if (!dir.isDirectory()) {
0129: err = "["
0130: + s
0131: + Resource
0132: .getResourceString("]_is_not_a_directory");
0133: }
0134:
0135: if (err == null)
0136: break;
0137:
0138: Errmsg.notice(err);
0139: }
0140:
0141: backupDir.setText(s);
0142: }
0143:
0144: // prompt the user to enter a database directory
0145: public static String chooseDbDir(boolean update) {
0146:
0147: String dbdir = null;
0148: while (true) {
0149: JFileChooser chooser = new JFileChooser();
0150:
0151: chooser.setCurrentDirectory(new File("."));
0152: chooser
0153: .setDialogTitle("Please choose directory for database files");
0154: chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
0155:
0156: int returnVal = chooser.showOpenDialog(null);
0157: if (returnVal != JFileChooser.APPROVE_OPTION) {
0158: return (null);
0159: }
0160:
0161: dbdir = chooser.getSelectedFile().getAbsolutePath();
0162: File dir = new File(dbdir);
0163: String err = null;
0164: if (!dir.exists()) {
0165: err = "Database Directory [" + dbdir
0166: + "] does not exist";
0167: } else if (!dir.isDirectory()) {
0168: err = "Database Directory [" + dbdir
0169: + "] is not a directory";
0170: }
0171:
0172: if (err == null) {
0173: break;
0174: }
0175:
0176: Errmsg.notice(err);
0177: }
0178:
0179: if (update) {
0180: Prefs.putPref(PrefName.DBDIR, dbdir);
0181: }
0182: return (dbdir);
0183: }
0184:
0185: public static void dbSelectOnly() {
0186: new OptionsView(true).setVisible(true);
0187:
0188: }
0189:
0190: public static OptionsView getReference() {
0191: if (singleton == null || !singleton.isShowing()) {
0192: singleton = new OptionsView(false);
0193: }
0194: return (singleton);
0195: }
0196:
0197: static public void setRestartListener(RestartListener rl) {
0198: rl_ = rl;
0199: }
0200:
0201: static private void setBooleanPref(JCheckBox box, PrefName pn) {
0202: if (box.isSelected()) {
0203: Prefs.putPref(pn, "true");
0204: } else {
0205: Prefs.putPref(pn, "false");
0206: }
0207: }
0208:
0209: static private void setCheckBox(JCheckBox box, PrefName pn) {
0210: String val = Prefs.getPref(pn);
0211: if (val.equals("true")) {
0212: box.setSelected(true);
0213: } else {
0214: box.setSelected(false);
0215: }
0216: }
0217:
0218: private javax.swing.JButton applyButton;
0219:
0220: private JPanel applyDismissPanel = null;
0221:
0222: private javax.swing.JButton apptFontButton;
0223:
0224: private javax.swing.JCheckBox autoupdate;
0225:
0226: private javax.swing.JCheckBox backgbox;
0227:
0228: private JButtonKnowsBgColor btn_ucs_birthdays;
0229:
0230: private JButtonKnowsBgColor btn_ucs_black;
0231:
0232: private JButtonKnowsBgColor btn_ucs_blue;
0233:
0234: private JButtonKnowsBgColor btn_ucs_default;
0235:
0236: private JButtonKnowsBgColor btn_ucs_green;
0237:
0238: private JButtonKnowsBgColor btn_ucs_halfday;
0239:
0240: private JButtonKnowsBgColor btn_ucs_holiday;
0241:
0242: private JButtonKnowsBgColor btn_ucs_holidays;
0243:
0244: private JButtonKnowsBgColor btn_ucs_red;
0245:
0246: private JButton btn_ucs_restore;
0247:
0248: private JButtonKnowsBgColor btn_ucs_stripe;
0249:
0250: private JButtonKnowsBgColor btn_ucs_tasks;
0251:
0252: private JButtonKnowsBgColor btn_ucs_today;
0253:
0254: private JButtonKnowsBgColor btn_ucs_vacation;
0255:
0256: private JButtonKnowsBgColor btn_ucs_weekday;
0257:
0258: private JButtonKnowsBgColor btn_ucs_weekend;
0259:
0260: private JButtonKnowsBgColor btn_ucs_white;
0261:
0262: private javax.swing.JCheckBox canadabox;
0263:
0264: private javax.swing.JCheckBox cb_ucs_marktodo;
0265:
0266: private javax.swing.JCheckBox cb_ucs_ontodo;
0267:
0268: private javax.swing.JSpinner checkfreq;
0269:
0270: private javax.swing.JButton chgdb;
0271:
0272: private javax.swing.JCheckBox colorprint;
0273:
0274: private javax.swing.JCheckBox colorsortbox;
0275:
0276: private javax.swing.JButton dayFontButton = new JButton();
0277:
0278: private javax.swing.JTextField dbDirText;
0279:
0280: private javax.swing.JTextField dbHostText;
0281:
0282: private javax.swing.JTextField dbNameText;
0283:
0284: private javax.swing.JTextField dbPortText;
0285:
0286: private javax.swing.ButtonGroup dbTypeGroup;
0287:
0288: private JPanel dbTypePanel = null;
0289:
0290: private javax.swing.JTextField dbUserText;
0291:
0292: private javax.swing.JButton defFontButton;
0293:
0294: private javax.swing.JButton dismissButton;
0295:
0296: private JCheckBox doyBox = null;
0297:
0298: private javax.swing.JCheckBox emailbox;
0299:
0300: private javax.swing.JTextField emailtext;
0301:
0302: /**
0303: * This method initializes emailtimebox
0304: *
0305: * @return javax.swing.JComboBox
0306: */
0307: private JSpinner emailtimebox = null;
0308:
0309: private JCheckBox exputcbox = null;
0310:
0311: // private JCheckBox extraDayBox;
0312:
0313: private javax.swing.JCheckBox holiday1;
0314:
0315: /**
0316: * This method initializes jRadioButton
0317: *
0318: * @return javax.swing.JRadioButton
0319: */
0320:
0321: private JRadioButton hsqldbButton;
0322:
0323: private JPanel hsqldbPanel;
0324:
0325: private javax.swing.JCheckBox icaltodobox;
0326:
0327: private javax.swing.JCheckBox iso8601Box = new JCheckBox();
0328:
0329: private javax.swing.JButton jButton5;
0330:
0331: private JRadioButton jdbcButton = null;
0332:
0333: private JPanel jdbcPanel = null;
0334:
0335: private JTextField jdbcText = null;
0336:
0337: private JLabel jLabel = null;
0338:
0339: private javax.swing.JLabel jLabel1;
0340:
0341: private javax.swing.JLabel jLabel15;
0342:
0343: private javax.swing.JLabel jLabel16;
0344:
0345: private javax.swing.JLabel jLabel17;
0346:
0347: private javax.swing.JLabel jLabel18;
0348:
0349: private javax.swing.JLabel jLabel19;
0350:
0351: private javax.swing.JLabel jLabel2;
0352:
0353: private javax.swing.JLabel jLabel20;
0354:
0355: private javax.swing.JLabel jLabel3;
0356:
0357: private javax.swing.JLabel jLabel4;
0358:
0359: private javax.swing.JLabel jLabel5;
0360:
0361: private javax.swing.JLabel jLabel6;
0362:
0363: private javax.swing.JLabel jLabel7;
0364:
0365: private javax.swing.JLabel jLabel8;
0366:
0367: private JPanel jPanelUCS = null;
0368:
0369: private javax.swing.JPasswordField jPasswordField1;
0370:
0371: private javax.swing.JSeparator jSeparator1;
0372:
0373: private javax.swing.JTabbedPane jTabbedPane1;
0374:
0375: private javax.swing.JComboBox lnfBox;
0376:
0377: private javax.swing.JComboBox localebox;
0378:
0379: private JRadioButton localFileButton = null;
0380:
0381: // End of variables declaration//GEN-END:variables
0382:
0383: private javax.swing.JPanel localFilePanel;
0384:
0385: private javax.swing.JCheckBox logobox;
0386:
0387: private javax.swing.JButton logobrowse;
0388:
0389: private javax.swing.JTextField logofile;
0390:
0391: private JComboBox lsbox = null;
0392:
0393: private JLabel lslabel = null;
0394:
0395: private javax.swing.JCheckBox miltime;
0396:
0397: private javax.swing.JCheckBox mondaycb;
0398:
0399: private javax.swing.JButton monthFontButton = new JButton();
0400:
0401: private JRadioButton MySQLButton = null;
0402:
0403: private javax.swing.JPanel mysqlPanel;
0404:
0405: private JCheckBox palmcb = null;
0406:
0407: private javax.swing.JCheckBox popenablebox;
0408:
0409: private javax.swing.JButton previewFontButton;
0410:
0411: private javax.swing.JCheckBox privbox;
0412:
0413: private javax.swing.JCheckBox pubbox;
0414:
0415: private JRadioButton remoteButton = null;
0416:
0417: private JPanel remoteServerPanel = null;
0418:
0419: private JTextField remoteURLText = null;
0420:
0421: private JLabel remtimelabel = null;
0422:
0423: private ReminderTimePanel remTimePanel = new ReminderTimePanel();
0424:
0425: private javax.swing.JCheckBox oldmonthbox;
0426:
0427: private javax.swing.JCheckBox sharedFileCheckBox;
0428:
0429: private javax.swing.JTextField smtptext;
0430:
0431: private javax.swing.JCheckBox soundbox;
0432:
0433: private javax.swing.JCheckBox splashbox;
0434:
0435: private javax.swing.JCheckBox stackbox;
0436:
0437: private JLabel syncminlabel = null;
0438:
0439: /**
0440: * This method initializes jTextField
0441: *
0442: * @return javax.swing.JTextField
0443: */
0444: private JSpinner syncmins;
0445:
0446: private javax.swing.JTextField tf_ucs_marker;
0447:
0448: private JPanel topPanel = null;
0449:
0450: private JCheckBox truncbox = null;
0451:
0452: private JCheckBox useBeep = null;
0453:
0454: private javax.swing.JButton versioncheck;
0455:
0456: private javax.swing.JButton weekFontButton = new JButton();
0457:
0458: private javax.swing.JComboBox wkendhr;
0459:
0460: private javax.swing.JComboBox wkstarthr;
0461:
0462: private javax.swing.JCheckBox wrapbox;
0463:
0464: JTextField hsqldbdir = new JTextField();
0465:
0466: JTextField backupDir = new JTextField();
0467:
0468: JCheckBox indEmailBox = new JCheckBox();
0469:
0470: JSpinner indEmailTime = null;
0471:
0472: JPasswordField smpw = new JPasswordField();
0473:
0474: JTextField socketPort = new JTextField();
0475:
0476: JTextField usertext = new JTextField();
0477:
0478: JCheckBox useSysTray = new JCheckBox();
0479:
0480: JCheckBox dock = new JCheckBox();
0481:
0482: // dbonly will only allow db changes
0483: private OptionsView(boolean dbonly) {
0484: super ();
0485:
0486: initComponents();
0487: dbTypeGroup = new javax.swing.ButtonGroup();
0488: dbTypeGroup.add(hsqldbButton);
0489: dbTypeGroup.add(MySQLButton);
0490: dbTypeGroup.add(remoteButton);
0491: dbTypeGroup.add(localFileButton);
0492: dbTypeGroup.add(jdbcButton);
0493:
0494: if (!dbonly) {
0495: addModel(AppointmentModel.getReference());
0496: } else {
0497: setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
0498: }
0499:
0500: // set the various screen items based on the existing user
0501: // preferences
0502:
0503: String ls = Prefs.getPref(PrefName.LINESPACING);
0504:
0505: lsbox.addItem("-0.5");
0506: lsbox.addItem("-0.3");
0507: lsbox.addItem("-0.15");
0508: lsbox.addItem("0.0");
0509: lsbox.addItem("0.5");
0510: lsbox.addItem("1.0");
0511:
0512: lsbox.setSelectedItem(ls);
0513:
0514: int emmins = Prefs.getIntPref(PrefName.EMAILTIME);
0515: Calendar cal = new GregorianCalendar(1980, 1, 1, 0, 0, 0);
0516: cal.add(Calendar.MINUTE, emmins);
0517: emailtimebox.setValue(cal.getTime());
0518:
0519: getIndEmailtimebox().setValue(
0520: new Integer(Prefs.getIntPref(PrefName.INDIVEMAILMINS)));
0521:
0522: //
0523: // database
0524: //
0525: String dbtype = Prefs.getPref(PrefName.DBTYPE);
0526: if (dbtype.equals("mysql")) {
0527: MySQLButton.setSelected(true);
0528: } else if (dbtype.equals("remote")) {
0529: remoteButton.setSelected(true);
0530: } else if (dbtype.equals("hsqldb")) {
0531: hsqldbButton.setSelected(true);
0532: } else if (dbtype.equals("jdbc")) {
0533: jdbcButton.setSelected(true);
0534: } else {
0535: localFileButton.setSelected(true);
0536: }
0537: dbTypeChange(dbtype);
0538:
0539: dbDirText.setText(Prefs.getPref(PrefName.DBDIR));
0540: dbNameText.setText(Prefs.getPref(PrefName.DBNAME));
0541: dbPortText.setText(Prefs.getPref(PrefName.DBPORT));
0542: dbHostText.setText(Prefs.getPref(PrefName.DBHOST));
0543: dbUserText.setText(Prefs.getPref(PrefName.DBUSER));
0544: jPasswordField1.setText(Prefs.getPref(PrefName.DBPASS));
0545: remoteURLText.setText(Prefs.getPref(PrefName.DBURL));
0546: jdbcText.setText(Prefs.getPref(PrefName.JDBCURL));
0547: hsqldbdir.setText(Prefs.getPref(PrefName.HSQLDBDIR));
0548: backupDir.setText(Prefs.getPref(PrefName.BACKUPDIR));
0549:
0550: if (dbonly) {
0551: // disable lots of non-db-related stuff
0552: jTabbedPane1.setEnabledAt(0, false);
0553: jTabbedPane1.setEnabledAt(1, false);
0554: jTabbedPane1.setEnabledAt(3, false);
0555: jTabbedPane1.setEnabledAt(4, false);
0556: jTabbedPane1.setEnabledAt(5, false);
0557: jTabbedPane1.setEnabledAt(6, false);
0558: jTabbedPane1.setEnabledAt(7, false);
0559: jTabbedPane1.setEnabledAt(8, false);
0560: jTabbedPane1.setEnabledAt(9, false);
0561: jTabbedPane1.setSelectedIndex(2);
0562: dismissButton.setEnabled(false);
0563: applyButton.setEnabled(false);
0564:
0565: return;
0566:
0567: }
0568:
0569: // set various simple boolean checkboxes
0570: setCheckBox(colorprint, PrefName.COLORPRINT);
0571: setCheckBox(pubbox, PrefName.SHOWPUBLIC);
0572: setCheckBox(privbox, PrefName.SHOWPRIVATE);
0573: setCheckBox(emailbox, PrefName.EMAILENABLED);
0574: setCheckBox(indEmailBox, PrefName.INDIVEMAILENABLED);
0575: setCheckBox(holiday1, PrefName.SHOWUSHOLIDAYS);
0576: setCheckBox(canadabox, PrefName.SHOWCANHOLIDAYS);
0577: setCheckBox(doyBox, PrefName.DAYOFYEAR);
0578: setCheckBox(exputcbox, PrefName.ICALUTC);
0579: setCheckBox(colorsortbox, PrefName.COLORSORT);
0580: setCheckBox(miltime, PrefName.MILTIME);
0581: setCheckBox(backgbox, PrefName.BACKGSTART);
0582: setCheckBox(splashbox, PrefName.SPLASH);
0583: setCheckBox(stackbox, PrefName.STACKTRACE);
0584: setCheckBox(wrapbox, PrefName.WRAP);
0585: setCheckBox(oldmonthbox, PrefName.OLDMONTHVIEW);
0586: setCheckBox(popenablebox, PrefName.REMINDERS);
0587: setCheckBox(soundbox, PrefName.BEEPINGREMINDERS);
0588: setCheckBox(palmcb, PrefName.PALM_SYNC);
0589: setCheckBox(useBeep, PrefName.USESYSTEMBEEP);
0590: setCheckBox(sharedFileCheckBox, PrefName.SHARED);
0591: setCheckBox(icaltodobox, PrefName.ICALTODOEV);
0592: setCheckBox(truncbox, PrefName.TRUNCAPPT);
0593: setCheckBox(iso8601Box, PrefName.ISOWKNUMBER);
0594: // setCheckBox(extraDayBox, PrefName.SHOWEXTRADAYS);
0595: setCheckBox(useSysTray, PrefName.USESYSTRAY);
0596: setCheckBox(taskAbbrevBox, PrefName.TASK_SHOW_ABBREV);
0597: setCheckBox(calShowTaskBox, PrefName.CAL_SHOW_TASKS);
0598: setCheckBox(calShowSubtaskBox, PrefName.CAL_SHOW_SUBTASKS);
0599: setCheckBox(ganttShowSubtaskBox, PrefName.GANTT_SHOW_SUBTASKS);
0600: setCheckBox(dock, PrefName.DOCKPANELS);
0601:
0602: int socket = Prefs.getIntPref(PrefName.SOCKETPORT);
0603: socketPort.setText(Integer.toString(socket));
0604:
0605: // print logo directory
0606: String logo = Prefs.getPref(PrefName.LOGO);
0607: logofile.setText(logo);
0608: if (!logo.equals("")) {
0609: logobox.setSelected(true);
0610: } else {
0611: logobox.setSelected(false);
0612: }
0613:
0614: // email server and address
0615: smtptext.setText(Prefs.getPref(PrefName.EMAILSERVER));
0616: emailtext.setText(Prefs.getPref(PrefName.EMAILADDR));
0617: usertext.setText(Prefs.getPref(PrefName.EMAILUSER));
0618: smpw.setText(Prefs.getPref(PrefName.EMAILPASS));
0619:
0620: int fdow = Prefs.getIntPref(PrefName.FIRSTDOW);
0621: if (fdow == Calendar.MONDAY) {
0622: mondaycb.setSelected(true);
0623: } else {
0624: mondaycb.setSelected(false);
0625: }
0626:
0627: // auto update check
0628: int au = Prefs.getIntPref(PrefName.VERCHKLAST);
0629: if (au != -1) {
0630: autoupdate.setSelected(true);
0631: } else {
0632: autoupdate.setSelected(false);
0633: }
0634:
0635: // add installed look and feels to lnfBox
0636: lnfBox.removeAllItems();
0637: TreeSet lnfs = new TreeSet();
0638: String curlnf = Prefs.getPref(PrefName.LNF);
0639: LookAndFeelInfo lnfinfo[] = UIManager
0640: .getInstalledLookAndFeels();
0641: for (int i = 0; i < lnfinfo.length; i++) {
0642: String name = lnfinfo[i].getClassName();
0643: lnfs.add(name);
0644: }
0645: try {
0646: Class
0647: .forName("com.jgoodies.looks.plastic.PlasticLookAndFeel");
0648: lnfs.add("com.jgoodies.looks.plastic.PlasticLookAndFeel");
0649: } catch (Exception e) {
0650: }
0651: try {
0652: Class
0653: .forName("com.jgoodies.looks.windows.WindowsLookAndFeel");
0654: lnfs.add("com.jgoodies.looks.windows.WindowsLookAndFeel");
0655: } catch (Exception e) {
0656: }
0657: try {
0658: Class
0659: .forName("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
0660: lnfs.add("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
0661: } catch (Exception e) {
0662: }
0663: try {
0664: Class
0665: .forName("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
0666: lnfs.add("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
0667: } catch (Exception e) {
0668: }
0669: try {
0670: Class
0671: .forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel");
0672: lnfs
0673: .add("com.incors.plaf.kunststoff.KunststoffLookAndFeel");
0674: } catch (Exception e) {
0675: }
0676: try {
0677: Class
0678: .forName("de.javasoft.plaf.synthetica.SyntheticaStandardLookAndFeel");
0679: lnfs
0680: .add("de.javasoft.plaf.synthetica.SyntheticaStandardLookAndFeel");
0681: } catch (Exception e) {
0682: }
0683:
0684: lnfs.add(curlnf);
0685:
0686: Iterator it = lnfs.iterator();
0687: while (it.hasNext()) {
0688: lnfBox.addItem(it.next());
0689: }
0690:
0691: lnfBox.setSelectedItem(curlnf);
0692: lnfBox.setEditable(false);
0693:
0694: String shr = Prefs.getPref(PrefName.WKSTARTHOUR);
0695: String ehr = Prefs.getPref(PrefName.WKENDHOUR);
0696: wkstarthr.setSelectedItem(shr);
0697: wkendhr.setSelectedItem(ehr);
0698:
0699: // add locales
0700: String nolocale = Prefs.getPref(PrefName.NOLOCALE);
0701: if (!nolocale.equals("1")) {
0702: localebox.removeAllItems();
0703:
0704: Locale locs[] = Locale.getAvailableLocales();
0705: for (int i = 0; i < locs.length; i++) {
0706: // String name = locs[i].
0707: localebox.addItem(locs[i].getDisplayName());
0708: }
0709:
0710: String currentlocale = Locale.getDefault().getDisplayName();
0711: localebox.setSelectedItem(currentlocale);
0712: } else {
0713: localebox.setEnabled(false);
0714: }
0715:
0716: int mins = Prefs.getIntPref(PrefName.REMINDERCHECKMINS);
0717: checkfreq.setValue(new Integer(mins));
0718:
0719: mins = Prefs.getIntPref(PrefName.SYNCMINS);
0720: syncmins.setValue(new Integer(mins));
0721:
0722: setCheckBox(cb_ucs_ontodo, PrefName.UCS_ONTODO);
0723: setCheckBox(cb_ucs_marktodo, PrefName.UCS_MARKTODO);
0724:
0725: tf_ucs_marker.setText(Prefs.getPref(PrefName.UCS_MARKER));
0726: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_RED));
0727: btn_ucs_red.setColorProperty(new Color(mins));
0728: btn_ucs_red.setColorByProperty();
0729: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_BLUE));
0730: btn_ucs_blue.setColorProperty(new Color(mins));
0731: btn_ucs_blue.setColorByProperty();
0732: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_GREEN));
0733: btn_ucs_green.setColorProperty(new Color(mins));
0734: btn_ucs_green.setColorByProperty();
0735: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_BLACK));
0736: btn_ucs_black.setColorProperty(new Color(mins));
0737: btn_ucs_black.setColorByProperty();
0738: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_WHITE));
0739: btn_ucs_white.setColorProperty(new Color(mins));
0740: btn_ucs_white.setColorByProperty();
0741:
0742: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_NAVY));
0743: btn_ucs_tasks.setColorProperty(new Color(mins));
0744: btn_ucs_tasks.setColorByProperty();
0745: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_PURPLE));
0746: btn_ucs_holidays.setColorProperty(new Color(mins));
0747: btn_ucs_holidays.setColorByProperty();
0748: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_BRICK));
0749: btn_ucs_birthdays.setColorProperty(new Color(mins));
0750: btn_ucs_birthdays.setColorByProperty();
0751:
0752: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_DEFAULT));
0753: btn_ucs_default.setColorProperty(new Color(mins));
0754: btn_ucs_default.setColorByProperty();
0755: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_TODAY));
0756: btn_ucs_today.setColorProperty(new Color(mins));
0757: btn_ucs_today.setColorByProperty();
0758: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_HOLIDAY));
0759: btn_ucs_holiday.setColorProperty(new Color(mins));
0760: btn_ucs_holiday.setColorByProperty();
0761: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_HALFDAY));
0762: btn_ucs_halfday.setColorProperty(new Color(mins));
0763: btn_ucs_halfday.setColorByProperty();
0764: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_VACATION));
0765: btn_ucs_vacation.setColorProperty(new Color(mins));
0766: btn_ucs_vacation.setColorByProperty();
0767: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_WEEKEND));
0768: btn_ucs_weekend.setColorProperty(new Color(mins));
0769: btn_ucs_weekend.setColorByProperty();
0770: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_WEEKDAY));
0771: btn_ucs_weekday.setColorProperty(new Color(mins));
0772: btn_ucs_weekday.setColorByProperty();
0773: mins = Integer.parseInt(Prefs.getPref(PrefName.UCS_STRIPE));
0774: btn_ucs_stripe.setColorProperty(new Color(mins));
0775: btn_ucs_stripe.setColorByProperty();
0776:
0777: logobrowse.setEnabled(true);
0778:
0779: manageMySize(PrefName.OPTVIEWSIZE);
0780: }
0781:
0782: public void destroy() {
0783: this .dispose();
0784: }
0785:
0786: public void refresh() {
0787: }
0788:
0789: private void apply(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_apply
0790: applyChanges();
0791: }// GEN-LAST:event_apply
0792:
0793: private void applyChanges() {
0794:
0795: setBooleanPref(colorprint, PrefName.COLORPRINT);
0796: setBooleanPref(pubbox, PrefName.SHOWPUBLIC);
0797: setBooleanPref(privbox, PrefName.SHOWPRIVATE);
0798: setBooleanPref(emailbox, PrefName.EMAILENABLED);
0799: setBooleanPref(indEmailBox, PrefName.INDIVEMAILENABLED);
0800: setBooleanPref(holiday1, PrefName.SHOWUSHOLIDAYS);
0801: setBooleanPref(canadabox, PrefName.SHOWCANHOLIDAYS);
0802: setBooleanPref(doyBox, PrefName.DAYOFYEAR);
0803: setBooleanPref(exputcbox, PrefName.ICALUTC);
0804: setBooleanPref(colorsortbox, PrefName.COLORSORT);
0805: setBooleanPref(miltime, PrefName.MILTIME);
0806: setBooleanPref(backgbox, PrefName.BACKGSTART);
0807: setBooleanPref(splashbox, PrefName.SPLASH);
0808: setBooleanPref(stackbox, PrefName.STACKTRACE);
0809: setBooleanPref(wrapbox, PrefName.WRAP);
0810: setBooleanPref(oldmonthbox, PrefName.OLDMONTHVIEW);
0811: setBooleanPref(popenablebox, PrefName.REMINDERS);
0812: setBooleanPref(soundbox, PrefName.BEEPINGREMINDERS);
0813: setBooleanPref(palmcb, PrefName.PALM_SYNC);
0814: setBooleanPref(useBeep, PrefName.USESYSTEMBEEP);
0815: setBooleanPref(sharedFileCheckBox, PrefName.SHARED);
0816: setBooleanPref(icaltodobox, PrefName.ICALTODOEV);
0817: setBooleanPref(truncbox, PrefName.TRUNCAPPT);
0818: setBooleanPref(iso8601Box, PrefName.ISOWKNUMBER);
0819: // setBooleanPref(extraDayBox, PrefName.SHOWEXTRADAYS);
0820: setBooleanPref(useSysTray, PrefName.USESYSTRAY);
0821: setBooleanPref(taskAbbrevBox, PrefName.TASK_SHOW_ABBREV);
0822: setBooleanPref(calShowTaskBox, PrefName.CAL_SHOW_TASKS);
0823: setBooleanPref(calShowSubtaskBox, PrefName.CAL_SHOW_SUBTASKS);
0824: setBooleanPref(ganttShowSubtaskBox,
0825: PrefName.GANTT_SHOW_SUBTASKS);
0826: setBooleanPref(dock, PrefName.DOCKPANELS);
0827:
0828: Prefs.putPref(PrefName.BACKUPDIR, backupDir.getText());
0829:
0830: try {
0831: int socket = Integer.parseInt(socketPort.getText());
0832: Prefs.putPref(PrefName.SOCKETPORT, new Integer(socket));
0833: } catch (NumberFormatException e) {
0834: Errmsg.notice(Resource
0835: .getPlainResourceString("socket_warn"));
0836: socketPort.setText("-1");
0837: Prefs.putPref(PrefName.SOCKETPORT, new Integer(-1));
0838: return;
0839: }
0840:
0841: Integer i = (Integer) getIndEmailtimebox().getValue();
0842: int cur = Prefs.getIntPref(PrefName.INDIVEMAILMINS);
0843: if (i.intValue() != cur) {
0844: Prefs.putPref(PrefName.INDIVEMAILMINS, i);
0845: }
0846:
0847: i = (Integer) checkfreq.getValue();
0848: cur = Prefs.getIntPref(PrefName.REMINDERCHECKMINS);
0849: if (i.intValue() != cur) {
0850: Prefs.putPref(PrefName.REMINDERCHECKMINS, i);
0851: }
0852:
0853: i = (Integer) syncmins.getValue();
0854: cur = Prefs.getIntPref(PrefName.SYNCMINS);
0855: if (i.intValue() != cur) {
0856: Prefs.putPref(PrefName.SYNCMINS, i);
0857: }
0858:
0859: if (mondaycb.isSelected()) {
0860: Prefs.putPref(PrefName.FIRSTDOW, new Integer(
0861: Calendar.MONDAY));
0862: } else {
0863: Prefs.putPref(PrefName.FIRSTDOW, new Integer(
0864: Calendar.SUNDAY));
0865: }
0866:
0867: Prefs.putPref(PrefName.WKENDHOUR, wkendhr.getSelectedItem());
0868: Prefs
0869: .putPref(PrefName.WKSTARTHOUR, wkstarthr
0870: .getSelectedItem());
0871:
0872: // enable/disable auto-update-check
0873: // value is the last day-of-year that check was done (1-365)
0874: // phony value 400 will cause check during current day
0875: // value -1 is the shut-off value
0876: if (autoupdate.isSelected()) {
0877: Prefs.putPref(PrefName.VERCHKLAST, new Integer(400));
0878: } else {
0879: Prefs.putPref(PrefName.VERCHKLAST, new Integer(-1));
0880: }
0881:
0882: setBooleanPref(cb_ucs_ontodo, PrefName.UCS_ONTODO);
0883: setBooleanPref(cb_ucs_marktodo, PrefName.UCS_MARKTODO);
0884:
0885: Prefs.putPref(PrefName.UCS_MARKER, tf_ucs_marker.getText());
0886:
0887: Integer ucsi = new Integer((btn_ucs_red.getColorProperty())
0888: .getRGB());
0889: Prefs.putPref(PrefName.UCS_RED, ucsi.toString());
0890: ucsi = new Integer((btn_ucs_blue.getColorProperty()).getRGB());
0891: Prefs.putPref(PrefName.UCS_BLUE, ucsi.toString());
0892: ucsi = new Integer((btn_ucs_green.getColorProperty()).getRGB());
0893: Prefs.putPref(PrefName.UCS_GREEN, ucsi.toString());
0894: ucsi = new Integer((btn_ucs_black.getColorProperty()).getRGB());
0895: Prefs.putPref(PrefName.UCS_BLACK, ucsi.toString());
0896: ucsi = new Integer((btn_ucs_white.getColorProperty()).getRGB());
0897: Prefs.putPref(PrefName.UCS_WHITE, ucsi.toString());
0898:
0899: ucsi = new Integer((btn_ucs_tasks.getColorProperty()).getRGB());
0900: Prefs.putPref(PrefName.UCS_NAVY, ucsi.toString());
0901: ucsi = new Integer((btn_ucs_holidays.getColorProperty())
0902: .getRGB());
0903: Prefs.putPref(PrefName.UCS_PURPLE, ucsi.toString());
0904: ucsi = new Integer((btn_ucs_birthdays.getColorProperty())
0905: .getRGB());
0906: Prefs.putPref(PrefName.UCS_BRICK, ucsi.toString());
0907:
0908: ucsi = new Integer((btn_ucs_default.getColorProperty())
0909: .getRGB());
0910: Prefs.putPref(PrefName.UCS_DEFAULT, ucsi.toString());
0911: ucsi = new Integer((btn_ucs_holiday.getColorProperty())
0912: .getRGB());
0913: Prefs.putPref(PrefName.UCS_HOLIDAY, ucsi.toString());
0914: ucsi = new Integer((btn_ucs_halfday.getColorProperty())
0915: .getRGB());
0916: Prefs.putPref(PrefName.UCS_HALFDAY, ucsi.toString());
0917: ucsi = new Integer((btn_ucs_vacation.getColorProperty())
0918: .getRGB());
0919: Prefs.putPref(PrefName.UCS_VACATION, ucsi.toString());
0920: ucsi = new Integer((btn_ucs_today.getColorProperty()).getRGB());
0921: Prefs.putPref(PrefName.UCS_TODAY, ucsi.toString());
0922: ucsi = new Integer((btn_ucs_weekend.getColorProperty())
0923: .getRGB());
0924: Prefs.putPref(PrefName.UCS_WEEKEND, ucsi.toString());
0925: ucsi = new Integer((btn_ucs_weekday.getColorProperty())
0926: .getRGB());
0927: Prefs.putPref(PrefName.UCS_WEEKDAY, ucsi.toString());
0928: ucsi = new Integer((btn_ucs_stripe.getColorProperty()).getRGB());
0929: Prefs.putPref(PrefName.UCS_STRIPE, ucsi.toString());
0930: StripedTable.setStripeColor(new Color(ucsi.intValue()));
0931:
0932: if (!logobox.isSelected()) {
0933: Prefs.putPref(PrefName.LOGO, "");
0934: logofile.setText("");
0935: } else {
0936: Prefs.putPref(PrefName.LOGO, logofile.getText());
0937: }
0938:
0939: if (emailbox.isSelected()) {
0940: Prefs.putPref(PrefName.EMAILSERVER, smtptext.getText());
0941: Prefs.putPref(PrefName.EMAILADDR, emailtext.getText());
0942: Prefs.putPref(PrefName.EMAILUSER, usertext.getText());
0943: Prefs.putPref(PrefName.EMAILPASS, new String(smpw
0944: .getPassword()));
0945:
0946: }
0947:
0948: Locale locs[] = Locale.getAvailableLocales();
0949: String choice = (String) localebox.getSelectedItem();
0950: for (int ii = 0; ii < locs.length; ii++) {
0951: if (choice.equals(locs[ii].getDisplayName())) {
0952: Prefs.putPref(PrefName.COUNTRY, locs[ii].getCountry());
0953: Prefs
0954: .putPref(PrefName.LANGUAGE, locs[ii]
0955: .getLanguage());
0956: }
0957: }
0958:
0959: String newlnf = (String) lnfBox.getSelectedItem();
0960: String oldlnf = Prefs.getPref(PrefName.LNF);
0961: if (!newlnf.equals(oldlnf)) {
0962: Errmsg.notice(Resource.getPlainResourceString("lfrestart"));
0963: Prefs.putPref(PrefName.LNF, newlnf);
0964: /*
0965: try {
0966: UIManager.getLookAndFeelDefaults().put("ClassLoader",
0967: getClass().getClassLoader());
0968: UIManager.setLookAndFeel(newlnf);
0969: // don't try to change the main window l&f - is
0970: // doesn't work
0971: // 100%
0972: // SwingUtilities.updateComponentTreeUI(cg_);
0973: Prefs.putPref(PrefName.LNF, newlnf);
0974: // reset the option window's size since a change
0975: // of LNF
0976: // may cause the LNF combo box to be hidden
0977: Prefs.putPref(PrefName.OPTVIEWSIZE, new ViewSize().toString());
0978: } catch (Exception e) {
0979: // Errmsg.notice( "Could not find look and feel:
0980: // " + newlnf );
0981: Errmsg.notice(e.toString());
0982: return;
0983: }*/
0984: }
0985:
0986: Date d = (Date) emailtimebox.getValue();
0987: Calendar cal = new GregorianCalendar();
0988: cal.setTime(d);
0989: int hour = cal.get(Calendar.HOUR_OF_DAY);
0990: int min = cal.get(Calendar.MINUTE);
0991: Prefs.putPref(PrefName.EMAILTIME, new Integer(hour * 60 + min));
0992:
0993: String ls = (String) lsbox.getSelectedItem();
0994: Prefs.putPref(PrefName.LINESPACING, ls);
0995:
0996: remTimePanel.setTimes();
0997:
0998: Prefs.notifyListeners();
0999:
1000: }
1001:
1002: private void chgdbActionPerformed(java.awt.event.ActionEvent evt)// GEN-FIRST:event_chgdbActionPerformed
1003: {// GEN-HEADEREND:event_chgdbActionPerformed
1004: int ret = JOptionPane.showConfirmDialog(null, Resource
1005: .getResourceString("Really_change_the_database?"),
1006: Resource.getResourceString("Confirm_DB_Change"),
1007: JOptionPane.YES_NO_OPTION);
1008: if (ret == JOptionPane.YES_OPTION) {
1009: String dbdir = dbDirText.getText();
1010: Prefs.putPref(PrefName.DBDIR, dbdir);
1011: String hh = hsqldbdir.getText();
1012: Prefs.putPref(PrefName.HSQLDBDIR, hh);
1013:
1014: if (MySQLButton.isSelected()) {
1015: Prefs.putPref(PrefName.DBTYPE, "mysql");
1016: } else if (remoteButton.isSelected()) {
1017: Prefs.putPref(PrefName.DBTYPE, "remote");
1018: } else if (hsqldbButton.isSelected()) {
1019: Prefs.putPref(PrefName.DBTYPE, "hsqldb");
1020: } else if (jdbcButton.isSelected()) {
1021: Prefs.putPref(PrefName.DBTYPE, "jdbc");
1022: } else {
1023: Prefs.putPref(PrefName.DBTYPE, "local");
1024: }
1025:
1026: Prefs.putPref(PrefName.DBNAME, dbNameText.getText());
1027: Prefs.putPref(PrefName.DBPORT, dbPortText.getText());
1028: Prefs.putPref(PrefName.DBHOST, dbHostText.getText());
1029: Prefs.putPref(PrefName.DBUSER, dbUserText.getText());
1030: Prefs.putPref(PrefName.DBPASS, new String(jPasswordField1
1031: .getPassword()));
1032: Prefs.putPref(PrefName.DBURL, remoteURLText.getText());
1033: Prefs.putPref(PrefName.JDBCURL, jdbcText.getText());
1034:
1035: if (rl_ != null) {
1036: rl_.restart();
1037: }
1038:
1039: this .dispose();
1040: }
1041: }// GEN-LAST:event_chgdbActionPerformed
1042:
1043: private void dbTypeAction(java.awt.event.ActionEvent evt)// GEN-FIRST:event_dbTypeAction
1044: {// GEN-HEADEREND:event_dbTypeAction
1045: dbTypeChange(evt.getActionCommand());
1046: }// GEN-LAST:event_dbTypeAction
1047:
1048: private void dbTypeChange(String type) {
1049: if (type.equals("mysql")) {
1050: mysqlPanel.setVisible(true);
1051: localFilePanel.setVisible(false);
1052: remoteServerPanel.setVisible(false);
1053: hsqldbPanel.setVisible(false);
1054: jdbcPanel.setVisible(false);
1055: } else if (type.equals("remote")) {
1056: mysqlPanel.setVisible(false);
1057: localFilePanel.setVisible(false);
1058: remoteServerPanel.setVisible(true);
1059: hsqldbPanel.setVisible(false);
1060: jdbcPanel.setVisible(false);
1061: } else if (type.equals("hsqldb")) {
1062: mysqlPanel.setVisible(false);
1063: localFilePanel.setVisible(false);
1064: remoteServerPanel.setVisible(false);
1065: hsqldbPanel.setVisible(true);
1066: jdbcPanel.setVisible(false);
1067: } else if (type.equals("jdbc")) {
1068: mysqlPanel.setVisible(false);
1069: localFilePanel.setVisible(false);
1070: remoteServerPanel.setVisible(false);
1071: hsqldbPanel.setVisible(false);
1072: jdbcPanel.setVisible(true);
1073: } else {
1074: localFilePanel.setVisible(true);
1075: mysqlPanel.setVisible(false);
1076: remoteServerPanel.setVisible(false);
1077: hsqldbPanel.setVisible(false);
1078: jdbcPanel.setVisible(false);
1079: }
1080: }
1081:
1082: private void exitForm(java.awt.event.WindowEvent evt) {// GEN-FIRST:event_exitForm
1083: this .dispose();
1084: }// GEN-LAST:event_exitForm
1085:
1086: private void fontActionPerformed(java.awt.event.ActionEvent evt,
1087: PrefName fontname) {// GEN-FIRST:event_incfontActionPerformed
1088:
1089: Font pf = Font.decode(Prefs.getPref(fontname));
1090: Font f = NwFontChooserS.showDialog(null, null, pf);
1091: if (f == null) {
1092: return;
1093: }
1094: String s = NwFontChooserS.fontString(f);
1095:
1096: Prefs.putPref(fontname, s);
1097: if (fontname == PrefName.DEFFONT) {
1098: NwFontChooserS.setDefaultFont(f);
1099: SwingUtilities.updateComponentTreeUI(this );
1100: }
1101:
1102: Prefs.notifyListeners();
1103:
1104: }
1105:
1106: private JPanel getAppearancePanel() {
1107: JPanel appearancePanel = new JPanel();
1108: appearancePanel.setLayout(new java.awt.GridBagLayout());
1109:
1110: appearancePanel.setName(Resource
1111: .getResourceString("appearance"));
1112: ResourceHelper.setText(privbox, "Show_Private_Appointments");
1113: GridBagConstraints gridBagConstraints0 = new java.awt.GridBagConstraints();
1114: gridBagConstraints0.gridx = 1;
1115: gridBagConstraints0.gridy = 1;
1116: gridBagConstraints0.fill = java.awt.GridBagConstraints.BOTH;
1117: gridBagConstraints0.anchor = java.awt.GridBagConstraints.WEST;
1118: gridBagConstraints0.insets = new java.awt.Insets(4, 4, 4, 4);
1119: appearancePanel.add(privbox, gridBagConstraints0);
1120:
1121: ResourceHelper.setText(pubbox, "Show_Public_Appointments");
1122: GridBagConstraints gridBagConstraints1 = new java.awt.GridBagConstraints();
1123: gridBagConstraints1.gridx = 0;
1124: gridBagConstraints1.gridy = 1;
1125: gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
1126: gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST;
1127: gridBagConstraints1.insets = new java.awt.Insets(4, 4, 4, 4);
1128: appearancePanel.add(pubbox, gridBagConstraints1);
1129:
1130: ResourceHelper.setText(jLabel4, "Look_and_Feel:");
1131: jLabel4.setLabelFor(lnfBox);
1132: GridBagConstraints gridBagConstraints4 = new java.awt.GridBagConstraints();
1133: gridBagConstraints4.gridx = 0;
1134: gridBagConstraints4.gridy = 0;
1135: gridBagConstraints4.fill = java.awt.GridBagConstraints.BOTH;
1136: gridBagConstraints4.anchor = java.awt.GridBagConstraints.WEST;
1137: gridBagConstraints4.insets = new java.awt.Insets(4, 4, 4, 4);
1138: appearancePanel.add(jLabel4, gridBagConstraints4);
1139:
1140: lnfBox.setEditable(true);
1141: lnfBox.setMaximumSize(new java.awt.Dimension(131, 24));
1142: lnfBox.setPreferredSize(new java.awt.Dimension(50, 24));
1143: lnfBox.setAutoscrolls(true);
1144: GridBagConstraints gridBagConstraints5 = new java.awt.GridBagConstraints();
1145: gridBagConstraints5.gridx = 1;
1146: gridBagConstraints5.gridy = 0;
1147: gridBagConstraints5.fill = java.awt.GridBagConstraints.BOTH;
1148: gridBagConstraints5.anchor = java.awt.GridBagConstraints.WEST;
1149: gridBagConstraints5.insets = new java.awt.Insets(4, 4, 4, 4);
1150: appearancePanel.add(lnfBox, gridBagConstraints5);
1151:
1152: ResourceHelper.setText(holiday1, "Show_U.S._Holidays");
1153: GridBagConstraints gridBagConstraints6 = new java.awt.GridBagConstraints();
1154: gridBagConstraints6.gridx = 0;
1155: gridBagConstraints6.gridy = 3;
1156: gridBagConstraints6.fill = java.awt.GridBagConstraints.BOTH;
1157: gridBagConstraints6.anchor = java.awt.GridBagConstraints.WEST;
1158: gridBagConstraints6.insets = new java.awt.Insets(4, 4, 4, 4);
1159: appearancePanel.add(holiday1, gridBagConstraints6);
1160:
1161: ResourceHelper.setText(mondaycb, "Week_Starts_with_Monday");
1162: GridBagConstraints gridBagConstraints7 = new java.awt.GridBagConstraints();
1163: gridBagConstraints7.gridx = 1;
1164: gridBagConstraints7.gridy = 4;
1165: gridBagConstraints7.fill = java.awt.GridBagConstraints.BOTH;
1166: gridBagConstraints7.anchor = java.awt.GridBagConstraints.WEST;
1167: gridBagConstraints7.insets = new java.awt.Insets(4, 4, 4, 4);
1168: appearancePanel.add(mondaycb, gridBagConstraints7);
1169:
1170: ResourceHelper.setText(miltime, "Use_24_hour_time_format");
1171: GridBagConstraints gridBagConstraints8 = new java.awt.GridBagConstraints();
1172: gridBagConstraints8.gridx = 0;
1173: gridBagConstraints8.gridy = 4;
1174: gridBagConstraints8.fill = java.awt.GridBagConstraints.BOTH;
1175: gridBagConstraints8.anchor = java.awt.GridBagConstraints.WEST;
1176: gridBagConstraints8.insets = new java.awt.Insets(4, 4, 4, 4);
1177: appearancePanel.add(miltime, gridBagConstraints8);
1178:
1179: ResourceHelper.setText(jLabel5, "Week_View_Start_Hour:_");
1180: jLabel5.setLabelFor(wkstarthr);
1181: GridBagConstraints gridBagConstraints9 = new java.awt.GridBagConstraints();
1182: gridBagConstraints9.gridx = 0;
1183: gridBagConstraints9.gridy = 6;
1184: gridBagConstraints9.fill = java.awt.GridBagConstraints.BOTH;
1185: gridBagConstraints9.insets = new java.awt.Insets(4, 4, 4, 4);
1186: wkstarthr
1187: .setModel(new javax.swing.DefaultComboBoxModel(
1188: new String[] { "4", "5", "6", "7", "8", "9",
1189: "10", "11" }));
1190: appearancePanel.add(jLabel5, gridBagConstraints9);
1191:
1192: GridBagConstraints gridBagConstraints10 = new java.awt.GridBagConstraints();
1193: gridBagConstraints10.gridx = 1;
1194: gridBagConstraints10.gridy = 6;
1195: gridBagConstraints10.fill = java.awt.GridBagConstraints.VERTICAL;
1196: gridBagConstraints10.anchor = java.awt.GridBagConstraints.WEST;
1197: gridBagConstraints10.insets = new java.awt.Insets(4, 4, 4, 4);
1198: wkendhr.setModel(new javax.swing.DefaultComboBoxModel(
1199: new String[] { "12", "13", "14", "15", "16", "17",
1200: "18", "19", "20", "21", "22", "23" }));
1201: appearancePanel.add(wkstarthr, gridBagConstraints10);
1202:
1203: GridBagConstraints gridBagConstraints11 = new java.awt.GridBagConstraints();
1204: gridBagConstraints11.gridx = 1;
1205: gridBagConstraints11.gridy = 7;
1206: gridBagConstraints11.fill = java.awt.GridBagConstraints.VERTICAL;
1207: gridBagConstraints11.anchor = java.awt.GridBagConstraints.WEST;
1208: gridBagConstraints11.insets = new java.awt.Insets(4, 4, 4, 4);
1209: ResourceHelper.setText(jLabel6, "Week_View_End_Hour:_");
1210: jLabel6.setLabelFor(wkendhr);
1211: appearancePanel.add(wkendhr, gridBagConstraints11);
1212:
1213: GridBagConstraints gridBagConstraints12 = new java.awt.GridBagConstraints();
1214: gridBagConstraints12.gridx = 0;
1215: gridBagConstraints12.gridy = 7;
1216: gridBagConstraints12.fill = java.awt.GridBagConstraints.BOTH;
1217: gridBagConstraints12.insets = new java.awt.Insets(4, 4, 4, 4);
1218: ResourceHelper.setText(wrapbox, "Wrap_Appointment_Text");
1219: appearancePanel.add(jLabel6, gridBagConstraints12);
1220:
1221: GridBagConstraints gridBagConstraints13 = new java.awt.GridBagConstraints();
1222: gridBagConstraints13.gridx = 0;
1223: gridBagConstraints13.gridy = 2;
1224: gridBagConstraints13.fill = java.awt.GridBagConstraints.BOTH;
1225: gridBagConstraints13.insets = new java.awt.Insets(4, 4, 4, 4);
1226: appearancePanel.add(wrapbox, gridBagConstraints13);
1227:
1228: ResourceHelper.setText(canadabox, "Show_Canadian_Holidays");
1229: GridBagConstraints gridBagConstraints14 = new java.awt.GridBagConstraints();
1230: gridBagConstraints14.gridx = 1;
1231: gridBagConstraints14.gridy = 3;
1232: gridBagConstraints14.fill = java.awt.GridBagConstraints.BOTH;
1233: gridBagConstraints14.insets = new java.awt.Insets(4, 4, 4, 4);
1234: appearancePanel.add(canadabox, gridBagConstraints14);
1235:
1236: ResourceHelper.setText(jLabel8, "locale");
1237: jLabel8.setLabelFor(localebox);
1238: GridBagConstraints gridBagConstraints15 = new java.awt.GridBagConstraints();
1239: gridBagConstraints15.gridx = 0;
1240: gridBagConstraints15.gridy = 11;
1241: gridBagConstraints15.fill = java.awt.GridBagConstraints.BOTH;
1242: gridBagConstraints15.insets = new java.awt.Insets(4, 4, 4, 4);
1243: appearancePanel.add(jLabel8, gridBagConstraints15);
1244:
1245: GridBagConstraints gridBagConstraints16 = new java.awt.GridBagConstraints();
1246: gridBagConstraints16.gridx = 1;
1247: gridBagConstraints16.gridy = 11;
1248: gridBagConstraints16.fill = java.awt.GridBagConstraints.BOTH;
1249: gridBagConstraints16.insets = new java.awt.Insets(4, 4, 4, 4);
1250:
1251: appearancePanel.add(localebox, gridBagConstraints16);
1252:
1253: GridBagConstraints gridBagConstraints97 = new java.awt.GridBagConstraints();
1254: gridBagConstraints97.gridx = 1;
1255: gridBagConstraints97.gridy = 8;
1256: gridBagConstraints97.fill = java.awt.GridBagConstraints.VERTICAL;
1257: gridBagConstraints97.anchor = java.awt.GridBagConstraints.WEST;
1258: gridBagConstraints97.weightx = 1.0;
1259: gridBagConstraints97.insets = new java.awt.Insets(4, 4, 4, 4);
1260: ResourceHelper.setText(iso8601Box, "ISO_week_number");
1261: appearancePanel.add(iso8601Box, gridBagConstraints97);
1262:
1263: GridBagConstraints gridBagConstraintsdk = new java.awt.GridBagConstraints();
1264: gridBagConstraintsdk.gridx = 0;
1265: gridBagConstraintsdk.gridy = 8;
1266: gridBagConstraintsdk.fill = java.awt.GridBagConstraints.VERTICAL;
1267: gridBagConstraintsdk.anchor = java.awt.GridBagConstraints.WEST;
1268: gridBagConstraintsdk.weightx = 1.0;
1269: gridBagConstraintsdk.insets = new java.awt.Insets(4, 4, 4, 4);
1270: ResourceHelper.setText(dock, "dock_option");
1271: appearancePanel.add(dock, gridBagConstraintsdk);
1272:
1273: GridBagConstraints gridBagConstraints18 = new java.awt.GridBagConstraints();
1274: gridBagConstraints18.gridx = 0;
1275: gridBagConstraints18.gridy = 5;
1276: gridBagConstraints18.fill = java.awt.GridBagConstraints.BOTH;
1277: gridBagConstraints18.insets = new java.awt.Insets(4, 4, 4, 4);
1278: ResourceHelper.setText(colorsortbox, "colorsort");
1279: appearancePanel.add(colorsortbox, gridBagConstraints18);
1280:
1281: GridBagConstraints gridBagConstraints110 = new GridBagConstraints();
1282: gridBagConstraints110.gridx = 1;
1283: gridBagConstraints110.gridy = 5;
1284: gridBagConstraints110.fill = java.awt.GridBagConstraints.BOTH;
1285: gridBagConstraints110.insets = new java.awt.Insets(4, 4, 4, 4);
1286: appearancePanel.add(getDoyBox(), gridBagConstraints110);
1287:
1288: lslabel = new JLabel();
1289: ResourceHelper.setText(lslabel, "line_spacing");
1290: lslabel.setLabelFor(getLsbox());
1291: GridBagConstraints gridBagConstraints114 = new GridBagConstraints();
1292: gridBagConstraints114.gridx = 0;
1293: gridBagConstraints114.gridy = 10;
1294: gridBagConstraints114.fill = java.awt.GridBagConstraints.BOTH;
1295: gridBagConstraints114.insets = new java.awt.Insets(4, 4, 4, 4);
1296: appearancePanel.add(lslabel, gridBagConstraints114);
1297:
1298: GridBagConstraints gridBagConstraints115 = new GridBagConstraints();
1299: gridBagConstraints115.gridx = 1;
1300: gridBagConstraints115.gridy = 2;
1301: gridBagConstraints115.insets = new java.awt.Insets(4, 4, 4, 4);
1302: gridBagConstraints115.fill = java.awt.GridBagConstraints.BOTH;
1303: appearancePanel.add(getTruncbox(), gridBagConstraints115);
1304:
1305: GridBagConstraints gridBagConstraints44 = new GridBagConstraints();
1306: gridBagConstraints44.gridx = 1;
1307: gridBagConstraints44.gridy = 10;
1308: gridBagConstraints44.weightx = 1.0;
1309: gridBagConstraints44.fill = java.awt.GridBagConstraints.BOTH;
1310: gridBagConstraints44.insets = new java.awt.Insets(4, 4, 4, 4);
1311: appearancePanel.add(getLsbox(), gridBagConstraints44);
1312:
1313: return appearancePanel;
1314: }
1315:
1316: private JPanel getApplyDismissPanel() {
1317: if (applyDismissPanel == null) {
1318: applyDismissPanel = new JPanel();
1319:
1320: applyButton.setIcon(new javax.swing.ImageIcon(getClass()
1321: .getResource("/resource/Save16.gif")));
1322: ResourceHelper.setText(applyButton, "apply");
1323: applyButton
1324: .addActionListener(new java.awt.event.ActionListener() {
1325: public void actionPerformed(
1326: java.awt.event.ActionEvent evt) {
1327: apply(evt);
1328: }
1329: });
1330: applyDismissPanel.add(applyButton, null);
1331:
1332: dismissButton.setIcon(new javax.swing.ImageIcon(getClass()
1333: .getResource("/resource/Stop16.gif")));
1334: ResourceHelper.setText(dismissButton, "Dismiss");
1335: dismissButton
1336: .addActionListener(new java.awt.event.ActionListener() {
1337: public void actionPerformed(
1338: java.awt.event.ActionEvent evt) {
1339: jButton2ActionPerformed(evt);
1340: }
1341: });
1342: setDismissButton(dismissButton);
1343: applyDismissPanel.add(dismissButton, null);
1344: }
1345: return applyDismissPanel;
1346: }
1347:
1348: private JPanel getDBPanel() {
1349:
1350: JPanel dbPanel = new JPanel();
1351:
1352: dbPanel = new JPanel();
1353: dbPanel.setLayout(new GridBagLayout());
1354:
1355: GridBagConstraints gridBagConstraints2 = new java.awt.GridBagConstraints();
1356: gridBagConstraints2.gridx = 0;
1357: gridBagConstraints2.gridy = 1;
1358: gridBagConstraints2.gridwidth = java.awt.GridBagConstraints.REMAINDER;
1359: gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
1360: gridBagConstraints2.weightx = 1.0;
1361: gridBagConstraints2.weighty = 1.0;
1362: dbPanel.add(getMysqlPanel(), gridBagConstraints2);
1363:
1364: GridBagConstraints gridBagConstraints3 = new java.awt.GridBagConstraints();
1365: gridBagConstraints3.gridx = 0;
1366: gridBagConstraints3.gridy = 2;
1367: gridBagConstraints3.gridwidth = java.awt.GridBagConstraints.REMAINDER;
1368: gridBagConstraints3.fill = java.awt.GridBagConstraints.BOTH;
1369: gridBagConstraints3.weightx = 1.0;
1370: gridBagConstraints3.weighty = 1.0;
1371: dbPanel.add(getLocalFilePanel(), gridBagConstraints3);
1372:
1373: GridBagConstraints gridBagConstraints4 = new java.awt.GridBagConstraints();
1374: gridBagConstraints4.fill = java.awt.GridBagConstraints.HORIZONTAL;
1375: gridBagConstraints4.gridwidth = java.awt.GridBagConstraints.REMAINDER;
1376: gridBagConstraints4.gridy = 0;
1377: gridBagConstraints4.gridx = 0;
1378: dbPanel.add(getDbTypePanel(), gridBagConstraints4);
1379:
1380: GridBagConstraints gridBagConstraints5 = new java.awt.GridBagConstraints();
1381: gridBagConstraints5.insets = new java.awt.Insets(4, 4, 4, 4);
1382: gridBagConstraints5.gridx = 0; // Generated
1383: gridBagConstraints5.gridy = 6;
1384: gridBagConstraints5.weightx = 1.0;
1385: gridBagConstraints5.anchor = GridBagConstraints.CENTER;
1386: dbPanel.add(chgdb, gridBagConstraints5); // Generated
1387: chgdb.setForeground(new java.awt.Color(255, 0, 51));
1388: chgdb.setIcon(new javax.swing.ImageIcon(getClass().getResource(
1389: "/resource/Refresh16.gif")));
1390: ResourceHelper.setText(chgdb, "Apply_DB_Change");
1391: chgdb.addActionListener(new java.awt.event.ActionListener() {
1392: public void actionPerformed(java.awt.event.ActionEvent evt) {
1393: chgdbActionPerformed(evt);
1394: }
1395: });
1396:
1397: JButton help = new JButton();
1398: GridBagConstraints gridBagConstraintsh = new java.awt.GridBagConstraints();
1399: gridBagConstraintsh.insets = new java.awt.Insets(4, 4, 4, 4);
1400: gridBagConstraintsh.gridx = 1; // Generated
1401: gridBagConstraintsh.gridy = 6;
1402: gridBagConstraintsh.weightx = 1.0;
1403: gridBagConstraintsh.anchor = GridBagConstraints.CENTER;
1404: // gridBagConstraintsh.fill = java.awt.GridBagConstraints.HORIZONTAL;
1405: dbPanel.add(help, gridBagConstraintsh); // Generated
1406: help.setForeground(new java.awt.Color(255, 0, 51));
1407: help.setIcon(new javax.swing.ImageIcon(getClass().getResource(
1408: "/resource/Help16.gif")));
1409: ResourceHelper.setText(help, "Help");
1410:
1411: help.addActionListener(new java.awt.event.ActionListener() {
1412: public void actionPerformed(java.awt.event.ActionEvent evt) {
1413: try {
1414: HelpProxy.launchHelp();
1415: } catch (Exception e) {
1416: Errmsg.errmsg(e);
1417: }
1418: }
1419: });
1420:
1421: GridBagConstraints gridBagConstraints6 = new java.awt.GridBagConstraints();
1422: gridBagConstraints6.gridx = 0;
1423: gridBagConstraints6.gridy = 3;
1424: gridBagConstraints6.weightx = 1.0;
1425: gridBagConstraints6.weighty = 1.0;
1426: gridBagConstraints6.gridwidth = java.awt.GridBagConstraints.REMAINDER;
1427: gridBagConstraints6.insets = new java.awt.Insets(4, 4, 4, 4);
1428: gridBagConstraints6.fill = java.awt.GridBagConstraints.HORIZONTAL;
1429: dbPanel.add(getRemoteServerPanel(), gridBagConstraints6); // Generated
1430:
1431: GridBagConstraints gridBagConstraints6h = new java.awt.GridBagConstraints();
1432: gridBagConstraints6h.gridx = 0;
1433: gridBagConstraints6h.gridy = 4;
1434: gridBagConstraints6h.weightx = 1.0;
1435: gridBagConstraints6h.weighty = 1.0;
1436: gridBagConstraints6h.insets = new java.awt.Insets(4, 4, 4, 4);
1437: gridBagConstraints6h.fill = java.awt.GridBagConstraints.HORIZONTAL;
1438: gridBagConstraints6h.gridwidth = java.awt.GridBagConstraints.REMAINDER;
1439: dbPanel.add(getHSQLDBPanel(), gridBagConstraints6h); // Generated
1440:
1441: GridBagConstraints gridBagConstraints7h = new java.awt.GridBagConstraints();
1442: gridBagConstraints7h.gridx = 0;
1443: gridBagConstraints7h.gridy = 5;
1444: gridBagConstraints7h.weightx = 1.0;
1445: gridBagConstraints7h.weighty = 1.0;
1446: gridBagConstraints7h.gridwidth = java.awt.GridBagConstraints.REMAINDER;
1447: gridBagConstraints7h.insets = new java.awt.Insets(4, 4, 4, 4);
1448: gridBagConstraints7h.fill = java.awt.GridBagConstraints.HORIZONTAL;
1449: dbPanel.add(getJdbcPanel(), gridBagConstraints7h); // Generated
1450:
1451: return dbPanel;
1452: }
1453:
1454: private JPanel getDbTypePanel() {
1455: if (dbTypePanel == null) {
1456: FlowLayout flowLayout = new FlowLayout();
1457: flowLayout.setAlignment(java.awt.FlowLayout.LEFT); // Generated
1458: flowLayout.setHgap(40); // Generated
1459: dbTypePanel = new JPanel();
1460: dbTypePanel.setLayout(flowLayout); // Generated
1461: dbTypePanel.add(getHSQLDBFileButton(), null);
1462: dbTypePanel.add(getMySQLButton(), null); // Generated
1463: dbTypePanel.add(getRemoteButton(), null); // Generated
1464: dbTypePanel.add(getLocalFileButton(), null); // Generated
1465: dbTypePanel.add(getJdbcButton(), null); // Generated
1466:
1467: }
1468: return dbTypePanel;
1469: }
1470:
1471: private JCheckBox getDoyBox() {
1472: if (doyBox == null) {
1473: doyBox = new JCheckBox();
1474: ResourceHelper.setText(doyBox, "showdoy");
1475: }
1476: return doyBox;
1477: }
1478:
1479: private JPanel getEmailPanel() {
1480: JPanel emailPanel = new JPanel();
1481: emailPanel.setLayout(new java.awt.GridBagLayout());
1482:
1483: ResourceHelper.setText(jLabel1, "SMTP_Server");
1484: GridBagConstraints gridBagConstraints35 = new java.awt.GridBagConstraints();
1485: gridBagConstraints35.gridx = 0;
1486: gridBagConstraints35.gridy = 1;
1487: gridBagConstraints35.fill = java.awt.GridBagConstraints.BOTH;
1488: gridBagConstraints35.insets = new java.awt.Insets(0, 4, 0, 0);
1489: emailPanel.add(jLabel1, gridBagConstraints35);
1490: jLabel1.setLabelFor(smtptext);
1491:
1492: JLabel userlabel = new JLabel();
1493: ResourceHelper.setText(userlabel, "SMTP_user");
1494: GridBagConstraints gridBagConstraintsUL = new java.awt.GridBagConstraints();
1495: gridBagConstraintsUL.gridx = 0;
1496: gridBagConstraintsUL.gridy = 2;
1497: gridBagConstraintsUL.fill = java.awt.GridBagConstraints.BOTH;
1498: gridBagConstraintsUL.insets = new java.awt.Insets(0, 4, 0, 0);
1499: emailPanel.add(userlabel, gridBagConstraintsUL);
1500: userlabel.setLabelFor(usertext);
1501:
1502: GridBagConstraints gridBagConstraintsTF = new java.awt.GridBagConstraints();
1503: gridBagConstraintsTF.gridx = 1;
1504: gridBagConstraintsTF.gridy = 2;
1505: gridBagConstraintsTF.fill = java.awt.GridBagConstraints.BOTH;
1506: // gridBagConstraintsTF.insets = new java.awt.Insets(0, 4, 0,
1507: // 0);
1508: emailPanel.add(usertext, gridBagConstraintsTF);
1509:
1510: JLabel passlabel = new JLabel();
1511: ResourceHelper.setText(passlabel, "SMTP_password");
1512: GridBagConstraints gridBagConstraintsPWL = new java.awt.GridBagConstraints();
1513: gridBagConstraintsPWL.gridx = 0;
1514: gridBagConstraintsPWL.gridy = 3;
1515: gridBagConstraintsPWL.fill = java.awt.GridBagConstraints.BOTH;
1516: gridBagConstraintsPWL.insets = new java.awt.Insets(0, 4, 0, 0);
1517: emailPanel.add(passlabel, gridBagConstraintsPWL);
1518: passlabel.setLabelFor(smpw);
1519:
1520: GridBagConstraints gridBagConstraintsPW = new java.awt.GridBagConstraints();
1521: gridBagConstraintsPW.gridx = 1;
1522: gridBagConstraintsPW.gridy = 3;
1523: gridBagConstraintsPW.fill = java.awt.GridBagConstraints.BOTH;
1524: // gridBagConstraintsTF.insets = new java.awt.Insets(0, 4, 0,
1525: // 0);
1526: emailPanel.add(smpw, gridBagConstraintsPW);
1527:
1528: ResourceHelper.setText(jLabel2, "Your_Email_Address");
1529: GridBagConstraints gridBagConstraints36 = new java.awt.GridBagConstraints();
1530: gridBagConstraints36.gridx = 0;
1531: gridBagConstraints36.gridy = 4;
1532: gridBagConstraints36.fill = java.awt.GridBagConstraints.BOTH;
1533: gridBagConstraints36.insets = new java.awt.Insets(0, 4, 0, 4);
1534: emailPanel.add(jLabel2, gridBagConstraints36);
1535: jLabel2.setLabelFor(emailtext);
1536:
1537: smtptext.setColumns(30);
1538: GridBagConstraints gridBagConstraints37 = new java.awt.GridBagConstraints();
1539: gridBagConstraints37.gridx = 1;
1540: gridBagConstraints37.gridy = 1;
1541: gridBagConstraints37.fill = java.awt.GridBagConstraints.BOTH;
1542: gridBagConstraints37.weightx = 1.0;
1543: emailPanel.add(smtptext, gridBagConstraints37);
1544:
1545: emailtext.setColumns(30);
1546: GridBagConstraints gridBagConstraints38 = new java.awt.GridBagConstraints();
1547: gridBagConstraints38.gridx = 1;
1548: gridBagConstraints38.gridy = 4;
1549: gridBagConstraints38.fill = java.awt.GridBagConstraints.BOTH;
1550: gridBagConstraints38.weightx = 1.0;
1551: emailPanel.add(emailtext, gridBagConstraints38);
1552:
1553: ResourceHelper.setText(emailbox, "Enable_Email");
1554: GridBagConstraints gridBagConstraints39 = new java.awt.GridBagConstraints();
1555: gridBagConstraints39.gridx = 0;
1556: gridBagConstraints39.gridy = 0;
1557: gridBagConstraints39.fill = java.awt.GridBagConstraints.BOTH;
1558: gridBagConstraints39.anchor = java.awt.GridBagConstraints.WEST;
1559: emailPanel.add(emailbox, gridBagConstraints39);
1560:
1561: GridBagConstraints gridBagConstraints116 = new GridBagConstraints();
1562:
1563: gridBagConstraints116.gridx = 0;
1564: gridBagConstraints116.gridy = 5;
1565: gridBagConstraints116.fill = java.awt.GridBagConstraints.BOTH;
1566: gridBagConstraints116.insets = new java.awt.Insets(4, 4, 4, 4);
1567: ResourceHelper.setText(remtimelabel, "reminder_time");
1568: remtimelabel.setLabelFor(emailtimebox);
1569: emailPanel.add(remtimelabel, gridBagConstraints116);
1570:
1571: GridBagConstraints gridBagConstraints212 = new GridBagConstraints();
1572: gridBagConstraints212.gridx = 1;
1573: gridBagConstraints212.gridy = 5;
1574: gridBagConstraints212.weightx = 1.0;
1575: gridBagConstraints212.fill = java.awt.GridBagConstraints.VERTICAL;
1576: gridBagConstraints212.insets = new java.awt.Insets(4, 4, 4, 4);
1577: gridBagConstraints212.anchor = java.awt.GridBagConstraints.WEST;
1578: emailPanel.add(getEmailtimebox(), gridBagConstraints212);
1579:
1580: ResourceHelper.setText(indEmailBox, "Email_Ind");
1581: GridBagConstraints gridBagConstraintse1 = new java.awt.GridBagConstraints();
1582: gridBagConstraintse1.gridx = 0;
1583: gridBagConstraintse1.gridy = 6;
1584: gridBagConstraintse1.fill = java.awt.GridBagConstraints.BOTH;
1585: gridBagConstraintse1.anchor = java.awt.GridBagConstraints.WEST;
1586: emailPanel.add(indEmailBox, gridBagConstraintse1);
1587:
1588: JLabel itimel = new JLabel();
1589: GridBagConstraints gridBagConstraintse3 = new GridBagConstraints();
1590: gridBagConstraintse3.gridx = 0;
1591: gridBagConstraintse3.gridy = 7;
1592: gridBagConstraintse3.fill = java.awt.GridBagConstraints.BOTH;
1593: gridBagConstraintse3.insets = new java.awt.Insets(4, 4, 4, 4);
1594: ResourceHelper.setText(itimel, "Email_Ind_Min");
1595: itimel.setLabelFor(getIndEmailtimebox());
1596: emailPanel.add(itimel, gridBagConstraintse3);
1597:
1598: GridBagConstraints gridBagConstraintse2 = new GridBagConstraints();
1599: gridBagConstraintse2.gridx = 1;
1600: gridBagConstraintse2.gridy = 7;
1601: gridBagConstraintse2.weightx = 1.0;
1602: gridBagConstraintse2.fill = java.awt.GridBagConstraints.VERTICAL;
1603: gridBagConstraintse2.insets = new java.awt.Insets(4, 4, 4, 4);
1604: gridBagConstraintse2.anchor = java.awt.GridBagConstraints.WEST;
1605: emailPanel.add(getIndEmailtimebox(), gridBagConstraintse2);
1606:
1607: return emailPanel;
1608: }
1609:
1610: private JSpinner getEmailtimebox() {
1611: if (emailtimebox == null) {
1612: emailtimebox = new JSpinner(new SpinnerDateModel());
1613: JSpinner.DateEditor de = new JSpinner.DateEditor(
1614: emailtimebox, "HH:mm");
1615: emailtimebox.setEditor(de);
1616: // emailtimebox.setValue(new Date());
1617:
1618: }
1619: return emailtimebox;
1620: }
1621:
1622: private JCheckBox getExputcbox() {
1623: if (exputcbox == null) {
1624: exputcbox = new JCheckBox();
1625: ResourceHelper.setText(exputcbox, "exputc");
1626: }
1627: return exputcbox;
1628: }
1629:
1630: /*
1631: private JCheckBox getExtraDayBox() {
1632: if (extraDayBox == null) {
1633: extraDayBox = new JCheckBox();
1634: ResourceHelper.setText(extraDayBox, "show_extra");
1635: }
1636: return extraDayBox;
1637: }
1638: */
1639:
1640: private JPanel getFontPanel() {
1641: JPanel fontPanel = new JPanel();
1642: fontPanel.setLayout(new FlowLayout());
1643:
1644: ResourceHelper.setText(previewFontButton, "set_pre_font");
1645: previewFontButton
1646: .setBorder(new javax.swing.border.SoftBevelBorder(
1647: javax.swing.border.BevelBorder.RAISED));
1648: // previewFontButton.setFont(Font.decode(Prefs.getPref(PrefName.PREVIEWFONT)));
1649: previewFontButton
1650: .addActionListener(new java.awt.event.ActionListener() {
1651: public void actionPerformed(
1652: java.awt.event.ActionEvent evt) {
1653: fontActionPerformed(evt, PrefName.PREVIEWFONT);
1654: // previewFontButton.setFont(Font.decode(Prefs.getPref(PrefName.PREVIEWFONT)));
1655: }
1656: });
1657: fontPanel.add(previewFontButton);
1658:
1659: ResourceHelper.setText(apptFontButton, "set_appt_font");
1660: apptFontButton
1661: .setBorder(new javax.swing.border.SoftBevelBorder(
1662: javax.swing.border.BevelBorder.RAISED));
1663: // apptFontButton.setFont(Font.decode(Prefs.getPref(PrefName.APPTFONT)));
1664: apptFontButton
1665: .addActionListener(new java.awt.event.ActionListener() {
1666: public void actionPerformed(
1667: java.awt.event.ActionEvent evt) {
1668: fontActionPerformed(evt, PrefName.APPTFONT);
1669: // apptFontButton.setFont(Font.decode(Prefs.getPref(PrefName.APPTFONT)));
1670: }
1671: });
1672: fontPanel.add(apptFontButton);
1673:
1674: ResourceHelper.setText(defFontButton, "set_def_font");
1675: defFontButton.setBorder(new javax.swing.border.SoftBevelBorder(
1676: javax.swing.border.BevelBorder.RAISED));
1677: // if( !Prefs.getPref(PrefName.DEFFONT).equals(""))
1678: // defFontButton.setFont(Font.decode(Prefs.getPref(PrefName.DEFFONT)));
1679: defFontButton
1680: .addActionListener(new java.awt.event.ActionListener() {
1681: public void actionPerformed(
1682: java.awt.event.ActionEvent evt) {
1683: fontActionPerformed(evt, PrefName.DEFFONT);
1684: // defFontButton.setFont(Font.decode(Prefs.getPref(PrefName.DEFFONT)));
1685: }
1686: });
1687: fontPanel.add(defFontButton);
1688:
1689: ResourceHelper.setText(dayFontButton, "dview_font");
1690: dayFontButton.setBorder(new javax.swing.border.SoftBevelBorder(
1691: javax.swing.border.BevelBorder.RAISED));
1692: // dayFontButton.setFont(Font.decode(Prefs.getPref(PrefName.DAYVIEWFONT)));
1693: dayFontButton
1694: .addActionListener(new java.awt.event.ActionListener() {
1695: public void actionPerformed(
1696: java.awt.event.ActionEvent evt) {
1697: fontActionPerformed(evt, PrefName.DAYVIEWFONT);
1698: // dayFontButton.setFont(Font.decode(Prefs.getPref(PrefName.DAYVIEWFONT)));
1699: }
1700: });
1701: fontPanel.add(dayFontButton);
1702:
1703: ResourceHelper.setText(weekFontButton, "wview_font");
1704: weekFontButton
1705: .setBorder(new javax.swing.border.SoftBevelBorder(
1706: javax.swing.border.BevelBorder.RAISED));
1707: // weekFontButton.setFont(Font.decode(Prefs.getPref(PrefName.WEEKVIEWFONT)));
1708: weekFontButton
1709: .addActionListener(new java.awt.event.ActionListener() {
1710: public void actionPerformed(
1711: java.awt.event.ActionEvent evt) {
1712: fontActionPerformed(evt, PrefName.WEEKVIEWFONT);
1713: // weekFontButton.setFont(Font.decode(Prefs.getPref(PrefName.WEEKVIEWFONT)));
1714: }
1715: });
1716: fontPanel.add(weekFontButton);
1717:
1718: ResourceHelper.setText(monthFontButton, "mview_font");
1719: monthFontButton
1720: .setBorder(new javax.swing.border.SoftBevelBorder(
1721: javax.swing.border.BevelBorder.RAISED));
1722: // monthFontButton.setFont(Font.decode(Prefs.getPref(PrefName.MONTHVIEWFONT)));
1723: monthFontButton
1724: .addActionListener(new java.awt.event.ActionListener() {
1725: public void actionPerformed(
1726: java.awt.event.ActionEvent evt) {
1727: fontActionPerformed(evt, PrefName.MONTHVIEWFONT);
1728: // monthFontButton.setFont(Font.decode(Prefs.getPref(PrefName.MONTHVIEWFONT)));
1729: }
1730: });
1731: fontPanel.add(monthFontButton);
1732:
1733: return fontPanel;
1734: }
1735:
1736: private JRadioButton getHSQLDBFileButton() {
1737: if (hsqldbButton == null) {
1738: hsqldbButton = new JRadioButton();
1739: hsqldbButton.setActionCommand("hsqldb");
1740: ResourceHelper.setText(hsqldbButton, "hsqldb");
1741: hsqldbButton
1742: .addActionListener(new java.awt.event.ActionListener() {
1743: public void actionPerformed(
1744: java.awt.event.ActionEvent e) {
1745: dbTypeAction(e);
1746: }
1747: });
1748: }
1749: return hsqldbButton;
1750: }
1751:
1752: private JPanel getHSQLDBPanel() {
1753: hsqldbPanel = new JPanel();
1754: hsqldbPanel.setLayout(new java.awt.GridBagLayout());
1755:
1756: JLabel hs1 = new JLabel();
1757: hsqldbPanel.setBorder(new javax.swing.border.TitledBorder(
1758: Resource.getResourceString("hsqldbinfo")));
1759: ResourceHelper.setText(hs1, "DataBase_Directory");
1760: hs1.setLabelFor(dbDirText);
1761: GridBagConstraints gridBagConstraints30 = new java.awt.GridBagConstraints();
1762: gridBagConstraints30.gridx = 0;
1763: gridBagConstraints30.gridy = 0;
1764: gridBagConstraints30.fill = java.awt.GridBagConstraints.BOTH;
1765: gridBagConstraints30.anchor = java.awt.GridBagConstraints.WEST;
1766: gridBagConstraints30.insets = new java.awt.Insets(0, 8, 0, 0);
1767: hsqldbPanel.add(hs1, gridBagConstraints30);
1768:
1769: GridBagConstraints gridBagConstraints31 = new java.awt.GridBagConstraints();
1770: gridBagConstraints31.gridx = 0;
1771: gridBagConstraints31.gridy = 1;
1772: gridBagConstraints31.fill = java.awt.GridBagConstraints.BOTH;
1773: gridBagConstraints31.anchor = java.awt.GridBagConstraints.WEST;
1774: gridBagConstraints31.weightx = 0.5;
1775: gridBagConstraints31.insets = new java.awt.Insets(4, 8, 4, 8);
1776: hsqldbPanel.add(hsqldbdir, gridBagConstraints31);
1777:
1778: JButton hsb1 = new JButton();
1779: ResourceHelper.setText(hsb1, "Browse");
1780: hsb1.addActionListener(new java.awt.event.ActionListener() {
1781: public void actionPerformed(java.awt.event.ActionEvent evt) {
1782: hsqldbActionPerformed(evt);
1783: }
1784: });
1785:
1786: GridBagConstraints gridBagConstraints32 = new java.awt.GridBagConstraints();
1787: gridBagConstraints32.gridx = 1;
1788: gridBagConstraints32.gridy = 1;
1789: gridBagConstraints32.fill = java.awt.GridBagConstraints.BOTH;
1790: gridBagConstraints32.insets = new java.awt.Insets(4, 4, 4, 4);
1791: hsqldbPanel.add(hsb1, gridBagConstraints32);
1792:
1793: return hsqldbPanel;
1794: }
1795:
1796: private JSpinner getIndEmailtimebox() {
1797: if (indEmailTime == null) {
1798: indEmailTime = new JSpinner(new SpinnerNumberModel());
1799: }
1800: return indEmailTime;
1801: }
1802:
1803: private JRadioButton getJdbcButton() {
1804: if (jdbcButton == null) {
1805: jdbcButton = new JRadioButton();
1806: jdbcButton.setActionCommand("jdbc");
1807: ResourceHelper.setText(jdbcButton, "jdbc");
1808: jdbcButton
1809: .addActionListener(new java.awt.event.ActionListener() {
1810: public void actionPerformed(
1811: java.awt.event.ActionEvent e) {
1812: dbTypeAction(e);
1813: }
1814: });
1815: }
1816: return jdbcButton;
1817: }
1818:
1819: private JPanel getJdbcPanel() {
1820: if (jdbcPanel == null) {
1821: GridBagConstraints gridBagConstraints54 = new GridBagConstraints();
1822: gridBagConstraints54.fill = java.awt.GridBagConstraints.HORIZONTAL; // Generated
1823: gridBagConstraints54.gridy = 1; // Generated
1824: gridBagConstraints54.ipadx = 0; // Generated
1825: gridBagConstraints54.weightx = 1.0; // Generated
1826: gridBagConstraints54.insets = new java.awt.Insets(4, 4, 4,
1827: 4); // Generated
1828: gridBagConstraints54.gridx = 0; // Generated
1829: GridBagConstraints gridBagConstraints = new GridBagConstraints();
1830: gridBagConstraints.gridx = 0; // Generated
1831: gridBagConstraints.ipadx = 0; // Generated
1832: gridBagConstraints.ipady = 5; // Generated
1833: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); // Generated
1834: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; // Generated
1835: gridBagConstraints.gridy = 0; // Generated
1836:
1837: JLabel enturlLabel = new JLabel();
1838: ResourceHelper.setText(enturlLabel, "enturl");
1839: enturlLabel.setLabelFor(getJdbcText());
1840: enturlLabel
1841: .setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); // Generated
1842: enturlLabel
1843: .setHorizontalAlignment(javax.swing.SwingConstants.LEFT); // Generated
1844: jdbcPanel = new JPanel();
1845: jdbcPanel.setLayout(new GridBagLayout()); // Generated
1846: jdbcPanel
1847: .setBorder(javax.swing.BorderFactory
1848: .createTitledBorder(
1849: null,
1850: Resource.getResourceString("jdbc"),
1851: javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
1852: javax.swing.border.TitledBorder.DEFAULT_POSITION,
1853: null, null)); // Generated
1854: jdbcPanel.add(enturlLabel, gridBagConstraints); // Generated
1855: jdbcPanel.add(getJdbcText(), gridBagConstraints54); // Generated
1856: }
1857: return jdbcPanel;
1858: }
1859:
1860: private JTextField getJdbcText() {
1861: if (jdbcText == null) {
1862: jdbcText = new JTextField();
1863: }
1864: return jdbcText;
1865: }
1866:
1867: private JPanel getJPanelUCS() {
1868: if (jPanelUCS == null) {
1869: jPanelUCS = new JPanel();
1870: jPanelUCS.setLayout(new GridLayout(10, 2));
1871:
1872: cb_ucs_ontodo = new javax.swing.JCheckBox();
1873: ResourceHelper.setText(cb_ucs_ontodo, "ucolortext1");
1874: cb_ucs_marktodo = new javax.swing.JCheckBox();
1875: ResourceHelper.setText(cb_ucs_marktodo, "ucolortext2");
1876: tf_ucs_marker = new JTextField("! "); //$NON-NLS-1$
1877: btn_ucs_red = new JButtonKnowsBgColor(
1878: Resource.getResourceString("ucolortext4"), Color.WHITE, false); //$NON-NLS-1$
1879: btn_ucs_blue = new JButtonKnowsBgColor(
1880: Resource.getResourceString("ucolortext5"), Color.WHITE, false); //$NON-NLS-1$
1881: btn_ucs_green = new JButtonKnowsBgColor(
1882: Resource.getResourceString("ucolortext6"), Color.WHITE, false); //$NON-NLS-1$
1883: btn_ucs_black = new JButtonKnowsBgColor(
1884: Resource.getResourceString("ucolortext7"), Color.WHITE, false); //$NON-NLS-1$
1885: btn_ucs_white = new JButtonKnowsBgColor(
1886: Resource.getResourceString("ucolortext8"), Color.WHITE, false); //$NON-NLS-1$
1887: btn_ucs_tasks = new JButtonKnowsBgColor(
1888: Resource.getResourceString("ucolortext9"), Color.WHITE, false); //$NON-NLS-1$
1889: btn_ucs_holidays = new JButtonKnowsBgColor(Resource
1890: .getResourceString("ucolortext10"), Color.WHITE, //$NON-NLS-1$
1891: false);
1892: btn_ucs_birthdays = new JButtonKnowsBgColor(Resource
1893: .getResourceString("ucolortext11"), Color.WHITE, //$NON-NLS-1$
1894: false);
1895: btn_ucs_default = new JButtonKnowsBgColor(
1896: Resource.getResourceString("ucolortext12"), Color.WHITE, true); //$NON-NLS-1$
1897: btn_ucs_holiday = new JButtonKnowsBgColor(
1898: Resource.getResourceString("ucolortext13"), Color.WHITE, true); //$NON-NLS-1$
1899: btn_ucs_halfday = new JButtonKnowsBgColor(
1900: Resource.getResourceString("ucolortext14"), Color.WHITE, true); //$NON-NLS-1$
1901: btn_ucs_vacation = new JButtonKnowsBgColor(Resource
1902: .getResourceString("ucolortext15"), Color.WHITE, //$NON-NLS-1$
1903: true);
1904: btn_ucs_today = new JButtonKnowsBgColor(
1905: Resource.getResourceString("ucolortext16"), Color.WHITE, true); //$NON-NLS-1$
1906: btn_ucs_weekend = new JButtonKnowsBgColor(
1907: Resource.getResourceString("ucolortext17"), Color.WHITE, true); //$NON-NLS-1$
1908: btn_ucs_weekday = new JButtonKnowsBgColor(
1909: Resource.getResourceString("ucolortext18"), Color.WHITE, true); //$NON-NLS-1$
1910: btn_ucs_stripe = new JButtonKnowsBgColor(Resource
1911: .getResourceString("stripecolor"), Color.WHITE,
1912: true);
1913:
1914: btn_ucs_restore = new JButton(Resource
1915: .getResourceString("restore_defaults")); //$NON-NLS-1$
1916:
1917: btn_ucs_restore.addActionListener(new ActionListener() {
1918: public void actionPerformed(ActionEvent e) {
1919: btn_ucs_red.setColorProperty(new Color(13369395));
1920: btn_ucs_red.setColorByProperty();
1921: btn_ucs_blue.setColorProperty(new Color(6684876));
1922: btn_ucs_blue.setColorByProperty();
1923: btn_ucs_green.setColorProperty(new Color(39168));
1924: btn_ucs_green.setColorByProperty();
1925: btn_ucs_black.setColorProperty(new Color(13107));
1926: btn_ucs_black.setColorByProperty();
1927: btn_ucs_white.setColorProperty(new Color(16250609));
1928: btn_ucs_white.setColorByProperty();
1929: btn_ucs_tasks.setColorProperty(new Color(13158));
1930: btn_ucs_tasks.setColorByProperty();
1931: btn_ucs_holidays.setColorProperty(new Color(
1932: 10027212));
1933: btn_ucs_holidays.setColorByProperty();
1934: btn_ucs_birthdays.setColorProperty(new Color(
1935: 10027008));
1936: btn_ucs_birthdays.setColorByProperty();
1937: // // Calendar view day background
1938: // colors
1939:
1940: btn_ucs_default
1941: .setColorProperty(new Color(16777164));
1942: btn_ucs_default.setColorByProperty();
1943: btn_ucs_today.setColorProperty(new Color(16751001));
1944: btn_ucs_today.setColorByProperty();
1945: btn_ucs_holiday
1946: .setColorProperty(new Color(16764108));
1947: btn_ucs_holiday.setColorByProperty();
1948: btn_ucs_vacation.setColorProperty(new Color(
1949: 13434828));
1950: btn_ucs_vacation.setColorByProperty();
1951: btn_ucs_halfday
1952: .setColorProperty(new Color(13421823));
1953: btn_ucs_halfday.setColorByProperty();
1954: btn_ucs_weekend
1955: .setColorProperty(new Color(16764057));
1956: btn_ucs_weekend.setColorByProperty();
1957: btn_ucs_weekday
1958: .setColorProperty(new Color(16777164));
1959: btn_ucs_weekday.setColorByProperty();
1960: btn_ucs_stripe
1961: .setColorProperty(new Color(15792890));
1962: btn_ucs_stripe.setColorByProperty();
1963: }
1964: });
1965:
1966: jPanelUCS.add(btn_ucs_red);
1967: jPanelUCS.add(btn_ucs_default);
1968: jPanelUCS.add(btn_ucs_blue);
1969: jPanelUCS.add(btn_ucs_today);
1970: jPanelUCS.add(btn_ucs_green);
1971: jPanelUCS.add(btn_ucs_holiday);
1972: jPanelUCS.add(btn_ucs_black);
1973: jPanelUCS.add(btn_ucs_halfday);
1974: jPanelUCS.add(btn_ucs_white);
1975: jPanelUCS.add(btn_ucs_vacation);
1976: jPanelUCS.add(btn_ucs_tasks);
1977: jPanelUCS.add(btn_ucs_weekend);
1978: jPanelUCS.add(btn_ucs_holidays);
1979: jPanelUCS.add(btn_ucs_weekday);
1980: jPanelUCS.add(btn_ucs_birthdays);
1981: jPanelUCS.add(btn_ucs_stripe);
1982: jPanelUCS.add(btn_ucs_restore);
1983: jPanelUCS.add(cb_ucs_ontodo);
1984:
1985: JPanel njp = new JPanel();
1986: njp.setLayout(new BorderLayout());
1987: njp.add(cb_ucs_marktodo, BorderLayout.WEST);
1988: njp.add(tf_ucs_marker, BorderLayout.CENTER);
1989: getJPanelUCS().add(njp);
1990: }
1991: return jPanelUCS;
1992: }
1993:
1994: private JRadioButton getLocalFileButton() {
1995: if (localFileButton == null) {
1996: localFileButton = new JRadioButton();
1997: localFileButton.setActionCommand("local");
1998: ResourceHelper.setText(localFileButton, "localFile");
1999: localFileButton
2000: .addActionListener(new java.awt.event.ActionListener() {
2001: public void actionPerformed(
2002: java.awt.event.ActionEvent e) {
2003: dbTypeAction(e);
2004: }
2005: });
2006: }
2007: return localFileButton;
2008: }
2009:
2010: private JPanel getLocalFilePanel() {
2011: localFilePanel = new JPanel();
2012: localFilePanel.setLayout(new java.awt.GridBagLayout());
2013:
2014: localFilePanel.setBorder(new javax.swing.border.TitledBorder(
2015: Resource.getResourceString("localFileInfo")));
2016: JTextArea warning = new JTextArea();
2017: warning.setText("**** "
2018: + Resource.getPlainResourceString("mdb_deprecated")
2019: + " ****");
2020: GridBagConstraints gridBagConstraintsw = new java.awt.GridBagConstraints();
2021: warning.setEditable(false);
2022: warning.setWrapStyleWord(true);
2023: warning.setLineWrap(true);
2024: warning.setBackground(Color.white);
2025: warning.setForeground(Color.red);
2026: gridBagConstraintsw.gridx = 0;
2027: gridBagConstraintsw.gridy = 0;
2028: gridBagConstraintsw.weighty = 1.0;
2029: gridBagConstraintsw.fill = java.awt.GridBagConstraints.BOTH;
2030: gridBagConstraintsw.anchor = java.awt.GridBagConstraints.WEST;
2031: gridBagConstraintsw.insets = new java.awt.Insets(0, 20, 0, 0);
2032: localFilePanel.add(warning, gridBagConstraintsw);
2033:
2034: ResourceHelper.setText(jLabel3, "DataBase_Directory");
2035: jLabel3.setLabelFor(dbDirText);
2036: GridBagConstraints gridBagConstraints30 = new java.awt.GridBagConstraints();
2037: gridBagConstraints30.gridx = 0;
2038: gridBagConstraints30.gridy = 1;
2039: gridBagConstraints30.fill = java.awt.GridBagConstraints.BOTH;
2040: gridBagConstraints30.anchor = java.awt.GridBagConstraints.WEST;
2041: gridBagConstraints30.insets = new java.awt.Insets(0, 8, 0, 0);
2042: localFilePanel.add(jLabel3, gridBagConstraints30);
2043:
2044: GridBagConstraints gridBagConstraints31 = new java.awt.GridBagConstraints();
2045: gridBagConstraints31.gridx = 0;
2046: gridBagConstraints31.gridy = 2;
2047: gridBagConstraints31.fill = java.awt.GridBagConstraints.BOTH;
2048: gridBagConstraints31.anchor = java.awt.GridBagConstraints.WEST;
2049: gridBagConstraints31.weightx = 0.5;
2050: gridBagConstraints31.insets = new java.awt.Insets(4, 8, 4, 8);
2051: localFilePanel.add(dbDirText, gridBagConstraints31);
2052:
2053: ResourceHelper.setText(jButton5, "Browse");
2054: jButton5.addActionListener(new java.awt.event.ActionListener() {
2055: public void actionPerformed(java.awt.event.ActionEvent evt) {
2056: jButton5ActionPerformed(evt);
2057: }
2058: });
2059:
2060: GridBagConstraints gridBagConstraints32 = new java.awt.GridBagConstraints();
2061: gridBagConstraints32.gridx = 1;
2062: gridBagConstraints32.gridy = 2;
2063: gridBagConstraints32.fill = java.awt.GridBagConstraints.BOTH;
2064: gridBagConstraints32.insets = new java.awt.Insets(4, 4, 4, 4);
2065: localFilePanel.add(jButton5, gridBagConstraints32);
2066:
2067: return localFilePanel;
2068: }
2069:
2070: /**
2071: * This method initializes lsbox
2072: *
2073: * @return javax.swing.JComboBox
2074: */
2075: private JComboBox getLsbox() {
2076: if (lsbox == null) {
2077: lsbox = new JComboBox();
2078: }
2079: return lsbox;
2080: }
2081:
2082: private JPanel getMiscPanel() {
2083: JPanel miscPanel = new JPanel();
2084:
2085: miscPanel.setLayout(new java.awt.GridBagLayout());
2086:
2087: ResourceHelper.setText(autoupdate, "Auto_Update_Check");
2088: autoupdate
2089: .setToolTipText(Resource
2090: .getResourceString("Enable_a_daily_check_to_the_BORG_website_to_see_if_a_new_version_is_out._Does_not_update_the_product."));
2091: GridBagConstraints gridBagConstraints45 = new java.awt.GridBagConstraints();
2092: gridBagConstraints45.gridx = 0;
2093: gridBagConstraints45.gridy = 3;
2094: gridBagConstraints45.fill = java.awt.GridBagConstraints.BOTH;
2095: gridBagConstraints45.anchor = java.awt.GridBagConstraints.WEST;
2096: miscPanel.add(autoupdate, gridBagConstraints45);
2097:
2098: versioncheck.setFont(new java.awt.Font("Dialog", 0, 10));
2099: ResourceHelper.setText(versioncheck, "Check_for_updates_now");
2100: versioncheck
2101: .setToolTipText(Resource
2102: .getResourceString("Check_for_the_latest_BORG_version_now"));
2103: versioncheck.setBorder(new javax.swing.border.SoftBevelBorder(
2104: javax.swing.border.BevelBorder.RAISED));
2105: versioncheck
2106: .addActionListener(new java.awt.event.ActionListener() {
2107: public void actionPerformed(
2108: java.awt.event.ActionEvent evt) {
2109: versioncheckActionPerformed(evt);
2110: }
2111: });
2112:
2113: GridBagConstraints gridBagConstraints46 = new java.awt.GridBagConstraints();
2114: gridBagConstraints46.gridx = 1;
2115: gridBagConstraints46.gridy = 3;
2116: gridBagConstraints46.anchor = java.awt.GridBagConstraints.WEST;
2117: miscPanel.add(versioncheck, gridBagConstraints46);
2118:
2119: ResourceHelper.setText(splashbox, "splash");
2120: GridBagConstraints gridBagConstraints47 = new java.awt.GridBagConstraints();
2121: gridBagConstraints47.gridx = 0;
2122: gridBagConstraints47.gridy = 0;
2123: gridBagConstraints47.fill = java.awt.GridBagConstraints.BOTH;
2124: miscPanel.add(splashbox, gridBagConstraints47);
2125:
2126: ResourceHelper.setText(backgbox,
2127: "Start_in_background_(Windows_only,_TrayIcon_req)");
2128: backgbox
2129: .setToolTipText(Resource
2130: .getResourceString("Do_not_open_todo_and_month_view_on_startup,_start_in_systray"));
2131: GridBagConstraints gridBagConstraints48 = new java.awt.GridBagConstraints();
2132: gridBagConstraints48.gridx = 0;
2133: gridBagConstraints48.gridy = 1;
2134: gridBagConstraints48.gridwidth = 2;
2135: gridBagConstraints48.fill = java.awt.GridBagConstraints.BOTH;
2136: gridBagConstraints48.anchor = java.awt.GridBagConstraints.WEST;
2137: miscPanel.add(backgbox, gridBagConstraints48);
2138:
2139: ResourceHelper.setText(stackbox, "stackonerr");
2140: GridBagConstraints gridBagConstraints49 = new java.awt.GridBagConstraints();
2141: gridBagConstraints49.gridx = 0;
2142: gridBagConstraints49.gridy = 4;
2143: gridBagConstraints49.fill = java.awt.GridBagConstraints.BOTH;
2144: miscPanel.add(stackbox, gridBagConstraints49);
2145:
2146: ResourceHelper.setText(icaltodobox, "icaltodo");
2147: GridBagConstraints gridBagConstraints50 = new java.awt.GridBagConstraints();
2148: gridBagConstraints50.gridx = 0;
2149: gridBagConstraints50.gridy = 5;
2150: gridBagConstraints50.fill = java.awt.GridBagConstraints.BOTH;
2151: miscPanel.add(icaltodobox, gridBagConstraints50);
2152:
2153: ResourceHelper.setText(oldmonthbox, "use_old_monthview");
2154: GridBagConstraints gridBagConstraints51 = new java.awt.GridBagConstraints();
2155: gridBagConstraints51.gridx = 0;
2156: gridBagConstraints51.gridy = 7;
2157: gridBagConstraints51.fill = java.awt.GridBagConstraints.BOTH;
2158: miscPanel.add(oldmonthbox, gridBagConstraints51);
2159:
2160: GridBagConstraints gridBagConstraints111 = new GridBagConstraints();
2161: gridBagConstraints111.gridx = 0;
2162: gridBagConstraints111.gridy = 6;
2163: gridBagConstraints111.fill = java.awt.GridBagConstraints.HORIZONTAL;
2164: miscPanel.add(getExputcbox(), gridBagConstraints111);
2165:
2166: GridBagConstraints gridBagConstraints310 = new GridBagConstraints();
2167: gridBagConstraints310.gridx = 0;
2168: gridBagConstraints310.gridy = 8;
2169: gridBagConstraints310.ipadx = 0;
2170: gridBagConstraints310.ipady = 0;
2171: gridBagConstraints310.insets = new java.awt.Insets(0, 0, 0, 0);
2172: gridBagConstraints310.anchor = java.awt.GridBagConstraints.WEST;
2173: miscPanel.add(getPalmcb(), gridBagConstraints310);
2174:
2175: JLabel sportlabel = new JLabel();
2176: ResourceHelper.setText(sportlabel, "socket_port");
2177: GridBagConstraints gridBagConstraints311 = new GridBagConstraints();
2178: gridBagConstraints311.gridx = 0;
2179: gridBagConstraints311.gridy = 9;
2180: gridBagConstraints311.anchor = java.awt.GridBagConstraints.WEST;
2181: miscPanel.add(sportlabel, gridBagConstraints311);
2182:
2183: GridBagConstraints gridBagConstraints312 = new GridBagConstraints();
2184: gridBagConstraints312.gridx = 1;
2185: gridBagConstraints312.gridy = 9;
2186: gridBagConstraints312.fill = java.awt.GridBagConstraints.HORIZONTAL;
2187: gridBagConstraints312.anchor = java.awt.GridBagConstraints.EAST;
2188: miscPanel.add(socketPort, gridBagConstraints312);
2189:
2190: GridBagConstraints gridBagConstraintsUST = new GridBagConstraints();
2191: gridBagConstraintsUST.gridx = 0;
2192: gridBagConstraintsUST.gridy = 10;
2193: gridBagConstraintsUST.fill = java.awt.GridBagConstraints.HORIZONTAL;
2194: useSysTray.setText(Resource
2195: .getPlainResourceString("enable_systray"));
2196: miscPanel.add(useSysTray, gridBagConstraintsUST);
2197:
2198: JPanel backp = new JPanel();
2199: backp.setLayout(new GridBagLayout());
2200:
2201: gridBagConstraintsUST.gridx = 0;
2202: gridBagConstraintsUST.gridy = 0;
2203: gridBagConstraintsUST.fill = java.awt.GridBagConstraints.NONE;
2204: backp.add(new JLabel(Resource
2205: .getPlainResourceString("backup_dir")
2206: + ": "), gridBagConstraintsUST);
2207:
2208: gridBagConstraintsUST.gridx = 1;
2209: gridBagConstraintsUST.weightx = 1.0;
2210: gridBagConstraintsUST.fill = java.awt.GridBagConstraints.HORIZONTAL;
2211: backp.add(backupDir, gridBagConstraintsUST);
2212:
2213: JButton bb = new JButton();
2214: ResourceHelper.setText(bb, "Browse");
2215: gridBagConstraintsUST.gridx = 2;
2216: gridBagConstraintsUST.weightx = 0;
2217: gridBagConstraintsUST.fill = java.awt.GridBagConstraints.NONE;
2218: bb.addActionListener(new java.awt.event.ActionListener() {
2219: public void actionPerformed(java.awt.event.ActionEvent evt) {
2220: backupDirActionPerformed(evt);
2221: }
2222: });
2223: backp.add(bb, gridBagConstraintsUST);
2224:
2225: gridBagConstraintsUST.gridx = 0;
2226: gridBagConstraintsUST.gridy = 11;
2227: gridBagConstraintsUST.weightx = 1.0;
2228: gridBagConstraintsUST.gridwidth = 2;
2229: gridBagConstraintsUST.fill = java.awt.GridBagConstraints.HORIZONTAL;
2230: miscPanel.add(backp, gridBagConstraintsUST);
2231: return miscPanel;
2232: }
2233:
2234: private JPanel taskOptionPanel = null; // @jve:decl-index=0:visual-constraint="12,2528"
2235:
2236: private JCheckBox taskAbbrevBox = new JCheckBox();
2237:
2238: private JCheckBox calShowTaskBox = new JCheckBox();
2239:
2240: private JCheckBox calShowSubtaskBox = new JCheckBox();
2241:
2242: private JCheckBox ganttShowSubtaskBox = new JCheckBox();
2243:
2244: private JPanel getTaskOptionPanel() {
2245: if (taskOptionPanel == null) {
2246: GridBagConstraints gridBagConstraints20 = new GridBagConstraints();
2247: gridBagConstraints20.insets = new Insets(4, 4, 4, 4);
2248: gridBagConstraints20.gridy = 2;
2249: gridBagConstraints20.ipady = 0;
2250: gridBagConstraints20.fill = GridBagConstraints.NONE;
2251: gridBagConstraints20.anchor = GridBagConstraints.WEST;
2252: gridBagConstraints20.gridx = 0;
2253: GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
2254: gridBagConstraints21.insets = new Insets(4, 4, 4, 4);
2255: gridBagConstraints21.gridy = 3;
2256: gridBagConstraints21.ipady = 0;
2257: gridBagConstraints21.fill = GridBagConstraints.NONE;
2258: gridBagConstraints21.anchor = GridBagConstraints.WEST;
2259: gridBagConstraints21.gridx = 0;
2260: GridBagConstraints gridBagConstraints19 = new GridBagConstraints();
2261: gridBagConstraints19.insets = new Insets(4, 4, 4, 4);
2262: gridBagConstraints19.gridy = 1;
2263: gridBagConstraints19.ipady = 0;
2264: gridBagConstraints19.fill = GridBagConstraints.NONE;
2265: gridBagConstraints19.anchor = GridBagConstraints.WEST;
2266: gridBagConstraints19.gridx = 0;
2267: GridBagConstraints gridBagConstraints17 = new GridBagConstraints();
2268: gridBagConstraints17.gridx = 0;
2269: gridBagConstraints17.ipadx = 0;
2270: gridBagConstraints17.insets = new Insets(4, 4, 4, 4);
2271: gridBagConstraints17.fill = GridBagConstraints.NONE;
2272: gridBagConstraints17.anchor = GridBagConstraints.WEST;
2273: gridBagConstraints17.gridy = 0;
2274: taskOptionPanel = new JPanel();
2275:
2276: taskOptionPanel.setLayout(new GridBagLayout());
2277: taskOptionPanel.setSize(new Dimension(168, 159));
2278: taskOptionPanel.add(taskAbbrevBox, gridBagConstraints17);
2279: taskOptionPanel.add(calShowTaskBox, gridBagConstraints19);
2280: taskOptionPanel
2281: .add(calShowSubtaskBox, gridBagConstraints20);
2282: taskOptionPanel.add(ganttShowSubtaskBox,
2283: gridBagConstraints21);
2284: taskAbbrevBox.setText(Resource
2285: .getPlainResourceString("task_abbrev"));
2286: calShowTaskBox.setText(Resource
2287: .getPlainResourceString("calShowTask"));
2288: calShowSubtaskBox.setText(Resource
2289: .getPlainResourceString("calShowSubtask"));
2290: ganttShowSubtaskBox.setText(Resource
2291: .getPlainResourceString("ganttShowSubtask"));
2292: }
2293: return taskOptionPanel;
2294: }
2295:
2296: private JPanel getMultiUserPanel() {
2297: JPanel panel = new JPanel();
2298: panel.setLayout(new GridBagLayout());
2299:
2300: GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
2301: gridBagConstraints1.gridx = 0;
2302: gridBagConstraints1.gridy = 0;
2303: gridBagConstraints1.gridwidth = 2;
2304: gridBagConstraints1.insets = new java.awt.Insets(4, 4, 4, 4);
2305: gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
2306: panel.add(sharedFileCheckBox, gridBagConstraints1);
2307:
2308: GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
2309: gridBagConstraints2.gridx = 1;
2310: gridBagConstraints2.gridy = 1;
2311: gridBagConstraints2.insets = new java.awt.Insets(4, 4, 4, 4);
2312: gridBagConstraints2.weightx = 1.0;
2313: gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
2314: panel.add(getSyncMins(), gridBagConstraints2);
2315:
2316: syncminlabel = new JLabel();
2317: ResourceHelper.setText(syncminlabel, "sync_mins");
2318: syncminlabel.setLabelFor(getSyncMins());
2319: GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
2320: gridBagConstraints3.insets = new java.awt.Insets(4, 4, 4, 4);
2321: gridBagConstraints3.fill = java.awt.GridBagConstraints.BOTH;
2322: gridBagConstraints3.gridx = 0;
2323: gridBagConstraints3.gridy = 1;
2324: gridBagConstraints3.weightx = 1.0;
2325: panel.add(syncminlabel, gridBagConstraints3);
2326:
2327: return panel;
2328: }
2329:
2330: /**
2331: * This method initializes jRadioButton1
2332: *
2333: * @return javax.swing.JRadioButton
2334: */
2335: private JRadioButton getMySQLButton() {
2336: if (MySQLButton == null) {
2337: MySQLButton = new JRadioButton();
2338: MySQLButton.setActionCommand("mysql");
2339: MySQLButton.setText("MySQL");
2340: MySQLButton.setMnemonic(KeyEvent.VK_M);
2341: MySQLButton
2342: .addActionListener(new java.awt.event.ActionListener() {
2343: public void actionPerformed(
2344: java.awt.event.ActionEvent e) {
2345: dbTypeAction(e);
2346: }
2347: });
2348: }
2349: return MySQLButton;
2350: }
2351:
2352: private JPanel getMysqlPanel() {
2353: mysqlPanel = new javax.swing.JPanel();
2354: mysqlPanel.setLayout(new java.awt.GridBagLayout());
2355:
2356: mysqlPanel.setBorder(new javax.swing.border.TitledBorder(
2357: Resource.getResourceString("MySQLInfo")));
2358: ResourceHelper.setText(jLabel7, "DatabaseName");
2359: jLabel7.setLabelFor(dbNameText);
2360: GridBagConstraints gridBagConstraints1 = new java.awt.GridBagConstraints();
2361: gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
2362: gridBagConstraints1.insets = new java.awt.Insets(0, 4, 0, 4);
2363: mysqlPanel.add(jLabel7, gridBagConstraints1);
2364:
2365: GridBagConstraints gridBagConstraints2 = new java.awt.GridBagConstraints();
2366: gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
2367: gridBagConstraints2.weightx = 1.0;
2368: mysqlPanel.add(dbNameText, gridBagConstraints2);
2369:
2370: ResourceHelper.setText(jLabel17, "hostname");
2371: jLabel17.setLabelFor(dbHostText);
2372: GridBagConstraints gridBagConstraints3 = new java.awt.GridBagConstraints();
2373: gridBagConstraints3.gridx = 0;
2374: gridBagConstraints3.gridy = 1;
2375: gridBagConstraints3.fill = java.awt.GridBagConstraints.BOTH;
2376: gridBagConstraints3.insets = new java.awt.Insets(0, 4, 0, 4);
2377: mysqlPanel.add(jLabel17, gridBagConstraints3);
2378:
2379: GridBagConstraints gridBagConstraints4 = new java.awt.GridBagConstraints();
2380: gridBagConstraints4.gridx = 1;
2381: gridBagConstraints4.gridy = 1;
2382: gridBagConstraints4.fill = java.awt.GridBagConstraints.BOTH;
2383: gridBagConstraints4.weightx = 1.0;
2384: mysqlPanel.add(dbHostText, gridBagConstraints4);
2385:
2386: ResourceHelper.setText(jLabel18, "port");
2387: jLabel18.setLabelFor(dbPortText);
2388: GridBagConstraints gridBagConstraints5 = new java.awt.GridBagConstraints();
2389: gridBagConstraints5.gridx = 0;
2390: gridBagConstraints5.gridy = 2;
2391: gridBagConstraints5.fill = java.awt.GridBagConstraints.BOTH;
2392: gridBagConstraints5.insets = new java.awt.Insets(0, 4, 0, 4);
2393: mysqlPanel.add(jLabel18, gridBagConstraints5);
2394:
2395: GridBagConstraints gridBagConstraints6 = new java.awt.GridBagConstraints();
2396: gridBagConstraints6.gridx = 1;
2397: gridBagConstraints6.gridy = 2;
2398: gridBagConstraints6.fill = java.awt.GridBagConstraints.BOTH;
2399: gridBagConstraints6.weightx = 1.0;
2400: mysqlPanel.add(dbPortText, gridBagConstraints6);
2401:
2402: ResourceHelper.setText(jLabel19, "User");
2403: jLabel19.setLabelFor(dbUserText);
2404: GridBagConstraints gridBagConstraints25 = new java.awt.GridBagConstraints();
2405: gridBagConstraints25.gridx = 0;
2406: gridBagConstraints25.gridy = 3;
2407: gridBagConstraints25.fill = java.awt.GridBagConstraints.BOTH;
2408: gridBagConstraints25.insets = new java.awt.Insets(0, 4, 0, 4);
2409: mysqlPanel.add(jLabel19, gridBagConstraints25);
2410:
2411: GridBagConstraints gridBagConstraints7 = new java.awt.GridBagConstraints();
2412: gridBagConstraints7.gridx = 1;
2413: gridBagConstraints7.gridy = 3;
2414: gridBagConstraints7.fill = java.awt.GridBagConstraints.BOTH;
2415: gridBagConstraints7.weightx = 1.0;
2416: mysqlPanel.add(dbUserText, gridBagConstraints7);
2417:
2418: ResourceHelper.setText(jLabel20, "Password");
2419: jLabel20.setLabelFor(jPasswordField1);
2420: GridBagConstraints gridBagConstraints8 = new java.awt.GridBagConstraints();
2421: gridBagConstraints8.gridx = 0;
2422: gridBagConstraints8.gridy = 4;
2423: gridBagConstraints8.fill = java.awt.GridBagConstraints.BOTH;
2424: gridBagConstraints8.insets = new java.awt.Insets(0, 4, 0, 4);
2425: mysqlPanel.add(jLabel20, gridBagConstraints8);
2426:
2427: GridBagConstraints gridBagConstraints9 = new java.awt.GridBagConstraints();
2428: gridBagConstraints9.gridx = 1;
2429: gridBagConstraints9.gridy = 4;
2430: gridBagConstraints9.fill = java.awt.GridBagConstraints.BOTH;
2431: mysqlPanel.add(jPasswordField1, gridBagConstraints9);
2432:
2433: return mysqlPanel;
2434: }
2435:
2436: /**
2437: * This method initializes palmcb
2438: *
2439: * @return javax.swing.JCheckBox
2440: */
2441: private JCheckBox getPalmcb() {
2442: if (palmcb == null) {
2443: palmcb = new JCheckBox();
2444: ResourceHelper.setText(palmcb, "palmopt");
2445: }
2446: return palmcb;
2447: }
2448:
2449: private JPanel getPrintPanel() {
2450: JPanel printPanel = new JPanel();
2451: printPanel.setLayout(new java.awt.GridBagLayout());
2452:
2453: ResourceHelper.setText(colorprint, "Print_In_Color?");
2454: GridBagConstraints gridBagConstraints40 = new java.awt.GridBagConstraints();
2455: gridBagConstraints40.gridx = 0;
2456: gridBagConstraints40.gridy = 0;
2457: gridBagConstraints40.fill = java.awt.GridBagConstraints.BOTH;
2458: gridBagConstraints40.anchor = java.awt.GridBagConstraints.NORTHEAST;
2459: printPanel.add(colorprint, gridBagConstraints40);
2460:
2461: ResourceHelper.setText(logobox, "Print_Logo_(GIF/JPG/PNG)");
2462: GridBagConstraints gridBagConstraints43 = new java.awt.GridBagConstraints();
2463: gridBagConstraints43.gridx = 0;
2464: gridBagConstraints43.gridy = 1;
2465: gridBagConstraints43.fill = java.awt.GridBagConstraints.HORIZONTAL;
2466: printPanel.add(logobox, gridBagConstraints43);
2467:
2468: logofile.setEditable(false);
2469: GridBagConstraints gridBagConstraints41 = new java.awt.GridBagConstraints();
2470: gridBagConstraints41.gridx = 1;
2471: gridBagConstraints41.gridy = 1;
2472: gridBagConstraints41.fill = java.awt.GridBagConstraints.BOTH;
2473: gridBagConstraints41.weightx = 1.0;
2474: gridBagConstraints41.insets = new java.awt.Insets(0, 8, 0, 8);
2475: printPanel.add(logofile, gridBagConstraints41);
2476:
2477: ResourceHelper.setText(logobrowse, "Browse");
2478: logobrowse
2479: .addActionListener(new java.awt.event.ActionListener() {
2480: public void actionPerformed(
2481: java.awt.event.ActionEvent evt) {
2482: logobrowseActionPerformed(evt);
2483: }
2484: });
2485:
2486: GridBagConstraints gridBagConstraints42 = new java.awt.GridBagConstraints();
2487: gridBagConstraints42.gridx = 2;
2488: gridBagConstraints42.gridy = 1;
2489: gridBagConstraints42.fill = java.awt.GridBagConstraints.BOTH;
2490: printPanel.add(logobrowse, gridBagConstraints42);
2491: return printPanel;
2492: }
2493:
2494: private JPanel getReminderPanel() {
2495:
2496: JPanel reminderPanel = new JPanel();
2497: reminderPanel.setLayout(new java.awt.GridBagLayout());
2498:
2499: ResourceHelper.setText(popenablebox, "enable_popups");
2500: GridBagConstraints gridBagConstraints52 = new java.awt.GridBagConstraints();
2501: gridBagConstraints52.gridx = 0;
2502: gridBagConstraints52.gridy = 0;
2503: gridBagConstraints52.fill = java.awt.GridBagConstraints.BOTH;
2504: gridBagConstraints52.insets = new java.awt.Insets(0, 8, 0, 0);
2505: reminderPanel.add(popenablebox, gridBagConstraints52);
2506:
2507: ResourceHelper.setText(soundbox, "beeps");
2508: GridBagConstraints gridBagConstraints59 = new java.awt.GridBagConstraints();
2509: gridBagConstraints59.gridx = 0;
2510: gridBagConstraints59.gridy = 3;
2511: gridBagConstraints59.fill = java.awt.GridBagConstraints.BOTH;
2512: gridBagConstraints59.insets = new java.awt.Insets(0, 8, 0, 0);
2513: reminderPanel.add(soundbox, gridBagConstraints59);
2514:
2515: jLabel15
2516: .setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
2517: ResourceHelper.setText(jLabel15, "min_between_chks");
2518: jLabel15.setLabelFor(getEmailtimebox());
2519: GridBagConstraints gridBagConstraints63 = new java.awt.GridBagConstraints();
2520: gridBagConstraints63.gridx = 0;
2521: gridBagConstraints63.gridy = 1;
2522: gridBagConstraints63.fill = java.awt.GridBagConstraints.HORIZONTAL;
2523: gridBagConstraints63.insets = new java.awt.Insets(0, 0, 0, 8);
2524: reminderPanel.add(jLabel15, gridBagConstraints63);
2525:
2526: checkfreq.setMinimumSize(new java.awt.Dimension(50, 20));
2527: GridBagConstraints gridBagConstraints64 = new java.awt.GridBagConstraints();
2528: gridBagConstraints64.gridx = 1;
2529: gridBagConstraints64.gridy = 1;
2530: gridBagConstraints64.fill = java.awt.GridBagConstraints.BOTH;
2531: gridBagConstraints64.weightx = 1.0;
2532: reminderPanel.add(checkfreq, gridBagConstraints64);
2533:
2534: GridBagConstraints gridBagConstraints65 = new java.awt.GridBagConstraints();
2535: gridBagConstraints65.gridx = 0;
2536: gridBagConstraints65.gridy = 2;
2537: gridBagConstraints65.gridwidth = java.awt.GridBagConstraints.REMAINDER;
2538: gridBagConstraints65.fill = java.awt.GridBagConstraints.BOTH;
2539: gridBagConstraints65.insets = new java.awt.Insets(8, 8, 8, 8);
2540: reminderPanel.add(jSeparator1, gridBagConstraints65);
2541:
2542: ResourceHelper.setText(jLabel16, "restart_req");
2543: GridBagConstraints gridBagConstraints66 = new java.awt.GridBagConstraints();
2544: gridBagConstraints66.gridx = 2;
2545: gridBagConstraints66.gridy = 1;
2546: gridBagConstraints66.fill = java.awt.GridBagConstraints.BOTH;
2547: gridBagConstraints66.insets = new java.awt.Insets(0, 8, 0, 0);
2548: reminderPanel.add(jLabel16, gridBagConstraints66);
2549: ResourceHelper.setText(sharedFileCheckBox, "shared");
2550:
2551: GridBagConstraints gridBagConstraints112 = new GridBagConstraints();
2552: gridBagConstraints112.gridx = 0;
2553: gridBagConstraints112.gridy = 4;
2554: gridBagConstraints112.anchor = java.awt.GridBagConstraints.WEST;
2555: gridBagConstraints112.insets = new java.awt.Insets(0, 8, 0, 0);
2556: reminderPanel.add(getUseBeep(), gridBagConstraints112);
2557:
2558: GridBagConstraints gridBagConstraints113 = new GridBagConstraints();
2559: gridBagConstraints113.gridx = 0;
2560: gridBagConstraints113.gridy = 5;
2561: gridBagConstraints113.gridwidth = java.awt.GridBagConstraints.REMAINDER;
2562: gridBagConstraints113.anchor = java.awt.GridBagConstraints.WEST;
2563: gridBagConstraints113.insets = new java.awt.Insets(18, 18, 18,
2564: 18);
2565: reminderPanel.add(remTimePanel, gridBagConstraints113);
2566:
2567: return reminderPanel;
2568: }
2569:
2570: /**
2571: * This method initializes remoteButton
2572: *
2573: * @return javax.swing.JRadioButton
2574: */
2575: private JRadioButton getRemoteButton() {
2576: if (remoteButton == null) {
2577: remoteButton = new JRadioButton();
2578: remoteButton.setActionCommand("remote"); // Generated
2579: ResourceHelper.setText(remoteButton, "rem_server"); // Generated
2580: remoteButton
2581: .addActionListener(new java.awt.event.ActionListener() {
2582: public void actionPerformed(
2583: java.awt.event.ActionEvent e) {
2584: dbTypeAction(e);
2585: }
2586: });
2587: }
2588: return remoteButton;
2589: }
2590:
2591: /**
2592: * This method initializes jPanel12
2593: *
2594: * @return javax.swing.JPanel
2595: */
2596: private JPanel getRemoteServerPanel() {
2597: if (remoteServerPanel == null) {
2598: GridBagConstraints gridBagConstraints54 = new GridBagConstraints();
2599: gridBagConstraints54.fill = java.awt.GridBagConstraints.HORIZONTAL; // Generated
2600: gridBagConstraints54.gridy = 1; // Generated
2601: gridBagConstraints54.ipadx = 0; // Generated
2602: gridBagConstraints54.weightx = 1.0; // Generated
2603: gridBagConstraints54.insets = new java.awt.Insets(4, 4, 4,
2604: 4); // Generated
2605: gridBagConstraints54.gridx = 0; // Generated
2606: GridBagConstraints gridBagConstraints = new GridBagConstraints();
2607: gridBagConstraints.gridx = 0; // Generated
2608: gridBagConstraints.ipadx = 0; // Generated
2609: gridBagConstraints.ipady = 5; // Generated
2610: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); // Generated
2611: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; // Generated
2612: gridBagConstraints.gridy = 0; // Generated
2613:
2614: jLabel = new JLabel();
2615: ResourceHelper.setText(jLabel, "enturl");
2616: jLabel.setLabelFor(getRemoteURLText());
2617: jLabel
2618: .setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); // Generated
2619: jLabel
2620: .setHorizontalAlignment(javax.swing.SwingConstants.LEFT); // Generated
2621: remoteServerPanel = new JPanel();
2622: remoteServerPanel.setLayout(new GridBagLayout()); // Generated
2623: remoteServerPanel
2624: .setBorder(javax.swing.BorderFactory
2625: .createTitledBorder(
2626: null,
2627: Resource
2628: .getResourceString("rem_server_info"),
2629: javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
2630: javax.swing.border.TitledBorder.DEFAULT_POSITION,
2631: null, null)); // Generated
2632: remoteServerPanel.add(jLabel, gridBagConstraints); // Generated
2633: remoteServerPanel.add(getRemoteURLText(),
2634: gridBagConstraints54); // Generated
2635: }
2636: return remoteServerPanel;
2637: }
2638:
2639: /**
2640: * This method initializes remoteURLText
2641: *
2642: * @return javax.swing.JTextField
2643: */
2644: private JTextField getRemoteURLText() {
2645: if (remoteURLText == null) {
2646: remoteURLText = new JTextField();
2647: }
2648: return remoteURLText;
2649: }
2650:
2651: private JSpinner getSyncMins() {
2652: if (syncmins == null) {
2653: syncmins = new JSpinner();
2654: }
2655: return syncmins;
2656: }
2657:
2658: private JPanel getTopPanel() {
2659: if (topPanel == null) {
2660: GridBagConstraints gridBagConstraints510 = new GridBagConstraints();
2661: GridBagConstraints gridBagConstraints210 = new GridBagConstraints();
2662: topPanel = new JPanel();
2663: topPanel.setLayout(new GridBagLayout());
2664: gridBagConstraints210.gridx = 0;
2665: gridBagConstraints210.gridy = 0;
2666: gridBagConstraints210.weightx = 1.0;
2667: gridBagConstraints210.weighty = 1.0;
2668: gridBagConstraints210.fill = java.awt.GridBagConstraints.BOTH;
2669: gridBagConstraints210.insets = new java.awt.Insets(4, 4, 4,
2670: 4);
2671: gridBagConstraints210.gridwidth = 1;
2672: gridBagConstraints510.gridx = 0;
2673: gridBagConstraints510.gridy = 2;
2674: gridBagConstraints510.insets = new java.awt.Insets(4, 4, 4,
2675: 4);
2676: topPanel.add(jTabbedPane1, gridBagConstraints210);
2677: topPanel.add(getApplyDismissPanel(), gridBagConstraints510);
2678: }
2679: return topPanel;
2680: }
2681:
2682: /**
2683: * This method initializes truncbox
2684: *
2685: * @return javax.swing.JCheckBox
2686: */
2687: private JCheckBox getTruncbox() {
2688: if (truncbox == null) {
2689: truncbox = new JCheckBox();
2690: ResourceHelper.setText(truncbox, "truncate_appts");
2691: }
2692: return truncbox;
2693: }
2694:
2695: /**
2696: * This method initializes useBeep
2697: *
2698: * @return javax.swing.JCheckBox
2699: */
2700: private JCheckBox getUseBeep() {
2701: if (useBeep == null) {
2702: useBeep = new JCheckBox();
2703: ResourceHelper.setText(useBeep, "Use_system_beep");
2704: }
2705: return useBeep;
2706: }
2707:
2708: private void hsqldbActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButton5ActionPerformed
2709:
2710: // browse for new database dir
2711: String dbdir = OptionsView.chooseDbDir(false);
2712: if (dbdir == null) {
2713: return;
2714: }
2715:
2716: // update text field - nothing else changes. DB change will take
2717: // effect
2718: // only on restart
2719: hsqldbdir.setText(dbdir);
2720:
2721: }
2722:
2723: private void backupDirActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButton5ActionPerformed
2724:
2725: String dbdir = OptionsView.chooseDbDir(false);
2726: if (dbdir == null) {
2727: return;
2728: }
2729:
2730: backupDir.setText(dbdir);
2731:
2732: }
2733:
2734: private void initComponents() {
2735:
2736: calShowSubtaskBox.setName("calShowSubtaskBox");
2737: calShowSubtaskBox.setHorizontalAlignment(SwingConstants.LEFT);
2738: ganttShowSubtaskBox.setName("calShowSubtaskBox");
2739: ganttShowSubtaskBox.setHorizontalAlignment(SwingConstants.LEFT);
2740: calShowTaskBox.setName("calShowTaskBox");
2741: calShowTaskBox.setHorizontalAlignment(SwingConstants.LEFT);
2742: taskAbbrevBox.setName("taskAbbrevBox");
2743: taskAbbrevBox.setHorizontalAlignment(SwingConstants.LEFT);
2744: remtimelabel = new JLabel();
2745: jTabbedPane1 = new javax.swing.JTabbedPane();
2746: privbox = new javax.swing.JCheckBox();
2747: pubbox = new javax.swing.JCheckBox();
2748: previewFontButton = new javax.swing.JButton();
2749: apptFontButton = new javax.swing.JButton();
2750: jLabel4 = new javax.swing.JLabel();
2751: lnfBox = new javax.swing.JComboBox();
2752: holiday1 = new javax.swing.JCheckBox();
2753: mondaycb = new javax.swing.JCheckBox();
2754: miltime = new javax.swing.JCheckBox();
2755: jLabel5 = new javax.swing.JLabel();
2756: wkstarthr = new javax.swing.JComboBox();
2757: wkendhr = new javax.swing.JComboBox();
2758: jLabel6 = new javax.swing.JLabel();
2759: wrapbox = new javax.swing.JCheckBox();
2760: canadabox = new javax.swing.JCheckBox();
2761: jLabel8 = new javax.swing.JLabel();
2762: localebox = new javax.swing.JComboBox();
2763: defFontButton = new javax.swing.JButton();
2764: colorsortbox = new javax.swing.JCheckBox();
2765: jLabel7 = new javax.swing.JLabel();
2766: dbNameText = new javax.swing.JTextField();
2767: jLabel17 = new javax.swing.JLabel();
2768: dbHostText = new javax.swing.JTextField();
2769: jLabel18 = new javax.swing.JLabel();
2770: dbPortText = new javax.swing.JTextField();
2771: jLabel19 = new javax.swing.JLabel();
2772: dbUserText = new javax.swing.JTextField();
2773: jLabel20 = new javax.swing.JLabel();
2774: jPasswordField1 = new javax.swing.JPasswordField();
2775: jLabel3 = new javax.swing.JLabel();
2776: dbDirText = new javax.swing.JTextField();
2777: jButton5 = new javax.swing.JButton();
2778: chgdb = new javax.swing.JButton();
2779: jLabel1 = new javax.swing.JLabel();
2780: jLabel2 = new javax.swing.JLabel();
2781: smtptext = new javax.swing.JTextField();
2782: emailtext = new javax.swing.JTextField();
2783: emailbox = new javax.swing.JCheckBox();
2784: colorprint = new javax.swing.JCheckBox();
2785: logobox = new javax.swing.JCheckBox();
2786: logofile = new javax.swing.JTextField();
2787: logobrowse = new javax.swing.JButton();
2788: autoupdate = new javax.swing.JCheckBox();
2789: versioncheck = new javax.swing.JButton();
2790: splashbox = new javax.swing.JCheckBox();
2791: backgbox = new javax.swing.JCheckBox();
2792: stackbox = new javax.swing.JCheckBox();
2793: icaltodobox = new javax.swing.JCheckBox();
2794: oldmonthbox = new javax.swing.JCheckBox();
2795: popenablebox = new javax.swing.JCheckBox();
2796: soundbox = new javax.swing.JCheckBox();
2797: jLabel15 = new javax.swing.JLabel();
2798: checkfreq = new javax.swing.JSpinner();
2799: jSeparator1 = new javax.swing.JSeparator();
2800: jLabel16 = new javax.swing.JLabel();
2801: sharedFileCheckBox = new javax.swing.JCheckBox();
2802: dismissButton = new javax.swing.JButton();
2803: applyButton = new javax.swing.JButton();
2804:
2805: setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
2806: ResourceHelper.setTitle(this , "Options");
2807: addWindowListener(new java.awt.event.WindowAdapter() {
2808: public void windowClosing(java.awt.event.WindowEvent evt) {
2809: exitForm(evt);
2810: }
2811: });
2812:
2813: ResourceHelper.addTab(jTabbedPane1, "appearance",
2814: getAppearancePanel());
2815: ResourceHelper.addTab(jTabbedPane1, "fonts", getFontPanel());
2816: ResourceHelper.addTab(jTabbedPane1, "DatabaseInformation",
2817: getDBPanel());
2818: ResourceHelper.addTab(jTabbedPane1, "EmailParameters",
2819: getEmailPanel());
2820: ResourceHelper.addTab(jTabbedPane1, "popup_reminders",
2821: getReminderPanel());
2822: ResourceHelper
2823: .addTab(jTabbedPane1, "printing", getPrintPanel());
2824: ResourceHelper.addTab(jTabbedPane1, "Multi_User",
2825: getMultiUserPanel());
2826: ResourceHelper.addTab(jTabbedPane1, "misc", getMiscPanel());
2827: ResourceHelper.addTab(jTabbedPane1, "UserColorScheme",
2828: getJPanelUCS());
2829: ResourceHelper.addTab(jTabbedPane1, "taskOptions",
2830: getTaskOptionPanel());
2831:
2832: this .setContentPane(getTopPanel());
2833: this .setSize(629, 493);
2834:
2835: pack();
2836: }// GEN-END:initComponents
2837:
2838: private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)// GEN-FIRST:event_jButton2ActionPerformed
2839: {// GEN-HEADEREND:event_jButton2ActionPerformed
2840: this .dispose();
2841: }// GEN-LAST:event_jButton2ActionPerformed
2842:
2843: private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButton5ActionPerformed
2844:
2845: // browse for new database dir
2846: String dbdir = OptionsView.chooseDbDir(false);
2847: if (dbdir == null) {
2848: return;
2849: }
2850:
2851: // update text field - nothing else changes. DB change will take
2852: // effect
2853: // only on restart
2854: dbDirText.setText(dbdir);
2855:
2856: }// GEN-LAST:event_jButton5ActionPerformed
2857:
2858: private void logobrowseActionPerformed(
2859: java.awt.event.ActionEvent evt)// GEN-FIRST:event_logobrowseActionPerformed
2860: {// GEN-HEADEREND:event_logobrowseActionPerformed
2861:
2862: // browse for new logo file
2863: logobox.setSelected(true);
2864: String logo = null;
2865: while (true) {
2866: JFileChooser chooser = new JFileChooser();
2867:
2868: chooser.setCurrentDirectory(new File("."));
2869: chooser
2870: .setDialogTitle(Resource
2871: .getResourceString("Please_choose_the_logo_file_-_GIF/JPG/PNG_only"));
2872: chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
2873:
2874: int returnVal = chooser.showOpenDialog(null);
2875: if (returnVal != JFileChooser.APPROVE_OPTION) {
2876: return;
2877: }
2878:
2879: logo = chooser.getSelectedFile().getAbsolutePath();
2880: File lf = new File(logo);
2881: String err = null;
2882: if (!lf.exists()) {
2883: err = Resource.getResourceString("File_[")
2884: + logo
2885: + Resource
2886: .getResourceString("]_does_not_exist");
2887: } else if (!lf.canRead()) {
2888: err = Resource
2889: .getResourceString("Database_Directory_[")
2890: + logo
2891: + Resource
2892: .getResourceString("]_is_not_writable");
2893: }
2894:
2895: if (err == null) {
2896: break;
2897: }
2898:
2899: Errmsg.notice(err);
2900: }
2901:
2902: // update text field - nothing else changes. DB change will take
2903: // effect
2904: // only on restart
2905: logofile.setText(logo);
2906: }// GEN-LAST:event_logobrowseActionPerformed
2907:
2908: private void versioncheckActionPerformed(
2909: java.awt.event.ActionEvent evt)// GEN-FIRST:event_versioncheckActionPerformed
2910: {// GEN-HEADEREND:event_versioncheckActionPerformed
2911: try {
2912: // get version and compare
2913: URL webverurl = new URL(
2914: "http://borg-calendar.sourceforge.net/latest_version");
2915: InputStream is = webverurl.openStream();
2916: int i;
2917: String webver = "";
2918: while (true) {
2919: i = is.read();
2920: if (i == -1 || i == '\n' || i == '\r') {
2921: break;
2922: }
2923: webver += (char) i;
2924: }
2925:
2926: String info = Resource
2927: .getResourceString("Your_BORG_version_=_")
2928: + Resource.getVersion()
2929: + Resource
2930: .getResourceString("Latest_version_at_sourceforge_=_")
2931: + webver;
2932: JOptionPane
2933: .showMessageDialog(null, info, Resource
2934: .getResourceString("BORG_Version_Check"),
2935: JOptionPane.INFORMATION_MESSAGE,
2936: new ImageIcon(getClass().getResource(
2937: "/resource/borg.jpg")));
2938: } catch (Exception e) {
2939: Errmsg.errmsg(e);
2940: }
2941:
2942: }// GEN-LAST:event_versioncheckActionPerformed
2943: }
|