/** Instantiates a new miscellaneous options panel. */ public MiscellaneousOptionsPanel() { this.setLayout(new java.awt.GridBagLayout()); ResourceHelper.setText(splashbox, "splash"); this.add(splashbox, GridBagConstraintsFactory.create(0, 0, GridBagConstraints.BOTH)); ResourceHelper.setText(stackbox, "stackonerr"); this.add(stackbox, GridBagConstraintsFactory.create(0, 1, GridBagConstraints.BOTH)); JLabel sportlabel = new JLabel(); ResourceHelper.setText(sportlabel, "socket_port"); this.add(sportlabel, GridBagConstraintsFactory.create(0, 2, GridBagConstraints.BOTH)); this.add(socketPort, GridBagConstraintsFactory.create(1, 2, GridBagConstraints.BOTH)); useSysTray.setText(Resource.getResourceString("enable_systray")); this.add(useSysTray, GridBagConstraintsFactory.create(0, 3, GridBagConstraints.BOTH)); startToSysTray.setText(Resource.getResourceString("StartToSysTray")); this.add(startToSysTray, GridBagConstraintsFactory.create(0, 4, GridBagConstraints.BOTH)); dateInSysTray.setText(Resource.getResourceString("show_date_in_systray")); this.add(dateInSysTray, GridBagConstraintsFactory.create(0, 5, GridBagConstraints.BOTH)); JPanel backp = new JPanel(); backp.setLayout(new GridBagLayout()); backp.add( new JLabel(Resource.getResourceString("backup_dir") + ": "), GridBagConstraintsFactory.create(0, 0, GridBagConstraints.NONE)); backp.add(backupDir, GridBagConstraintsFactory.create(1, 0, GridBagConstraints.BOTH, 1.0, 0.0)); JButton bb = new JButton(); ResourceHelper.setText(bb, "Browse"); bb.addActionListener( new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { String dbdir = OptionsPanel.chooseDir(); if (dbdir == null) { return; } backupDir.setText(dbdir); } }); backp.add(bb, GridBagConstraintsFactory.create(2, 0, GridBagConstraints.NONE)); backp.add( new JLabel(Resource.getResourceString("on_shutdown")), GridBagConstraintsFactory.create(0, 1, GridBagConstraints.BOTH)); shutdownAction.addItem(Resource.getResourceString("prompt_for_backup")); shutdownAction.addItem(Resource.getResourceString("exit_no_backup")); shutdownAction.addItem(Resource.getResourceString("write_backup_file")); shutdownAction.addItem(Resource.getResourceString("backup_with_email")); backp.add( shutdownAction, GridBagConstraintsFactory.create(1, 1, GridBagConstraints.BOTH, 1.0, 0.0)); GridBagConstraints gbc1 = GridBagConstraintsFactory.create(0, 6, GridBagConstraints.BOTH, 1.0, 0.0); gbc1.gridwidth = 2; this.add(backp, gbc1); ResourceHelper.setText(colorprint, "Print_In_Color?"); this.add(colorprint, GridBagConstraintsFactory.create(0, 8, GridBagConstraints.BOTH)); dynamicLoading.setText(Resource.getResourceString("enable_plugins")); gbc1 = GridBagConstraintsFactory.create(0, 9, GridBagConstraints.BOTH); gbc1.gridwidth = 2; this.add(dynamicLoading, gbc1); verboseLogging.setText(Resource.getResourceString("verbose_logging")); gbc1 = GridBagConstraintsFactory.create(0, 10, GridBagConstraints.BOTH); gbc1.gridwidth = 2; this.add(verboseLogging, gbc1); useProxy.setText(Resource.getResourceString("Use_Proxy")); gbc1 = GridBagConstraintsFactory.create(0, 11, GridBagConstraints.BOTH); gbc1.gridwidth = 2; this.add(useProxy, gbc1); this.add( new JLabel(Resource.getResourceString("proxy_host")), GridBagConstraintsFactory.create(0, 12, GridBagConstraints.BOTH)); this.add(proxyHostText, GridBagConstraintsFactory.create(1, 12, GridBagConstraints.BOTH)); this.add( new JLabel(Resource.getResourceString("proxy_port")), GridBagConstraintsFactory.create(0, 13, GridBagConstraints.BOTH)); this.add(proxyPortText, GridBagConstraintsFactory.create(1, 13, GridBagConstraints.BOTH)); }
/** Initialize the UI. */ private void initComponents() // GEN-BEGIN:initComponents { setLayout(new GridBagLayout()); /* * project info panel */ JPanel projectInfoPanel = new JPanel(); projectInfoPanel.setLayout(new GridBagLayout()); projectInfoPanel.setBorder(new TitledBorder(Resource.getResourceString("ProjectInformation"))); projectIdText = new JTextField(); projectIdText.setText("projectIdText"); description = new JTextField(); JLabel lblItemNum = new JLabel(); lblItemNum.setText(Resource.getResourceString("Item_#")); dueDateChooser = new JDateChooser(); JLabel lblStartDate = new JLabel(); JLabel lblDueDate = new JLabel(); statusComboBox = new JComboBox(); JLabel catlabel = new JLabel(); JLabel lblStatus = new JLabel(); ResourceHelper.setText(lblStatus, "Status"); lblStatus.setLabelFor(statusComboBox); startDateChooser = new JDateChooser(); ResourceHelper.setText(lblStartDate, "Start_Date"); lblStartDate.setLabelFor(startDateChooser); ResourceHelper.setText(lblDueDate, "Due_Date"); lblDueDate.setLabelFor(dueDateChooser); ResourceHelper.setText(catlabel, "Category"); categoryBox = new JComboBox(); catlabel.setLabelFor(categoryBox); projectInfoPanel.add( lblItemNum, GridBagConstraintsFactory.create(0, 0, GridBagConstraints.BOTH)); projectInfoPanel.add( lblStatus, GridBagConstraintsFactory.create(0, 1, GridBagConstraints.BOTH)); projectInfoPanel.add(catlabel, GridBagConstraintsFactory.create(0, 2, GridBagConstraints.BOTH)); JLabel descLabel = new JLabel(); descLabel.setText(Resource.getResourceString("Description")); projectInfoPanel.add( descLabel, GridBagConstraintsFactory.create(0, 3, GridBagConstraints.BOTH)); projectInfoPanel.add( projectIdText, GridBagConstraintsFactory.create(1, 0, GridBagConstraints.BOTH)); projectInfoPanel.add( statusComboBox, GridBagConstraintsFactory.create(1, 1, GridBagConstraints.BOTH, 1.0, 0.0)); projectInfoPanel.add( categoryBox, GridBagConstraintsFactory.create(1, 2, GridBagConstraints.BOTH, 1.0, 0.0)); GridBagConstraints dgbc = GridBagConstraintsFactory.create(1, 3, GridBagConstraints.BOTH, 1.0, 0.0); dgbc.gridwidth = 5; projectInfoPanel.add(description, dgbc); JLabel parentLabel = new JLabel(Resource.getResourceString("parent")); projectInfoPanel.add( parentLabel, GridBagConstraintsFactory.create(2, 0, GridBagConstraints.BOTH)); projectInfoPanel.add( lblStartDate, GridBagConstraintsFactory.create(2, 1, GridBagConstraints.BOTH)); projectInfoPanel.add( lblDueDate, GridBagConstraintsFactory.create(2, 2, GridBagConstraints.BOTH)); projectInfoPanel.add( parentProjectComboBox, GridBagConstraintsFactory.create(3, 0, GridBagConstraints.BOTH, 1.0, 0.0)); projectInfoPanel.add( startDateChooser, GridBagConstraintsFactory.create(3, 1, GridBagConstraints.BOTH, 1.0, 0.0)); projectInfoPanel.add( dueDateChooser, GridBagConstraintsFactory.create(3, 2, GridBagConstraints.BOTH, 1.0, 0.0)); JLabel daysLeftLabel = new JLabel(); daysLeftLabel.setText(Resource.getResourceString("Days_Left")); daysLeftLabel.setHorizontalTextPosition(SwingConstants.RIGHT); daysLeftLabel.setHorizontalAlignment(SwingConstants.RIGHT); projectInfoPanel.add(daysLeftLabel, GridBagConstraintsFactory.create(4, 0)); JLabel totalLabel = new JLabel(); totalLabel.setText(Resource.getResourceString("total_tasks")); projectInfoPanel.add(totalLabel, GridBagConstraintsFactory.create(4, 1)); JLabel openLabel = new JLabel(); openLabel.setText(Resource.getResourceString("open_tasks")); projectInfoPanel.add(openLabel, GridBagConstraintsFactory.create(4, 2)); daysLeftText = new JTextField(); daysLeftText.setEditable(false); projectInfoPanel.add( daysLeftText, GridBagConstraintsFactory.create(5, 0, GridBagConstraints.BOTH, 1.0, 0.0)); totalTaskCount = new JTextField(); totalTaskCount.setEditable(false); projectInfoPanel.add( totalTaskCount, GridBagConstraintsFactory.create(5, 1, GridBagConstraints.BOTH, 1.0, 0.0)); openTaskCount = new JTextField(); openTaskCount.setEditable(false); projectInfoPanel.add( openTaskCount, GridBagConstraintsFactory.create(5, 2, GridBagConstraints.BOTH, 1.0, 0.0)); add( projectInfoPanel, GridBagConstraintsFactory.create(0, 0, GridBagConstraints.BOTH, 1.0, 0.0)); /* * button panel */ JPanel buttonPanel = new JPanel(); JButton savebutton = new JButton(); savebutton.setIcon(new ImageIcon(getClass().getResource("/resource/Save16.gif"))); ResourceHelper.setText(savebutton, "Save"); savebutton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { saveProject(); } }); buttonPanel.add(savebutton, savebutton.getName()); GridBagConstraints bc = GridBagConstraintsFactory.create(0, 7, GridBagConstraints.BOTH, 0.0, 0.0); bc.gridwidth = 6; projectInfoPanel.add(buttonPanel, bc); /* * link panel */ linkPanel.setBorder(new TitledBorder(Resource.getResourceString("links"))); add(linkPanel, GridBagConstraintsFactory.create(0, 2, GridBagConstraints.BOTH)); /* * panel that will contain the project's task list */ taskBorder = new JPanel(); taskBorder.setBorder(new TitledBorder(Resource.getResourceString("tasks"))); taskBorder.setLayout(new GridBagLayout()); add(taskBorder, GridBagConstraintsFactory.create(0, 3, GridBagConstraints.BOTH, 1.0, 1.0)); }