List of usage examples for javax.swing SwingConstants RIGHT
int RIGHT
To view the source code for javax.swing SwingConstants RIGHT.
Click Source Link
From source file:net.rptools.maptool.client.MapTool.java
private static final void configureJide() { LookAndFeelFactory.UIDefaultsCustomizer uiDefaultsCustomizer = new LookAndFeelFactory.UIDefaultsCustomizer() { public void customize(UIDefaults defaults) { ThemePainter painter = (ThemePainter) UIDefaultsLookup.get("Theme.painter"); defaults.put("OptionPaneUI", "com.jidesoft.plaf.basic.BasicJideOptionPaneUI"); defaults.put("OptionPane.showBanner", Boolean.TRUE); // show banner or not. default is true defaults.put("OptionPane.bannerIcon", new ImageIcon(MapTool.class.getClassLoader() .getResource("net/rptools/maptool/client/image/maptool_icon.png"))); defaults.put("OptionPane.bannerFontSize", 13); defaults.put("OptionPane.bannerFontStyle", Font.BOLD); defaults.put("OptionPane.bannerMaxCharsPerLine", 60); defaults.put("OptionPane.bannerForeground", painter != null ? painter.getOptionPaneBannerForeground() : null); // you should adjust this if banner background is not the default gradient paint defaults.put("OptionPane.bannerBorder", null); // use default border // set both bannerBackgroundDk and bannerBackgroundLt to null if you don't want gradient defaults.put("OptionPane.bannerBackgroundDk", painter != null ? painter.getOptionPaneBannerDk() : null); defaults.put("OptionPane.bannerBackgroundLt", painter != null ? painter.getOptionPaneBannerLt() : null); defaults.put("OptionPane.bannerBackgroundDirection", Boolean.TRUE); // default is true // optionally, you can set a Paint object for BannerPanel. If so, the three UIDefaults related to banner background above will be ignored. defaults.put("OptionPane.bannerBackgroundPaint", null); defaults.put("OptionPane.buttonAreaBorder", BorderFactory.createEmptyBorder(6, 6, 6, 6)); defaults.put("OptionPane.buttonOrientation", SwingConstants.RIGHT); }/*from w w w . j av a2 s. co m*/ }; uiDefaultsCustomizer.customize(UIManager.getDefaults()); }
From source file:atlas.kingj.roi.FrmMain.java
/** * Initialize the contents of the frame. *///w w w.ja v a2 s. c o m private void initialize() { frmTitanRoiCalculator = new JFrame(); frmTitanRoiCalculator.addWindowListener(new FrmTitanRoiCalculatorWindowListener()); frmTitanRoiCalculator.setResizable(false); frmTitanRoiCalculator.setTitle("Titan Production Calculator"); try { frmTitanRoiCalculator.setIconImage(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/logo.png")));//Toolkit.getDefaultToolkit().getImage(FrmMain.class.getResource("/atlas/logo.png"))); } catch (NullPointerException e) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } frmTitanRoiCalculator.setBounds(100, 100, 800, 600); frmTitanRoiCalculator.setLocationRelativeTo(null); frmTitanRoiCalculator.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);//JFrame.EXIT_ON_CLOSE); JMenuBar menuBar = new JMenuBar(); frmTitanRoiCalculator.setJMenuBar(menuBar); JMenu mnFile = new JMenu("File"); mnFile.setMnemonic('F'); menuBar.add(mnFile); mntmOpen = new JMenuItem("Open"); mntmOpen.setMnemonic('O'); mntmOpen.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK)); mntmOpen.addActionListener(new MntmOpenActionListener()); mnFile.add(mntmOpen); mntmSave = new JMenuItem("Save"); mntmSave.setMnemonic('S'); mntmSave.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK)); mntmSave.addActionListener(new MntmSaveActionListener()); mnFile.add(mntmSave); JMenuItem mntmExit = new JMenuItem("Exit"); mntmExit.setMnemonic('X'); mntmExit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { SaveAndClose(); } }); mntmSaveAll = new JMenuItem("Save All"); mntmSaveAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { SaveAll(); } }); mntmOpenAll = new JMenuItem("Open All"); mntmOpenAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { OpenAll(); } }); mnFile.add(mntmOpenAll); mntmSaveAll.setMnemonic('V'); mnFile.add(mntmSaveAll); mnExport = new JMenu("Export"); mnFile.add(mnExport); mntmSpreadsheet = new JMenuItem("Spreadsheet"); mntmSpreadsheet.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { ResetStatusLabel(); fc = new OpenSaveFileChooser(); fc.setFileFilter(new XLSfilter()); fc.type = 3; int returnVal = fc.showSaveDialog(frmTitanRoiCalculator); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); String path = file.getAbsolutePath(); String extension = ".xls"; if (!path.endsWith(extension)) { file = new File(path + extension); } StatusDialog a = new StatusDialog("Generating spreadsheet..."); SaveFileWorker worker = new SaveFileWorker(file, a, false); worker.execute(); a.setLocationRelativeTo(frmTitanRoiCalculator); a.setVisible(true); if (FileSaveError) ShowMessage("File save error"); else if (FileSaveWarning) ShowMessage("File saved, but possible errors."); else ShowMessageSuccess("File saved."); } } }); mnExport.add(mntmSpreadsheet); mnFile.add(mntmExit); JMenu mnView = new JMenu("View"); mnView.setMnemonic('V'); menuBar.add(mnView); RoiData = new ROIData(); mntmUnitConverter = new JMenuItem("Unit Converter"); mntmUnitConverter.setMnemonic('C'); mntmUnitConverter.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.CTRL_MASK)); mntmUnitConverter.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { new UnitConverter(); } }); mnView.add(mntmUnitConverter); mnSettings = new JMenu("Settings"); mnSettings.setMnemonic('E'); menuBar.add(mnSettings); mnUnits = new JMenu("Units"); mnUnits.setMnemonic('U'); mnSettings.add(mnUnits); rdbtnmntmImperial = new JRadioButtonMenuItem("Imperial"); rdbtnmntmImperial.setMnemonic('I'); rdbtnmntmImperial.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_MASK)); rdbtnmntmImperial.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if (metric) { // Change units from metric to imperial ChangeUnits(); } } }); mnUnits.add(rdbtnmntmImperial); rdbtnmntmMetric = new JRadioButtonMenuItem("Metric"); rdbtnmntmMetric.setMnemonic('M'); rdbtnmntmMetric.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.CTRL_MASK)); rdbtnmntmMetric.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (!metric) { // Change units from imperial to metric ChangeUnits(); } } }); rdbtnmntmMetric.setSelected(true); mnUnits.add(rdbtnmntmMetric); btnsUnits.add(rdbtnmntmMetric); btnsUnits.add(rdbtnmntmImperial); JMenuItem mntmOptions_1 = new JMenuItem("Options"); mntmOptions_1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_MASK)); mntmOptions_1.setMnemonic('O'); mntmOptions_1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { Machine machine = null; if (listMachines.getSelectedIndex() > -1) machine = (Machine) listMachines.getSelectedValue(); OptionDialog options = new OptionDialog(environment, machine); options.setLocationRelativeTo(frmTitanRoiCalculator); options.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { UpdateAnalysis(); } }); options.setVisible(true); } }); mnTimings = new JMenu("Timings"); mnSettings.add(mnTimings); mntmSaveToFile = new JMenuItem("Save to File"); mntmSaveToFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { OperatorTimings times = environment.timings; fc = new OpenSaveFileChooser(); fc.setFileFilter(new OBJfilter(3)); fc.type = 1; int returnVal = fc.showSaveDialog(frmTitanRoiCalculator); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); String path = file.getAbsolutePath(); String extension = ".ser"; if (!path.endsWith(extension)) { file = new File(path + extension); } try { FileOutputStream fout = new FileOutputStream(file); ObjectOutputStream oos = new ObjectOutputStream(fout); oos.writeObject(times); oos.close(); ShowMessageSuccess("File saved."); } catch (Exception e1) { JOptionPane.showMessageDialog(frmTitanRoiCalculator, "Error writing file.", "Error", JOptionPane.ERROR_MESSAGE); } } } }); mnTimings.add(mntmSaveToFile); mntmLoadFromFile = new JMenuItem("Load from File"); mntmLoadFromFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { fc = new OpenSaveFileChooser(); fc.setFileFilter(new OBJfilter(3)); fc.type = 1; int returnVal = fc.showOpenDialog(frmTitanRoiCalculator); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); try { FileInputStream fin = new FileInputStream(file); ObjectInputStream ois = new ObjectInputStream(fin); environment.timings = (OperatorTimings) ois.readObject(); ois.close(); ShowMessageSuccess("File loaded."); } catch (Exception e1) { ShowMessage("File error."); } } } }); mnTimings.add(mntmLoadFromFile); mnSettings.add(mntmOptions_1); JMenu mnHelp = new JMenu("Help"); mnHelp.setMnemonic('H'); menuBar.add(mnHelp); JMenuItem mntmInstructions = new JMenuItem("Instructions"); mntmInstructions.setMnemonic('I'); mntmInstructions.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { InstructDialog instructions = new InstructDialog(); instructions.setLocationRelativeTo(frmTitanRoiCalculator); instructions.setVisible(true); } }); mnHelp.add(mntmInstructions); JMenuItem mntmAbout = new JMenuItem("About"); mntmAbout.setMnemonic('A'); mntmAbout.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { AboutDialog about = new AboutDialog(); about.setLocationRelativeTo(frmTitanRoiCalculator); about.setVisible(true); } }); mnHelp.add(mntmAbout); tabbedPane = new JTabbedPane(JTabbedPane.TOP); tabbedPane.addChangeListener(TabChangeListener); frmTitanRoiCalculator.getContentPane().add(tabbedPane, BorderLayout.CENTER); pnlMachine = new JPanel(); tabbedPane.addTab("Machine Selection", null, pnlMachine, "Add and configure machine setups"); tabbedPane.setEnabledAt(0, true); pnlMachine.setLayout(null); grpMachines = new JPanel(); grpMachines.setFont(new Font("Tahoma", Font.PLAIN, 11)); grpMachines.setBounds(20, 72, 182, 256); grpMachines.setBorder( new TitledBorder(null, "Machine Type", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pnlMachine.add(grpMachines); grpMachines.setLayout(null); try { rdbtnER610 = new JRadioButton( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/er610.png")))); rdbtnER610.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/er610_dis.png")))); rdbtnER610.setDisabledSelectedIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/er610_dis.png")))); rdbtnER610.setEnabled(false); rdbtnER610.setToolTipText("Titan ER610"); } catch (NullPointerException e1) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } rdbtnER610.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { rdbtnClick("ER610"); UpdateMachine(); listMachines.repaint(); } }); rdbtnER610.setSelected(true); rdbtnER610.setBounds(13, 24, 155, 40); try { rdbtnER610.setPressedIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/er610_down.png")))); rdbtnER610.setRolloverEnabled(true); rdbtnER610.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/er610_over.png")))); rdbtnER610.setSelectedIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/er610_select.png")))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } grpMachines.add(rdbtnER610); try { rdbtnSR9DS = new JRadioButton( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr9ds.png")))); rdbtnSR9DS.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr9ds_dis.png")))); rdbtnSR9DS.setEnabled(false); rdbtnSR9DS.setToolTipText("Titan SR9-DS"); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } rdbtnSR9DS.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { rdbtnClick("SR9DS"); UpdateMachine(); listMachines.repaint(); } }); try { rdbtnSR9DS.setPressedIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr9ds_down.png")))); rdbtnSR9DS.setRolloverEnabled(true); rdbtnSR9DS.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr9ds_over.png")))); rdbtnSR9DS.setSelectedIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr9ds_select.png")))); rdbtnSR9DS.setBounds(13, 68, 155, 40); grpMachines.add(rdbtnSR9DS); rdbtnSR9DT = new JRadioButton( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr9dt.png")))); rdbtnSR9DT.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr9dt_dis.png")))); rdbtnSR9DT.setEnabled(false); rdbtnSR9DT.setToolTipText("Titan SR9-DT"); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } rdbtnSR9DT.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { rdbtnClick("SR9DT"); UpdateMachine(); listMachines.repaint(); } }); rdbtnSR9DT.setBounds(13, 112, 155, 40); try { rdbtnSR9DT.setPressedIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr9dt_down.png")))); rdbtnSR9DT.setRolloverEnabled(true); rdbtnSR9DT.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr9dt_over.png")))); rdbtnSR9DT.setSelectedIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr9dt_select.png")))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } grpMachines.add(rdbtnSR9DT); try { rdbtnSR800 = new JRadioButton( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr800.png")))); rdbtnSR800.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr800_dis.png")))); rdbtnSR800.setEnabled(false); rdbtnSR800.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { rdbtnClick("SR800"); UpdateMachine(); listMachines.repaint(); } }); rdbtnSR800.setPressedIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr800_down.png")))); rdbtnSR800.setRolloverEnabled(true); rdbtnSR800.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr800_over.png")))); rdbtnSR800.setSelectedIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/sr800_select.png")))); } catch (IOException e2) { e2.printStackTrace(); } rdbtnSR800.setToolTipText("Titan SR800"); rdbtnSR800.setRolloverEnabled(true); rdbtnSR800.setBounds(13, 156, 155, 40); grpMachines.add(rdbtnSR800); try { rdbtnCustom = new JRadioButton( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/custom.png")))); rdbtnCustom.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/custom_dis.png")))); rdbtnCustom.setEnabled(false); rdbtnCustom.setPressedIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/custom_down.png")))); rdbtnCustom.setRolloverEnabled(true); rdbtnCustom.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/custom_over.png")))); rdbtnCustom.setSelectedIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/custom_select.png")))); } catch (IOException e2) { e2.printStackTrace(); } rdbtnCustom.setToolTipText("Custom Machine"); rdbtnCustom.setRolloverEnabled(true); rdbtnCustom.setBounds(13, 200, 155, 40); grpMachines.add(rdbtnCustom); rdbtnCustom.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { rdbtnClick("Custom"); UpdateMachine(); ResetStatusLabel(); listMachines.repaint(); } }); rdbtnsMachines.add(rdbtnER610); rdbtnsMachines.add(rdbtnSR9DS); rdbtnsMachines.add(rdbtnSR9DT); rdbtnsMachines.add(rdbtnSR800); rdbtnsMachines.add(rdbtnCustom); grpVariants = new JPanel(); grpVariants.setFont(new Font("Tahoma", Font.PLAIN, 11)); grpVariants.setBounds(20, 339, 482, 112); grpVariants .setBorder(new TitledBorder(null, "Variants", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pnlMachine.add(grpVariants); grpVariants.setLayout(null); cmbCorepos = new JComboBox(); cmbCorepos.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbCorepos.setToolTipText("Set the core positioning system"); cmbCorepos.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); } }); cmbCorepos.setEnabled(false); cmbCorepos.setBounds(104, 70, 122, 20); grpVariants.add(cmbCorepos); cmbCorepos.setModel(new DefaultComboBoxModel(new String[] { "Manual", "Laser" })); lblCorePositioning = new JLabel("Core Positioning:"); lblCorePositioning.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblCorePositioning.setToolTipText("Set the core positioning system"); lblCorePositioning.setEnabled(false); lblCorePositioning.setHorizontalAlignment(SwingConstants.RIGHT); lblCorePositioning.setBounds(12, 73, 88, 14); grpVariants.add(lblCorePositioning); lblKnifeControl = new JLabel("Knife Control:"); lblKnifeControl.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblKnifeControl.setToolTipText("Set the type of knife positioning system"); lblKnifeControl.setEnabled(false); lblKnifeControl.setHorizontalAlignment(SwingConstants.RIGHT); lblKnifeControl.setBounds(22, 48, 78, 14); grpVariants.add(lblKnifeControl); cmbKnives = new JComboBox(); cmbKnives.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbKnives.setToolTipText("Set the type of knife positioning system"); cmbKnives.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); } }); cmbKnives.setEnabled(false); cmbKnives.setBounds(104, 45, 122, 20); grpVariants.add(cmbKnives); cmbKnives.setModel(new DefaultComboBoxModel(new String[] { "Manual", "Auto" })); cmbUnloader = new JComboBox(); cmbUnloader.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbUnloader.setToolTipText("Set the unloader type"); cmbUnloader.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); } }); cmbUnloader.setEnabled(false); cmbUnloader.setBounds(350, 20, 122, 20); grpVariants.add(cmbUnloader); cmbUnloader.setModel(new DefaultComboBoxModel(new String[] { "Manual", "Pneumatic", "Electric" })); lblUnloader = new JLabel("Unloader:"); lblUnloader.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblUnloader.setToolTipText("Set the unloader type"); lblUnloader.setEnabled(false); lblUnloader.setHorizontalAlignment(SwingConstants.RIGHT); lblUnloader.setBounds(259, 23, 87, 14); grpVariants.add(lblUnloader); cmbSpeed = new JComboBox(); cmbSpeed.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbSpeed.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if (formReady) UpdateMachine(); } }); cmbSpeed.setEnabled(false); cmbSpeed.setToolTipText("Machine top speed in metres/min"); cmbSpeed.setBounds(104, 20, 122, 20); grpVariants.add(cmbSpeed); cmbSpeed.setModel(new DefaultComboBoxModel(new String[] { "450", "550" })); lblSpeed = new JLabel("Speed:"); lblSpeed.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblSpeed.setToolTipText("Machine top speed in metres/min"); lblSpeed.setEnabled(false); lblSpeed.setHorizontalAlignment(SwingConstants.RIGHT); lblSpeed.setBounds(54, 23, 46, 14); grpVariants.add(lblSpeed); cmbUnwindDrive = new JComboBox(); cmbUnwindDrive.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbUnwindDrive.setToolTipText("Unwind drive type"); cmbUnwindDrive.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); } }); cmbUnwindDrive.setEnabled(false); cmbUnwindDrive.setBounds(350, 45, 122, 20); grpVariants.add(cmbUnwindDrive); cmbUnwindDrive.setModel(new DefaultComboBoxModel(new String[] { "Single", "Double" })); lblUnwindDrive = new JLabel("Unwind Drive:"); lblUnwindDrive.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblUnwindDrive.setToolTipText("Unwind drive type"); lblUnwindDrive.setEnabled(false); lblUnwindDrive.setHorizontalAlignment(SwingConstants.RIGHT); lblUnwindDrive.setBounds(259, 48, 87, 14); grpVariants.add(lblUnwindDrive); lblRewindControlLoop = new JLabel("Rewind Control Loop:"); lblRewindControlLoop.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblRewindControlLoop.setToolTipText("Rewind control loop type"); lblRewindControlLoop.setEnabled(false); lblRewindControlLoop.setHorizontalAlignment(SwingConstants.RIGHT); lblRewindControlLoop.setBounds(224, 73, 122, 14); grpVariants.add(lblRewindControlLoop); cmbRewindCtrl = new JComboBox(); cmbRewindCtrl.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbRewindCtrl.setToolTipText("Rewind control loop type"); cmbRewindCtrl.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); } }); cmbRewindCtrl.setEnabled(false); cmbRewindCtrl.setBounds(350, 70, 122, 20); grpVariants.add(cmbRewindCtrl); cmbRewindCtrl.setModel(new DefaultComboBoxModel(new String[] { "Open", "Closed" })); listModel = new DefaultListModel(); jobModel = new DefaultListModel(); scheduleModel = new DefaultListModel(); listModel.removeAllElements(); /*listMachines.setModel(new AbstractListModel() { String[] values = new String[] {"ER610: My test 1", "SR9-DS: this is another test", "SR9-DT: third test", "ER610: test 2", "ER610: bla bla", "SR9-DS: this is another test", "SR9-DT: hello", "SR9-DT: third test"}; public int getSize() { return values.length; } public Object getElementAt(int index) { return values[index]; } });*/ JLabel lblMachines = new JLabel("Machines"); lblMachines.setFont(new Font("Tahoma", Font.BOLD, 12)); lblMachines.setBounds(522, 19, 85, 14); pnlMachine.add(lblMachines); btnMachDelete = new JButton(""); try { btnMachDelete .setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/delete.png")))); btnMachDelete.setRolloverEnabled(true); btnMachDelete.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/delete_over.png")))); btnMachDelete.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/delete_dis.png")))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } btnMachDelete.setToolTipText("Delete machine"); btnMachDelete.setEnabled(false); btnMachDelete.addActionListener(new DeleteButtonListener()); btnMachDelete.setBounds(651, 460, 36, 36); pnlMachine.add(btnMachDelete); btnMachUp = new JButton(""); btnMachUp.setToolTipText("Move machine up"); btnMachUp.setEnabled(false); try { btnMachUp.setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/up.png")))); btnMachUp.setRolloverEnabled(true); btnMachUp.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/up_over.png")))); btnMachUp.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/up_dis.png")))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } btnMachUp.addActionListener(new UpListener()); btnMachUp.setBounds(700, 463, 30, 30); pnlMachine.add(btnMachUp); btnMachDown = new JButton(""); btnMachDown.setToolTipText("Move machine down"); btnMachDown.setEnabled(false); try { btnMachDown.setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/down.png")))); btnMachDown.setRolloverEnabled(true); btnMachDown.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/down_over.png")))); btnMachDown.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/down_dis.png")))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } btnMachDown.addActionListener(new DownListener()); btnMachDown.setBounds(737, 463, 30, 30); pnlMachine.add(btnMachDown); btnMachReset = new JButton("Reset"); btnMachReset.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnMachReset.setEnabled(false); btnMachReset.setToolTipText("Reset the form"); btnMachReset.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { ResetForm(); } }); btnMachReset.setBounds(20, 460, 100, 36); pnlMachine.add(btnMachReset); /*txtMachName.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { int key = e.getKeyCode(); if (e.getKeyCode() == KeyEvent.VK_ENTER) btnAddMachine.doClick(); } });*/ btnNewMachine = new JButton("Add New"); btnNewMachine.setFont(new Font("Tahoma", Font.BOLD, 11)); btnNewMachine.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { formReady = false; ResetStatusLabel(); int index = listMachines.getSelectedIndex(); int size = listModel.getSize(); if (size >= Consts.MACH_LIST_LIMIT) { // Max list size ShowMessage( "Maximum number of machines allocated. Please delete before attempting to add more."); return; } String newName = getUniqueName("Machine"); txtMachName.setText(newName); machine = new Machine(newName); machNames.add(newName.toLowerCase()); //If no selection or if item in last position is selected, //add the new one to end of list, and select new one. if (index == -1 || (index + 1 == size)) { listModel.addElement(machine); listMachines.setSelectedIndex(size); RoiData.energies.add(RoiData.new EnergyData()); RoiData.maintenance.add(RoiData.new MaintData()); listCompare.addSelectionInterval(size, size); //Otherwise insert the new one after the current selection, //and select new one. } else { int[] sel = listCompare.getSelectedIndices(); int[] selection = new int[sel.length + 1]; System.arraycopy(sel, 0, selection, 0, sel.length); listCompare.setSelectedIndices(new int[] {}); listModel.insertElementAt(machine, index + 1); boolean max = false; for (int i = 0; i < selection.length; i++) { if (selection[i] >= index + 1 && !max) { if (i < selection.length - 1) System.arraycopy(selection, i, selection, i + 1, selection.length - i - 1); selection[i] = index + 1; max = true; } else if (selection[i] >= index + 1) selection[i] = selection[i] + 1; } RoiData.energies.add(index + 1, RoiData.new EnergyData()); RoiData.maintenance.add(index + 1, RoiData.new MaintData()); listCompare.setSelectedIndices(selection); //listCompareRoi.setSelectedIndices(selection); listMachines.setSelectedIndex(index + 1); //listCompare.addSelectionInterval(index + 1, index + 1); } ResetStatusLabel(); //UpdateForm(); already triggered in listchanged formReady = true; txtMachName.requestFocusInWindow(); } }); try { btnNewMachine .setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/plus.png")))); } catch (IOException e1) { e1.printStackTrace(); } btnNewMachine.setToolTipText("Add new machine"); btnNewMachine.setBounds(522, 460, 110, 36); pnlMachine.add(btnNewMachine); grpOptions = new JPanel(); grpOptions.setFont(new Font("Tahoma", Font.PLAIN, 11)); grpOptions.setBounds(212, 72, 290, 256); pnlMachine.add(grpOptions); grpOptions.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Options", TitledBorder.LEADING, TitledBorder.TOP, null, null)); grpOptions.setLayout(null); chckbxFlag = new JCheckBox("Flag Detection"); chckbxFlag.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxFlag.setToolTipText("Whether an automatic flag detection system is used"); chckbxFlag.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); if (!chckbxFlag.isSelected()) chckbxSelectAll.setSelected(false); else UpdateSelectAllChckbx(); } }); chckbxFlag.setEnabled(false); chckbxFlag.setBounds(155, 104, 109, 23); grpOptions.add(chckbxFlag); chckbxSpliceTable = new JCheckBox("Splice Table"); chckbxSpliceTable.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxSpliceTable.setToolTipText("Whether a splice table is fitted"); chckbxSpliceTable.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); if (!chckbxSpliceTable.isSelected()) chckbxSelectAll.setSelected(false); else UpdateSelectAllChckbx(); } }); chckbxSpliceTable.setEnabled(false); chckbxSpliceTable.setBounds(22, 104, 109, 23); grpOptions.add(chckbxSpliceTable); chckbxAlignmentGuide = new JCheckBox("Alignment Guide"); chckbxAlignmentGuide.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxAlignmentGuide.setToolTipText("Whether an alignment guide is fitted"); chckbxAlignmentGuide.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); if (!chckbxAlignmentGuide.isSelected()) chckbxSelectAll.setSelected(false); else UpdateSelectAllChckbx(); } }); chckbxAlignmentGuide.setEnabled(false); chckbxAlignmentGuide.setBounds(22, 130, 127, 23); grpOptions.add(chckbxAlignmentGuide); chckbxRollConditioning = new JCheckBox("Roll Conditioning"); chckbxRollConditioning.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxRollConditioning.setToolTipText("Whether the machine supports roll conditioning"); chckbxRollConditioning.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); if (!chckbxRollConditioning.isSelected()) chckbxSelectAll.setSelected(false); else UpdateSelectAllChckbx(); } }); chckbxRollConditioning.setEnabled(false); chckbxRollConditioning.setBounds(22, 156, 127, 23); grpOptions.add(chckbxRollConditioning); chckbxTurretSupport = new JCheckBox("Turret Support"); chckbxTurretSupport.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxTurretSupport.setToolTipText("For dual turret machines: extra turret support"); chckbxTurretSupport.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); if (!chckbxTurretSupport.isSelected()) chckbxSelectAll.setSelected(false); else UpdateSelectAllChckbx(); } }); chckbxTurretSupport.setEnabled(false); chckbxTurretSupport.setBounds(22, 182, 127, 23); grpOptions.add(chckbxTurretSupport); chckbxAutostripping = new JCheckBox("Autostripping"); chckbxAutostripping.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxAutostripping.setToolTipText("Whether an autostripping feature is present for reel unloading"); chckbxAutostripping.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); if (!chckbxAutostripping.isSelected()) chckbxSelectAll.setSelected(false); else UpdateSelectAllChckbx(); } }); chckbxAutostripping.setEnabled(false); chckbxAutostripping.setBounds(22, 208, 97, 23); grpOptions.add(chckbxAutostripping); chckbxExtraRewind = new JCheckBox("850mm Rewind"); chckbxExtraRewind.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxExtraRewind.setToolTipText("Extra wide 850mm max diameter rewind support"); chckbxExtraRewind.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); if (!chckbxExtraRewind.isSelected()) chckbxSelectAll.setSelected(false); else UpdateSelectAllChckbx(); } }); chckbxExtraRewind.setEnabled(false); chckbxExtraRewind.setBounds(155, 208, 109, 23); grpOptions.add(chckbxExtraRewind); chckbxAutoCutoff = new JCheckBox("Auto Cut-off"); chckbxAutoCutoff.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxAutoCutoff.setToolTipText("Whether the web is cut automatically when a run completes"); chckbxAutoCutoff.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); if (!chckbxAutoCutoff.isSelected()) chckbxSelectAll.setSelected(false); else UpdateSelectAllChckbx(); } }); chckbxAutoCutoff.setEnabled(false); chckbxAutoCutoff.setBounds(155, 130, 109, 23); grpOptions.add(chckbxAutoCutoff); chckbxAutoTapeCore = new JCheckBox("Auto Tape Core"); chckbxAutoTapeCore.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxAutoTapeCore.setToolTipText("Whether new reels are automatically taped before a run begins"); chckbxAutoTapeCore.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); if (!chckbxAutoTapeCore.isSelected()) chckbxSelectAll.setSelected(false); else UpdateSelectAllChckbx(); } }); chckbxAutoTapeCore.setEnabled(false); chckbxAutoTapeCore.setBounds(155, 156, 109, 23); grpOptions.add(chckbxAutoTapeCore); chckbxAutoTapeTail = new JCheckBox("Auto Tape Tail"); chckbxAutoTapeTail.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxAutoTapeTail.setToolTipText("Whether the tails of completed reels are automatically taped down"); chckbxAutoTapeTail.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (formReady) UpdateMachine(); if (!chckbxAutoTapeTail.isSelected()) chckbxSelectAll.setSelected(false); else UpdateSelectAllChckbx(); } }); chckbxAutoTapeTail.setEnabled(false); chckbxAutoTapeTail.setBounds(155, 182, 109, 23); grpOptions.add(chckbxAutoTapeTail); txtMachName = new JTextField(); txtMachName.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtMachName.selectAll(); } }); txtMachName.getDocument().addDocumentListener(new DocumentListener() { @Override public void changedUpdate(DocumentEvent arg0) { } @Override public void insertUpdate(DocumentEvent arg0) { UpdateMachineName(); } @Override public void removeUpdate(DocumentEvent arg0) { UpdateMachineName(); } }); txtMachName.setEnabled(false); txtMachName.setBounds(125, 35, 137, 28); grpOptions.add(txtMachName); txtMachName.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { } public void removeUpdate(DocumentEvent e) { // text was deleted } public void insertUpdate(DocumentEvent e) { // text was inserted } }); txtMachName.setToolTipText("Enter a name to refer to this particular machine by"); txtMachName.setFont(new Font("Tahoma", Font.BOLD, 12)); txtMachName.setColumns(10); lblMachName = new JLabel("Machine name:"); lblMachName.setToolTipText("Enter a name to refer to this particular machine by"); lblMachName.setEnabled(false); lblMachName.setBounds(26, 36, 91, 24); grpOptions.add(lblMachName); lblMachName.setFont(new Font("Tahoma", Font.PLAIN, 13)); chckbxSelectAll = new JCheckBox("Select All"); chckbxSelectAll.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxSelectAll.setToolTipText("Select all available options"); chckbxSelectAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (chckbxSelectAll.isSelected()) { if (chckbxAlignmentGuide.isEnabled()) chckbxAlignmentGuide.setSelected(true); if (chckbxAutoCutoff.isEnabled()) chckbxAutoCutoff.setSelected(true); if (chckbxAutostripping.isEnabled()) chckbxAutostripping.setSelected(true); if (chckbxAutoTapeCore.isEnabled()) chckbxAutoTapeCore.setSelected(true); if (chckbxAutoTapeTail.isEnabled()) chckbxAutoTapeTail.setSelected(true); if (chckbxExtraRewind.isEnabled()) chckbxExtraRewind.setSelected(true); if (chckbxFlag.isEnabled()) chckbxFlag.setSelected(true); if (chckbxRollConditioning.isEnabled()) chckbxRollConditioning.setSelected(true); if (chckbxSpliceTable.isEnabled()) chckbxSpliceTable.setSelected(true); if (chckbxTurretSupport.isEnabled()) chckbxTurretSupport.setSelected(true); } else { chckbxAlignmentGuide.setSelected(false); chckbxAutoCutoff.setSelected(false); chckbxAutostripping.setSelected(false); chckbxAutoTapeCore.setSelected(false); chckbxAutoTapeTail.setSelected(false); chckbxExtraRewind.setSelected(false); chckbxFlag.setSelected(false); chckbxRollConditioning.setSelected(false); chckbxSpliceTable.setSelected(false); chckbxTurretSupport.setSelected(false); } if (formReady) UpdateMachine(); } }); chckbxSelectAll.setEnabled(false); chckbxSelectAll.setBounds(22, 78, 97, 23); grpOptions.add(chckbxSelectAll); lblMachineConfiguration = new JLabel("Machine Configuration"); lblMachineConfiguration.setFont(new Font("Tahoma", Font.BOLD, 18)); lblMachineConfiguration.setBounds(29, 18, 269, 22); pnlMachine.add(lblMachineConfiguration); lblAddNewMachines = new JLabel( "Add new machines to the list on the right, then configure their options and variants below"); lblAddNewMachines.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblAddNewMachines.setBounds(29, 45, 433, 14); pnlMachine.add(lblAddNewMachines); btnCustomMachine = new JButton("Custom Machine Options"); btnCustomMachine.setEnabled(false); btnCustomMachine.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnCustomMachine.setBounds(322, 460, 180, 36); pnlMachine.add(btnCustomMachine); btnCustomMachine.setToolTipText("Edit settings for a custom machine type"); scrollPane = new JScrollPane(); scrollPane.setBorder(null); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setBounds(522, 44, 245, 405); pnlMachine.add(scrollPane); panel_6 = new JPanel(); panel_6.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, new Color(192, 192, 192), null, null, null)); panel_6.setBackground(Color.WHITE); panel_6.setToolTipText("Select a machine to edit options, re-order, or delete"); scrollPane.setViewportView(panel_6); panel_6.setLayout(new BorderLayout(0, 0)); //Create the list and put it in a scroll pane. listMachines = new JList(listModel); panel_6.add(listMachines, BorderLayout.NORTH); listMachines.addListSelectionListener(new MachineListSelectionListener()); listMachines.setCellRenderer(new MachineListRenderer()); listMachines.setBorder(null); listMachines.setToolTipText("Select a machine to edit options, re-order, or delete"); listMachines.setFont(new Font("Tahoma", Font.PLAIN, 13)); listMachines.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); btnOverrideDefaultAcceleration = new JButton("Override Default Acceleration"); btnOverrideDefaultAcceleration.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnOverrideDefaultAcceleration .setToolTipText("Set new values for the acceleration/deceleration of this machine"); btnOverrideDefaultAcceleration.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { // check list selected listMachines.getSelectedIndex(); } catch (Exception e2) { return; } Machine currMachine = (Machine) listMachines.getSelectedValue(); AccelDecel dialog = new AccelDecel(currMachine); dialog.setLocationRelativeTo(frmTitanRoiCalculator); dialog.setVisible(true); } }); btnOverrideDefaultAcceleration.setEnabled(false); btnOverrideDefaultAcceleration.setBounds(130, 460, 182, 36); pnlMachine.add(btnOverrideDefaultAcceleration); btnCustomMachine.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ResetStatusLabel(); //rdbtnOther.doClick(); MachineBuilder newmach = new MachineBuilder(machine); newmach.setLocationRelativeTo(frmTitanRoiCalculator); newmach.setVisible(true); } }); pnlJob = new JPanel(); tabbedPane.addTab("Job Selection", null, pnlJob, "Add and configure machine jobs"); tabbedPane.setEnabledAt(1, true); pnlJob.setLayout(null); JPanel pnlMaterials = new JPanel(); pnlMaterials.setBounds(280, 72, 227, 124); pnlMaterials.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Material Settings", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pnlJob.add(pnlMaterials); pnlMaterials.setLayout(null); Material[] materials = { new Material("Custom", 1.0, 20), new Material("Aluminium", 2.7, 40), new Material("Board", 1.3, 80), new Material("Cellophane", 1.5, 20), new Material("HDPE/BOPE", 0.94, 20), new Material("Laminate", 1.0, 20), new Material("LDPE/BOPE", 0.91, 20), new Material("LLDPE", 0.9, 20), new Material("MDPE", 0.925, 20), new Material("Nylon", 1.12, 20), new Material("Polypropylene", 0.91, 20), new Material("Polystyrene", 1.04, 20), new Material("Paper", 0.8, 100), new Material("PEEK", 1.3, 20), new Material("Polyester", 1.4, 20), new Material("PLA", 1.24, 20), new Material("Polyolefin", 0.92, 20), new Material("PSA Label", 1.1, 20), new Material("PVC", 1.36, 20), new Material("Shrink label", 0.91, 20), new Material("Tri. Lam.", 1.1, 20) }; cmbMaterials = new JComboBox(materials); cmbMaterials.setMaximumRowCount(20); cmbMaterials.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if (jobFormReady) { Material m = (Material) cmbMaterials.getSelectedItem(); if (!(m.name.equals("Custom"))) { jobFormReady = false; txtThickness.setText(Double.toString(roundTwoDecimals(m.getThickness()))); if (lblGsm.getText().equals("(gsm)")) txtDensity.setText(Double.toString(roundTwoDecimals(m.getDensity()))); else txtDensity .setText(Double.toString(roundTwoDecimals(m.getDensity() * m.getThickness()))); if (!metric) { txtThickness .setText(Double.toString(roundTwoDecimals(Core.MicroToMil(m.getThickness())))); } jobFormReady = true; } UpdateJob(); } } }); cmbMaterials.setEnabled(false); cmbMaterials.setSelectedIndex(0); cmbMaterials.setToolTipText("Choose a preset material"); cmbMaterials.setBounds(81, 26, 117, 22); pnlMaterials.add(cmbMaterials); lblPresets = new JLabel("Presets:"); lblPresets.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblPresets.setToolTipText("Choose a preset material"); lblPresets.setEnabled(false); lblPresets.setBounds(37, 29, 40, 15); pnlMaterials.add(lblPresets); lblThickness_1 = new JLabel("Thickness:"); lblThickness_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblThickness_1.setToolTipText("Material thickness"); lblThickness_1.setEnabled(false); lblThickness_1.setHorizontalAlignment(SwingConstants.RIGHT); lblThickness_1.setBounds(7, 61, 70, 14); pnlMaterials.add(lblThickness_1); lblDensity_1 = new JLabel("Density:"); lblDensity_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblDensity_1.setToolTipText("Material density (per volume, not area)"); lblDensity_1.setEnabled(false); lblDensity_1.setHorizontalAlignment(SwingConstants.RIGHT); lblDensity_1.setBounds(31, 86, 46, 14); pnlMaterials.add(lblDensity_1); txtThickness = new JTextField(); txtThickness.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtThickness.selectAll(); } }); txtThickness.setEnabled(false); txtThickness.getDocument().addDocumentListener(new JobInputChangeListener()); txtThickness.setToolTipText("Material thickness"); txtThickness.setText("20"); txtThickness.setBounds(81, 58, 86, 20); pnlMaterials.add(txtThickness); txtThickness.setColumns(10); txtDensity = new JTextField(); txtDensity.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtDensity.selectAll(); } }); txtDensity.setEnabled(false); txtDensity.getDocument().addDocumentListener(new JobInputChangeListener()); txtDensity.setToolTipText("Material density (per volume, not area)"); txtDensity.setText("0.92"); txtDensity.setBounds(81, 83, 86, 20); pnlMaterials.add(txtDensity); txtDensity.setColumns(10); lblmicro0 = new JLabel("(\u00B5m)"); lblmicro0.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblmicro0.setEnabled(false); lblmicro0.setBounds(177, 61, 46, 14); pnlMaterials.add(lblmicro0); lblgm3 = new JLabel("(g/cm )"); lblgm3.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblgm3.setEnabled(false); lblgm3.setBounds(177, 86, 46, 14); pnlMaterials.add(lblgm3); label_3 = new JLabel("3"); label_3.setEnabled(false); label_3.setFont(new Font("Tahoma", Font.PLAIN, 8)); label_3.setBounds(204, 83, 14, 14); pnlMaterials.add(label_3); JPanel pnlJobs = new JPanel(); pnlJobs.setBounds(20, 168, 250, 283); pnlJobs.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Rewind Settings", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0))); pnlJob.add(pnlJobs); pnlJobs.setLayout(null); lblTargetRewindLength = new JLabel("Rewind Output:"); lblTargetRewindLength.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblTargetRewindLength.setToolTipText("Quantity of rewind output"); lblTargetRewindLength.setEnabled(false); lblTargetRewindLength.setHorizontalAlignment(SwingConstants.RIGHT); lblTargetRewindLength.setBounds(17, 197, 88, 14); pnlJobs.add(lblTargetRewindLength); lblSlitWidth = new JLabel("Slit Width:"); lblSlitWidth.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblSlitWidth.setToolTipText("Width of each output reel"); lblSlitWidth.setEnabled(false); lblSlitWidth.setHorizontalAlignment(SwingConstants.RIGHT); lblSlitWidth.setBounds(46, 60, 59, 14); pnlJobs.add(lblSlitWidth); lblSlitCount = new JLabel("Reel Count:"); lblSlitCount.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblSlitCount.setToolTipText("Number of reels per set at the output"); lblSlitCount.setEnabled(false); lblSlitCount.setHorizontalAlignment(SwingConstants.RIGHT); lblSlitCount.setBounds(46, 33, 59, 14); pnlJobs.add(lblSlitCount); lblTrimtotal = new JLabel("Trim (total):"); lblTrimtotal.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblTrimtotal.setToolTipText("The trim resulting from the given slit widths"); lblTrimtotal.setEnabled(false); lblTrimtotal.setHorizontalAlignment(SwingConstants.RIGHT); lblTrimtotal.setBounds(20, 114, 85, 14); pnlJobs.add(lblTrimtotal); txtSlits = new JTextField(); txtSlits.setToolTipText("Number of reels per set at the output"); txtSlits.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtSlits.selectAll(); } }); txtSlits.getDocument().addDocumentListener(new JobInputChangeListener()); txtSlits.setEnabled(false); txtSlits.setText("1"); txtSlits.setBounds(109, 30, 86, 20); pnlJobs.add(txtSlits); txtSlits.setColumns(10); txtSlitWidth = new JTextField(); txtSlitWidth.setToolTipText("Width of each output reel"); txtSlitWidth.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtSlitWidth.selectAll(); } }); txtSlitWidth.getDocument().addDocumentListener(new JobInputChangeListener()); txtSlitWidth.setEnabled(false); txtSlitWidth.setText("1350"); txtSlitWidth.setBounds(109, 58, 86, 20); pnlJobs.add(txtSlitWidth); txtSlitWidth.setColumns(10); txtRewindAmount = new JTextField(); txtRewindAmount.setToolTipText("Quantity of rewind output"); txtRewindAmount.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtRewindAmount.selectAll(); } }); txtRewindAmount.getDocument().addDocumentListener(new JobInputChangeListener()); txtRewindAmount.setEnabled(false); txtRewindAmount.setName("RewindLength"); txtRewindAmount.setText("1000"); txtRewindAmount.setBounds(109, 194, 86, 20); pnlJobs.add(txtRewindAmount); txtRewindAmount.setColumns(10); lblTrim = new JLabel("0 mm"); lblTrim.setToolTipText("The trim resulting from the given slit widths"); lblTrim.setEnabled(false); lblTrim.setBounds(111, 114, 65, 14); pnlJobs.add(lblTrim); cmbRewindCore = new JComboBox(); cmbRewindCore.setToolTipText("Core diameter of rewind reels"); ((JTextField) cmbRewindCore.getEditor().getEditorComponent()).getDocument() .addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent arg0) { UpdateJob(); } @Override public void insertUpdate(DocumentEvent arg0) { UpdateJob(); } @Override public void changedUpdate(DocumentEvent arg0) { } }); /*cmbRewindCore.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UpdateJob(jobIndex); } });*/ cmbRewindCore.setEnabled(false); cmbRewindCore.setModel(new DefaultComboBoxModel(Consts.REWIND_CORE_MM)); cmbRewindCore.setSelectedIndex(1); cmbRewindCore.setBounds(109, 137, 87, 20); pnlJobs.add(cmbRewindCore); cmbRewindCore.setEditable(true); lblRewindCoremm = new JLabel("Rewind Core:"); lblRewindCoremm.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblRewindCoremm.setToolTipText("Core diameter of rewind reels"); lblRewindCoremm.setEnabled(false); lblRewindCoremm.setBounds(40, 140, 65, 14); pnlJobs.add(lblRewindCoremm); lblPer_1 = new JLabel("per:"); lblPer_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblPer_1.setToolTipText("Set whether rewind output is measured per reel or per set"); lblPer_1.setEnabled(false); lblPer_1.setBounds(85, 248, 20, 14); pnlJobs.add(lblPer_1); cmbJobDomain = new JComboBox(); cmbJobDomain.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UpdateSetReel(); //UpdateJob(); } }); cmbJobDomain.setEnabled(false); cmbJobDomain.setToolTipText("Set whether rewind output is measured per reel or per set"); cmbJobDomain.setModel(new DefaultComboBoxModel(new String[] { "Reel", "Set" })); cmbJobDomain.setBounds(109, 246, 95, 20); pnlJobs.add(cmbJobDomain); lblmm3 = new JLabel("(mm)"); lblmm3.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblmm3.setEnabled(false); lblmm3.setBounds(205, 61, 27, 14); pnlJobs.add(lblmm3); lblmm2 = new JLabel("(mm)"); lblmm2.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblmm2.setEnabled(false); lblmm2.setBounds(206, 140, 27, 14); pnlJobs.add(lblmm2); pnlUnwinds = new JPanel(); pnlUnwinds.setLayout(null); pnlUnwinds.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Unwind Settings", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pnlUnwinds.setBounds(280, 207, 227, 162); pnlJob.add(pnlUnwinds); lblUnwindLength = new JLabel("Unwind Size:"); lblUnwindLength.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblUnwindLength.setToolTipText("Quantity of material per mother roll"); lblUnwindLength.setEnabled(false); lblUnwindLength.setHorizontalAlignment(SwingConstants.RIGHT); lblUnwindLength.setBounds(21, 104, 66, 14); pnlUnwinds.add(lblUnwindLength); txtUnwindAmount = new JTextField(); txtUnwindAmount.setToolTipText("Quantity of material per mother roll"); txtUnwindAmount.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent arg0) { txtUnwindAmount.selectAll(); } }); txtUnwindAmount.getDocument().addDocumentListener(new JobInputChangeListener()); txtUnwindAmount.setEnabled(false); txtUnwindAmount.setName("UnwindLength"); txtUnwindAmount.setText("10000"); txtUnwindAmount.setBounds(92, 100, 86, 20); pnlUnwinds.add(txtUnwindAmount); txtUnwindAmount.setColumns(10); lblWebWidthmm = new JLabel("Web Width:"); lblWebWidthmm.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblWebWidthmm.setToolTipText("Width of mother rolls"); lblWebWidthmm.setEnabled(false); lblWebWidthmm.setBounds(31, 29, 57, 14); pnlUnwinds.add(lblWebWidthmm); lblUnwindCoremm = new JLabel("Unwind Core:"); lblUnwindCoremm.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblUnwindCoremm.setToolTipText("Core diameter of mother rolls"); lblUnwindCoremm.setEnabled(false); lblUnwindCoremm.setBounds(22, 54, 66, 14); pnlUnwinds.add(lblUnwindCoremm); cmbUnwindCore = new JComboBox(); cmbUnwindCore.setToolTipText("Core diameter of mother rolls"); ((JTextField) cmbUnwindCore.getEditor().getEditorComponent()).getDocument() .addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent arg0) { UpdateJob(); } @Override public void insertUpdate(DocumentEvent arg0) { UpdateJob(); } @Override public void changedUpdate(DocumentEvent arg0) { } }); cmbUnwindCore.setEnabled(false); cmbUnwindCore.setModel(new DefaultComboBoxModel(new String[] { "76", "152", "254" })); cmbUnwindCore.setBounds(92, 51, 86, 20); pnlUnwinds.add(cmbUnwindCore); cmbUnwindCore.setEditable(true); lblmm0 = new JLabel("(mm)"); lblmm0.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblmm0.setEnabled(false); lblmm0.setBounds(189, 29, 32, 14); pnlUnwinds.add(lblmm0); lblmm1 = new JLabel("(mm)"); lblmm1.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblmm1.setEnabled(false); lblmm1.setBounds(189, 53, 32, 14); pnlUnwinds.add(lblmm1); pnlEnviron = new JPanel(); tabbedPane.addTab("Job Scheduling", null, pnlEnviron, "Edit the schedule of jobs to be analysed"); tabbedPane.setEnabledAt(2, true); pnlEnviron.setLayout(null); JPanel pnlShifts = new JPanel(); pnlShifts.setLayout(null); pnlShifts.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Shift Options", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pnlShifts.setBounds(20, 72, 287, 162); pnlEnviron.add(pnlShifts); JLabel lblShiftLength = new JLabel("Shift Length:"); lblShiftLength.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblShiftLength.setToolTipText("Hours per working shift"); lblShiftLength.setHorizontalAlignment(SwingConstants.RIGHT); lblShiftLength.setBounds(15, 28, 108, 14); pnlShifts.add(lblShiftLength); JLabel lblDayLength = new JLabel("Day Length:"); lblDayLength.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblDayLength.setToolTipText("Working hours per day"); lblDayLength.setHorizontalAlignment(SwingConstants.RIGHT); lblDayLength.setBounds(29, 78, 94, 14); pnlShifts.add(lblDayLength); JLabel lblShiftsDay = new JLabel("Shifts per Day:"); lblShiftsDay.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblShiftsDay.setToolTipText("Shifts per day"); lblShiftsDay.setHorizontalAlignment(SwingConstants.RIGHT); lblShiftsDay.setBounds(15, 53, 108, 14); pnlShifts.add(lblShiftsDay); JLabel lblDays = new JLabel("Days per Year:"); lblDays.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblDays.setToolTipText("Days per year"); lblDays.setHorizontalAlignment(SwingConstants.RIGHT); lblDays.setBounds(0, 106, 123, 14); pnlShifts.add(lblDays); txtShiftLength = new JTextField(); txtShiftLength.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent arg0) { UpdateShifts(); } @Override public void insertUpdate(DocumentEvent arg0) { UpdateShifts(); } @Override public void changedUpdate(DocumentEvent arg0) { } }); txtShiftLength.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent arg0) { txtShiftLength.selectAll(); } }); txtShiftLength.setToolTipText("Hours per working shift"); txtShiftLength.setText("8"); txtShiftLength.setBounds(133, 25, 86, 20); pnlShifts.add(txtShiftLength); txtShiftLength.setColumns(10); txtShiftCount = new JTextField(); txtShiftCount.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent arg0) { UpdateShifts(); } @Override public void insertUpdate(DocumentEvent arg0) { UpdateShifts(); } @Override public void changedUpdate(DocumentEvent arg0) { } }); txtShiftCount.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtShiftCount.selectAll(); } }); txtShiftCount.setToolTipText("Shifts per day"); txtShiftCount.setText("3"); txtShiftCount.setBounds(133, 50, 86, 20); pnlShifts.add(txtShiftCount); txtShiftCount.setColumns(10); txtDaysYear = new JTextField(); txtDaysYear.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent arg0) { UpdateShifts(); } @Override public void insertUpdate(DocumentEvent arg0) { UpdateShifts(); } @Override public void changedUpdate(DocumentEvent arg0) { } }); txtDaysYear.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtDaysYear.selectAll(); } }); txtDaysYear.setToolTipText("Days per year"); txtDaysYear.setText("250"); txtDaysYear.setBounds(133, 103, 86, 20); pnlShifts.add(txtDaysYear); txtDaysYear.setColumns(10); lblDayLength2 = new JLabel("24 hours"); lblDayLength2.setToolTipText("Working hours per day"); lblDayLength2.setBounds(133, 78, 86, 14); pnlShifts.add(lblDayLength2); lblHoursYear = new JLabel("Hours per Year:"); lblHoursYear.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblHoursYear.setToolTipText("Working hours per year"); lblHoursYear.setBounds(47, 131, 76, 14); pnlShifts.add(lblHoursYear); lblHoursYear2 = new JLabel("6000 hours"); lblHoursYear2.setToolTipText("Working hours per year"); lblHoursYear2.setBounds(133, 131, 86, 14); pnlShifts.add(lblHoursYear2); lblHrs = new JLabel("hrs"); lblHrs.setBounds(229, 28, 46, 14); pnlShifts.add(lblHrs); btnAddAll = new JButton("Add All"); btnAddAll.setToolTipText("Add all jobs to the schedule in order"); btnAddAll.setFont(new Font("Tahoma", Font.BOLD, 11)); btnAddAll.setEnabled(false); try { btnAddAll.setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/plus.png")))); } catch (IOException e1) { e1.printStackTrace(); } btnAddAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { for (int i = 0; i < jobModel.getSize(); ++i) { listJobsAvail.setSelectedIndex(i); btnAddJob.doClick(); } } }); btnAddAll.setBounds(327, 460, 110, 36); pnlEnviron.add(btnAddAll); btnAddJob = new JButton(""); btnAddJob.setToolTipText("Add this job to the schedule"); btnAddJob.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //AddToSchedule(listJobsAvail.getSelectedValue()); ResetStatusLabel(); int index = listSchedule.getSelectedIndex(); //int source_index = listJobsAvail.getSelectedIndex(); Job sel = (Job) listJobsAvail.getSelectedValue(); JobItem j = environment.getSchedule().new JobItem(sel, 0, sel.getTotWeight(), sel.getTotLength()); int size = scheduleModel.getSize(); // no limit now there are scroll bars /* if(size >= Consts.JOB_LIST_LIMIT){ // Max list size ShowMessage("Maximum number of jobs scheduled. Please delete before attempting to add more."); return; }*/ //If no selection or if item in last position is selected, //add the new one to end of list, and select new one. if (index == -1 || (index + 1 == size)) { scheduleModel.addElement(sel); listSchedule.setSelectedIndex(size); environment.getSchedule().addJob(j); //Otherwise insert the new one after the current selection, //and select new one. } else { scheduleModel.insertElementAt(sel, index + 1); listSchedule.setSelectedIndex(index + 1); environment.getSchedule().insertJob(j, index + 1); } btnClearSchedule.setEnabled(true); } }); btnAddJob.setEnabled(false); try { btnAddJob.setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/add_job.png")))); btnAddJob.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/add_job_dis.png")))); btnAddJob.setRolloverEnabled(true); btnAddJob.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/add_job_over.png")))); } catch (NullPointerException e111) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } btnAddJob.setBounds(521, 178, 54, 54); pnlEnviron.add(btnAddJob); btnRemoveJob = new JButton(""); btnRemoveJob.setToolTipText("Remove job from schedule"); btnRemoveJob.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ResetStatusLabel(); // Uncomment this code to allow jobs to be saved back after removal from schedule /*if(listSchedule.getSelectedIndex() > -1){ Job j = (Job) listSchedule.getSelectedValue(); String name = j.getName().toLowerCase(); if(!jobNames.contains(name) && !jobModel.contains(j)){ if(jobModel.size() < Consts.JOB_LIST_LIMIT){ jobNames.add(name); jobFormReady = true; int index = -1; if(listJobsAvail.getSelectedIndex() > -1) index = listJobsAvail.getSelectedIndex(); if(index < 0){ jobModel.addElement(j); listJobsAvail.setSelectedIndex(jobModel.size()-1); listJobs.setSelectedIndex(jobModel.size()-1); }else{ jobModel.insertElementAt(j, index+1); listJobsAvail.setSelectedIndex(index+1); listJobs.setSelectedIndex(index+1); } } } }*/ ListSelectionModel lsm = listSchedule.getSelectionModel(); int firstSelected = lsm.getMinSelectionIndex(); int lastSelected = lsm.getMaxSelectionIndex(); scheduleModel.removeRange(firstSelected, lastSelected); environment.getSchedule().remove(firstSelected); int size = scheduleModel.size(); if (size == 0) { //List is empty: disable delete, up, and down buttons. btnClearSchedule.setEnabled(false); btnUpSchedule.setEnabled(false); btnDownSchedule.setEnabled(false); listSchedule.clearSelection(); btnRemoveJob.setEnabled(false); btnViewSchedule.setEnabled(false); } else { //Adjust the selection. if (firstSelected == scheduleModel.getSize()) { //Removed item in last position. firstSelected--; } listSchedule.setSelectedIndex(firstSelected); if (size == 21) { // No longer full list ResetStatusLabel(); } } } }); btnRemoveJob.setEnabled(false); try { btnRemoveJob .setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/del_job.png")))); btnRemoveJob.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/del_job_dis.png")))); btnRemoveJob.setRolloverEnabled(true); btnRemoveJob.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/del_job_over.png")))); } catch (NullPointerException e111) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } btnRemoveJob.setBounds(520, 243, 54, 54); pnlEnviron.add(btnRemoveJob); lblJobSchedule_1 = new JLabel("Job Schedule"); lblJobSchedule_1.setFont(new Font("Tahoma", Font.BOLD, 18)); lblJobSchedule_1.setBounds(29, 18, 269, 22); pnlEnviron.add(lblJobSchedule_1); lblScheduleJobsTo = new JLabel("Schedule jobs to the right, then set shift options below"); lblScheduleJobsTo.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblScheduleJobsTo.setBounds(29, 45, 279, 14); pnlEnviron.add(lblScheduleJobsTo); lblAvailableJobs_1 = new JLabel("Available Jobs"); lblAvailableJobs_1.setFont(new Font("Tahoma", Font.BOLD, 12)); lblAvailableJobs_1.setBounds(327, 19, 137, 14); pnlEnviron.add(lblAvailableJobs_1); lblJobSchedule_2 = new JLabel("Job Schedule"); lblJobSchedule_2.setFont(new Font("Tahoma", Font.BOLD, 12)); lblJobSchedule_2.setBounds(577, 19, 110, 14); pnlEnviron.add(lblJobSchedule_2); panel = new JPanel(); panel.setLayout(null); panel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Schedule Options", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel.setBounds(20, 245, 287, 104); pnlEnviron.add(panel); btnViewSchedule = new JButton("View Schedule Diagram"); btnViewSchedule.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnViewSchedule.setToolTipText("View chart of schedule timings"); btnViewSchedule.setEnabled(false); btnViewSchedule.setBounds(33, 27, 170, 29); panel.add(btnViewSchedule); chckbxSimulateScheduleStart = new JCheckBox("Ignore machine config & knife positioning times"); chckbxSimulateScheduleStart.setFont(new Font("Tahoma", Font.PLAIN, 11)); chckbxSimulateScheduleStart.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (!initialising) environment.StartStopTimes = !chckbxSimulateScheduleStart.isSelected(); } }); chckbxSimulateScheduleStart.setToolTipText( "WARNING: Use ONLY when you wish to model the output of a single job over a long time period \u2013 such that the initial set-up time has no material impact on the production volume"); chckbxSimulateScheduleStart.setBounds(30, 62, 251, 18); panel.add(chckbxSimulateScheduleStart); lblhoverForInfo = new JLabel("(hover for info)"); lblhoverForInfo.setToolTipText( "WARNING: Use ONLY when you wish to model the output of a single job over a long time period \u2013 such that the initial set-up time has no material impact on the production volume"); lblhoverForInfo.setForeground(Color.GRAY); lblhoverForInfo.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblhoverForInfo.setBounds(34, 80, 147, 14); panel.add(lblhoverForInfo); btnUpSchedule = new JButton(""); btnUpSchedule.setToolTipText("Move job earlier in schedule"); btnUpSchedule.addActionListener(new ScheduleUpListener()); try { btnUpSchedule.setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/up.png")))); btnUpSchedule.setRolloverEnabled(true); btnUpSchedule.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/up_over.png")))); btnUpSchedule.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/up_dis.png")))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } btnUpSchedule.setEnabled(false); btnUpSchedule.setBounds(700, 463, 30, 30); pnlEnviron.add(btnUpSchedule); btnDownSchedule = new JButton(""); btnDownSchedule.setToolTipText("Move job later in schedule"); btnDownSchedule.addActionListener(new ScheduleDownListener()); try { btnDownSchedule .setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/down.png")))); btnDownSchedule.setRolloverEnabled(true); btnDownSchedule.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/down_over.png")))); btnDownSchedule.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/down_dis.png")))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } btnDownSchedule.setEnabled(false); btnDownSchedule.setBounds(737, 463, 30, 30); pnlEnviron.add(btnDownSchedule); btnClearSchedule = new JButton("Clear"); btnClearSchedule.setToolTipText("Clear all jobs from the schedule"); btnClearSchedule.setFont(new Font("Tahoma", Font.BOLD, 11)); btnClearSchedule.setEnabled(false); try { btnClearSchedule .setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/delete.png")))); btnClearSchedule.setRolloverEnabled(true); btnClearSchedule.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/delete_over.png")))); btnClearSchedule.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/delete_dis.png")))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } btnClearSchedule.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scheduleModel.removeAllElements(); environment.getSchedule().empty(); } }); btnClearSchedule.setBounds(577, 460, 110, 36); pnlEnviron.add(btnClearSchedule); //listSchedule.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null)); //listSchedule.setBounds(577, 44, 190, 405); //pnlEnviron.add(listSchedule); btnViewSchedule.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { ScheduleChart ch = new ScheduleChart(environment.getSchedule()); ch.pack(); try { ch.setIconImage(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/logo.png"))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e) { e.printStackTrace(); } ch.setLocationRelativeTo(frmTitanRoiCalculator); ch.setVisible(true); } }); scrlSchedule = new JScrollPane(); scrlSchedule.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrlSchedule.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, null, null, null)); scrlSchedule.setBounds(577, 44, 190, 405); scrlSchedule.getVerticalScrollBar().setUnitIncrement(16); pnlEnviron.add(scrlSchedule); panel_8 = new JPanel(); panel_8.setToolTipText("Select job to re-order or remove from schedule"); panel_8.setBackground(Color.WHITE); panel_8.setBorder(null); scrlSchedule.setViewportView(panel_8); panel_8.setLayout(new BorderLayout(0, 0)); listSchedule = new JList(scheduleModel); panel_8.add(listSchedule, BorderLayout.NORTH); listSchedule.setToolTipText("Select job to re-order or remove from schedule"); listSchedule.addListSelectionListener(new ScheduleSelectionListener()); listSchedule.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); listSchedule.setCellRenderer(new JobListRenderer()); panel_5 = new JPanel(); panel_5.setLayout(null); panel_5.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Notes", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_5.setBounds(20, 360, 287, 136); pnlEnviron.add(panel_5); lblToViewAnalysis = new JLabel("To view analysis for 1 job only, add just that job"); lblToViewAnalysis.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblToViewAnalysis.setBounds(24, 24, 241, 14); panel_5.add(lblToViewAnalysis); lblToTheSchedule = new JLabel("to the schedule."); lblToTheSchedule.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblToTheSchedule.setBounds(24, 38, 241, 14); panel_5.add(lblToTheSchedule); lblToModelMaintenance = new JLabel("To model maintenance or other downtime, edit the"); lblToModelMaintenance.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblToModelMaintenance.setBounds(24, 59, 253, 14); panel_5.add(lblToModelMaintenance); lblShiftOptionsAbove = new JLabel("shift options above. This will affect annual output,"); lblShiftOptionsAbove.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblShiftOptionsAbove.setBounds(24, 73, 253, 14); panel_5.add(lblShiftOptionsAbove); lblButNotThe = new JLabel("but not the rates or efficiencies. For these, use the"); lblButNotThe.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblButNotThe.setBounds(24, 87, 253, 14); panel_5.add(lblButNotThe); lbladvancedTabIn = new JLabel("'advanced' tab in the options menu box."); lbladvancedTabIn.setFont(new Font("Tahoma", Font.PLAIN, 11)); lbladvancedTabIn.setBounds(24, 101, 253, 14); panel_5.add(lbladvancedTabIn); scrollPane_2 = new JScrollPane(); scrollPane_2.setBorder(null); scrollPane_2.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); scrollPane_2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane_2.setBounds(327, 44, 190, 405); pnlEnviron.add(scrollPane_2); panel_9 = new JPanel(); panel_9.setToolTipText("Select job to be added"); scrollPane_2.setViewportView(panel_9); panel_9.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, null, null, null)); panel_9.setBackground(Color.WHITE); panel_9.setLayout(new BorderLayout(0, 0)); listJobsAvail = new JList(jobModel); panel_9.add(listJobsAvail, BorderLayout.NORTH); listJobsAvail.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "add"); listJobsAvail.getActionMap().put("add", new AddScheduleBtn()); listJobsAvail.setToolTipText("Select job to be added"); listJobsAvail.addListSelectionListener(new JobAvailSelectionListener()); listJobsAvail.setCellRenderer(new JobListRenderer()); listJobsAvail.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); listJobsAvail.setBorder(null); pnlCompare = new JPanel(); tabbedPane.addTab("Productivity Comparison", null, pnlCompare, "Productivity comparison data & graphs"); tabbedPane.setEnabledAt(3, true); pnlCompare.setLayout(null); pnlResults = new JPanel(); pnlResults.setBorder( new TitledBorder(null, "Numerical Results", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pnlResults.setBounds(20, 72, 479, 134); pnlCompare.add(pnlResults); pnlResults.setLayout(null); lblOutputLength = new JLabel("Output length over time period:"); lblOutputLength.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblOutputLength.setEnabled(false); lblOutputLength.setToolTipText("Quantity produced"); lblOutputLength.setBounds(220, 54, 152, 14); pnlResults.add(lblOutputLength); lblOutputWeight = new JLabel("Output weight over time period:"); lblOutputWeight.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblOutputWeight.setEnabled(false); lblOutputWeight.setToolTipText("Quantity produced"); lblOutputWeight.setBounds(220, 79, 162, 14); pnlResults.add(lblOutputWeight); cmbTimeRef = new JComboBox(); cmbTimeRef.setEnabled(false); cmbTimeRef.setToolTipText("Select a time range to display results over"); cmbTimeRef.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Refresh analyses UpdateNumericalAnalysis(); } }); cmbTimeRef.setModel( new DefaultComboBoxModel(new String[] { "Schedule", "Year", "Hour", "Shift", "Day"/*, "Week"*/ })); cmbTimeRef.setBounds(247, 98, 125, 24); pnlResults.add(cmbTimeRef); lblPer = new JLabel("Per:"); lblPer.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblPer.setEnabled(false); lblPer.setBounds(220, 103, 20, 14); pnlResults.add(lblPer); lblAverageMmin = new JLabel("Average rate:"); lblAverageMmin.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblAverageMmin.setEnabled(false); lblAverageMmin.setToolTipText("Average quantity processed"); lblAverageMmin.setBounds(20, 54, 95, 14); pnlResults.add(lblAverageMmin); lblNumericsWeight = new JLabel("0.0 tons"); lblNumericsWeight.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblNumericsWeight.setEnabled(false); lblNumericsWeight.setToolTipText("Quantity produced"); lblNumericsWeight.setBounds(380, 79, 89, 14); pnlResults.add(lblNumericsWeight); lblNumericsLength = new JLabel("0.0 metres"); lblNumericsLength.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblNumericsLength.setEnabled(false); lblNumericsLength.setToolTipText("Quantity produced"); lblNumericsLength.setBounds(380, 54, 89, 14); pnlResults.add(lblNumericsLength); lblNumericsRate = new JLabel("0.0 m/hr"); lblNumericsRate.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblNumericsRate.setEnabled(false); lblNumericsRate.setToolTipText("Average quantity processed"); lblNumericsRate.setBounds(128, 54, 82, 14); pnlResults.add(lblNumericsRate); lblEfficiency = new JLabel("Machine running:"); lblEfficiency.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblEfficiency.setEnabled(false); lblEfficiency.setToolTipText("Proportion of total time for which the machine is running"); lblEfficiency.setBounds(20, 104, 95, 14); pnlResults.add(lblEfficiency); cmbMachines = new JComboBox(); cmbMachines.setMaximumRowCount(15); cmbMachines.setFont(new Font("Tahoma", Font.BOLD, 11)); cmbMachines.setEnabled(false); cmbMachines.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { UpdateNumericalAnalysis(); } }); cmbMachines.setToolTipText("Select machine"); cmbMachines.setBounds(128, 20, 244, 24); pnlResults.add(cmbMachines); lblMachine = new JLabel("Select Machine:"); lblMachine.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblMachine.setEnabled(false); lblMachine.setToolTipText("Select machine"); lblMachine.setBounds(20, 25, 77, 14); pnlResults.add(lblMachine); lblNumericsEff = new JLabel("0.0 %"); lblNumericsEff.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblNumericsEff.setEnabled(false); lblNumericsEff.setToolTipText("Machine efficiency"); lblNumericsEff.setBounds(128, 104, 65, 14); pnlResults.add(lblNumericsEff); lblscheduletimelbl = new JLabel("Time to run schedule:"); lblscheduletimelbl.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblscheduletimelbl.setToolTipText("Time to run schedule"); lblscheduletimelbl.setEnabled(false); lblscheduletimelbl.setBounds(20, 79, 103, 14); pnlResults.add(lblscheduletimelbl); lblscheduletime = new JLabel("0.0 hr"); lblscheduletime.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblscheduletime.setToolTipText("Time to run schedule"); lblscheduletime.setEnabled(false); lblscheduletime.setBounds(128, 79, 77, 14); pnlResults.add(lblscheduletime); pnlROI = new JPanel(); tabbedPane.addTab("Return on Investment", (Icon) null, pnlROI, "Return on investment comparison and analysis"); pnlROI.setLayout(null); tabbedPane.setEnabledAt(4, true); lblProductivityComparison = new JLabel("Productivity Comparison"); lblProductivityComparison.setFont(new Font("Tahoma", Font.BOLD, 18)); lblProductivityComparison.setBounds(29, 18, 269, 22); pnlCompare.add(lblProductivityComparison); lblSelectMultipleMachines = new JLabel( "Select multiple machines from the list on the right, then compare them below"); lblSelectMultipleMachines.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblSelectMultipleMachines.setBounds(29, 45, 433, 14); pnlCompare.add(lblSelectMultipleMachines); label_2 = new JLabel("Machines"); label_2.setFont(new Font("Tahoma", Font.BOLD, 12)); label_2.setBounds(522, 19, 85, 14); pnlCompare.add(label_2); pnlProdGraph = new JPanel(); pnlProdGraph.setBounds(20, 222, 479, 274); pnlCompare.add(pnlProdGraph); pnlProdGraph.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Graphical Results", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pnlProdGraph.setLayout(null); btnShowGraph = new JButton("Open Graph"); btnShowGraph.setFont(new Font("Tahoma", Font.BOLD, 11)); btnShowGraph.setToolTipText("Open graph in new window"); btnShowGraph.setEnabled(false); btnShowGraph.setBounds(366, 51, 99, 39); pnlProdGraph.add(btnShowGraph); btnSaveToFile = new JButton("Save to File"); btnSaveToFile.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnSaveToFile.setToolTipText("Save image to disk"); btnSaveToFile.setEnabled(false); btnSaveToFile.addActionListener(SaveActionListener); btnSaveToFile.setBounds(366, 97, 99, 24); pnlProdGraph.add(btnSaveToFile); pnlPreview = new JPanel(); pnlPreview.setBackground(Color.WHITE); pnlPreview.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, null, null, null)); pnlPreview.setBounds(21, 51, 335, 205); pnlProdGraph.add(pnlPreview); pnlPreview.setLayout(null); pnlGraph = new ChartPanel(chart); pnlGraph.setBounds(2, 2, 331, 201); //pnlGraph.setPreferredSize(new java.awt.Dimension(243, 171)); pnlPreview.add(pnlGraph); try { picLabel = new JLabel( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/no_preview.png")))); } catch (IOException e2) { e2.printStackTrace(); } picLabel.setBounds(2, 2, 331, 201); pnlPreview.add(picLabel); pnlGraph.setVisible(false); lblPreview = new JLabel("Graph Preview"); lblPreview.setForeground(Color.DARK_GRAY); lblPreview.setFont(new Font("Tahoma", Font.BOLD, 12)); lblPreview.setEnabled(false); lblPreview.setBounds(21, 24, 99, 16); pnlProdGraph.add(lblPreview); lblType = new JLabel("Graph Type:"); lblType.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblType.setEnabled(false); lblType.setToolTipText("Choose measurement type"); lblType.setBounds(184, 26, 65, 14); pnlProdGraph.add(lblType); btnShowTimings = new JButton("Machine Runs"); btnShowTimings.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnShowTimings.setToolTipText("Show timing diagram for a single machine run"); btnShowTimings.setEnabled(false); btnShowTimings.addActionListener(new BtnShowTimingsActionListener()); btnShowTimings.setBounds(366, 201, 99, 24); pnlProdGraph.add(btnShowTimings); btnDowntime = new JButton("Productivity"); btnDowntime.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnDowntime.setToolTipText("View productivity breakdown charts for the selected machines"); btnDowntime.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ShowTimingBreakdown(); } }); btnDowntime.setEnabled(false); btnDowntime.setBounds(366, 232, 99, 24); pnlProdGraph.add(btnDowntime); lblbreakdown1 = new JLabel("Show timing"); lblbreakdown1.setEnabled(false); lblbreakdown1.setBounds(370, 166, 99, 14); pnlProdGraph.add(lblbreakdown1); lblbreakdown2 = new JLabel("breakdown for:"); lblbreakdown2.setEnabled(false); lblbreakdown2.setBounds(370, 182, 99, 14); pnlProdGraph.add(lblbreakdown2); panel_3 = new JPanel(); panel_3.setBorder(new TitledBorder(null, "", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_3.setBounds(522, 459, 245, 37); pnlCompare.add(panel_3); panel_3.setLayout(null); btnNone = new JButton("None"); btnNone.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnNone.setEnabled(false); btnNone.setBounds(172, 7, 57, 23); panel_3.add(btnNone); btnNone.setToolTipText("Clear machine selection"); btnAll = new JButton("All"); btnAll.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnAll.setEnabled(false); btnAll.setBounds(105, 7, 57, 23); panel_3.add(btnAll); btnAll.setToolTipText("Select all machines"); lblSelect = new JLabel("Select:"); lblSelect.setEnabled(false); lblSelect.setBounds(37, 11, 46, 14); panel_3.add(lblSelect); scrollPane_3 = new JScrollPane(); scrollPane_3.setBorder(null); scrollPane_3.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); scrollPane_3.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane_3.setBounds(522, 44, 245, 405); pnlCompare.add(scrollPane_3); panel_10 = new JPanel(); panel_10.setToolTipText( "Click a machine to select it. Select multiple machines to compare their performance under the chosen job schedule."); panel_10.setBackground(Color.WHITE); scrollPane_3.setViewportView(panel_10); panel_10.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, null, null, null)); panel_10.setLayout(new BorderLayout(0, 0)); listCompare = new JList(listModel); panel_10.add(listCompare, BorderLayout.NORTH); listCompare.setCellRenderer(new MachineListRenderer()); listCompare.setToolTipText( "Click a machine to select it. Select multiple machines to compare their performance under the chosen job schedule."); listCompare.setBorder(null); listCompare.addListSelectionListener(new MultiSelectionListener()); btnAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int[] count = new int[listModel.size()]; for (int i = 0; i < listModel.size(); ++i) count[i] = i; listCompare.setSelectedIndices(count); } }); btnNone.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { listCompare.clearSelection(); } }); btnShowGraph.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { // TODO base on cmbGraphType: or not if just using chart /*PieChart test = new PieChart("title","this is a pie chart"); test.pack(); test.setVisible(true); test.setLocationRelativeTo(null);*/ JFrame popGraph = new JFrame(); JFreeChart chartBig = null; try { chartBig = (JFreeChart) chart.clone(); } catch (CloneNotSupportedException e) { e.printStackTrace(); } //chartBig.setTitle("Productivity Comparison"); ChartPanel cpanel = new ChartPanel(chartBig); cpanel.setPreferredSize(new java.awt.Dimension(500, 300)); popGraph.setContentPane(cpanel); try { popGraph.setIconImage(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/logo.png"))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e) { e.printStackTrace(); } popGraph.setTitle("Productivity Graph"); popGraph.setSize(450, 300); popGraph.pack(); popGraph.setVisible(true); popGraph.setLocationRelativeTo(frmTitanRoiCalculator); } }); cmbGraphType = new JComboBox(); cmbGraphType.setMaximumRowCount(10); cmbGraphType.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbGraphType.setEnabled(false); cmbGraphType.setToolTipText("Choose measurement type"); cmbGraphType.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Refresh analyses UpdateGraph(); } }); cmbGraphType.setModel(new DefaultComboBoxModel(new String[] { "Schedule Time", "Length per Hour", "Weight per Hour", "Length per Year", "Weight per Year", "Run Percentage" })); cmbGraphType.setSelectedIndex(0); cmbGraphType.setBounds(251, 21, 105, 24); pnlProdGraph.add(cmbGraphType); lblReturnOnInvestment = new JLabel("Return on Investment"); lblReturnOnInvestment.setFont(new Font("Tahoma", Font.BOLD, 18)); lblReturnOnInvestment.setBounds(29, 18, 269, 22); pnlROI.add(lblReturnOnInvestment); lblSelectMultipleMachines_1 = new JLabel( "Select multiple machines from the list on the right, then compare them below"); lblSelectMultipleMachines_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblSelectMultipleMachines_1.setBounds(29, 45, 433, 14); pnlROI.add(lblSelectMultipleMachines_1); lblCompareroiList = new JLabel("Machines"); lblCompareroiList.setFont(new Font("Tahoma", Font.BOLD, 12)); lblCompareroiList.setBounds(522, 19, 85, 14); pnlROI.add(lblCompareroiList); panel_4 = new JPanel(); panel_4.setLayout(null); panel_4.setBorder(new TitledBorder(null, "", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_4.setBounds(522, 459, 245, 37); pnlROI.add(panel_4); btnROIselectnone = new JButton("None"); btnROIselectnone.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnROIselectnone.setEnabled(false); btnROIselectnone.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { listCompareRoi.clearSelection(); } }); btnROIselectnone.setToolTipText("Clear machine selection"); btnROIselectnone.setBounds(172, 7, 57, 23); panel_4.add(btnROIselectnone); btnROIselectall = new JButton("All"); btnROIselectall.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnROIselectall.setEnabled(false); btnROIselectall.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { int[] count = new int[listModel.size()]; for (int i = 0; i < listModel.size(); ++i) count[i] = i; listCompareRoi.setSelectedIndices(count); } }); btnROIselectall.setToolTipText("Select all machines"); btnROIselectall.setBounds(105, 7, 57, 23); panel_4.add(btnROIselectall); lblROIselect = new JLabel("Select:"); lblROIselect.setEnabled(false); lblROIselect.setBounds(37, 11, 46, 14); panel_4.add(lblROIselect); tabsROI = new JTabbedPane(JTabbedPane.TOP); tabsROI.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { try { ResetStatusLabel(); } catch (NullPointerException e) { // Form is still initialising return; } int tab = tabsROI.getSelectedIndex(); switch (tab) { case 0: UpdateROIProd(); break; case 1: UpdateROIEnergy(); break; case 2: UpdateROIMaint(); break; case 3: UpdateROIWaste(); break; } } }); tabsROI.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null)); tabsROI.setBounds(29, 72, 470, 424); pnlROI.add(tabsROI); pnlProdROI = new JPanel(); pnlProdROI.setBackground(Color.WHITE); tabsROI.addTab("Productivity", null, pnlProdROI, "ROI based on productivity"); pnlProdROI.setLayout(null); lblThisToolIlllustrates = new JLabel( "This tool illlustrates the long-term financial benfits of particular machines and options in"); lblThisToolIlllustrates.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblThisToolIlllustrates.setForeground(Color.GRAY); lblThisToolIlllustrates.setBounds(10, 11, 439, 14); pnlProdROI.add(lblThisToolIlllustrates); lblInTermsOf = new JLabel("terms of productivity gains."); lblInTermsOf.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblInTermsOf.setForeground(Color.GRAY); lblInTermsOf.setBounds(10, 27, 317, 14); pnlProdROI.add(lblInTermsOf); pnlGraphProd = new JPanel(); pnlGraphProd.setBackground(Color.WHITE); pnlGraphProd.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, null, null, null)); pnlGraphProd.setBounds(10, 100, 439, 230); pnlProdROI.add(pnlGraphProd); pnlGraphProd.setLayout(null); pnlGraphProdInner = new ChartPanel(null); pnlGraphProdInner.setBounds(2, 2, 435, 226); //pnlGraphProd.add(pnlGraphProdInner); try { lblNoGraph = new JLabel( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/no_preview.png")))); } catch (IOException e2) { e2.printStackTrace(); } lblNoGraph.setBounds(2, 2, 435, 226); pnlGraphProd.add(lblNoGraph); lblSellingPrice = new JLabel("Selling price:"); lblSellingPrice.setEnabled(false); lblSellingPrice.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblSellingPrice.setBounds(10, 52, 60, 14); pnlProdROI.add(lblSellingPrice); txtsellingprice = new JTextField(); txtsellingprice.setToolTipText("Average selling price of the material per unit weight"); txtsellingprice.setEnabled(false); txtsellingprice.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent arg0) { txtsellingprice.selectAll(); } }); txtsellingprice.getDocument().addDocumentListener(new DocumentListener() { @Override public void changedUpdate(DocumentEvent arg0) { } @Override public void insertUpdate(DocumentEvent arg0) { UpdateROIValue(); } @Override public void removeUpdate(DocumentEvent arg0) { UpdateROIValue(); } }); txtsellingprice.setFont(new Font("Tahoma", Font.PLAIN, 11)); txtsellingprice.setBounds(90, 49, 65, 20); pnlProdROI.add(txtsellingprice); txtsellingprice.setColumns(10); lblPerTonne = new JLabel("per tonne"); lblPerTonne.setEnabled(false); lblPerTonne.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblPerTonne.setBounds(160, 52, 70, 14); pnlProdROI.add(lblPerTonne); lblContribution = new JLabel("Contribution:"); lblContribution.setEnabled(false); lblContribution.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblContribution.setBounds(10, 75, 70, 14); pnlProdROI.add(lblContribution); txtcontribution = new JTextField(); txtcontribution.setToolTipText("Contribution percentage"); txtcontribution.setEnabled(false); txtcontribution.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtcontribution.selectAll(); } }); txtcontribution.getDocument().addDocumentListener(new DocumentListener() { @Override public void changedUpdate(DocumentEvent e) { } @Override public void insertUpdate(DocumentEvent e) { UpdateROIValue(); } @Override public void removeUpdate(DocumentEvent e) { UpdateROIValue(); } }); txtcontribution.setFont(new Font("Tahoma", Font.PLAIN, 11)); txtcontribution.setBounds(90, 73, 65, 20); pnlProdROI.add(txtcontribution); txtcontribution.setColumns(10); lblpercent = new JLabel("%"); lblpercent.setEnabled(false); lblpercent.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblpercent.setBounds(160, 76, 11, 14); pnlProdROI.add(lblpercent); lblValueAddedlbl = new JLabel("Value added:"); lblValueAddedlbl.setEnabled(false); lblValueAddedlbl.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblValueAddedlbl.setBounds(279, 52, 70, 14); pnlProdROI.add(lblValueAddedlbl); lblvalueadded = new JLabel("\u00A30.00 / tonne"); lblvalueadded.setToolTipText("Value added per unit weight"); lblvalueadded.setEnabled(false); lblvalueadded.setFont(new Font("Tahoma", Font.BOLD, 12)); lblvalueadded.setBounds(279, 71, 170, 20); pnlProdROI.add(lblvalueadded); cmbMarg1 = new JComboBox(); cmbMarg1.setToolTipText("Old machine"); cmbMarg1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { UpdateROIProd(); } }); cmbMarg1.setEnabled(false); cmbMarg1.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbMarg1.setBounds(10, 359, 111, 20); pnlProdROI.add(cmbMarg1); cmbMarg2 = new JComboBox(); cmbMarg2.setToolTipText("New machine"); cmbMarg2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { UpdateROIProd(); } }); cmbMarg2.setEnabled(false); cmbMarg2.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbMarg2.setBounds(141, 359, 111, 20); pnlProdROI.add(cmbMarg2); lblMarginalImprovement = new JLabel("\u00A30.00 per annum"); lblMarginalImprovement.setToolTipText("Marginal improvement"); lblMarginalImprovement.setEnabled(false); lblMarginalImprovement.setFont(new Font("Tahoma", Font.BOLD, 13)); lblMarginalImprovement.setBounds(279, 358, 170, 20); pnlProdROI.add(lblMarginalImprovement); lblSelectMachines = new JLabel("Select 2 machines to view the marginal improvement between them:"); lblSelectMachines.setForeground(Color.GRAY); lblSelectMachines.setFont(new Font("Tahoma", Font.BOLD, 11)); lblSelectMachines.setBounds(10, 338, 412, 14); pnlProdROI.add(lblSelectMachines); lblpound1 = new JLabel("\u00A3"); lblpound1.setEnabled(false); lblpound1.setBounds(80, 52, 11, 14); pnlProdROI.add(lblpound1); lblTo = new JLabel("to"); lblTo.setForeground(Color.GRAY); lblTo.setFont(new Font("Tahoma", Font.BOLD, 11)); lblTo.setBounds(125, 362, 16, 14); pnlProdROI.add(lblTo); label = new JLabel("="); label.setForeground(Color.GRAY); label.setFont(new Font("Tahoma", Font.BOLD, 13)); label.setBounds(259, 362, 11, 14); pnlProdROI.add(label); pnlEnergy = new JPanel(); pnlEnergy.setBackground(Color.WHITE); tabsROI.addTab("Energy Efficiency", null, pnlEnergy, "ROI based on machine power usage"); pnlEnergy.setLayout(null); lblThisToolHighlights = new JLabel( "This tool highlights power consumption differences between machines, and the resulting"); lblThisToolHighlights.setForeground(Color.GRAY); lblThisToolHighlights.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblThisToolHighlights.setBounds(10, 11, 439, 14); pnlEnergy.add(lblThisToolHighlights); lblImpactOnFinancial = new JLabel("impact on financial returns."); lblImpactOnFinancial.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblImpactOnFinancial.setForeground(Color.GRAY); lblImpactOnFinancial.setBounds(10, 27, 439, 14); pnlEnergy.add(lblImpactOnFinancial); rdbtnAveragePower = new JRadioButton("Average power"); rdbtnAveragePower.setToolTipText("Select \"average power\" input type"); rdbtnAveragePower.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnAveragePower.setEnabled(false); rdbtnAveragePower.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { ClearPowerTxts(); txtaveragepower.setEnabled(true); txthourlyusage.setEnabled(false); txtannualusage.setEnabled(false); lblKw.setEnabled(true); lblKwh.setEnabled(false); lblKwh_1.setEnabled(false); txtaveragepower.requestFocusInWindow(); UpdateEnergyData(); } }); rdbtnAveragePower.setSelected(true); rdbtnAveragePower.setBackground(Color.WHITE); rdbtnAveragePower.setBounds(349, 44, 109, 23); pnlEnergy.add(rdbtnAveragePower); rdbtnHourlyUsage = new JRadioButton("Hourly usage"); rdbtnHourlyUsage.setToolTipText("Select \"hourly usage\" input type"); rdbtnHourlyUsage.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnHourlyUsage.setEnabled(false); rdbtnHourlyUsage.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ClearPowerTxts(); txtaveragepower.setEnabled(false); txthourlyusage.setEnabled(true); txtannualusage.setEnabled(false); lblKw.setEnabled(false); lblKwh.setEnabled(true); lblKwh_1.setEnabled(false); txthourlyusage.requestFocusInWindow(); UpdateEnergyData(); } }); rdbtnHourlyUsage.setBackground(Color.WHITE); rdbtnHourlyUsage.setBounds(349, 70, 109, 23); pnlEnergy.add(rdbtnHourlyUsage); rdbtnAnnualUsage = new JRadioButton("Annual usage"); rdbtnAnnualUsage.setToolTipText("Select \"annual usage\" input type"); rdbtnAnnualUsage.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnAnnualUsage.setEnabled(false); rdbtnAnnualUsage.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ClearPowerTxts(); txtaveragepower.setEnabled(false); txthourlyusage.setEnabled(false); txtannualusage.setEnabled(true); lblKw.setEnabled(false); lblKwh.setEnabled(false); lblKwh_1.setEnabled(true); txtannualusage.requestFocusInWindow(); UpdateEnergyData(); } }); rdbtnAnnualUsage.setBackground(Color.WHITE); rdbtnAnnualUsage.setBounds(349, 97, 109, 23); pnlEnergy.add(rdbtnAnnualUsage); rdbtnsPower.add(rdbtnAveragePower); rdbtnsPower.add(rdbtnHourlyUsage); rdbtnsPower.add(rdbtnAnnualUsage); lblEnergyCostl = new JLabel("Energy cost:"); lblEnergyCostl.setEnabled(false); lblEnergyCostl.setFont(new Font("Tahoma", Font.BOLD, 11)); lblEnergyCostl.setBounds(10, 101, 72, 14); pnlEnergy.add(lblEnergyCostl); lblpound2 = new JLabel("\u00A3"); lblpound2.setEnabled(false); lblpound2.setFont(new Font("Tahoma", Font.PLAIN, 12)); lblpound2.setBounds(91, 100, 13, 14); pnlEnergy.add(lblpound2); txtenergycost = new JTextField(); txtenergycost.setToolTipText("Raw energy cost, per kWh"); txtenergycost.setEnabled(false); txtenergycost.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent arg0) { txtenergycost.selectAll(); } }); txtenergycost.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent arg0) { UpdateROIEnergy(); } @Override public void insertUpdate(DocumentEvent arg0) { UpdateROIEnergy(); } @Override public void changedUpdate(DocumentEvent arg0) { } }); txtenergycost.setFont(new Font("Tahoma", Font.PLAIN, 12)); txtenergycost.setBounds(102, 98, 74, 20); pnlEnergy.add(txtenergycost); txtenergycost.setColumns(10); lblPerKwh = new JLabel("per kWh"); lblPerKwh.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblPerKwh.setEnabled(false); lblPerKwh.setBounds(179, 101, 46, 14); pnlEnergy.add(lblPerKwh); txtaveragepower = new JTextField(); txtaveragepower.setToolTipText("Average power in kW"); txtaveragepower.setEnabled(false); txtaveragepower.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent arg0) { UpdateEnergyData(); } @Override public void insertUpdate(DocumentEvent arg0) { UpdateEnergyData(); } @Override public void changedUpdate(DocumentEvent arg0) { } }); txtaveragepower.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtaveragepower.selectAll(); } }); txtaveragepower.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent arg0) { if (txtLimitRunSpeed.contains(arg0.getPoint())) { if (!txtaveragepower.isEnabled()) { rdbtnAveragePower.doClick(); } } } }); txtaveragepower.setBounds(233, 47, 86, 20); pnlEnergy.add(txtaveragepower); txtaveragepower.setColumns(10); txthourlyusage = new JTextField(); txthourlyusage.setToolTipText("Average hourly energy usage"); txthourlyusage.setEnabled(false); txthourlyusage.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { UpdateEnergyData(); } @Override public void insertUpdate(DocumentEvent e) { UpdateEnergyData(); } @Override public void changedUpdate(DocumentEvent e) { } }); txthourlyusage.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txthourlyusage.selectAll(); } }); txthourlyusage.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent arg0) { if (txtLimitRunSpeed.contains(arg0.getPoint())) { if (!txthourlyusage.isEnabled()) rdbtnHourlyUsage.doClick(); } } }); txthourlyusage.setColumns(10); txthourlyusage.setBounds(233, 73, 86, 20); pnlEnergy.add(txthourlyusage); txtannualusage = new JTextField(); txtannualusage.setToolTipText("Average annual energy usage"); txtannualusage.setEnabled(false); txtannualusage.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { UpdateEnergyData(); } @Override public void insertUpdate(DocumentEvent e) { UpdateEnergyData(); } @Override public void changedUpdate(DocumentEvent e) { } }); txtannualusage.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtannualusage.selectAll(); } }); txtannualusage.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent arg0) { if (txtLimitRunSpeed.contains(arg0.getPoint())) { if (!txtannualusage.isEnabled()) rdbtnAnnualUsage.doClick(); } } }); txtannualusage.setColumns(10); txtannualusage.setBounds(233, 99, 86, 20); pnlEnergy.add(txtannualusage); cmbMachineEnergy = new JComboBox(); cmbMachineEnergy.setEnabled(false); cmbMachineEnergy.setToolTipText("Select machine to edit"); cmbMachineEnergy.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { UpdateEnergyView(); } }); cmbMachineEnergy.setBounds(69, 46, 152, 23); pnlEnergy.add(cmbMachineEnergy); lblMachine_1 = new JLabel("Machine:"); lblMachine_1.setEnabled(false); lblMachine_1.setFont(new Font("Tahoma", Font.BOLD, 11)); lblMachine_1.setBounds(10, 50, 59, 14); pnlEnergy.add(lblMachine_1); lblKw = new JLabel("kW"); lblKw.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblKw.setEnabled(false); lblKw.setBounds(323, 50, 15, 14); pnlEnergy.add(lblKw); lblKwh = new JLabel("kWh"); lblKwh.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblKwh.setEnabled(false); lblKwh.setBounds(323, 76, 26, 14); pnlEnergy.add(lblKwh); lblKwh_1 = new JLabel("MWh"); lblKwh_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblKwh_1.setEnabled(false); lblKwh_1.setBounds(323, 102, 26, 14); pnlEnergy.add(lblKwh_1); pnlGraphEnergy = new JPanel(); pnlGraphEnergy.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, null, null, null)); pnlGraphEnergy.setBackground(Color.WHITE); pnlGraphEnergy.setBounds(10, 126, 439, 226); pnlEnergy.add(pnlGraphEnergy); pnlGraphEnergy.setLayout(null); try { lblNoGraph2 = new JLabel( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/no_preview.png")))); } catch (IOException e2) { e2.printStackTrace(); } lblNoGraph2.setBounds(2, 2, 435, 222); pnlGraphEnergy.add(lblNoGraph2); lblPleaseSetPower = new JLabel("Please set power usage for each machine"); lblPleaseSetPower.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblPleaseSetPower.setEnabled(false); lblPleaseSetPower.setForeground(Color.GRAY); lblPleaseSetPower.setBounds(10, 74, 215, 14); pnlEnergy.add(lblPleaseSetPower); lblMarginalEnergy = new JLabel("\u00A30.00 per annum"); lblMarginalEnergy.setToolTipText("Marginal improvement"); lblMarginalEnergy.setFont(new Font("Tahoma", Font.BOLD, 13)); lblMarginalEnergy.setEnabled(false); lblMarginalEnergy.setBounds(279, 358, 170, 20); pnlEnergy.add(lblMarginalEnergy); label_4 = new JLabel("="); label_4.setForeground(Color.GRAY); label_4.setFont(new Font("Tahoma", Font.BOLD, 13)); label_4.setBounds(259, 362, 11, 14); pnlEnergy.add(label_4); cmbMargEnergy2 = new JComboBox(); cmbMargEnergy2.setToolTipText("New machine"); cmbMargEnergy2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { UpdateROIEnergy(); } }); cmbMargEnergy2.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbMargEnergy2.setEnabled(false); cmbMargEnergy2.setBounds(141, 359, 111, 20); pnlEnergy.add(cmbMargEnergy2); label_5 = new JLabel("to"); label_5.setForeground(Color.GRAY); label_5.setFont(new Font("Tahoma", Font.BOLD, 11)); label_5.setBounds(125, 362, 16, 14); pnlEnergy.add(label_5); cmbMargEnergy1 = new JComboBox(); cmbMargEnergy1.setToolTipText("Old machine"); cmbMargEnergy1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { UpdateROIEnergy(); } }); cmbMargEnergy1.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbMargEnergy1.setEnabled(false); cmbMargEnergy1.setBounds(10, 359, 111, 20); pnlEnergy.add(cmbMargEnergy1); pnlMaint = new JPanel(); pnlMaint.setBackground(Color.WHITE); tabsROI.addTab("Maintenance", null, pnlMaint, "ROI based on maintenance costs"); tabsROI.setMnemonicAt(2, 65); pnlMaint.setLayout(null); lblThisToolDemonstrates_1 = new JLabel( "This tool demonstrates the maintenance reduction benefits of machines."); lblThisToolDemonstrates_1.setBounds(10, 11, 421, 14); lblThisToolDemonstrates_1.setForeground(Color.GRAY); lblThisToolDemonstrates_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); pnlMaint.add(lblThisToolDemonstrates_1); lblMaintenanceHoursPer = new JLabel("Annual downtime:"); lblMaintenanceHoursPer.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblMaintenanceHoursPer.setEnabled(false); lblMaintenanceHoursPer.setBounds(10, 64, 86, 14); pnlMaint.add(lblMaintenanceHoursPer); lblRepairCostsPer = new JLabel("Labour costs per hour:"); lblRepairCostsPer.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblRepairCostsPer.setEnabled(false); lblRepairCostsPer.setBounds(255, 36, 111, 14); pnlMaint.add(lblRepairCostsPer); lblPartsCostsPer = new JLabel("Parts costs per year:"); lblPartsCostsPer.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblPartsCostsPer.setEnabled(false); lblPartsCostsPer.setBounds(255, 64, 101, 14); pnlMaint.add(lblPartsCostsPer); cmbMachinesmaintenance = new JComboBox(); cmbMachinesmaintenance.setEnabled(false); cmbMachinesmaintenance.setToolTipText("Please set maintenance costs for each machine"); cmbMachinesmaintenance.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ViewMaintCosts(); } }); cmbMachinesmaintenance.setBounds(79, 30, 152, 23); pnlMaint.add(cmbMachinesmaintenance); txtmaintenancehours = new JTextField(); txtmaintenancehours.setToolTipText("Hours per year for which machine is not running due to maintenance"); txtmaintenancehours.setEnabled(false); txtmaintenancehours.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtmaintenancehours.selectAll(); } }); txtmaintenancehours.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { UpdateMaintCosts(); } @Override public void insertUpdate(DocumentEvent e) { UpdateMaintCosts(); } @Override public void changedUpdate(DocumentEvent e) { } }); txtmaintenancehours.setBounds(106, 61, 67, 20); pnlMaint.add(txtmaintenancehours); txtmaintenancehours.setColumns(10); txtmaintenanceperhour = new JTextField(); txtmaintenanceperhour.setToolTipText("Hourly labour costs for maintenance"); txtmaintenanceperhour.setEnabled(false); txtmaintenanceperhour.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtmaintenanceperhour.selectAll(); } }); txtmaintenanceperhour.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { UpdateMaintCosts(); } @Override public void insertUpdate(DocumentEvent e) { UpdateMaintCosts(); } @Override public void changedUpdate(DocumentEvent e) { } }); txtmaintenanceperhour.setColumns(10); txtmaintenanceperhour.setBounds(382, 33, 67, 20); pnlMaint.add(txtmaintenanceperhour); txtmaintenanceparts = new JTextField(); txtmaintenanceparts.setToolTipText("Annual cost of maintenance parts for this machine"); txtmaintenanceparts.setEnabled(false); txtmaintenanceparts.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtmaintenanceparts.selectAll(); } }); txtmaintenanceparts.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { UpdateMaintCosts(); } @Override public void insertUpdate(DocumentEvent e) { UpdateMaintCosts(); } @Override public void changedUpdate(DocumentEvent e) { } }); txtmaintenanceparts.setColumns(10); txtmaintenanceparts.setBounds(382, 61, 67, 20); pnlMaint.add(txtmaintenanceparts); lbltotalmaintcost = new JLabel("\u00A30.00 / year"); lbltotalmaintcost.setToolTipText("Total annual spend on maintenance for this machine (labour + parts)"); lbltotalmaintcost.setForeground(Color.GRAY); lbltotalmaintcost.setEnabled(false); lbltotalmaintcost.setHorizontalAlignment(SwingConstants.LEFT); lbltotalmaintcost.setFont(new Font("Tahoma", Font.BOLD, 11)); lbltotalmaintcost.setBounds(344, 87, 105, 14); pnlMaint.add(lbltotalmaintcost); lblpound10 = new JLabel("\u00A3"); lblpound10.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblpound10.setEnabled(false); lblpound10.setBounds(373, 36, 11, 14); pnlMaint.add(lblpound10); lblpound11 = new JLabel("\u00A3"); lblpound11.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblpound11.setEnabled(false); lblpound11.setBounds(373, 64, 11, 14); pnlMaint.add(lblpound11); pnlGraphMaint = new JPanel(); pnlGraphMaint.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, null, null, null)); pnlGraphMaint.setBackground(Color.WHITE); pnlGraphMaint.setBounds(10, 110, 439, 242); pnlMaint.add(pnlGraphMaint); pnlGraphMaint.setLayout(null); try { lblNoGraph3 = new JLabel( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/no_preview.png")))); } catch (IOException e2) { e2.printStackTrace(); } lblNoGraph3.setBounds(2, 2, 435, 238); pnlGraphMaint.add(lblNoGraph3); cmbMargMaint1 = new JComboBox(); cmbMargMaint1.setToolTipText("Old machine"); cmbMargMaint1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UpdateROIMaint(); } }); cmbMargMaint1.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbMargMaint1.setEnabled(false); cmbMargMaint1.setBounds(10, 359, 111, 20); pnlMaint.add(cmbMargMaint1); label_8 = new JLabel("to"); label_8.setForeground(Color.GRAY); label_8.setFont(new Font("Tahoma", Font.BOLD, 11)); label_8.setBounds(125, 362, 16, 14); pnlMaint.add(label_8); cmbMargMaint2 = new JComboBox(); cmbMargMaint2.setToolTipText("New machine"); cmbMargMaint2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UpdateROIMaint(); } }); cmbMargMaint2.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbMargMaint2.setEnabled(false); cmbMargMaint2.setBounds(141, 359, 111, 20); pnlMaint.add(cmbMargMaint2); label_9 = new JLabel("="); label_9.setForeground(Color.GRAY); label_9.setFont(new Font("Tahoma", Font.BOLD, 13)); label_9.setBounds(259, 362, 11, 14); pnlMaint.add(label_9); lblMarginalMaint = new JLabel("\u00A30.00 per annum"); lblMarginalMaint.setToolTipText("Marginal improvement"); lblMarginalMaint.setFont(new Font("Tahoma", Font.BOLD, 13)); lblMarginalMaint.setEnabled(false); lblMarginalMaint.setBounds(279, 358, 170, 20); pnlMaint.add(lblMarginalMaint); lblProdLoss = new JLabel("\u00A30.00 / year"); lblProdLoss.setToolTipText("Loss in production value due to downtime"); lblProdLoss.setForeground(Color.GRAY); lblProdLoss.setEnabled(false); lblProdLoss.setHorizontalAlignment(SwingConstants.LEFT); lblProdLoss.setFont(new Font("Tahoma", Font.BOLD, 11)); lblProdLoss.setBounds(106, 87, 125, 14); pnlMaint.add(lblProdLoss); lblHrs_1 = new JLabel("hrs"); lblHrs_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblHrs_1.setEnabled(false); lblHrs_1.setBounds(180, 64, 16, 14); pnlMaint.add(lblHrs_1); label_10 = new JLabel("Machine:"); label_10.setEnabled(false); label_10.setFont(new Font("Tahoma", Font.BOLD, 11)); label_10.setBounds(10, 34, 59, 14); pnlMaint.add(label_10); label_11 = new JLabel("="); label_11.setEnabled(false); label_11.setForeground(Color.GRAY); label_11.setFont(new Font("Tahoma", Font.BOLD, 13)); label_11.setBounds(88, 87, 11, 14); pnlMaint.add(label_11); label_12 = new JLabel("="); label_12.setEnabled(false); label_12.setForeground(Color.GRAY); label_12.setFont(new Font("Tahoma", Font.BOLD, 13)); label_12.setBounds(323, 87, 11, 14); pnlMaint.add(label_12); lblAnnualTotal = new JLabel("Annual total"); lblAnnualTotal.setEnabled(false); lblAnnualTotal.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblAnnualTotal.setBounds(255, 87, 67, 14); pnlMaint.add(lblAnnualTotal); lblProductionLoss = new JLabel("Production loss"); lblProductionLoss.setEnabled(false); lblProductionLoss.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblProductionLoss.setBounds(10, 87, 77, 14); pnlMaint.add(lblProductionLoss); pnlWaste = new JPanel(); pnlWaste.setBackground(Color.WHITE); tabsROI.addTab("Waste Reduction", null, pnlWaste, "ROI based on waste reduction"); pnlWaste.setLayout(null); lblThisToolDemonstrates = new JLabel( "This tool demonstrates the waste reduction capabilities of particular machines."); lblThisToolDemonstrates.setForeground(Color.GRAY); lblThisToolDemonstrates.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblThisToolDemonstrates.setBounds(10, 11, 439, 14); pnlWaste.add(lblThisToolDemonstrates); lblWasteSavedPer_1 = new JLabel("Waste saved per splice due to flag detection camera:"); lblWasteSavedPer_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblWasteSavedPer_1.setEnabled(false); lblWasteSavedPer_1.setBounds(10, 39, 256, 14); pnlWaste.add(lblWasteSavedPer_1); txtwastesavedflags = new JTextField(); txtwastesavedflags.setToolTipText("Saving per splice"); txtwastesavedflags.setEnabled(false); txtwastesavedflags.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtwastesavedflags.selectAll(); } }); txtwastesavedflags.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { UpdateROIWaste(); } @Override public void insertUpdate(DocumentEvent e) { UpdateROIWaste(); } @Override public void changedUpdate(DocumentEvent e) { } }); txtwastesavedflags.setBounds(286, 36, 86, 20); pnlWaste.add(txtwastesavedflags); txtwastesavedflags.setColumns(10); lblM_1 = new JLabel("m"); lblM_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblM_1.setEnabled(false); lblM_1.setBounds(378, 39, 46, 14); pnlWaste.add(lblM_1); lblWasteSavedPer_2 = new JLabel("Waste saved per mother roll due to alignment guide:"); lblWasteSavedPer_2.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblWasteSavedPer_2.setEnabled(false); lblWasteSavedPer_2.setBounds(10, 64, 256, 14); pnlWaste.add(lblWasteSavedPer_2); txtwastesavedguide = new JTextField(); txtwastesavedguide.setToolTipText("Saving per mother roll"); txtwastesavedguide.setEnabled(false); txtwastesavedguide.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { UpdateROIWaste(); } @Override public void insertUpdate(DocumentEvent e) { UpdateROIWaste(); } @Override public void changedUpdate(DocumentEvent e) { } }); txtwastesavedguide.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtwastesavedguide.selectAll(); } }); txtwastesavedguide.setBounds(286, 61, 86, 20); pnlWaste.add(txtwastesavedguide); txtwastesavedguide.setColumns(10); lblM_2 = new JLabel("m"); lblM_2.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblM_2.setEnabled(false); lblM_2.setBounds(378, 64, 46, 14); pnlWaste.add(lblM_2); pnlGraphWaste = new JPanel(); pnlGraphWaste.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, null, null, null)); pnlGraphWaste.setBackground(Color.WHITE); pnlGraphWaste.setBounds(10, 90, 439, 262); pnlWaste.add(pnlGraphWaste); pnlGraphWaste.setLayout(null); try { lblNoGraph4 = new JLabel( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/no_preview.png")))); } catch (IOException e2) { e2.printStackTrace(); } lblNoGraph4.setBounds(2, 2, 435, 258); pnlGraphWaste.add(lblNoGraph4); cmbMargWaste1 = new JComboBox(); cmbMargWaste1.setToolTipText("Old machine"); cmbMargWaste1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UpdateROIWaste(); } }); cmbMargWaste1.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbMargWaste1.setEnabled(false); cmbMargWaste1.setBounds(10, 359, 111, 20); pnlWaste.add(cmbMargWaste1); label_1 = new JLabel("to"); label_1.setForeground(Color.GRAY); label_1.setFont(new Font("Tahoma", Font.BOLD, 11)); label_1.setBounds(125, 362, 16, 14); pnlWaste.add(label_1); cmbMargWaste2 = new JComboBox(); cmbMargWaste2.setToolTipText("New machine"); cmbMargWaste2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UpdateROIWaste(); } }); cmbMargWaste2.setFont(new Font("Tahoma", Font.PLAIN, 11)); cmbMargWaste2.setEnabled(false); cmbMargWaste2.setBounds(141, 359, 111, 20); pnlWaste.add(cmbMargWaste2); label_6 = new JLabel("="); label_6.setForeground(Color.GRAY); label_6.setFont(new Font("Tahoma", Font.BOLD, 13)); label_6.setBounds(259, 362, 11, 14); pnlWaste.add(label_6); lblMarginalWaste = new JLabel("0.00m per annum"); lblMarginalWaste.setToolTipText("Marginal improvement"); lblMarginalWaste.setFont(new Font("Tahoma", Font.BOLD, 13)); lblMarginalWaste.setEnabled(false); lblMarginalWaste.setBounds(279, 355, 170, 16); pnlWaste.add(lblMarginalWaste); lblMarginalWasteValue = new JLabel("(\u00A30.00 per annum)"); lblMarginalWasteValue.setToolTipText("Marginal improvement value"); lblMarginalWasteValue.setForeground(Color.GRAY); lblMarginalWasteValue.setFont(new Font("Tahoma", Font.BOLD, 11)); lblMarginalWasteValue.setBounds(279, 370, 170, 16); pnlWaste.add(lblMarginalWasteValue); machNames = new HashSet<String>(); jobNames = new HashSet<String>(); lblStatus = new JLabel(" Ready."); lblStatus.setFont(new Font("Tahoma", Font.PLAIN, 12)); frmTitanRoiCalculator.getContentPane().add(lblStatus, BorderLayout.SOUTH); lblmmin = new JLabel("(m/min)"); lblmmin.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblmmin.setEnabled(false); lblmmin.setBounds(206, 168, 44, 14); pnlJobs.add(lblmmin); objfilter = new OBJfilter(1); // labels for unit conversion labs = new JLabel[7]; labs[0] = lblmm0; labs[1] = lblmm1; labs[2] = lblmm2; labs[3] = lblgm3; labs[4] = lblmm3; labs[5] = lblmicro0; lblGsm = new JLabel("(gsm)"); lblGsm.setToolTipText("Switch the input type for density between gsm and g/cc"); lblGsm.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblGsm.setEnabled(false); lblGsm.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent arg0) { if (lblGsm.isEnabled() && lblGsm.contains(arg0.getPoint())) { jobFormReady = false; try { //double oldval = Double.parseDouble(txtDensity.getText()); //double thickness = Double.parseDouble(txtThickness.getText()); double oldval = ((Job) listJobs.getSelectedValue()).getDensity(); double thickness = ((Job) listJobs.getSelectedValue()).getThickness(); if (lblGsm.getText().equals("(gsm)")) { lblGsm.setText("(g/cc)"); label_3.setVisible(false); lblgm3.setText("(gsm)"); txtDensity.setText(Double.toString(roundTwoDecimals(oldval * thickness))); ((Job) listJobs.getSelectedValue()).gsm = true; } else { lblGsm.setText("(gsm)"); label_3.setVisible(true); lblgm3.setText("(g/cm )"); txtDensity.setText(Double.toString(roundTwoDecimals(oldval))); ((Job) listJobs.getSelectedValue()).gsm = false; } } catch (Exception e) { lblGsm.setText("(gsm)"); label_3.setVisible(true); lblgm3.setText("(g/cm )"); txtDensity.setText("0.92"); } jobFormReady = true; } } @Override public void mouseEntered(MouseEvent arg0) { lblGsm.setForeground(new Color(0, 0, 128)); } @Override public void mouseExited(MouseEvent e) { lblGsm.setForeground(Color.black); } }); lblGsm.setForeground(new Color(0, 0, 0)); lblGsm.setCursor(new Cursor(Cursor.HAND_CURSOR)); lblGsm.setBounds(177, 102, 46, 14); pnlMaterials.add(lblGsm); lblOr = new JLabel("or:"); lblOr.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblOr.setEnabled(false); lblOr.setBounds(155, 102, 14, 14); pnlMaterials.add(lblOr); labs[6] = lblmmin; cmbUnwindType = new JComboBox(); cmbUnwindType.setToolTipText("Type of measure to use for the unwind quantity above"); cmbUnwindType.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UpdateUnwindAmount(); } }); cmbUnwindType.setEnabled(false); cmbUnwindType .setModel(new DefaultComboBoxModel(new String[] { "Length (m)", "Weight (kg)", "Diameter (mm)" })); cmbUnwindType.setBounds(92, 124, 95, 20); pnlUnwinds.add(cmbUnwindType); txtWebWidth = new JTextField(); txtWebWidth.setToolTipText("Width of mother rolls"); txtWebWidth.setText("1350"); txtWebWidth.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent arg0) { txtWebWidth.selectAll(); } }); txtWebWidth.setEnabled(false); txtWebWidth.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent arg0) { UpdateJob(); } @Override public void insertUpdate(DocumentEvent arg0) { UpdateJob(); } @Override public void changedUpdate(DocumentEvent arg0) { } }); txtWebWidth.setBounds(92, 26, 86, 20); pnlUnwinds.add(txtWebWidth); txtWebWidth.setColumns(10); lblAverageFlags = new JLabel("Average Flags:"); lblAverageFlags.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblAverageFlags.setToolTipText("The average number of flags in each mother roll"); lblAverageFlags.setEnabled(false); lblAverageFlags.setBounds(14, 79, 75, 14); pnlUnwinds.add(lblAverageFlags); txtFlagCount = new JTextField(); txtFlagCount.setToolTipText("The average number of flags in each mother roll"); txtFlagCount.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent arg0) { txtFlagCount.selectAll(); } }); txtFlagCount.getDocument().addDocumentListener(new JobInputChangeListener()); txtFlagCount.setEnabled(false); txtFlagCount.setText("1"); txtFlagCount.setBounds(92, 76, 43, 20); pnlUnwinds.add(txtFlagCount); txtFlagCount.setColumns(10); lblPerRoll = new JLabel("per roll"); lblPerRoll.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblPerRoll.setEnabled(false); lblPerRoll.setBounds(140, 79, 46, 14); pnlUnwinds.add(lblPerRoll); txtLimitRunSpeed = new JTextField(); txtLimitRunSpeed.setToolTipText( "Override for top machine speed (may be required for particular materials or environments)"); txtLimitRunSpeed.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent arg0) { if (txtLimitRunSpeed.contains(arg0.getPoint())) { txtLimitRunSpeed.setEnabled(true); chckbxLimitRunSpeed.setSelected(true); txtLimitRunSpeed.requestFocusInWindow(); txtLimitRunSpeed.selectAll(); UpdateJob(); } } }); txtLimitRunSpeed.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { if (txtLimitRunSpeed.isEnabled()) { txtLimitRunSpeed.selectAll(); chckbxLimitRunSpeed.setSelected(true); } } }); txtLimitRunSpeed.getDocument().addDocumentListener(new JobInputChangeListener()); txtLimitRunSpeed.setEnabled(false); txtLimitRunSpeed.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { chckbxLimitRunSpeed.setSelected(true); } }); txtLimitRunSpeed.setText("800"); txtLimitRunSpeed.setColumns(10); txtLimitRunSpeed.setBounds(130, 165, 65, 20); pnlJobs.add(txtLimitRunSpeed); cmbRewindType = new JComboBox(); cmbRewindType.setToolTipText("Type of measure to use for rewind output above"); cmbRewindType.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UpdateRewindAmount(); //UpdateJob(); } }); cmbRewindType.setEnabled(false); cmbRewindType .setModel(new DefaultComboBoxModel(new String[] { "Length (m)", "Weight (kg)", "Diameter (mm)" })); cmbRewindType.setBounds(109, 218, 95, 20); pnlJobs.add(cmbRewindType); chckbxLimitRunSpeed = new JCheckBox(""); chckbxLimitRunSpeed.setToolTipText( "Override for top machine speed (may be required for particular materials or environments)"); chckbxLimitRunSpeed.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (chckbxLimitRunSpeed.isSelected()) { txtLimitRunSpeed.setEnabled(true); txtLimitRunSpeed.requestFocusInWindow(); txtLimitRunSpeed.selectAll(); } else { txtLimitRunSpeed.setEnabled(false); } UpdateJob(); } }); chckbxLimitRunSpeed.setEnabled(false); chckbxLimitRunSpeed.setBounds(105, 164, 20, 20); pnlJobs.add(chckbxLimitRunSpeed); lblLimitRunSpeed = new JLabel("Speed Limit:"); lblLimitRunSpeed.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblLimitRunSpeed.setToolTipText( "Override for top machine speed (may be required for particular materials or environments)"); lblLimitRunSpeed.setEnabled(false); lblLimitRunSpeed.setBounds(47, 168, 59, 14); pnlJobs.add(lblLimitRunSpeed); lblKnifeType = new JLabel("Knife Type:"); lblKnifeType.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblKnifeType.setToolTipText("Select knife type for this job"); lblKnifeType.setEnabled(false); lblKnifeType.setHorizontalAlignment(SwingConstants.RIGHT); lblKnifeType.setBounds(46, 89, 59, 14); pnlJobs.add(lblKnifeType); cmbKnifeType = new JComboBox(); cmbKnifeType.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { UpdateJob(); } }); cmbKnifeType.setModel(new DefaultComboBoxModel(new String[] { "Razor in Air", "Rotary Shear" })); cmbKnifeType.setToolTipText("Select knife type for this job"); cmbKnifeType.setEnabled(false); cmbKnifeType.setBounds(109, 86, 95, 20); pnlJobs.add(cmbKnifeType); tabbedPane.setMnemonicAt(0, KeyEvent.VK_M); tabbedPane.setMnemonicAt(1, KeyEvent.VK_J); tabbedPane.setMnemonicAt(2, KeyEvent.VK_S); tabbedPane.setMnemonicAt(3, KeyEvent.VK_P); tabbedPane.setMnemonicAt(4, KeyEvent.VK_R); tabsROI.setMnemonicAt(0, KeyEvent.VK_D); tabsROI.setMnemonicAt(1, KeyEvent.VK_N); tabsROI.setMnemonicAt(3, KeyEvent.VK_W); scrollPane_4 = new JScrollPane(); scrollPane_4.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); scrollPane_4.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane_4.setBorder(null); scrollPane_4.setBounds(522, 44, 245, 405); pnlROI.add(scrollPane_4); panel_11 = new JPanel(); panel_11.setToolTipText( "Click a machine to select it. Select two or more machines to compare their ROI measures."); scrollPane_4.setViewportView(panel_11); panel_11.setBackground(Color.WHITE); panel_11.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, null, null, null)); panel_11.setLayout(new BorderLayout(0, 0)); listCompareRoi = new JList(listModel); panel_11.add(listCompareRoi, BorderLayout.NORTH); listCompareRoi.setToolTipText( "Click a machine to select it. Select two or more machines to compare their ROI measures."); listCompareRoi.setBorder(null); listCompareRoi.setSelectionModel(new DefaultListSelectionModel() { private static final long serialVersionUID = 1L; boolean gestureStarted = false; @Override public void setSelectionInterval(int index0, int index1) { if (!gestureStarted) { if (isSelectedIndex(index0)) { super.removeSelectionInterval(index0, index1); } else { super.addSelectionInterval(index0, index1); } } gestureStarted = true; } @Override public void setValueIsAdjusting(boolean isAdjusting) { if (isAdjusting == false) { gestureStarted = false; } } }); listCompareRoi.addListSelectionListener(new ROIListSelectionListener()); listCompareRoi.setCellRenderer(new MachineListRenderer()); listCompare.setSelectionModel(listCompareRoi.getSelectionModel()); btnJobUp = new JButton(""); btnJobUp.setToolTipText("Move job up"); btnJobUp.addActionListener(new JobUpListener()); try { btnJobUp.setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/up.png")))); btnJobUp.setRolloverEnabled(true); btnJobUp.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/up_over.png")))); btnJobUp.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/up_dis.png")))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } btnJobUp.setEnabled(false); btnJobUp.setBounds(700, 463, 30, 30); pnlJob.add(btnJobUp); btnJobDown = new JButton(""); btnJobDown.setToolTipText("Move job down"); btnJobDown.addActionListener(new JobDownListener()); try { btnJobDown.setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/down.png")))); btnJobDown.setRolloverEnabled(true); btnJobDown.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/down_over.png")))); btnJobDown.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/down_dis.png")))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } btnJobDown.setEnabled(false); btnJobDown.setBounds(737, 463, 30, 30); pnlJob.add(btnJobDown); btnNewJob = new JButton("Add New"); btnNewJob.setFont(new Font("Tahoma", Font.BOLD, 11)); btnNewJob.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jobFormReady = false; ResetStatusLabel(); EnableJobForm(); // new ResetJobForm(); lblGsm.setText("(gsm)"); label_3.setVisible(true); lblgm3.setText("(g/cm )"); txtDensity.setText("0.92"); btnJobDelete.setEnabled(true); btnAddAll.setEnabled(true); /*if(listJobs.getSelectedIndex() == 0) btnJobUp.setEnabled(false); else btnJobUp.setEnabled(true); if(listJobs.getSelectedIndex() == jobModel.getSize()-1) btnJobDown.setEnabled(false); else btnJobDown.setEnabled(true);*/ int index = listJobs.getSelectedIndex(); int size = jobModel.getSize(); if (size >= Consts.JOB_LIST_LIMIT) { // Max list size ShowMessage("Maximum number of jobs allocated. Please delete before attempting to add more."); return; } String newName = getUniqueJobName("Job"); txtJobName.setText(newName); job = new Job(newName); jobNames.add(newName.toLowerCase()); //If no selection or if item in last position is selected, //add the new one to end of list, and select new one. if (index == -1 || (index + 1 == size)) { jobModel.addElement(job); listJobs.setSelectedIndex(size); listJobsAvail.setSelectedIndex(size); if (size > 0) btnJobUp.setEnabled(true); //Otherwise insert the new one after the current selection, //and select new one. } else { jobModel.insertElementAt(job, index + 1); listJobs.setSelectedIndex(index + 1); listJobsAvail.setSelectedIndex(index + 1); } // TODO don't reset form, or add copy button ResetStatusLabel(); jobFormReady = true; UpdateJob(); txtJobName.requestFocusInWindow(); } }); try { btnNewJob.setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/plus.png")))); } catch (IOException e1) { e1.printStackTrace(); } btnNewJob.setToolTipText("Add new job"); btnNewJob.setBounds(522, 460, 110, 36); pnlJob.add(btnNewJob); lblJobConfiguration = new JLabel("Job Configuration"); lblJobConfiguration.setFont(new Font("Tahoma", Font.BOLD, 18)); lblJobConfiguration.setBounds(29, 18, 269, 22); pnlJob.add(lblJobConfiguration); btnJobDelete = new JButton(""); btnJobDelete.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ResetStatusLabel(); Job selected = (Job) listJobs.getSelectedValue(); jobNames.remove(selected.getName().toLowerCase()); ListSelectionModel lsm = listJobs.getSelectionModel(); int firstSelected = lsm.getMinSelectionIndex(); int lastSelected = lsm.getMaxSelectionIndex(); jobModel.removeRange(firstSelected, lastSelected); int size = jobModel.size(); if (size == 0) { //List is empty: disable delete, up, and down buttons. /*btnJobDelete.setEnabled(false); btnJobUp.setEnabled(false); btnJobDown.setEnabled(false);*/ } else { //Adjust the selection. if (firstSelected == jobModel.getSize()) { //Removed item in last position. firstSelected--; } listJobs.setSelectedIndex(firstSelected); if (size == 21) { // No longer full list ResetStatusLabel(); } job = (Job) listJobs.getSelectedValue(); } } }); try { btnJobDelete .setIcon(new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/delete.png")))); btnJobDelete.setRolloverEnabled(true); btnJobDelete.setRolloverIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/delete_over.png")))); btnJobDelete.setDisabledIcon( new ImageIcon(ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/delete_dis.png")))); } catch (NullPointerException e11) { System.out.println("Image load error"); } catch (IOException e1) { e1.printStackTrace(); } btnJobDelete.setToolTipText("Delete job"); btnJobDelete.setRolloverEnabled(true); btnJobDelete.setEnabled(false); btnJobDelete.setBounds(651, 460, 36, 36); pnlJob.add(btnJobDelete); lblAddNewJobs = new JLabel( "Add new jobs to the list on the right, then configure unwind, rewind and material settings below"); lblAddNewJobs.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblAddNewJobs.setBounds(29, 45, 483, 14); pnlJob.add(lblAddNewJobs); lblJobs = new JLabel("Jobs"); lblJobs.setFont(new Font("Tahoma", Font.BOLD, 12)); lblJobs.setBounds(522, 19, 85, 14); pnlJob.add(lblJobs); panel_1 = new JPanel(); panel_1.setLayout(null); panel_1.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Total Output", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_1.setBounds(280, 380, 227, 116); pnlJob.add(panel_1); lblTargetOutputFor = new JLabel("Target output for job:"); lblTargetOutputFor.setEnabled(false); lblTargetOutputFor.setBounds(30, 22, 129, 14); panel_1.add(lblTargetOutputFor); txtTargetTotal = new JTextField(); txtTargetTotal.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtTargetTotal.selectAll(); } }); txtTargetTotal.getDocument().addDocumentListener(new JobInputChangeListener()); txtTargetTotal.setToolTipText("Total output quantity for this job"); txtTargetTotal.setText("10000"); txtTargetTotal.setEnabled(false); txtTargetTotal.setColumns(10); txtTargetTotal.setBounds(30, 43, 118, 20); panel_1.add(txtTargetTotal); cmbTargetTotal = new JComboBox(); cmbTargetTotal.setToolTipText("Type of measure to use for output quantity above"); cmbTargetTotal.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UpdateTotalsAmount(); } }); cmbTargetTotal.setModel( new DefaultComboBoxModel(new String[] { "Length (m)", "Weight (kg)", "Weight (tonnes)" })); cmbTargetTotal.setEnabled(false); cmbTargetTotal.setBounds(30, 67, 118, 20); panel_1.add(cmbTargetTotal); lblCounts = new JLabel("0 reel(s), 0 set(s), 0 mother(s)"); lblCounts.setFont(new Font("Tahoma", Font.PLAIN, 11)); lblCounts.setForeground(Color.GRAY); lblCounts.setBounds(30, 92, 187, 14); panel_1.add(lblCounts); panel_2 = new JPanel(); panel_2.setLayout(null); panel_2.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Name", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0))); panel_2.setBounds(20, 72, 250, 83); pnlJob.add(panel_2); txtJobName = new JTextField(); txtJobName.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtJobName.selectAll(); } }); txtJobName.setBounds(90, 30, 145, 28); panel_2.add(txtJobName); txtJobName.getDocument().addDocumentListener(new DocumentListener() { @Override public void changedUpdate(DocumentEvent arg0) { } @Override public void insertUpdate(DocumentEvent arg0) { UpdateJobName(); } @Override public void removeUpdate(DocumentEvent arg0) { UpdateJobName(); } }); txtJobName.setToolTipText("Set the name of this job"); txtJobName.setFont(new Font("Tahoma", Font.BOLD, 12)); txtJobName.setEnabled(false); txtJobName.setColumns(10); lblJobName = new JLabel("Job name:"); lblJobName.setToolTipText("Set the name of this job"); lblJobName.setEnabled(false); lblJobName.setBounds(22, 31, 60, 24); panel_2.add(lblJobName); lblJobName.setFont(new Font("Tahoma", Font.PLAIN, 13)); btnResetJobs = new JButton("Reset"); btnResetJobs.setBounds(20, 460, 100, 36); pnlJob.add(btnResetJobs); btnResetJobs.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ResetJobForm(); UpdateJob(); } }); btnResetJobs.setToolTipText("Reset the form"); btnResetJobs.setEnabled(false); scrollPane_1 = new JScrollPane(); scrollPane_1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); scrollPane_1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane_1.setBorder(null); scrollPane_1.setBounds(522, 44, 245, 405); pnlJob.add(scrollPane_1); panel_7 = new JPanel(); panel_7.setToolTipText("Select a job to edit options, re-order, or delete"); scrollPane_1.setViewportView(panel_7); panel_7.setBackground(Color.WHITE); panel_7.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, null, null, null)); panel_7.setLayout(new BorderLayout(0, 0)); listJobs = new JList(jobModel); listJobs.setSelectionModel(listJobsAvail.getSelectionModel()); panel_7.add(listJobs, BorderLayout.NORTH); listJobs.setToolTipText("Select a job to edit options, re-order, or delete"); listJobs.addListSelectionListener(new JobListSelectionListener()); listJobs.setBorder(null); listJobs.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); listJobs.setCellRenderer(new JobListRenderer()); pnlJob.setFocusTraversalPolicy(new FocusTraversalOnArray( new Component[] { cmbMaterials, txtThickness, txtDensity, cmbUnwindCore, txtUnwindAmount, txtSlits, txtSlitWidth, cmbRewindCore, txtRewindAmount, cmbJobDomain, lblPresets, lblThickness_1, lblDensity_1, pnlMaterials, lblWebWidthmm, lblmm0, lblUnwindCoremm, lblmm1, lblUnwindLength, pnlUnwinds, lblmicro0, lblgm3, label_3, pnlJobs, lblTargetRewindLength, lblSlitWidth, lblSlitCount, lblTrimtotal, lblTrim, lblRewindCoremm, lblPer_1, lblmm3, lblmm2 })); Image img = null; try { img = ImageIO.read(FrmMain.class.getResourceAsStream("/atlas/refresh.png")); } catch (IOException e1) { e1.printStackTrace(); } BufferedImage bi = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB); Graphics g = bi.createGraphics(); g.drawImage(img, 0, 0, 25, 25, null); LoadSettings(); DoLicenceCheck(); initialising = false; }
From source file:brainflow.app.toplevel.BrainFlow.java
private void initExceptionHandler() { LookAndFeelFactory.UIDefaultsCustomizer uiDefaultsCustomizer = new LookAndFeelFactory.UIDefaultsCustomizer() { public void customize(UIDefaults defaults) { ThemePainter painter = (ThemePainter) UIDefaultsLookup.get("Theme.painter"); defaults.put("OptionPaneUI", "com.jidesoft.plaf.basic.BasicJideOptionPaneUI"); defaults.put("OptionPane.showBanner", Boolean.TRUE); // show banner or not. default is true //defaults.put("OptionPane.bannerIcon", JideIconsFactory.getImageIcon(JideIconsFactory.JIDE50)); defaults.put("OptionPane.bannerFontSize", 13); defaults.put("OptionPane.bannerFontStyle", Font.BOLD); defaults.put("OptionPane.bannerMaxCharsPerLine", 60); defaults.put("OptionPane.bannerForeground", painter != null ? painter.getOptionPaneBannerForeground() : null); // you should adjust this if banner background is not the default gradient paint defaults.put("OptionPane.bannerBorder", null); // use default border // set both bannerBackgroundDk and // set both bannerBackgroundLt to null if you don't want gradient defaults.put("OptionPane.bannerBackgroundDk", painter != null ? painter.getOptionPaneBannerDk() : null); defaults.put("OptionPane.bannerBackgroundLt", painter != null ? painter.getOptionPaneBannerLt() : null); defaults.put("OptionPane.bannerBackgroundDirection", Boolean.TRUE); // default is true // optionally, you can set a Paint object for BannerPanel. If so, the three UIDefaults related to banner background above will be ignored. defaults.put("OptionPane.bannerBackgroundPaint", null); defaults.put("OptionPane.buttonAreaBorder", BorderFactory.createEmptyBorder(6, 6, 6, 6)); defaults.put("OptionPane.buttonOrientation", SwingConstants.RIGHT); }//from ww w .java2 s. c o m }; uiDefaultsCustomizer.customize(UIManager.getDefaults()); Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { public void uncaughtException(Thread t, Throwable e) { e.printStackTrace(); ExceptionDialog ed = new ExceptionDialog(e); JDialog dialog = ed.createDialog(brainFrame); dialog.setVisible(true); } }); }
From source file:edu.ku.brc.af.ui.forms.ViewFactory.java
protected boolean createItem(final DBTableInfo parentTableInfo, final DBTableChildIFace childInfo, final MultiView parent, final ViewDefIFace viewDef, final FormValidator validator, final ViewBuilderIFace viewBldObj, final AltViewIFace.CreationMode mode, final HashMap<String, JLabel> labelsForHash, final Object currDataObj, final FormCellIFace cell, final boolean isEditOnCreateOnly, final int rowInx, final BuildInfoStruct bi) { bi.compToAdd = null;/*from ww w .ja va 2s.c om*/ bi.compToReg = null; bi.doAddToValidator = true; bi.doRegControl = true; DBRelationshipInfo relInfo = childInfo instanceof DBRelationshipInfo ? (DBRelationshipInfo) childInfo : null; if (isEditOnCreateOnly) { EditViewCompSwitcherPanel evcsp = new EditViewCompSwitcherPanel(cell); bi.compToAdd = evcsp; bi.compToReg = evcsp; if (validator != null) { //DataChangeNotifier dcn = validator.createDataChangeNotifer(cell.getIdent(), evcsp, null); DataChangeNotifier dcn = validator.hookupComponent(evcsp, cell.getIdent(), UIValidator.Type.Changed, null, false); evcsp.setDataChangeNotifier(dcn); } } else if (cell.getType() == FormCellIFace.CellType.label) { FormCellLabel cellLabel = (FormCellLabel) cell; String lblStr = cellLabel.getLabel(); if (cellLabel.isRecordObj()) { JComponent riComp = viewBldObj.createRecordIndentifier(lblStr, cellLabel.getIcon()); bi.compToAdd = riComp; } else { String lStr = " "; int align = SwingConstants.RIGHT; boolean useColon = StringUtils.isNotEmpty(cellLabel.getLabelFor()); if (lblStr.equals("##")) { //lStr = " "; bi.isDerivedLabel = true; cellLabel.setDerived(true); } else { String alignProp = cellLabel.getProperty("align"); if (StringUtils.isNotEmpty(alignProp)) { if (alignProp.equals("left")) { align = SwingConstants.LEFT; } else if (alignProp.equals("center")) { align = SwingConstants.CENTER; } else { align = SwingConstants.RIGHT; } } else if (useColon) { align = SwingConstants.RIGHT; } else { align = SwingConstants.LEFT; } if (isNotEmpty(lblStr)) { if (useColon) { lStr = lblStr + ":"; } else { lStr = lblStr; } } else { lStr = " "; } } if (lStr.indexOf(LF) > -1) { lStr = "<html>" + StringUtils.replace(lStr, LF, "<br>") + "</html>"; } JLabel lbl = createLabel(lStr, align); String colorStr = cellLabel.getProperty("fg"); if (StringUtils.isNotEmpty(colorStr)) { lbl.setForeground(UIHelper.parseRGB(colorStr)); } labelsForHash.put(cellLabel.getLabelFor(), lbl); bi.compToAdd = lbl; viewBldObj.addLabel(cellLabel, lbl); } bi.doAddToValidator = false; bi.doRegControl = false; } else if (cell.getType() == FormCellIFace.CellType.field) { FormCellField cellField = (FormCellField) cell; bi.isRequired = bi.isRequired || cellField.isRequired() || (childInfo != null && childInfo.isRequired()); DBFieldInfo fieldInfo = childInfo instanceof DBFieldInfo ? (DBFieldInfo) childInfo : null; if (fieldInfo != null && fieldInfo.isHidden()) { FormDevHelper.appendLocalizedFormDevError("ViewFactory.FORM_FIELD_HIDDEN", cellField.getIdent(), cellField.getName(), viewDef.getName()); } else { if (fieldInfo != null && fieldInfo.isHidden()) { FormDevHelper.appendLocalizedFormDevError("ViewFactory.FORM_REL_HIDDEN", cellField.getIdent(), cellField.getName(), viewDef.getName()); } } FormCellField.FieldType uiType = cellField.getUiType(); // Check to see if there is a PickList and get it if there is PickListDBAdapterIFace adapter = null; String pickListName = cellField.getPickListName(); if (childInfo != null && StringUtils.isEmpty(pickListName) && fieldInfo != null) { pickListName = fieldInfo.getPickListName(); } if (isNotEmpty(pickListName)) { adapter = PickListDBAdapterFactory.getInstance().create(pickListName, false); if (adapter == null || adapter.getPickList() == null) { FormDevHelper.appendFormDevError("PickList Adapter [" + pickListName + "] cannot be null!"); return false; } } /*if (uiType == FormCellFieldIFace.FieldType.text) { String weblink = cellField.getProperty("weblink"); if (StringUtils.isNotEmpty(weblink)) { String name = cellField.getProperty("name"); if (StringUtils.isNotEmpty(name) && name.equals("WebLink")) { uiType } } }*/ // The Default Display for combox is dsptextfield, except when there is a TableBased PickList // At the time we set the display we don't want to go get the picklist to find out. So we do it // here after we have the picklist and actually set the change into the cellField // because it uses the value to determine whether to convert the value into a text string // before setting it. if (mode == AltViewIFace.CreationMode.VIEW) { if (uiType == FormCellFieldIFace.FieldType.combobox && cellField.getDspUIType() != FormCellFieldIFace.FieldType.textpl) { if (adapter != null)// && adapter.isTabledBased()) { uiType = FormCellFieldIFace.FieldType.textpl; cellField.setDspUIType(uiType); } else { uiType = cellField.getDspUIType(); } } else { uiType = cellField.getDspUIType(); } } else if (uiType == FormCellField.FieldType.querycbx) { if (AppContextMgr.isSecurityOn()) { DBTableInfo tblInfo = childInfo != null ? DBTableIdMgr.getInstance() .getByShortClassName(childInfo.getDataClass().getSimpleName()) : null; if (tblInfo != null) { PermissionSettings perm = tblInfo.getPermissions(); if (perm != null) { //PermissionSettings.dumpPermissions("QCBX: "+tblInfo.getShortClassName(), perm.getOptions()); if (perm.isViewOnly() || !perm.canView()) { uiType = FormCellField.FieldType.textfieldinfo; } } } } } Class<?> fieldClass = childInfo != null ? childInfo.getDataClass() : null; String uiFormatName = cellField.getUIFieldFormatterName(); if (mode == AltViewIFace.CreationMode.EDIT && uiType == FormCellField.FieldType.text && fieldClass != null) { if (fieldClass == String.class && fieldInfo != null) { // check whether there's a formatter defined for this field in the schema if (fieldInfo.getFormatter() != null) { uiFormatName = fieldInfo.getFormatter().getName(); uiType = FormCellField.FieldType.formattedtext; } } else if (fieldClass == Integer.class || fieldClass == Long.class || fieldClass == Short.class || fieldClass == Byte.class || fieldClass == Double.class || fieldClass == Float.class || fieldClass == BigDecimal.class) { //log.debug(cellField.getName()+" is being changed to NUMERIC"); uiType = FormCellField.FieldType.formattedtext; uiFormatName = "Numeric" + fieldClass.getSimpleName(); } } // Create the UI Component boolean isReq = cellField.isRequired() || (fieldInfo != null && fieldInfo.isRequired()) || (relInfo != null && relInfo.isRequired()); cellField.setRequired(isReq); switch (uiType) { case text: bi.compToAdd = createTextField(validator, cellField, fieldInfo, isReq, adapter); bi.doAddToValidator = validator == null; // might already added to validator break; case formattedtext: { Class<?> tableClass = null; try { tableClass = Class.forName(viewDef.getClassName()); } catch (Exception ex) { } JComponent tfStart = createFormattedTextField(validator, cellField, tableClass, fieldInfo != null ? fieldInfo.getLength() : 0, uiFormatName, mode == AltViewIFace.CreationMode.VIEW, isReq, cellField.getPropertyAsBoolean("alledit", false)); bi.compToAdd = tfStart; if (cellField.getPropertyAsBoolean("series", false)) { JComponent tfEnd = createFormattedTextField(validator, cellField, tableClass, fieldInfo != null ? fieldInfo.getLength() : 0, uiFormatName, mode == AltViewIFace.CreationMode.VIEW, isReq, cellField.getPropertyAsBoolean("alledit", false)); // Make sure we register it like a plugin not a regular control SeriesProcCatNumPlugin plugin = new SeriesProcCatNumPlugin((ValFormattedTextFieldIFace) tfStart, (ValFormattedTextFieldIFace) tfEnd); bi.compToAdd = plugin.getUIComponent(); viewBldObj.registerPlugin(cell, plugin); bi.doRegControl = false; } bi.doAddToValidator = validator == null; // might already added to validator break; } case label: JLabel label = createLabel("", SwingConstants.LEFT); bi.compToAdd = label; break; case dsptextfield: if (StringUtils.isEmpty(cellField.getPickListName())) { JTextField text = UIHelper.createTextField(cellField.getTxtCols()); changeTextFieldUIForDisplay(text, cellField.getPropertyAsBoolean("transparent", false)); bi.compToAdd = text; } else { bi.compToAdd = createTextField(validator, cellField, fieldInfo, isReq, adapter); bi.doAddToValidator = validator == null; // might already added to validator } break; case textfieldinfo: bi.compToAdd = createTextFieldWithInfo(cellField, parent); break; case image: bi.compToAdd = createImageDisplay(cellField, mode, validator); bi.doAddToValidator = (validator != null); break; case url: BrowserLauncherBtn blb = new BrowserLauncherBtn(cellField.getProperty("title")); bi.compToAdd = blb; bi.doAddToValidator = false; break; case combobox: bi.compToAdd = createValComboBox(validator, cellField, adapter, isReq); bi.doAddToValidator = validator != null; // might already added to validator break; case checkbox: { String lblStr = cellField.getLabel(); if (lblStr.equals("##")) { bi.isDerivedLabel = true; cellField.setDerived(true); } ValCheckBox checkbox = new ValCheckBox(lblStr, isReq, cellField.isReadOnly() || mode == AltViewIFace.CreationMode.VIEW); if (validator != null) { DataChangeNotifier dcn = validator.createDataChangeNotifer(cellField.getIdent(), checkbox, validator.createValidator(checkbox, UIValidator.Type.Changed)); checkbox.addActionListener(dcn); checkbox.addItemListener(dcn); } bi.compToAdd = checkbox; break; } case tristate: { String lblStr = cellField.getLabel(); if (lblStr.equals("##")) { bi.isDerivedLabel = true; cellField.setDerived(true); } ValTristateCheckBox tristateCB = new ValTristateCheckBox(lblStr, isReq, cellField.isReadOnly() || mode == AltViewIFace.CreationMode.VIEW); if (validator != null) { DataChangeNotifier dcn = validator.createDataChangeNotifer(cellField.getIdent(), tristateCB, null); tristateCB.addActionListener(dcn); } bi.compToAdd = tristateCB; break; } case spinner: { String minStr = cellField.getProperty("min"); int min = StringUtils.isNotEmpty(minStr) ? Integer.parseInt(minStr) : 0; String maxStr = cellField.getProperty("max"); int max = StringUtils.isNotEmpty(maxStr) ? Integer.parseInt(maxStr) : 0; ValSpinner spinner = new ValSpinner(min, max, isReq, cellField.isReadOnly() || mode == AltViewIFace.CreationMode.VIEW); if (validator != null) { DataChangeNotifier dcn = validator.createDataChangeNotifer(cellField.getIdent(), spinner, validator.createValidator(spinner, UIValidator.Type.Changed)); spinner.addChangeListener(dcn); } bi.compToAdd = spinner; break; } case password: bi.compToAdd = createPasswordField(validator, cellField, isReq); bi.doAddToValidator = validator == null; // might already added to validator break; case dsptextarea: bi.compToAdd = createDisplayTextArea(cellField); break; case textarea: { JTextArea ta = createTextArea(validator, cellField, isReq, fieldInfo); JScrollPane scrollPane = new JScrollPane(ta); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy( UIHelper.isMacOS() ? ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS : ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); ta.setLineWrap(true); ta.setWrapStyleWord(true); bi.doAddToValidator = validator == null; // might already added to validator bi.compToReg = ta; bi.compToAdd = scrollPane; break; } case textareabrief: { String title = ""; DBTableInfo ti = DBTableIdMgr.getInstance().getByClassName(viewDef.getClassName()); if (ti != null) { DBFieldInfo fi = ti.getFieldByName(cellField.getName()); if (fi != null) { title = fi.getTitle(); } } ValTextAreaBrief txBrief = createTextAreaBrief(validator, cellField, isReq, fieldInfo); txBrief.setTitle(title); bi.doAddToValidator = validator == null; // might already added to validator bi.compToReg = txBrief; bi.compToAdd = txBrief.getUIComponent(); break; } case browse: { JTextField textField = createTextField(validator, cellField, null, isReq, null); if (textField instanceof ValTextField) { ValBrowseBtnPanel bbp = new ValBrowseBtnPanel((ValTextField) textField, cellField.getPropertyAsBoolean("dirsonly", false), cellField.getPropertyAsBoolean("forinput", true)); String fileFilter = cellField.getProperty("filefilter"); String fileFilterDesc = cellField.getProperty("filefilterdesc"); String defaultExtension = cellField.getProperty("defaultExtension"); if (fileFilter != null && fileFilterDesc != null) { bbp.setUseNativeFileDlg(false); bbp.setFileFilter(new FileNameExtensionFilter(fileFilterDesc, fileFilter)); bbp.setDefaultExtension(defaultExtension); //bbp.setNativeDlgFilter(new FileNameExtensionFilter(fileFilterDesc, fileFilter)); } bi.compToAdd = bbp; } else { BrowseBtnPanel bbp = new BrowseBtnPanel(textField, cellField.getPropertyAsBoolean("dirsonly", false), cellField.getPropertyAsBoolean("forinput", true)); bi.compToAdd = bbp; } break; } case querycbx: { ValComboBoxFromQuery cbx = createQueryComboBox(validator, cellField, isReq, cellField.getPropertyAsBoolean("adjustquery", true)); cbx.setMultiView(parent); cbx.setFrameTitle(cellField.getProperty("title")); bi.compToAdd = cbx; bi.doAddToValidator = validator == null; // might already added to validator break; } case list: { JList list = createList(validator, cellField, isReq); JScrollPane scrollPane = new JScrollPane(list); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy( UIHelper.isMacOS() ? ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS : ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); bi.doAddToValidator = validator == null; bi.compToReg = list; bi.compToAdd = scrollPane; break; } case colorchooser: { ColorChooser colorChooser = new ColorChooser(Color.BLACK); if (validator != null) { DataChangeNotifier dcn = validator.createDataChangeNotifer(cellField.getName(), colorChooser, null); colorChooser.addPropertyChangeListener("setValue", dcn); } //setControlSize(colorChooser); bi.compToAdd = colorChooser; break; } case button: JButton btn = createFormButton(cellField, cellField.getProperty("title")); bi.compToAdd = btn; break; case progress: bi.compToAdd = createProgressBar(0, 100); break; case plugin: UIPluginable uip = createPlugin(parent, validator, cellField, mode == AltViewIFace.CreationMode.VIEW, isReq); if (uip != null) { bi.compToAdd = uip.getUIComponent(); viewBldObj.registerPlugin(cell, uip); } else { bi.compToAdd = new JPanel(); log.error("Couldn't create UIPlugin [" + cellField.getName() + "] ID:" + cellField.getIdent()); } bi.doRegControl = false; break; case textpl: JTextField txt = new TextFieldFromPickListTable(adapter, cellField.getTxtCols()); changeTextFieldUIForDisplay(txt, cellField.getPropertyAsBoolean("transparent", false)); bi.compToAdd = txt; break; default: FormDevHelper.appendFormDevError("Don't recognize uitype=[" + uiType + "]"); } // switch } else if (cell.getType() == FormCellIFace.CellType.separator) { // still have compToAdd = null; FormCellSeparatorIFace fcs = (FormCellSeparatorIFace) cell; String collapsableName = fcs.getCollapseCompName(); String label = fcs.getLabel(); if (StringUtils.isEmpty(label) || label.equals("##")) { String className = fcs.getProperty("forclass"); if (StringUtils.isNotEmpty(className)) { DBTableInfo ti = DBTableIdMgr.getInstance().getByShortClassName(className); if (ti != null) { label = ti.getTitle(); } } } Component sep = viewBldObj.createSeparator(label); if (isNotEmpty(collapsableName)) { CollapsableSeparator collapseSep = new CollapsableSeparator(sep, false, null); if (bi.collapseSepHash == null) { bi.collapseSepHash = new HashMap<CollapsableSeparator, String>(); } bi.collapseSepHash.put(collapseSep, collapsableName); sep = collapseSep; } bi.doRegControl = cell.getName().length() > 0; bi.compToAdd = (JComponent) sep; bi.doRegControl = StringUtils.isNotEmpty(cell.getIdent()); bi.doAddToValidator = false; } else if (cell.getType() == FormCellIFace.CellType.command) { FormCellCommand cellCmd = (FormCellCommand) cell; JButton btn = createFormButton(cell, cellCmd.getLabel()); if (cellCmd.getCommandType().length() > 0) { btn.addActionListener(new CommandActionWrapper( new CommandAction(cellCmd.getCommandType(), cellCmd.getAction(), ""))); } bi.doAddToValidator = false; bi.compToAdd = btn; } else if (cell.getType() == FormCellIFace.CellType.iconview) { FormCellSubView cellSubView = (FormCellSubView) cell; String subViewName = cellSubView.getViewName(); ViewIFace subView = AppContextMgr.getInstance().getView(cellSubView.getViewSetName(), subViewName); if (subView != null) { if (parent != null) { int options = MultiView.VIEW_SWITCHER | (MultiView.isOptionOn(parent.getCreateOptions(), MultiView.IS_NEW_OBJECT) ? MultiView.IS_NEW_OBJECT : MultiView.NO_OPTIONS); options |= cellSubView.getPropertyAsBoolean("nosep", false) ? MultiView.DONT_USE_EMBEDDED_SEP : 0; options |= cellSubView.getPropertyAsBoolean("nosepmorebtn", false) ? MultiView.NO_MORE_BTN_FOR_SEP : 0; MultiView multiView = new MultiView(parent, cellSubView.getName(), subView, parent.getCreateWithMode(), options, null); parent.addChildMV(multiView); multiView.setClassToCreate(getClassToCreate(parent, cell)); log.debug("[" + cell.getType() + "] [" + cell.getName() + "] col: " + bi.colInx + " row: " + rowInx + " colspan: " + cell.getColspan() + " rowspan: " + cell.getRowspan()); viewBldObj.addSubView(cellSubView, multiView, bi.colInx, rowInx, cellSubView.getColspan(), 1); viewBldObj.closeSubView(cellSubView); bi.curMaxRow = rowInx; bi.colInx += cell.getColspan() + 1; } else { log.error("buildFormView - parent is NULL for subview [" + subViewName + "]"); } } else { log.error("buildFormView - Could find subview's with ViewSet[" + cellSubView.getViewSetName() + "] ViewName[" + subViewName + "]"); } // still have compToAdd = null; bi.colInx += 2; } else if (cell.getType() == FormCellIFace.CellType.subview) { FormCellSubView cellSubView = (FormCellSubView) cell; String subViewName = cellSubView.getViewName(); ViewIFace subView = AppContextMgr.getInstance().getView(cellSubView.getViewSetName(), subViewName); if (subView != null) { // Check to see this view should be "flatten" meaning we are creating a grid from a form if (!viewBldObj.shouldFlatten()) { if (parent != null) { ViewIFace parentView = parent.getView(); Properties props = cellSubView.getProperties(); boolean isSingle = cellSubView.isSingleValueFromSet(); boolean isACollection = false; try { Class<?> cls = Class.forName(parentView.getClassName()); Field fld = getFieldFromDotNotation(cellSubView, cls); if (fld != null) { isACollection = Collection.class.isAssignableFrom(fld.getType()); } else { log.error("Couldn't find field [" + cellSubView.getName() + "] in class [" + parentView.getClassName() + "]"); } } catch (Exception ex) { log.error("Couldn't find field [" + cellSubView.getName() + "] in class [" + parentView.getClassName() + "]"); edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(ViewFactory.class, ex); } if (isSingle) { isACollection = true; } boolean useNoScrollbars = UIHelper.getProperty(props, "noscrollbars", false); //Assume RecsetController will always be handled correctly for one-to-one boolean hideResultSetController = relInfo == null ? false : relInfo.getType().equals(DBRelationshipInfo.RelationshipType.ZeroOrOne); /*XXX bug #9497: boolean canEdit = true; boolean addAddBtn = isEditOnCreateOnly && relInfo != null; if (AppContextMgr.isSecurityOn()) { DBTableInfo tblInfo = childInfo != null ? DBTableIdMgr.getInstance().getByShortClassName(childInfo.getDataClass().getSimpleName()) : null; if (tblInfo != null) { PermissionSettings perm = tblInfo.getPermissions(); if (perm != null) { //XXX whoa. What about view perms??? //if (perm.isViewOnly() || !perm.canView()) { if (!perm.canModify()) { canEdit = false; } } } }*/ int options = (isACollection && !isSingle ? MultiView.RESULTSET_CONTROLLER : MultiView.IS_SINGLE_OBJ) | MultiView.VIEW_SWITCHER | (MultiView.isOptionOn(parent.getCreateOptions(), MultiView.IS_NEW_OBJECT) ? MultiView.IS_NEW_OBJECT : MultiView.NO_OPTIONS) | /* XXX bug #9497:(mode == AltViewIFace.CreationMode.EDIT && canEdit ? MultiView.IS_EDITTING : MultiView.NO_OPTIONS) | (useNoScrollbars ? MultiView.NO_SCROLLBARS : MultiView.NO_OPTIONS) //| (addAddBtn ? MultiView.INCLUDE_ADD_BTN : MultiView.NO_OPTIONS) ; */ (mode == AltViewIFace.CreationMode.EDIT ? MultiView.IS_EDITTING : MultiView.NO_OPTIONS) | (useNoScrollbars ? MultiView.NO_SCROLLBARS : MultiView.NO_OPTIONS) | (hideResultSetController ? MultiView.HIDE_RESULTSET_CONTROLLER : MultiView.NO_OPTIONS); //MultiView.printCreateOptions("HERE", options); options |= cellSubView.getPropertyAsBoolean("nosep", false) ? MultiView.DONT_USE_EMBEDDED_SEP : 0; options |= cellSubView.getPropertyAsBoolean("nosepmorebtn", false) ? MultiView.NO_MORE_BTN_FOR_SEP : 0; options |= cellSubView.getPropertyAsBoolean("collapse", false) ? MultiView.COLLAPSE_SEPARATOR : 0; if (!(isACollection && !isSingle)) { options &= ~MultiView.ADD_SEARCH_BTN; } else { options |= cellSubView.getPropertyAsBoolean("addsearch", false) ? MultiView.ADD_SEARCH_BTN : 0; } //MultiView.printCreateOptions("_______________________________", parent.getCreateOptions()); //MultiView.printCreateOptions("_______________________________", options); boolean useBtn = UIHelper.getProperty(props, "btn", false); if (useBtn) { SubViewBtn.DATA_TYPE dataType; if (isSingle) { dataType = SubViewBtn.DATA_TYPE.IS_SINGLESET_ITEM; } else if (isACollection) { dataType = SubViewBtn.DATA_TYPE.IS_SET; } else { dataType = cellSubView.getName().equals("this") ? SubViewBtn.DATA_TYPE.IS_THIS : SubViewBtn.DATA_TYPE.IS_SET; } SubViewBtn subViewBtn = getInstance().createSubViewBtn(parent, cellSubView, subView, dataType, options, props, getClassToCreate(parent, cell), mode); subViewBtn.setHelpContext(props.getProperty("hc", null)); bi.doAddToValidator = false; bi.compToAdd = subViewBtn; String visProp = cell.getProperty("visible"); if (StringUtils.isNotEmpty(visProp) && visProp.equalsIgnoreCase("false") && bi.compToAdd != null) { bi.compToAdd.setVisible(false); } try { addControl(validator, viewBldObj, rowInx, cell, bi); } catch (java.lang.IndexOutOfBoundsException ex) { String msg = "Error adding control type: `" + cell.getType() + "` id: `" + cell.getIdent() + "` name: `" + cell.getName() + "` on row: " + rowInx + " column: " + bi.colInx + "\n" + ex.getMessage(); UIRegistry.showError(msg); return false; } bi.doRegControl = false; bi.compToAdd = null; } else { Color bgColor = getBackgroundColor(props, parent.getBackground()); //log.debug(cellSubView.getName()+" "+UIHelper.getProperty(props, "addsearch", false)); if (UIHelper.getProperty(props, "addsearch", false)) { options |= MultiView.ADD_SEARCH_BTN; } if (UIHelper.getProperty(props, "addadd", false)) { options |= MultiView.INCLUDE_ADD_BTN; } //MultiView.printCreateOptions("SUBVIEW", options); MultiView multiView = new MultiView(parent, cellSubView.getName(), subView, parent.getCreateWithMode(), cellSubView.getDefaultAltViewType(), options, bgColor, cellSubView); multiView.setClassToCreate(getClassToCreate(parent, cell)); setBorder(multiView, cellSubView.getProperties()); parent.addChildMV(multiView); //log.debug("["+cell.getType()+"] ["+cell.getName()+"] col: "+bi.colInx+" row: "+rowInx+" colspan: "+cell.getColspan()+" rowspan: "+cell.getRowspan()); viewBldObj.addSubView(cellSubView, multiView, bi.colInx, rowInx, cellSubView.getColspan(), 1); viewBldObj.closeSubView(cellSubView); Viewable viewable = multiView.getCurrentView(); if (viewable != null) { if (viewable instanceof TableViewObj) { ((TableViewObj) viewable).setVisibleRowCount(cellSubView.getTableRows()); } if (viewable.getValidator() != null && childInfo != null) { viewable.getValidator().setRequired(childInfo.isRequired()); } } bi.colInx += cell.getColspan() + 1; } bi.curMaxRow = rowInx; //if (hasColor) //{ // setMVBackground(multiView, multiView.getBackground()); //} } else { log.error("buildFormView - parent is NULL for subview [" + subViewName + "]"); bi.colInx += 2; } } else { //log.debug("["+cell.getType()+"] ["+cell.getName()+"] col: "+bi.colInx+" row: "+rowInx+" colspan: "+cell.getColspan()+" rowspan: "+cell.getRowspan()); viewBldObj.addSubView(cellSubView, parent, bi.colInx, rowInx, cellSubView.getColspan(), 1); AltViewIFace altView = subView.getDefaultAltView(); DBTableInfo sbTableInfo = DBTableIdMgr.getInstance().getByClassName(subView.getClassName()); ViewDefIFace altsViewDef = (ViewDefIFace) altView.getViewDef(); if (altsViewDef instanceof FormViewDefIFace) { FormViewDefIFace fvd = (FormViewDefIFace) altsViewDef; processRows(sbTableInfo, parent, viewDef, validator, viewBldObj, altView.getMode(), labelsForHash, currDataObj, fvd.getRows()); } else if (altsViewDef == null) { // This error is bad enough to have it's own dialog String msg = String.format("The Altview '%s' has a null ViewDef!", altView.getName()); FormDevHelper.appendFormDevError(msg); UIRegistry.showError(msg); } viewBldObj.closeSubView(cellSubView); bi.colInx += cell.getColspan() + 1; } } else { log.error("buildFormView - Could find subview's with ViewSet[" + cellSubView.getViewSetName() + "] ViewName[" + subViewName + "]"); } // still have compToAdd = null; } else if (cell.getType() == FormCellIFace.CellType.statusbar) { bi.compToAdd = new JStatusBar(); bi.doRegControl = true; bi.doAddToValidator = false; } else if (cell.getType() == FormCellIFace.CellType.panel) { bi.doRegControl = false; bi.doAddToValidator = false; cell.setIgnoreSetGet(true); FormCellPanel cellPanel = (FormCellPanel) cell; PanelViewable.PanelType panelType = PanelViewable.getType(cellPanel.getPanelType()); if (panelType == PanelViewable.PanelType.Panel) { PanelViewable panelViewable = new PanelViewable(viewBldObj, cellPanel); processRows(parentTableInfo, parent, viewDef, validator, panelViewable, mode, labelsForHash, currDataObj, cellPanel.getRows()); panelViewable.setVisible(cellPanel.getPropertyAsBoolean("visible", true)); setBorder(panelViewable, cellPanel.getProperties()); if (parent != null) { Color bgColor = getBackgroundColor(cellPanel.getProperties(), parent.getBackground()); if (bgColor != null && bgColor != parent.getBackground()) { panelViewable.setOpaque(true); panelViewable.setBackground(bgColor); } } bi.compToAdd = panelViewable; bi.doRegControl = true; bi.compToReg = panelViewable; } else if (panelType == PanelViewable.PanelType.ButtonBar) { bi.compToAdd = PanelViewable.buildButtonBar(processRows(viewBldObj, cellPanel.getRows())); } else { FormDevHelper.appendFormDevError("Panel Type is not implemented."); return false; } } String visProp = cell.getProperty("visible"); if (StringUtils.isNotEmpty(visProp) && visProp.equalsIgnoreCase("false") && bi.compToAdd != null) { bi.compToAdd.setVisible(false); } return true; }
From source file:com.openbravo.pos.imports.JPanelCSVImport.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//w w w.j a v a2s . c o m */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jFileChooserPanel = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jFileName = new javax.swing.JTextField(); jbtnDbDriverLib = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); jComboReference = new javax.swing.JComboBox(); jComboBarcode = new javax.swing.JComboBox(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jCheckInCatalogue = new javax.swing.JCheckBox(); jLabel8 = new javax.swing.JLabel(); jCheckSellIncTax = new javax.swing.JCheckBox(); jLabel12 = new javax.swing.JLabel(); jComboBuy = new javax.swing.JComboBox(); jLabel11 = new javax.swing.JLabel(); jComboTax = new javax.swing.JComboBox(); jLabel10 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jComboSell = new javax.swing.JComboBox(); jComboDefaultCategory = new javax.swing.JComboBox(); jLabel20 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jComboCategory = new javax.swing.JComboBox(); jComboName = new javax.swing.JComboBox(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jHeaderRead = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jTextUpdates = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); jTextRecords = new javax.swing.JTextField(); jTextNew = new javax.swing.JTextField(); jTextInvalid = new javax.swing.JTextField(); jTextUpdate = new javax.swing.JTextField(); jTextMissing = new javax.swing.JTextField(); jTextBadPrice = new javax.swing.JTextField(); jTextNoChange = new javax.swing.JTextField(); jLabel19 = new javax.swing.JLabel(); jTextBadCats = new javax.swing.JTextField(); jComboSeparator = new javax.swing.JComboBox(); jImport = new javax.swing.JButton(); setOpaque(false); setPreferredSize(new java.awt.Dimension(630, 430)); jLabel1.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("pos_messages"); // NOI18N jLabel1.setText(bundle.getString("label.csvfile")); // NOI18N jLabel1.setPreferredSize(new java.awt.Dimension(100, 30)); jFileName.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jFileName.setPreferredSize(new java.awt.Dimension(275, 30)); jFileName.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jFileNameActionPerformed(evt); } }); jbtnDbDriverLib .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/fileopen.png"))); // NOI18N jbtnDbDriverLib.setMaximumSize(new java.awt.Dimension(64, 32)); jbtnDbDriverLib.setMinimumSize(new java.awt.Dimension(64, 32)); jbtnDbDriverLib.setPreferredSize(new java.awt.Dimension(64, 32)); jbtnDbDriverLib.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnDbDriverLibActionPerformed(evt); } }); javax.swing.GroupLayout jFileChooserPanelLayout = new javax.swing.GroupLayout(jFileChooserPanel); jFileChooserPanel.setLayout(jFileChooserPanelLayout); jFileChooserPanelLayout.setHorizontalGroup(jFileChooserPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jFileChooserPanelLayout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jFileName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jbtnDbDriverLib, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(116, 116, 116))); jFileChooserPanelLayout.setVerticalGroup(jFileChooserPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jFileChooserPanelLayout.createSequentialGroup().addGroup(jFileChooserPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jFileName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jbtnDbDriverLib, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jComboReference.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboReference.setEnabled(false); jComboReference.setMinimumSize(new java.awt.Dimension(32, 25)); jComboReference.setOpaque(false); jComboReference.setPreferredSize(new java.awt.Dimension(275, 30)); jComboReference.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboReferenceItemStateChanged(evt); } }); jComboReference.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboReferenceFocusGained(evt); } }); jComboBarcode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboBarcode.setEnabled(false); jComboBarcode.setMinimumSize(new java.awt.Dimension(32, 25)); jComboBarcode.setPreferredSize(new java.awt.Dimension(275, 30)); jComboBarcode.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboBarcodeItemStateChanged(evt); } }); jComboBarcode.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboBarcodeFocusGained(evt); } }); jLabel3.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel3.setText(bundle.getString("label.prodref")); // NOI18N jLabel3.setPreferredSize(new java.awt.Dimension(100, 30)); jLabel4.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel4.setText(bundle.getString("label.prodbarcode")); // NOI18N jLabel4.setPreferredSize(new java.awt.Dimension(100, 30)); jCheckInCatalogue.setEnabled(false); jLabel8.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jLabel8.setText(bundle.getString("label.prodincatalog")); // NOI18N jCheckSellIncTax.setEnabled(false); jLabel12.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jLabel12.setText(bundle.getString("label.csvsellingintax")); // NOI18N jComboBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboBuy.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "" })); jComboBuy.setSelectedIndex(-1); jComboBuy.setEnabled(false); jComboBuy.setMinimumSize(new java.awt.Dimension(32, 25)); jComboBuy.setPreferredSize(new java.awt.Dimension(275, 30)); jComboBuy.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboBuyItemStateChanged(evt); } }); jComboBuy.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboBuyFocusGained(evt); } }); jLabel11.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel11.setText(bundle.getString("label.prodcategory")); // NOI18N jLabel11.setPreferredSize(new java.awt.Dimension(100, 30)); jComboTax.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboTax.setEnabled(false); jComboTax.setPreferredSize(new java.awt.Dimension(275, 30)); jLabel10.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel10.setText(bundle.getString("label.prodpricebuy")); // NOI18N jLabel10.setPreferredSize(new java.awt.Dimension(100, 30)); jLabel7.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel7.setText(bundle.getString("label.prodtaxcode")); // NOI18N jLabel7.setPreferredSize(new java.awt.Dimension(100, 30)); jComboSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboSell.setEnabled(false); jComboSell.setMinimumSize(new java.awt.Dimension(32, 25)); jComboSell.setPreferredSize(new java.awt.Dimension(275, 30)); jComboSell.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboSellItemStateChanged(evt); } }); jComboSell.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboSellFocusGained(evt); } }); jComboDefaultCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboDefaultCategory.setEnabled(false); jComboDefaultCategory.setMinimumSize(new java.awt.Dimension(32, 25)); jComboDefaultCategory.setPreferredSize(new java.awt.Dimension(275, 30)); jComboDefaultCategory.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboDefaulrCategoryItemStateChanged(evt); } }); jComboDefaultCategory.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jComboDefaultCategoryActionPerformed(evt); } }); jLabel20.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel20.setText(bundle.getString("label.prodpricesell")); // NOI18N jLabel20.setPreferredSize(new java.awt.Dimension(100, 30)); jLabel5.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel5.setText(bundle.getString("label.prodname")); // NOI18N jLabel5.setPreferredSize(new java.awt.Dimension(100, 30)); jLabel6.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel6.setText(bundle.getString("label.proddefaultcategory")); // NOI18N jLabel6.setPreferredSize(new java.awt.Dimension(100, 30)); jComboCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboCategory.setEnabled(false); jComboCategory.setMinimumSize(new java.awt.Dimension(32, 25)); jComboCategory.setName(""); // NOI18N jComboCategory.setPreferredSize(new java.awt.Dimension(275, 30)); jComboCategory.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboCategoryItemStateChanged(evt); } }); jComboCategory.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboCategoryFocusGained(evt); } }); jComboName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboName.setEnabled(false); jComboName.setMinimumSize(new java.awt.Dimension(32, 25)); jComboName.setPreferredSize(new java.awt.Dimension(275, 30)); jComboName.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboNameItemStateChanged(evt); } }); jComboName.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboNameFocusGained(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout .createSequentialGroup().addGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jComboDefaultCategory, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboTax, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel20, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jComboSell, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBuy, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboName, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboCategory, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jComboReference, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jComboBarcode, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jCheckInCatalogue, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jCheckSellIncTax) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboReference, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBarcode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(8, 8, 8) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboDefaultCategory, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboTax, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckInCatalogue) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jCheckSellIncTax).addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jLabel17.setFont(new java.awt.Font("Arial", 0, 10)); // NOI18N jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel17.setText("Import Version v2.3"); jLabel18.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel18.setText(bundle.getString("label.csvdelimit")); // NOI18N jLabel18.setPreferredSize(new java.awt.Dimension(100, 30)); jHeaderRead.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N jHeaderRead.setText(bundle.getString("label.csvread")); // NOI18N jHeaderRead.setEnabled(false); jHeaderRead.setPreferredSize(new java.awt.Dimension(120, 30)); jHeaderRead.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jHeaderReadActionPerformed(evt); } }); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder( new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true), bundle.getString("title.CSVImport"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(102, 102, 102))); // NOI18N jLabel9.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel9.setText(bundle.getString("label.csvrecordsfound")); // NOI18N jLabel9.setPreferredSize(new java.awt.Dimension(100, 25)); jLabel14.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel14.setText(bundle.getString("label.csvnewproducts")); // NOI18N jLabel14.setMaximumSize(new java.awt.Dimension(77, 14)); jLabel14.setMinimumSize(new java.awt.Dimension(77, 14)); jLabel14.setPreferredSize(new java.awt.Dimension(100, 25)); jLabel16.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel16.setText(bundle.getString("label.cvsinvalid")); // NOI18N jLabel16.setPreferredSize(new java.awt.Dimension(100, 25)); jTextUpdates.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jTextUpdates.setText(bundle.getString("label.csvpriceupdated")); // NOI18N jTextUpdates.setPreferredSize(new java.awt.Dimension(100, 25)); jLabel2.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel2.setText(bundle.getString("label.csvmissing")); // NOI18N jLabel2.setPreferredSize(new java.awt.Dimension(100, 25)); jLabel15.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel15.setText(bundle.getString("label.csvbad")); // NOI18N jLabel15.setPreferredSize(new java.awt.Dimension(100, 25)); jLabel13.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel13.setText(bundle.getString("label.cvsnotchanged")); // NOI18N jLabel13.setPreferredSize(new java.awt.Dimension(100, 25)); jTextRecords.setBackground(new java.awt.Color(224, 223, 227)); jTextRecords.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextRecords.setForeground(new java.awt.Color(102, 102, 102)); jTextRecords.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextRecords.setBorder(null); jTextRecords.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextRecords.setEnabled(false); jTextRecords.setPreferredSize(new java.awt.Dimension(70, 25)); jTextNew.setBackground(new java.awt.Color(224, 223, 227)); jTextNew.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextNew.setForeground(new java.awt.Color(102, 102, 102)); jTextNew.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextNew.setBorder(null); jTextNew.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextNew.setEnabled(false); jTextNew.setPreferredSize(new java.awt.Dimension(70, 25)); jTextInvalid.setBackground(new java.awt.Color(224, 223, 227)); jTextInvalid.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextInvalid.setForeground(new java.awt.Color(102, 102, 102)); jTextInvalid.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextInvalid.setBorder(null); jTextInvalid.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextInvalid.setEnabled(false); jTextInvalid.setPreferredSize(new java.awt.Dimension(70, 25)); jTextUpdate.setBackground(new java.awt.Color(224, 223, 227)); jTextUpdate.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextUpdate.setForeground(new java.awt.Color(102, 102, 102)); jTextUpdate.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextUpdate.setBorder(null); jTextUpdate.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextUpdate.setEnabled(false); jTextUpdate.setPreferredSize(new java.awt.Dimension(70, 25)); jTextUpdate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextUpdateActionPerformed(evt); } }); jTextMissing.setBackground(new java.awt.Color(224, 223, 227)); jTextMissing.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextMissing.setForeground(new java.awt.Color(102, 102, 102)); jTextMissing.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextMissing.setBorder(null); jTextMissing.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextMissing.setEnabled(false); jTextMissing.setPreferredSize(new java.awt.Dimension(70, 25)); jTextBadPrice.setBackground(new java.awt.Color(224, 223, 227)); jTextBadPrice.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextBadPrice.setForeground(new java.awt.Color(102, 102, 102)); jTextBadPrice.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextBadPrice.setBorder(null); jTextBadPrice.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextBadPrice.setEnabled(false); jTextBadPrice.setPreferredSize(new java.awt.Dimension(70, 25)); jTextNoChange.setBackground(new java.awt.Color(224, 223, 227)); jTextNoChange.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextNoChange.setForeground(new java.awt.Color(102, 102, 102)); jTextNoChange.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextNoChange.setBorder(null); jTextNoChange.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextNoChange.setEnabled(false); jTextNoChange.setPreferredSize(new java.awt.Dimension(70, 25)); jLabel19.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel19.setText(bundle.getString("label.cvsbadcats")); // NOI18N jLabel19.setPreferredSize(new java.awt.Dimension(100, 25)); jTextBadCats.setBackground(new java.awt.Color(224, 223, 227)); jTextBadCats.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextBadCats.setForeground(new java.awt.Color(102, 102, 102)); jTextBadCats.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextBadCats.setBorder(null); jTextBadCats.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextBadCats.setEnabled(false); jTextBadCats.setPreferredSize(new java.awt.Dimension(70, 25)); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextRecords, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel16, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTextUpdates, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel15, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextBadCats, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextNew, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextInvalid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextMissing, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextBadPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextNoChange, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(26, Short.MAX_VALUE))); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGap(0, 0, 0).addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextRecords, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextNew, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextInvalid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextUpdates, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextMissing, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextBadPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextNoChange, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextBadCats, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jComboSeparator.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jComboSeparator.setPreferredSize(new java.awt.Dimension(50, 30)); jImport.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N jImport.setText(bundle.getString("label.csvimpostbtn")); // NOI18N jImport.setEnabled(false); jImport.setPreferredSize(new java.awt.Dimension(120, 30)); jImport.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jImportActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(10, 10, 10).addComponent( jFileChooserPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout .createSequentialGroup() .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jComboSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(106, 106, 106).addComponent(jHeaderRead, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jImport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(8, 8, 8))) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 394, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE).addComponent(jLabel17))) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addComponent(jLabel17) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jFileChooserPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jHeaderRead, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jImport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); }
From source file:v800_trainer.JCicloTronic.java
/** This method is called from within the constructor to * initialize the form./* w w w . j ava 2s . c o m*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the FormEditor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; buttonGroup_Karte = new javax.swing.ButtonGroup(); Hauptfenster = new javax.swing.JTabbedPane(); Datenliste_Panel = new javax.swing.JPanel(); Datenliste_scroll_Panel = new javax.swing.JScrollPane(); Datentabelle = new javax.swing.JTable(); Datenliste_Jahr = new javax.swing.JComboBox(); Datenliste_Monat = new javax.swing.JComboBox(); jLabel11 = new javax.swing.JLabel(); jLabel51 = new javax.swing.JLabel(); Datenliste_Zeitabschnitt = new javax.swing.JComboBox(); jLabel65 = new javax.swing.JLabel(); jLabel66 = new javax.swing.JLabel(); Datenliste_TourTyp = new javax.swing.JComboBox(); jLabel68 = new javax.swing.JLabel(); jLabel69_Selektiert = new javax.swing.JLabel(); Datenliste_search = new javax.swing.JTextField(); Datenliste_searchButton = new javax.swing.JButton(); jLabel_search = new javax.swing.JLabel(); Info_Panel = new javax.swing.JPanel(); Auswahl_Info = new javax.swing.JComboBox(); Info_Titel = new javax.swing.JTextField(); Info_Vorname = new javax.swing.JTextField(); Info_Name = new javax.swing.JTextField(); Info_GebTag = new javax.swing.JTextField(); Info_Gewicht = new javax.swing.JTextField(); Info_Verein = new javax.swing.JTextField(); Info_Material = new javax.swing.JTextField(); Info_Materialgewicht = new javax.swing.JTextField(); Info_Startort = new javax.swing.JTextField(); Info_Zielort = new javax.swing.JTextField(); jLabel24Uhrzeit = new javax.swing.JLabel(); jLabel24 = new javax.swing.JLabel(); jLabel52 = new javax.swing.JLabel(); jLabel53 = new javax.swing.JLabel(); jLabel54 = new javax.swing.JLabel(); jLabel55 = new javax.swing.JLabel(); jLabel56 = new javax.swing.JLabel(); jLabel57 = new javax.swing.JLabel(); jLabel58 = new javax.swing.JLabel(); jLabel59 = new javax.swing.JLabel(); jLabel60 = new javax.swing.JLabel(); jLabel61 = new javax.swing.JLabel(); Info_Button_kopieren = new javax.swing.JButton(); Info_Button_einfgen = new javax.swing.JButton(); jScrollPane2 = new javax.swing.JScrollPane(); Info_Notiz = new javax.swing.JTextArea(); Info_Button_speichern = new javax.swing.JButton(); jLabel63 = new javax.swing.JLabel(); jLabel64 = new javax.swing.JLabel(); jLabel65Typ = new javax.swing.JLabel(); jLabel69 = new javax.swing.JLabel(); Info_Button_Suche_TrackLog = new javax.swing.JButton(); Info_Track_Log = new javax.swing.JTextField(); Statistik_Panel = new javax.swing.JPanel(); Auswahl_Statistik = new javax.swing.JComboBox(); jPanel2 = new javax.swing.JPanel(); Statistik_Hhe = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); Statistik_Minimale_Hhe = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); Statistik_Maximale_Hhe = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); Statistik_Summe_Hm_Steigung = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); Statistik_Summe_Hm_Geflle = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); Statistik_HM_pro_km = new javax.swing.JLabel(); Statistik_Geschwindigkeit = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); Statistik_Max_Geschw = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); Statistik_av_Geschw = new javax.swing.JLabel(); Statistik_Herzfrequenz = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); Statistik_max_HF = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); Statistik_av_HF = new javax.swing.JLabel(); Statistik_Steigung_m = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); Statistik_max_Steigung_m = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); Statistik_av_Steigung_m = new javax.swing.JLabel(); Statistik_Geflle_m = new javax.swing.JPanel(); jLabel12 = new javax.swing.JLabel(); Statistik_max_Geflle_m = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); Statistik_av_Geflle_m = new javax.swing.JLabel(); Statistik_Temperatur = new javax.swing.JPanel(); jLabel14 = new javax.swing.JLabel(); Statistik_min_Temp = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); Statistik_max_Temp = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); Statistik_av_Temp = new javax.swing.JLabel(); Statistik_Cadence = new javax.swing.JPanel(); jLabel18 = new javax.swing.JLabel(); Statistik_max_Cadence = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); Statistik_av_Cadence = new javax.swing.JLabel(); Statistik_Steigung_p = new javax.swing.JPanel(); jLabel20 = new javax.swing.JLabel(); Statistik_max_Steigung_p = new javax.swing.JLabel(); jLabel21 = new javax.swing.JLabel(); Statistik_av_Steigung_p = new javax.swing.JLabel(); Statistik_Geflle_p = new javax.swing.JPanel(); jLabel22 = new javax.swing.JLabel(); Statistik_max_Geflle_p = new javax.swing.JLabel(); jLabel23 = new javax.swing.JLabel(); Statistik_av_Geflle_p = new javax.swing.JLabel(); Statistik_Zeit = new javax.swing.JPanel(); jLabel47 = new javax.swing.JLabel(); Statistik_Zeit_absolut = new javax.swing.JLabel(); jLabel48 = new javax.swing.JLabel(); Statistik_Zeit_aktiv = new javax.swing.JLabel(); jPanel5 = new javax.swing.JPanel(); jLabel25 = new javax.swing.JLabel(); Statistik_Teilstrecke = new javax.swing.JLabel(); Statistik_Schrittlnge = new javax.swing.JPanel(); jLabel26 = new javax.swing.JLabel(); Statistik_max_Schrittlnge = new javax.swing.JLabel(); jLabel28 = new javax.swing.JLabel(); Statistik_av_Schrittlnge = new javax.swing.JLabel(); Statistik_Training = new javax.swing.JPanel(); jLabel29 = new javax.swing.JLabel(); Statistik_Belastung = new javax.swing.JLabel(); jLabel30 = new javax.swing.JLabel(); Statistik_Erholungszeit = new javax.swing.JLabel(); jLabel35 = new javax.swing.JLabel(); Statistik_Lauf_Index = new javax.swing.JLabel(); Statistik_Kalorien = new javax.swing.JPanel(); jLabel31 = new javax.swing.JLabel(); Statistik_Kalorien_absolut = new javax.swing.JLabel(); jLabel34 = new javax.swing.JLabel(); Statistik_Kalorien_h = new javax.swing.JLabel(); jLabel32 = new javax.swing.JLabel(); Statistik_Fett = new javax.swing.JLabel(); jLabel33 = new javax.swing.JLabel(); Statistik_Protein = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); Statistik_Titel = new javax.swing.JLabel(); Graphik_Panel = new javax.swing.JPanel(); Auswahl_Graphik = new javax.swing.JComboBox(); Graphik_Sub_Panel = new javax.swing.JPanel(); Graphik_check_Geschwindigkeit = new javax.swing.JCheckBox(); Graphik_check_Hhe = new javax.swing.JCheckBox(); Graphik_check_HF = new javax.swing.JCheckBox(); Graphik_check_Temp = new javax.swing.JCheckBox(); Graphik_check_Steigung_p = new javax.swing.JCheckBox(); Graphik_check_Steigung_m = new javax.swing.JCheckBox(); Graphik_check_Cadence = new javax.swing.JCheckBox(); Graphik_Radio_Strecke = new javax.swing.JRadioButton(); Graphik_Radio_Zeit = new javax.swing.JRadioButton(); Graphik_check_Abstand = new javax.swing.JCheckBox(); Graphik_check_av_Geschw = new javax.swing.JCheckBox(); Graphik_check_Schrittlnge = new javax.swing.JCheckBox(); Histogramm_Panel = new javax.swing.JPanel(); Auswahl_Histogramm = new javax.swing.JComboBox(); Summenhistogramm_Check = new javax.swing.JCheckBox(); jPanel1 = new javax.swing.JPanel(); jPanel18_HistoSP = new javax.swing.JPanel(); jPanel17_HistoHM = new javax.swing.JPanel(); jPanel16_HistoHF = new javax.swing.JPanel(); jPanel19_HistoCd = new javax.swing.JPanel(); jLabel26_Histotitel = new javax.swing.JLabel(); Map_Panel = new javax.swing.JPanel(); Auswahl_Map = new javax.swing.JComboBox(); LoadGoogleEarth = new javax.swing.JButton(); Kein_kmz_text = new javax.swing.JLabel(); Map_internal_Panel = new javax.swing.JPanel(); jLabel_map_streckenlnge = new javax.swing.JLabel(); jLabel27 = new javax.swing.JLabel(); Map_Type = new javax.swing.JComboBox<>(); Jahresuebersicht_Panel = new javax.swing.JPanel(); Auswahl_bersicht = new javax.swing.JComboBox(); JahrVergleich = new javax.swing.JComboBox(); jLabel67 = new javax.swing.JLabel(); jLabel70 = new javax.swing.JLabel(); jRadioButton_jahresverlauf = new javax.swing.JRadioButton(); jRadioButton_monatsbersicht = new javax.swing.JRadioButton(); jPanel17bersichtchart = new javax.swing.JPanel(); jMenuHaupt = new javax.swing.JMenuBar(); jMenuDatei = new javax.swing.JMenu(); jMenuOpen = new javax.swing.JMenuItem(); jMenuOpenall = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JSeparator(); jMenuLschen = new javax.swing.JMenuItem(); jMenuExit = new javax.swing.JMenuItem(); jMenu_V800_Laden = new javax.swing.JMenu(); jMenuTourEditor = new javax.swing.JMenu(); jMenuEinstellungen = new javax.swing.JMenu(); jMenuHilfe = new javax.swing.JMenu(); setTitle("HWCyclingData"); setPreferredSize(new java.awt.Dimension(800, 600)); addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { formComponentResized(evt); } }); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { exitForm(evt); } }); java.awt.GridBagLayout layout = new java.awt.GridBagLayout(); layout.columnWidths = new int[] { 0 }; layout.rowHeights = new int[] { 0 }; getContentPane().setLayout(layout); Hauptfenster.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); Hauptfenster.setAlignmentX(0.0F); Hauptfenster.setAlignmentY(0.0F); Hauptfenster.setAutoscrolls(true); Hauptfenster.setPreferredSize(new java.awt.Dimension(10, 10)); java.awt.GridBagLayout Datenliste_PanelLayout = new java.awt.GridBagLayout(); Datenliste_PanelLayout.columnWidths = new int[] { 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0 }; Datenliste_PanelLayout.rowHeights = new int[] { 0, 5, 0, 5, 0 }; Datenliste_Panel.setLayout(Datenliste_PanelLayout); Datenliste_scroll_Panel.setAutoscrolls(true); Datentabelle.setAutoCreateColumnsFromModel(false); Datentabelle.setFont(Datentabelle.getFont()); Datentabelle.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN); Datentabelle.setRowHeight(25); //ChangeModel(); Datentabelle.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { DatentabelleMouseDragged(evt); } }); Datentabelle.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { DatentabelleMouseClicked(evt); } }); Datenliste_scroll_Panel.setViewportView(Datentabelle); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 19; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 1; gridBagConstraints.ipady = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Datenliste_Panel.add(Datenliste_scroll_Panel, gridBagConstraints); Datenliste_Jahr.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Datenliste_JahrActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_Jahr, gridBagConstraints); Datenliste_Monat.setEnabled(false); InitComboMonat(); Datenliste_Monat.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Datenliste_MonatActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 12; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_Monat, gridBagConstraints); jLabel11.setText("Jahr whlen"); jLabel11.setToolTipText("Selektier alle Daten des entsprechenden Jahres"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel11, gridBagConstraints); jLabel51.setText("Monat whlen"); jLabel51.setToolTipText("Selektiert alle Daten des entsprechenden Monats"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 12; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel51, gridBagConstraints); Datenliste_Zeitabschnitt.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Datenliste_ZeitabschnittActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_Zeitabschnitt, gridBagConstraints); jLabel65.setText("Zeitraum whlen"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel65, gridBagConstraints); jLabel66.setText("Tour-Typ"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel66, gridBagConstraints); Datenliste_TourTyp.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Datenliste_TourTypActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_TourTyp, gridBagConstraints); jLabel68.setText("Selektierte Daten / von"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 14; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel68, gridBagConstraints); jLabel69_Selektiert.setText("' '"); jLabel69_Selektiert.setMaximumSize(new java.awt.Dimension(300, 50)); jLabel69_Selektiert.setMinimumSize(new java.awt.Dimension(300, 50)); jLabel69_Selektiert.setVerticalTextPosition(javax.swing.SwingConstants.TOP); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 14; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; Datenliste_Panel.add(jLabel69_Selektiert, gridBagConstraints); Datenliste_search.setToolTipText("~ Vorstellen um zu Deselektieren"); Datenliste_search.setMaximumSize(new java.awt.Dimension(200, 23)); Datenliste_search.setMinimumSize(new java.awt.Dimension(200, 23)); Datenliste_search.setPreferredSize(new java.awt.Dimension(200, 23)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 16; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_search, gridBagConstraints); Datenliste_searchButton.setText("Suchen"); Datenliste_searchButton.setMaximumSize(new java.awt.Dimension(200, 23)); Datenliste_searchButton.setMinimumSize(new java.awt.Dimension(200, 23)); Datenliste_searchButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Datenliste_searchButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 18; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_searchButton, gridBagConstraints); jLabel_search.setText("Eintrag im Titel suchen"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 16; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel_search, gridBagConstraints); Hauptfenster.addTab("Datenliste", null, Datenliste_Panel, ""); Info_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Info_PanelComponentShown(evt); } }); java.awt.GridBagLayout Info_PanelLayout = new java.awt.GridBagLayout(); Info_PanelLayout.columnWidths = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Info_PanelLayout.rowHeights = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Info_Panel.setLayout(Info_PanelLayout); Auswahl_Info.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_InfoActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 5; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Info_Panel.add(Auswahl_Info, gridBagConstraints); Info_Titel.setText("jTextField1"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 6; gridBagConstraints.gridwidth = 19; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Titel, gridBagConstraints); Info_Vorname.setText("jTextField4"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 10; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Vorname, gridBagConstraints); Info_Name.setText("jTextField5"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 10; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Name, gridBagConstraints); Info_GebTag.setText("jTextField6"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 14; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_GebTag, gridBagConstraints); Info_Gewicht.setText("jTextField7"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 14; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Gewicht, gridBagConstraints); Info_Verein.setText("jTextField8"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 18; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Verein, gridBagConstraints); Info_Material.setText("jTextField10"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 22; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Material, gridBagConstraints); Info_Materialgewicht.setText("jTextField9"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 22; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Materialgewicht, gridBagConstraints); Info_Startort.setText("jTextField2"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 26; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Startort, gridBagConstraints); Info_Zielort.setText("jTextField3"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 26; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Zielort, gridBagConstraints); jLabel24Uhrzeit.setText("jLabel24"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel24Uhrzeit, gridBagConstraints); jLabel24.setText("Titel"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel24, gridBagConstraints); jLabel52.setText("Vorname"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 8; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel52, gridBagConstraints); jLabel53.setText("Name"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 8; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel53, gridBagConstraints); jLabel54.setText("Geburtsdatum"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 12; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel54, gridBagConstraints); jLabel55.setText("Gewicht"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 12; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel55, gridBagConstraints); jLabel56.setText("Verein / Mitfahrer"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 16; gridBagConstraints.gridwidth = 17; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel56, gridBagConstraints); jLabel57.setText("Material"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 20; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel57, gridBagConstraints); jLabel58.setText("Materialgewicht"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 20; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel58, gridBagConstraints); jLabel59.setText("Startort"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 24; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel59, gridBagConstraints); jLabel60.setText("Zielort"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 24; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel60, gridBagConstraints); jLabel61.setText("Notiz"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 34; gridBagConstraints.gridwidth = 9; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel61, gridBagConstraints); Info_Button_kopieren.setText("Kopieren"); Info_Button_kopieren.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Info_Button_kopierenActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 18; gridBagConstraints.gridy = 18; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Button_kopieren, gridBagConstraints); Info_Button_einfgen.setText("Einfgen"); Info_Button_einfgen.setEnabled(false); Info_Button_einfgen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Info_Button_einfgenActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 18; gridBagConstraints.gridy = 22; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Button_einfgen, gridBagConstraints); Info_Notiz.setLineWrap(true); jScrollPane2.setViewportView(Info_Notiz); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 36; gridBagConstraints.gridwidth = 19; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Info_Panel.add(jScrollPane2, gridBagConstraints); Info_Button_speichern.setText("Speichern"); Info_Button_speichern.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Info_Button_speichernActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 18; gridBagConstraints.gridy = 26; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Button_speichern, gridBagConstraints); jLabel63.setText("Startzeit:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel63, gridBagConstraints); jLabel64.setText("Typ:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel64, gridBagConstraints); jLabel65Typ.setText("jLabel65"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 12; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel65Typ, gridBagConstraints); jLabel69.setText("Track Log"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 30; gridBagConstraints.gridwidth = 7; gridBagConstraints.ipady = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel69, gridBagConstraints); Info_Button_Suche_TrackLog.setText("..."); Info_Button_Suche_TrackLog.setToolTipText("Track Log ndern"); Info_Button_Suche_TrackLog.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Info_Button_Suche_TrackLogActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 18; gridBagConstraints.gridy = 32; gridBagConstraints.ipady = -3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Button_Suche_TrackLog, gridBagConstraints); Info_Track_Log.setText("jTextField1"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 32; gridBagConstraints.gridwidth = 17; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; Info_Panel.add(Info_Track_Log, gridBagConstraints); Hauptfenster.addTab("Infos", null, Info_Panel, ""); Statistik_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Statistik_PanelComponentShown_StatistikStarten(evt); } }); java.awt.GridBagLayout Statistik_PanelLayout1 = new java.awt.GridBagLayout(); Statistik_PanelLayout1.columnWidths = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Statistik_PanelLayout1.rowHeights = new int[] { 0, 10, 0, 10, 0, 10, 0, 10, 0 }; Statistik_Panel.setLayout(Statistik_PanelLayout1); Auswahl_Statistik.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_StatistikActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.BASELINE_LEADING; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Statistik_Panel.add(Auswahl_Statistik, gridBagConstraints); java.awt.GridBagLayout jPanel2Layout = new java.awt.GridBagLayout(); jPanel2Layout.columnWidths = new int[] { 0, 10, 0, 10, 0, 10, 0, 10, 0 }; jPanel2Layout.rowHeights = new int[] { 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0 }; jPanel2.setLayout(jPanel2Layout); Statistik_Hhe.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Hhe [m]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Hhe.setLayout(new java.awt.GridLayout(5, 2, 5, 5)); jLabel1.setText("min.:"); Statistik_Hhe.add(jLabel1); Statistik_Minimale_Hhe.setText("---"); Statistik_Minimale_Hhe.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); Statistik_Hhe.add(Statistik_Minimale_Hhe); jLabel2.setText("max.:"); Statistik_Hhe.add(jLabel2); Statistik_Maximale_Hhe.setText("---"); Statistik_Hhe.add(Statistik_Maximale_Hhe); jLabel3.setText("Hm +:"); Statistik_Hhe.add(jLabel3); Statistik_Summe_Hm_Steigung.setText("---"); Statistik_Hhe.add(Statistik_Summe_Hm_Steigung); jLabel4.setText("Hm -:"); Statistik_Hhe.add(jLabel4); Statistik_Summe_Hm_Geflle.setText("---"); Statistik_Hhe.add(Statistik_Summe_Hm_Geflle); jLabel17.setText("Hm/km:"); Statistik_Hhe.add(jLabel17); Statistik_HM_pro_km.setText("---"); Statistik_Hhe.add(Statistik_HM_pro_km); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 6; gridBagConstraints.gridheight = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Hhe, gridBagConstraints); Statistik_Geschwindigkeit .setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Geschwindigkeit [km/h]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Geschwindigkeit.setLayout(new java.awt.GridLayout(3, 2, 5, 5)); jLabel5.setText("max.:"); jLabel5.setToolTipText(""); Statistik_Geschwindigkeit.add(jLabel5); Statistik_Max_Geschw.setText("---"); Statistik_Geschwindigkeit.add(Statistik_Max_Geschw); jLabel6.setText("Durchschnitt:"); Statistik_Geschwindigkeit.add(jLabel6); Statistik_av_Geschw.setText("---"); Statistik_Geschwindigkeit.add(Statistik_av_Geschw); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Geschwindigkeit, gridBagConstraints); Statistik_Herzfrequenz.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Herzfrequenz [p/min]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Herzfrequenz.setLayout(new java.awt.GridLayout(3, 2, 5, 5)); jLabel7.setText("max.:"); Statistik_Herzfrequenz.add(jLabel7); Statistik_max_HF.setText("---"); Statistik_Herzfrequenz.add(Statistik_max_HF); jLabel8.setText("Durchschnitt:"); Statistik_Herzfrequenz.add(jLabel8); Statistik_av_HF.setText("---"); Statistik_Herzfrequenz.add(Statistik_av_HF); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Herzfrequenz, gridBagConstraints); Statistik_Steigung_m.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Steigung [m/min]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Steigung_m.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel9.setText("max.:"); Statistik_Steigung_m.add(jLabel9); Statistik_max_Steigung_m.setText("---"); Statistik_Steigung_m.add(Statistik_max_Steigung_m); jLabel10.setText("Durchschnitt:"); Statistik_Steigung_m.add(jLabel10); Statistik_av_Steigung_m.setText("---"); Statistik_Steigung_m.add(Statistik_av_Steigung_m); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 8; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Steigung_m, gridBagConstraints); Statistik_Geflle_m.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Geflle [m/min]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Geflle_m.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel12.setText("max.:"); Statistik_Geflle_m.add(jLabel12); Statistik_max_Geflle_m.setText("---"); Statistik_Geflle_m.add(Statistik_max_Geflle_m); jLabel13.setText("Durchschnitt:"); Statistik_Geflle_m.add(jLabel13); Statistik_av_Geflle_m.setText("---"); Statistik_Geflle_m.add(Statistik_av_Geflle_m); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 8; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Geflle_m, gridBagConstraints); Statistik_Temperatur.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Temperatur [C]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Temperatur.setLayout(new java.awt.GridLayout(3, 2, 5, 5)); jLabel14.setText("min.:"); Statistik_Temperatur.add(jLabel14); Statistik_min_Temp.setText("---"); Statistik_Temperatur.add(Statistik_min_Temp); jLabel15.setText("max.:"); Statistik_Temperatur.add(jLabel15); Statistik_max_Temp.setText("---"); Statistik_Temperatur.add(Statistik_max_Temp); jLabel16.setText("Durchschnitt:"); Statistik_Temperatur.add(jLabel16); Statistik_av_Temp.setText("---"); Statistik_Temperatur.add(Statistik_av_Temp); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Temperatur, gridBagConstraints); Statistik_Cadence.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cadence [n/min]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Cadence.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel18.setText("max.:"); Statistik_Cadence.add(jLabel18); Statistik_max_Cadence.setText("---"); Statistik_Cadence.add(Statistik_max_Cadence); jLabel19.setText("Durchschnitt:"); Statistik_Cadence.add(jLabel19); Statistik_av_Cadence.setText("---"); Statistik_Cadence.add(Statistik_av_Cadence); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 6; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Cadence, gridBagConstraints); Statistik_Steigung_p.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Steigung [%]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Steigung_p.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel20.setText("max.:"); Statistik_Steigung_p.add(jLabel20); Statistik_max_Steigung_p.setText("---"); Statistik_Steigung_p.add(Statistik_max_Steigung_p); jLabel21.setText("Durchschnitt:"); Statistik_Steigung_p.add(jLabel21); Statistik_av_Steigung_p.setText("---"); Statistik_Steigung_p.add(Statistik_av_Steigung_p); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 6; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Steigung_p, gridBagConstraints); Statistik_Geflle_p.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Geflle [%]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Geflle_p.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel22.setText("max.:"); Statistik_Geflle_p.add(jLabel22); Statistik_max_Geflle_p.setText("---"); Statistik_Geflle_p.add(Statistik_max_Geflle_p); jLabel23.setText("Durchschnitt:"); Statistik_Geflle_p.add(jLabel23); Statistik_av_Geflle_p.setText("---"); Statistik_Geflle_p.add(Statistik_av_Geflle_p); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 6; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Geflle_p, gridBagConstraints); Statistik_Zeit.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Zeit [hh:mm:ss]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Zeit.setLayout(new java.awt.GridLayout(3, 2, 5, 5)); jLabel47.setText("absolut:"); Statistik_Zeit.add(jLabel47); Statistik_Zeit_absolut.setText("---"); Statistik_Zeit.add(Statistik_Zeit_absolut); jLabel48.setText("gefahren:"); Statistik_Zeit.add(jLabel48); Statistik_Zeit_aktiv.setText("---"); Statistik_Zeit.add(Statistik_Zeit_aktiv); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Zeit, gridBagConstraints); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Zoom", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); jPanel5.setPreferredSize(new java.awt.Dimension(270, 65)); jPanel5.setLayout(new java.awt.GridLayout(1, 0)); jLabel25.setText("Teilstrecke: "); jLabel25.setMaximumSize(new java.awt.Dimension(200, 26)); jLabel25.setMinimumSize(new java.awt.Dimension(200, 26)); jLabel25.setPreferredSize(new java.awt.Dimension(200, 26)); jPanel5.add(jLabel25); Statistik_Teilstrecke.setText("jLabel26"); jPanel5.add(Statistik_Teilstrecke); Statistik_Teilstrecke.getAccessibleContext().setAccessibleName("jLabel26_Teilstrecke"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; jPanel2.add(jPanel5, gridBagConstraints); Statistik_Schrittlnge.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Schrittlnge [cm]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Schrittlnge.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel26.setText("max.:"); Statistik_Schrittlnge.add(jLabel26); Statistik_max_Schrittlnge.setText("---"); Statistik_Schrittlnge.add(Statistik_max_Schrittlnge); jLabel28.setText("Durchschnitt:"); Statistik_Schrittlnge.add(jLabel28); Statistik_av_Schrittlnge.setText("---"); Statistik_Schrittlnge.add(Statistik_av_Schrittlnge); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 8; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Schrittlnge, gridBagConstraints); Statistik_Training.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Training", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Training.setLayout(new java.awt.GridLayout(4, 2, 5, 5)); jLabel29.setText("Belastung:"); Statistik_Training.add(jLabel29); Statistik_Belastung.setText("---"); Statistik_Training.add(Statistik_Belastung); jLabel30.setText("Erholungszeit:"); Statistik_Training.add(jLabel30); Statistik_Erholungszeit.setText("---"); Statistik_Training.add(Statistik_Erholungszeit); jLabel35.setText("Lauf-Index:"); Statistik_Training.add(jLabel35); Statistik_Lauf_Index.setText("---"); Statistik_Training.add(Statistik_Lauf_Index); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 10; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Training, gridBagConstraints); Statistik_Kalorien.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Kalorien", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Kalorien.setLayout(new java.awt.GridLayout(4, 2, 5, 5)); jLabel31.setText("kCal"); Statistik_Kalorien.add(jLabel31); Statistik_Kalorien_absolut.setText("---"); Statistik_Kalorien.add(Statistik_Kalorien_absolut); jLabel34.setText("kCal/h"); Statistik_Kalorien.add(jLabel34); Statistik_Kalorien_h.setText("---"); Statistik_Kalorien.add(Statistik_Kalorien_h); jLabel32.setText("Fett [%]"); Statistik_Kalorien.add(jLabel32); Statistik_Fett.setText("---"); Statistik_Kalorien.add(Statistik_Fett); jLabel33.setText("Protein [%]"); Statistik_Kalorien.add(jLabel33); Statistik_Protein.setText("---"); Statistik_Kalorien.add(Statistik_Protein); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 10; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Kalorien, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 7; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Statistik_Panel.add(jPanel2, gridBagConstraints); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 8; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; gridBagConstraints.weighty = 100.0; Statistik_Panel.add(jPanel3, gridBagConstraints); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 100.0; Statistik_Panel.add(jPanel4, gridBagConstraints); Statistik_Titel.setText("jLabel26"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Statistik_Panel.add(Statistik_Titel, gridBagConstraints); Hauptfenster.addTab("Statistik", null, Statistik_Panel, ""); Graphik_Panel.setMinimumSize(new java.awt.Dimension(22, 22)); Graphik_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Graphik_PanelComponentShown(evt); } public void componentHidden(java.awt.event.ComponentEvent evt) { Graphik_PanelComponentHidden(evt); } }); java.awt.GridBagLayout Graphik_PanelLayout = new java.awt.GridBagLayout(); Graphik_PanelLayout.columnWidths = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Graphik_PanelLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0 }; Graphik_Panel.setLayout(Graphik_PanelLayout); Auswahl_Graphik.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_GraphikActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 1; gridBagConstraints.ipady = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Graphik_Panel.add(Auswahl_Graphik, gridBagConstraints); Graphik_Sub_Panel.setMinimumSize(new java.awt.Dimension(0, 0)); Graphik_Sub_Panel.setPreferredSize(new java.awt.Dimension(0, 0)); javax.swing.GroupLayout Graphik_Sub_PanelLayout = new javax.swing.GroupLayout(Graphik_Sub_Panel); Graphik_Sub_Panel.setLayout(Graphik_Sub_PanelLayout); Graphik_Sub_PanelLayout.setHorizontalGroup(Graphik_Sub_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Graphik_Sub_PanelLayout.setVerticalGroup(Graphik_Sub_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 15; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Graphik_Panel.add(Graphik_Sub_Panel, gridBagConstraints); Graphik_check_Geschwindigkeit.setText("Geschwindigkeit"); Graphik_check_Geschwindigkeit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_GeschwindigkeitActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 0; gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Geschwindigkeit, gridBagConstraints); Graphik_check_Hhe.setText("Hhe"); Graphik_check_Hhe.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_HheActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Hhe, gridBagConstraints); Graphik_check_HF.setText("Herzfrequenz"); Graphik_check_HF.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_HFActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_HF, gridBagConstraints); Graphik_check_Temp.setText("Temperatur"); Graphik_check_Temp.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_TempActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 14; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Temp, gridBagConstraints); Graphik_check_Steigung_p.setText("Steigung [%]"); Graphik_check_Steigung_p.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_Steigung_pActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 12; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Steigung_p, gridBagConstraints); Graphik_check_Steigung_m.setText("Steigung [m/min]"); Graphik_check_Steigung_m.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_Steigung_mActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 12; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Steigung_m, gridBagConstraints); Graphik_check_Cadence.setText("Cadence"); Graphik_check_Cadence.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_CadenceActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Cadence, gridBagConstraints); Graphik_Radio_Strecke.setSelected(true); Graphik_Radio_Strecke.setText("ber Strecke"); Graphik_Radio_Strecke.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_Radio_StreckeActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0); Graphik_Panel.add(Graphik_Radio_Strecke, gridBagConstraints); Graphik_Radio_Zeit.setText("ber Zeit"); Graphik_Radio_Zeit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_Radio_ZeitActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.ipady = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0); Graphik_Panel.add(Graphik_Radio_Zeit, gridBagConstraints); Graphik_check_Abstand.setText("Zeit- / Streckenabstand"); Graphik_check_Abstand.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_AbstandActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 14; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 27; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Abstand, gridBagConstraints); Graphik_check_av_Geschw.setText("av-Geschw."); Graphik_check_av_Geschw.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_av_GeschwActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_av_Geschw, gridBagConstraints); Graphik_check_Schrittlnge.setText("Schrittlnge"); Graphik_check_Schrittlnge.setToolTipText(""); Graphik_check_Schrittlnge.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_SchrittlngeActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Schrittlnge, gridBagConstraints); Hauptfenster.addTab("Graphik", null, Graphik_Panel, ""); Histogramm_Panel.setMinimumSize(new java.awt.Dimension(22, 22)); Histogramm_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Histogramm_PanelComponentShown(evt); } }); java.awt.GridBagLayout Histogramm_PanelLayout = new java.awt.GridBagLayout(); Histogramm_PanelLayout.columnWidths = new int[] { 0, 5, 0, 5, 0 }; Histogramm_PanelLayout.rowHeights = new int[] { 0, 0, 0, 0, 0 }; Histogramm_Panel.setLayout(Histogramm_PanelLayout); Auswahl_Histogramm.setAlignmentX(0.0F); Auswahl_Histogramm.setAlignmentY(0.0F); Auswahl_Histogramm.setMinimumSize(new java.awt.Dimension(200, 20)); Auswahl_Histogramm.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_HistogrammActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Histogramm_Panel.add(Auswahl_Histogramm, gridBagConstraints); Summenhistogramm_Check.setText("Summenhistogramme"); Summenhistogramm_Check.setAlignmentY(0.0F); Summenhistogramm_Check.setMaximumSize(new java.awt.Dimension(32767, 32767)); Summenhistogramm_Check.setMinimumSize(new java.awt.Dimension(300, 23)); Summenhistogramm_Check.setOpaque(false); Summenhistogramm_Check.setPreferredSize(new java.awt.Dimension(300, 23)); Summenhistogramm_Check.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Summenhistogramm_CheckActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Histogramm_Panel.add(Summenhistogramm_Check, gridBagConstraints); jPanel1.setLayout(new java.awt.GridBagLayout()); jPanel18_HistoSP.setAlignmentX(0.0F); jPanel18_HistoSP.setAlignmentY(0.0F); javax.swing.GroupLayout jPanel18_HistoSPLayout = new javax.swing.GroupLayout(jPanel18_HistoSP); jPanel18_HistoSP.setLayout(jPanel18_HistoSPLayout); jPanel18_HistoSPLayout.setHorizontalGroup(jPanel18_HistoSPLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel18_HistoSPLayout.setVerticalGroup(jPanel18_HistoSPLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; gridBagConstraints.weightx = 0.5; gridBagConstraints.weighty = 0.5; jPanel1.add(jPanel18_HistoSP, gridBagConstraints); jPanel17_HistoHM.setAlignmentX(0.0F); jPanel17_HistoHM.setAlignmentY(0.0F); javax.swing.GroupLayout jPanel17_HistoHMLayout = new javax.swing.GroupLayout(jPanel17_HistoHM); jPanel17_HistoHM.setLayout(jPanel17_HistoHMLayout); jPanel17_HistoHMLayout.setHorizontalGroup(jPanel17_HistoHMLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel17_HistoHMLayout.setVerticalGroup(jPanel17_HistoHMLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST; gridBagConstraints.weightx = 0.5; gridBagConstraints.weighty = 0.5; jPanel1.add(jPanel17_HistoHM, gridBagConstraints); jPanel16_HistoHF.setAlignmentX(0.0F); jPanel16_HistoHF.setAlignmentY(0.0F); javax.swing.GroupLayout jPanel16_HistoHFLayout = new javax.swing.GroupLayout(jPanel16_HistoHF); jPanel16_HistoHF.setLayout(jPanel16_HistoHFLayout); jPanel16_HistoHFLayout.setHorizontalGroup(jPanel16_HistoHFLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel16_HistoHFLayout.setVerticalGroup(jPanel16_HistoHFLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 0.5; gridBagConstraints.weighty = 0.5; jPanel1.add(jPanel16_HistoHF, gridBagConstraints); jPanel19_HistoCd.setAlignmentX(0.0F); jPanel19_HistoCd.setAlignmentY(0.0F); javax.swing.GroupLayout jPanel19_HistoCdLayout = new javax.swing.GroupLayout(jPanel19_HistoCd); jPanel19_HistoCd.setLayout(jPanel19_HistoCdLayout); jPanel19_HistoCdLayout.setHorizontalGroup(jPanel19_HistoCdLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel19_HistoCdLayout.setVerticalGroup(jPanel19_HistoCdLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST; gridBagConstraints.weightx = 0.5; gridBagConstraints.weighty = 0.5; jPanel1.add(jPanel19_HistoCd, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 5; gridBagConstraints.gridheight = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Histogramm_Panel.add(jPanel1, gridBagConstraints); jLabel26_Histotitel.setText("jLabel26"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; Histogramm_Panel.add(jLabel26_Histotitel, gridBagConstraints); Hauptfenster.addTab("Histogramme", null, Histogramm_Panel, ""); Map_Panel.setPreferredSize(new java.awt.Dimension(594, 400)); Map_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Map_PanelComponentShown(evt); } }); java.awt.GridBagLayout Map_PanelLayout = new java.awt.GridBagLayout(); Map_PanelLayout.columnWidths = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Map_PanelLayout.rowHeights = new int[] { 0, 5, 0, 5, 0 }; Map_Panel.setLayout(Map_PanelLayout); Auswahl_Map.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_MapActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Map_Panel.add(Auswahl_Map, gridBagConstraints); LoadGoogleEarth.setText("Google Earth"); LoadGoogleEarth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { LoadGoogleEarthActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Map_Panel.add(LoadGoogleEarth, gridBagConstraints); Kein_kmz_text.setText("Kein Log File"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Map_Panel.add(Kein_kmz_text, gridBagConstraints); Map_internal_Panel.setLayout(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 11; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Map_Panel.add(Map_internal_Panel, gridBagConstraints); jLabel_map_streckenlnge.setText("jLabel26"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 0; Map_Panel.add(jLabel_map_streckenlnge, gridBagConstraints); jLabel27.setText("GPS Lnge:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; Map_Panel.add(jLabel27, gridBagConstraints); Map_Type.setModel( new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); Map_Type.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Map_TypeActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Map_Panel.add(Map_Type, gridBagConstraints); Hauptfenster.addTab("Landkarte", Map_Panel); Jahresuebersicht_Panel.setPreferredSize(new java.awt.Dimension(688, 400)); Jahresuebersicht_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Jahresuebersicht_PanelComponentShown(evt); } }); java.awt.GridBagLayout Jahresuebersicht_PanelLayout = new java.awt.GridBagLayout(); Jahresuebersicht_PanelLayout.columnWidths = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Jahresuebersicht_PanelLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; Jahresuebersicht_Panel.setLayout(Jahresuebersicht_PanelLayout); Auswahl_bersicht.setMinimumSize(new java.awt.Dimension(200, 20)); Auswahl_bersicht.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_bersichtActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(Auswahl_bersicht, gridBagConstraints); JahrVergleich.setMinimumSize(new java.awt.Dimension(200, 20)); JahrVergleich.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { JahrVergleichActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(JahrVergleich, gridBagConstraints); jLabel67.setText("Vergleich mit Jahr:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(jLabel67, gridBagConstraints); jLabel70.setText(" Jahr:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(jLabel70, gridBagConstraints); jRadioButton_jahresverlauf.setSelected(true); jRadioButton_jahresverlauf.setText("Jahresverlauf"); jRadioButton_jahresverlauf.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton_jahresverlaufActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(jRadioButton_jahresverlauf, gridBagConstraints); jRadioButton_monatsbersicht.setText("Monatsbersicht"); jRadioButton_monatsbersicht.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton_monatsbersichtActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(jRadioButton_monatsbersicht, gridBagConstraints); jPanel17bersichtchart .setLayout(new javax.swing.BoxLayout(jPanel17bersichtchart, javax.swing.BoxLayout.LINE_AXIS)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 11; gridBagConstraints.gridheight = 7; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Jahresuebersicht_Panel.add(jPanel17bersichtchart, gridBagConstraints); Hauptfenster.addTab("Jahresbersicht", null, Jahresuebersicht_Panel, ""); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(Hauptfenster, gridBagConstraints); jMenuDatei.setLabel("Datei "); jMenuOpen.setText("Rohdaten Importieren"); jMenuOpen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuOpenActionPerformed(evt); } }); jMenuDatei.add(jMenuOpen); jMenuOpenall.setText("Alle Rohdaten Importieren"); jMenuOpenall.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuOpenallActionPerformed(evt); } }); jMenuDatei.add(jMenuOpenall); jMenuDatei.add(jSeparator1); jMenuLschen.setText("Lschen"); jMenuLschen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuLschenActionPerformed(evt); } }); jMenuDatei.add(jMenuLschen); jMenuExit.setText("Beenden"); jMenuExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuExitActionPerformed(evt); } }); jMenuDatei.add(jMenuExit); jMenuHaupt.add(jMenuDatei); jMenu_V800_Laden.setText("Daten Empfangen "); jMenu_V800_Laden.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jMenu_V800_LadenMouseClicked(evt); } }); jMenuHaupt.add(jMenu_V800_Laden); jMenuTourEditor.setLabel("Tour Editor "); jMenuTourEditor.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jMenuTourEditorMouseClicked(evt); } }); jMenuHaupt.add(jMenuTourEditor); jMenuTourEditor.getAccessibleContext().setAccessibleName("Tour Editor"); jMenuEinstellungen.setLabel("Einstellungen "); jMenuEinstellungen.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jMenuEinstellungenMouseClicked(evt); } }); jMenuHaupt.add(jMenuEinstellungen); jMenuHilfe.setText("Hilfe"); jMenuHilfe.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jMenuHilfeMouseClicked(evt); } }); jMenuHaupt.add(jMenuHilfe); setJMenuBar(jMenuHaupt); pack(); }
From source file:br.com.jinsync.view.FrmJInSync.java
private void loadLayoutTableFile() { int i = 0;//from w w w. j a v a 2 s . c o m tableFile.setModel(tableFileModel); DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer(); rightRenderer.setHorizontalAlignment(SwingConstants.RIGHT); DefaultTableCellRenderer leftRenderer = new DefaultTableCellRenderer(); leftRenderer.setHorizontalAlignment(SwingConstants.LEFT); for (i = 0; i < defField.size(); i++) { if (defField.get(i).equals("Zoned Decimal") || defField.get(i).equals("Binary") || defField.get(i).equals("Packed Decimal")) { tableFile.getColumnModel().getColumn(i).setCellRenderer(rightRenderer); } else { tableFile.getColumnModel().getColumn(i).setCellRenderer(leftRenderer); } } for (i = 0; i < columnNamesFile.length; i++) { int teste = columnNamesFile[i].length(); if (teste == 3) { teste = 5; } tableFile.getColumnModel().getColumn(i).setPreferredWidth(teste * 8); } tableFile.getTableHeader().setReorderingAllowed(false); tableFile.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); scrFile.setViewportView(tableFile); }
From source file:com.willwinder.universalgcodesender.MainWindow.java
/** This method is called from within the constructor to * initialize the form.//ww w . j a v a 2s. c o m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; lineBreakGroup = new javax.swing.ButtonGroup(); jTabbedPane1 = new javax.swing.JTabbedPane(); jMenuItem1 = new javax.swing.JMenuItem(); jMenuItem3 = new javax.swing.JMenuItem(); jMenuItem4 = new javax.swing.JMenuItem(); jogUnitsGroup = new javax.swing.ButtonGroup(); scrollWindowCheckBox = new javax.swing.JCheckBox(); bottomTabbedPane = new javax.swing.JTabbedPane(); commandsPanel = new javax.swing.JPanel(); commandLabel = new javax.swing.JLabel(); commandTextField = new com.willwinder.universalgcodesender.uielements.CommandTextArea(backend); consoleScrollPane = new javax.swing.JScrollPane(); consoleTextArea = new javax.swing.JTextArea(); commandTableScrollPane = new javax.swing.JScrollPane(); commandTable = new com.willwinder.universalgcodesender.uielements.GcodeTable(); controlContextTabbedPane = new javax.swing.JTabbedPane(); machineControlPanel = new javax.swing.JPanel(); helpButtonMachineControl = new javax.swing.JButton(); resetYButton = new javax.swing.JButton(); softResetMachineControl = new javax.swing.JButton(); requestStateInformation = new javax.swing.JButton(); returnToZeroButton = new javax.swing.JButton(); toggleCheckMode = new javax.swing.JButton(); resetCoordinatesButton = new javax.swing.JButton(); performHomingCycleButton = new javax.swing.JButton(); killAlarmLock = new javax.swing.JButton(); resetXButton = new javax.swing.JButton(); resetZButton = new javax.swing.JButton(); keyboardMovementPanel = new javax.swing.JPanel(); stepSizeSpinner = new javax.swing.JSpinner(); arrowMovementEnabled = new javax.swing.JCheckBox(); movementButtonPanel = new javax.swing.JPanel(); zMinusButton = new javax.swing.JButton(); yMinusButton = new javax.swing.JButton(); xPlusButton = new javax.swing.JButton(); xMinusButton = new javax.swing.JButton(); zPlusButton = new javax.swing.JButton(); yPlusButton = new javax.swing.JButton(); stepSizeLabel = new javax.swing.JLabel(); inchRadioButton = new javax.swing.JRadioButton(); mmRadioButton = new javax.swing.JRadioButton(); macroPane = new javax.swing.JScrollPane(); macroPanel = new com.willwinder.universalgcodesender.uielements.MacroPanel(settings, backend); connectionPanel = new javax.swing.JPanel(); commPortComboBox = new javax.swing.JComboBox(); baudrateSelectionComboBox = new javax.swing.JComboBox(); opencloseButton = new javax.swing.JButton(); refreshButton = new javax.swing.JButton(); baudLabel = new javax.swing.JLabel(); portLabel = new javax.swing.JLabel(); firmwareLabel = new javax.swing.JLabel(); firmwareComboBox = new javax.swing.JComboBox(); showVerboseOutputCheckBox = new javax.swing.JCheckBox(); statusPanel = new javax.swing.JPanel(); activeStateLabel = new javax.swing.JLabel(); activeStateValueLabel = new javax.swing.JLabel(); machinePosition = new javax.swing.JLabel(); machinePositionXLabel = new javax.swing.JLabel(); machinePositionYLabel = new javax.swing.JLabel(); machinePositionZLabel = new javax.swing.JLabel(); workPositionLabel = new javax.swing.JLabel(); workPositionXLabel = new javax.swing.JLabel(); workPositionYLabel = new javax.swing.JLabel(); workPositionZLabel = new javax.swing.JLabel(); machinePositionXValueLabel = new javax.swing.JLabel(); machinePositionYValueLabel = new javax.swing.JLabel(); machinePositionZValueLabel = new javax.swing.JLabel(); workPositionXValueLabel = new javax.swing.JLabel(); workPositionYValueLabel = new javax.swing.JLabel(); workPositionZValueLabel = new javax.swing.JLabel(); latestCommentValueLabel = new javax.swing.JLabel(); latestCommentLabel = new javax.swing.JLabel(); showCommandTableCheckBox = new javax.swing.JCheckBox(); fileModePanel = new javax.swing.JPanel(); sendButton = new javax.swing.JButton(); pauseButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); visualizeButton = new javax.swing.JButton(); browseButton = new javax.swing.JButton(); saveButton = new javax.swing.JButton(); fileRunPanel = new javax.swing.JPanel(); remainingTimeValueLabel = new javax.swing.JLabel(); sentRowsValueLabel = new javax.swing.JLabel(); remainingRowsLabel = new javax.swing.JLabel(); rowsValueLabel = new javax.swing.JLabel(); remainingTimeLabel = new javax.swing.JLabel(); durationValueLabel = new javax.swing.JLabel(); durationLabel = new javax.swing.JLabel(); remainingRowsValueLabel = new javax.swing.JLabel(); sentRowsLabel = new javax.swing.JLabel(); rowsLabel = new javax.swing.JLabel(); mainMenuBar = new javax.swing.JMenuBar(); settingsMenu = new javax.swing.JMenu(); grblConnectionSettingsMenuItem = new javax.swing.JMenuItem(); firmwareSettingsMenu = new javax.swing.JMenu(); grblFirmwareSettingsMenuItem = new javax.swing.JMenuItem(); PendantMenu = new javax.swing.JMenu(); startPendantServerButton = new javax.swing.JMenuItem(); stopPendantServerButton = new javax.swing.JMenuItem(); jMenuItem1.setText("jMenuItem1"); jMenuItem3.setText("jMenuItem3"); jMenuItem4.setText("jMenuItem4"); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setMinimumSize(new java.awt.Dimension(640, 520)); scrollWindowCheckBox.setSelected(true); scrollWindowCheckBox.setText("Scroll output window"); scrollWindowCheckBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { scrollWindowCheckBoxActionPerformed(evt); } }); bottomTabbedPane.setBorder(javax.swing.BorderFactory.createTitledBorder("")); bottomTabbedPane.setMinimumSize(new java.awt.Dimension(0, 0)); bottomTabbedPane.setPreferredSize(new java.awt.Dimension(468, 100)); commandsPanel.setLayout(new java.awt.GridBagLayout()); commandLabel.setText("Command"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; commandsPanel.add(commandLabel, gridBagConstraints); commandTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { commandTextFieldActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; commandsPanel.add(commandTextField, gridBagConstraints); consoleTextArea.setEditable(false); consoleTextArea.setColumns(20); consoleTextArea.setDocument(new LengthLimitedDocument(consoleSize)); consoleTextArea.setRows(5); consoleTextArea.setMaximumSize(new java.awt.Dimension(32767, 32767)); consoleTextArea.setMinimumSize(new java.awt.Dimension(0, 0)); consoleScrollPane.setViewportView(consoleTextArea); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; commandsPanel.add(consoleScrollPane, gridBagConstraints); bottomTabbedPane.addTab("Commands", commandsPanel); commandTable.setMaximumSize(new java.awt.Dimension(32767, 32767)); commandTable.getTableHeader().setReorderingAllowed(false); commandTableScrollPane.setViewportView(commandTable); bottomTabbedPane.addTab("Command Table", commandTableScrollPane); controlContextTabbedPane.setBorder(javax.swing.BorderFactory.createTitledBorder("")); controlContextTabbedPane.setMinimumSize(new java.awt.Dimension(395, 175)); controlContextTabbedPane.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { controlContextTabbedPaneComponentShown(evt); } }); helpButtonMachineControl.setText("Help"); helpButtonMachineControl.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { helpButtonMachineControlActionPerformed(evt); } }); resetYButton.setText("Reset Y Axis"); resetYButton.setEnabled(false); resetYButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { resetYCoordinateButtonActionPerformed(evt); } }); softResetMachineControl.setText("Soft Reset"); softResetMachineControl.setEnabled(false); softResetMachineControl.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { softResetMachineControlActionPerformed(evt); } }); requestStateInformation.setText("$G"); requestStateInformation.setEnabled(false); requestStateInformation.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { requestStateInformationActionPerformed(evt); } }); returnToZeroButton.setText("Return to Zero"); returnToZeroButton.setEnabled(false); returnToZeroButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { returnToZeroButtonActionPerformed(evt); } }); toggleCheckMode.setText("$C"); toggleCheckMode.setEnabled(false); toggleCheckMode.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { toggleCheckModeActionPerformed(evt); } }); resetCoordinatesButton.setText("Reset Zero"); resetCoordinatesButton.setEnabled(false); resetCoordinatesButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { resetCoordinatesButtonActionPerformed(evt); } }); performHomingCycleButton.setText("$H"); performHomingCycleButton.setEnabled(false); performHomingCycleButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { performHomingCycleButtonActionPerformed(evt); } }); killAlarmLock.setText("$X"); killAlarmLock.setEnabled(false); killAlarmLock.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { killAlarmLockActionPerformed(evt); } }); resetXButton.setText("Reset X Axis"); resetXButton.setEnabled(false); resetXButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { resetXCoordinateButtonActionPerformed(evt); } }); resetZButton.setText("Reset Z Axis"); resetZButton.setEnabled(false); resetZButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { resetZCoordinateButtonActionPerformed(evt); } }); keyboardMovementPanel.setPreferredSize(new java.awt.Dimension(247, 180)); stepSizeSpinner.setModel(new StepSizeSpinnerModel(1.0, 0.0, null, 1.0)); stepSizeSpinner.setEnabled(false); stepSizeSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { stepSizeSpinnerStateChanged(evt); } }); arrowMovementEnabled.setText("Enable Keyboard Movement"); arrowMovementEnabled.setEnabled(false); zMinusButton.setText("Z-"); zMinusButton.setEnabled(false); zMinusButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { zMinusButtonActionPerformed(evt); } }); yMinusButton.setText("Y-"); yMinusButton.setEnabled(false); yMinusButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { yMinusButtonActionPerformed(evt); } }); xPlusButton.setText("X+"); xPlusButton.setEnabled(false); xPlusButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { xPlusButtonActionPerformed(evt); } }); xMinusButton.setText("X-"); xMinusButton.setEnabled(false); xMinusButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { xMinusButtonActionPerformed(evt); } }); zPlusButton.setText("Z+"); zPlusButton.setEnabled(false); zPlusButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { zPlusButtonActionPerformed(evt); } }); yPlusButton.setText("Y+"); yPlusButton.setEnabled(false); yPlusButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { yPlusButtonActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout movementButtonPanelLayout = new org.jdesktop.layout.GroupLayout( movementButtonPanel); movementButtonPanel.setLayout(movementButtonPanelLayout); movementButtonPanelLayout.setHorizontalGroup(movementButtonPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(movementButtonPanelLayout.createSequentialGroup() .add(xMinusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(movementButtonPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(yPlusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(yMinusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(xPlusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(movementButtonPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, zMinusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, zPlusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))); movementButtonPanelLayout.setVerticalGroup( movementButtonPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(movementButtonPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER) .add(xMinusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(xPlusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(movementButtonPanelLayout.createSequentialGroup() .add(yPlusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(yMinusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(movementButtonPanelLayout.createSequentialGroup() .add(zPlusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(zMinusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))); stepSizeLabel.setText("Step size:"); stepSizeLabel.setEnabled(false); jogUnitsGroup.add(inchRadioButton); inchRadioButton.setText("inch"); inchRadioButton.setEnabled(false); inchRadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { inchRadioButtonActionPerformed(evt); } }); jogUnitsGroup.add(mmRadioButton); mmRadioButton.setText("millimeters"); mmRadioButton.setEnabled(false); mmRadioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { mmRadioButtonActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout keyboardMovementPanelLayout = new org.jdesktop.layout.GroupLayout( keyboardMovementPanel); keyboardMovementPanel.setLayout(keyboardMovementPanelLayout); keyboardMovementPanelLayout.setHorizontalGroup(keyboardMovementPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(keyboardMovementPanelLayout.createSequentialGroup().add(keyboardMovementPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(arrowMovementEnabled) .add(keyboardMovementPanelLayout.createSequentialGroup().addContainerGap() .add(keyboardMovementPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(keyboardMovementPanelLayout.createSequentialGroup() .add(keyboardMovementPanelLayout .createParallelGroup( org.jdesktop.layout.GroupLayout.LEADING) .add(inchRadioButton).add(stepSizeLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(keyboardMovementPanelLayout .createParallelGroup( org.jdesktop.layout.GroupLayout.LEADING) .add(stepSizeSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(mmRadioButton))) .add(movementButtonPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(23, Short.MAX_VALUE))); keyboardMovementPanelLayout.setVerticalGroup(keyboardMovementPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(keyboardMovementPanelLayout.createSequentialGroup().add(arrowMovementEnabled) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(keyboardMovementPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(stepSizeLabel) .add(stepSizeSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(keyboardMovementPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER) .add(inchRadioButton).add(mmRadioButton)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(movementButtonPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(46, Short.MAX_VALUE))); keyboardMovementPanelLayout.linkSize(new java.awt.Component[] { stepSizeLabel, stepSizeSpinner }, org.jdesktop.layout.GroupLayout.VERTICAL); org.jdesktop.layout.GroupLayout machineControlPanelLayout = new org.jdesktop.layout.GroupLayout( machineControlPanel); machineControlPanel.setLayout(machineControlPanelLayout); machineControlPanelLayout.setHorizontalGroup(machineControlPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(machineControlPanelLayout.createSequentialGroup().add(machineControlPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(machineControlPanelLayout.createSequentialGroup() .add(requestStateInformation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 49, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(helpButtonMachineControl)) .add(resetCoordinatesButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 159, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(returnToZeroButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 159, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(softResetMachineControl, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 159, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(machineControlPanelLayout.createSequentialGroup() .add(performHomingCycleButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 49, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(6, 6, 6) .add(killAlarmLock, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 49, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(6, 6, 6).add(toggleCheckMode, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 49, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .add(6, 6, 6) .add(machineControlPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(resetXButton).add(resetYButton).add(resetZButton)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 65, Short.MAX_VALUE) .add(keyboardMovementPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))); machineControlPanelLayout.setVerticalGroup(machineControlPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(machineControlPanelLayout.createSequentialGroup().add(machineControlPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(machineControlPanelLayout.createSequentialGroup().add(resetCoordinatesButton) .add(6, 6, 6).add(returnToZeroButton).add(6, 6, 6).add(softResetMachineControl) .add(6, 6, 6) .add(machineControlPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(performHomingCycleButton).add(killAlarmLock).add(toggleCheckMode)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(machineControlPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(requestStateInformation).add(helpButtonMachineControl))) .add(machineControlPanelLayout.createSequentialGroup().add(resetXButton).add(6, 6, 6) .add(resetYButton).add(6, 6, 6).add(resetZButton))) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(keyboardMovementPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 233, Short.MAX_VALUE)); controlContextTabbedPane.addTab("Machine Control", machineControlPanel); macroPane.setViewportView(macroPanel); controlContextTabbedPane.addTab("Macros", macroPane); connectionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Connection")); connectionPanel.setMaximumSize(new java.awt.Dimension(247, 100)); connectionPanel.setMinimumSize(new java.awt.Dimension(247, 100)); connectionPanel.setName("Connection"); // NOI18N connectionPanel.setPreferredSize(new java.awt.Dimension(247, 100)); commPortComboBox.setEditable(true); baudrateSelectionComboBox.setModel(new javax.swing.DefaultComboBoxModel( new String[] { "2400", "4800", "9600", "19200", "38400", "57600", "115200" })); baudrateSelectionComboBox.setSelectedIndex(2); baudrateSelectionComboBox.setToolTipText("Select baudrate to use for the serial port."); baudrateSelectionComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { baudrateSelectionComboBoxActionPerformed(evt); } }); opencloseButton.setText("Open"); opencloseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { opencloseButtonActionPerformed(evt); } }); refreshButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/refresh.gif"))); // NOI18N refreshButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { refreshButtonActionPerformed(evt); } }); baudLabel.setText("Baud:"); portLabel.setText("Port:"); firmwareLabel.setText("Firmware:"); org.jdesktop.layout.GroupLayout connectionPanelLayout = new org.jdesktop.layout.GroupLayout( connectionPanel); connectionPanel.setLayout(connectionPanelLayout); connectionPanelLayout.setHorizontalGroup(connectionPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(connectionPanelLayout.createSequentialGroup().addContainerGap().add(connectionPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(org.jdesktop.layout.GroupLayout.TRAILING, connectionPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(connectionPanelLayout.createSequentialGroup().add(portLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(commPortComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 183, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(connectionPanelLayout.createSequentialGroup().add(baudLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(baudrateSelectionComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(refreshButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(opencloseButton))) .add(connectionPanelLayout.createSequentialGroup().add(firmwareLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(firmwareComboBox, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addContainerGap())); connectionPanelLayout.setVerticalGroup(connectionPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(connectionPanelLayout.createSequentialGroup() .add(connectionPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(commPortComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(portLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(connectionPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(connectionPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(baudLabel).add(baudrateSelectionComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(refreshButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(opencloseButton)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(connectionPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(firmwareLabel).add(firmwareComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); showVerboseOutputCheckBox.setText("Show verbose output"); statusPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Machine status")); statusPanel.setMinimumSize(new java.awt.Dimension(247, 160)); statusPanel.setPreferredSize(new java.awt.Dimension(247, 160)); activeStateLabel.setText("Active State:"); activeStateLabel.setOpaque(true); activeStateValueLabel.setText(" "); activeStateValueLabel.setOpaque(true); machinePosition.setText("Machine Position:"); machinePositionXLabel.setText("X:"); machinePositionYLabel.setText("Y:"); machinePositionZLabel.setText("Z:"); workPositionLabel.setText("Work Position:"); workPositionXLabel.setText("X:"); workPositionYLabel.setText("Y:"); workPositionZLabel.setText("Z:"); machinePositionXValueLabel.setText("0"); machinePositionYValueLabel.setText("0"); machinePositionZValueLabel.setText("0"); workPositionXValueLabel.setText("0"); workPositionYValueLabel.setText("0"); workPositionZValueLabel.setText("0"); latestCommentValueLabel.setText(" "); latestCommentLabel.setText("Latest Comment:"); org.jdesktop.layout.GroupLayout statusPanelLayout = new org.jdesktop.layout.GroupLayout(statusPanel); statusPanel.setLayout(statusPanelLayout); statusPanelLayout.setHorizontalGroup(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(statusPanelLayout.createSequentialGroup().addContainerGap().add(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(statusPanelLayout.createSequentialGroup().add(latestCommentLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(latestCommentValueLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(statusPanelLayout.createSequentialGroup().add(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(statusPanelLayout.createSequentialGroup().add(activeStateLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(activeStateValueLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(statusPanelLayout.createSequentialGroup().add(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(workPositionLabel) .add(statusPanelLayout.createSequentialGroup().add(17, 17, 17) .add(statusPanelLayout .createParallelGroup( org.jdesktop.layout.GroupLayout.LEADING, false) .add(statusPanelLayout.createSequentialGroup() .add(workPositionZLabel) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(workPositionZValueLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(statusPanelLayout.createSequentialGroup() .add(workPositionYLabel) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(workPositionYValueLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(statusPanelLayout.createSequentialGroup() .add(workPositionXLabel) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(workPositionXValueLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 65, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(machinePosition) .add(statusPanelLayout.createSequentialGroup().add(17, 17, 17) .add(statusPanelLayout .createParallelGroup( org.jdesktop.layout.GroupLayout.LEADING, false) .add(statusPanelLayout.createSequentialGroup() .add(machinePositionZLabel) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(machinePositionZValueLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(statusPanelLayout.createSequentialGroup() .add(machinePositionYLabel) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(machinePositionYValueLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(statusPanelLayout.createSequentialGroup() .add(machinePositionXLabel) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(machinePositionXValueLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 65, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))))) .add(0, 0, Short.MAX_VALUE))) .addContainerGap())); statusPanelLayout.setVerticalGroup(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(statusPanelLayout.createSequentialGroup() .add(statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(activeStateLabel).add(activeStateValueLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(latestCommentLabel).add(latestCommentValueLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(statusPanelLayout.createSequentialGroup().add(workPositionLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(workPositionXLabel).add(workPositionXValueLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(workPositionYLabel).add(workPositionYValueLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(workPositionZLabel).add(workPositionZValueLabel))) .add(statusPanelLayout.createSequentialGroup().add(machinePosition) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(machinePositionXLabel).add(machinePositionXValueLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(machinePositionYLabel).add(machinePositionYValueLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(machinePositionZLabel).add(machinePositionZValueLabel)))) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); showCommandTableCheckBox.setSelected(true); showCommandTableCheckBox.setText("Enable command table"); showCommandTableCheckBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { showCommandTableCheckBoxActionPerformed(evt); } }); fileModePanel.setMinimumSize(new java.awt.Dimension(389, 150)); fileModePanel.setPreferredSize(new java.awt.Dimension(247, 258)); fileModePanel.setLayout(new java.awt.GridBagLayout()); sendButton.setText("Send"); sendButton.setEnabled(false); sendButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { sendButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; fileModePanel.add(sendButton, gridBagConstraints); pauseButton.setText("Pause"); pauseButton.setEnabled(false); pauseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pauseButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; fileModePanel.add(pauseButton, gridBagConstraints); cancelButton.setText("Cancel"); cancelButton.setEnabled(false); cancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; fileModePanel.add(cancelButton, gridBagConstraints); visualizeButton.setText("Visualize"); visualizeButton.setEnabled(false); visualizeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { visualizeButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; fileModePanel.add(visualizeButton, gridBagConstraints); browseButton.setText("Browse"); browseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { browseButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; fileModePanel.add(browseButton, gridBagConstraints); saveButton.setText("Save"); saveButton.setEnabled(false); saveButton.setMaximumSize(new java.awt.Dimension(88, 29)); saveButton.setMinimumSize(new java.awt.Dimension(88, 29)); saveButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; fileModePanel.add(saveButton, gridBagConstraints); remainingTimeValueLabel.setText("--:--:--"); sentRowsValueLabel.setText("0"); remainingRowsLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); remainingRowsLabel.setText("Remaining Rows:"); remainingRowsLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); remainingRowsLabel.setMaximumSize(null); remainingRowsLabel.setMinimumSize(new java.awt.Dimension(106, 14)); remainingRowsLabel.setPreferredSize(new java.awt.Dimension(106, 14)); rowsValueLabel.setText("0"); remainingTimeLabel.setText("Estimated Time Remaining:"); durationValueLabel.setText("00:00:00"); durationLabel.setText("Duration:"); remainingRowsValueLabel.setText("0"); sentRowsLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); sentRowsLabel.setText("Sent Rows:"); sentRowsLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); sentRowsLabel.setMaximumSize(null); sentRowsLabel.setMinimumSize(new java.awt.Dimension(106, 14)); sentRowsLabel.setPreferredSize(new java.awt.Dimension(106, 14)); rowsLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); rowsLabel.setText("Rows In File:"); rowsLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); rowsLabel.setMinimumSize(new java.awt.Dimension(106, 14)); rowsLabel.setPreferredSize(new java.awt.Dimension(106, 14)); org.jdesktop.layout.GroupLayout fileRunPanelLayout = new org.jdesktop.layout.GroupLayout(fileRunPanel); fileRunPanel.setLayout(fileRunPanelLayout); fileRunPanelLayout .setHorizontalGroup(fileRunPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(fileRunPanelLayout.createSequentialGroup().add(0, 0, 0) .add(fileRunPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, remainingRowsLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, remainingTimeLabel) .add(org.jdesktop.layout.GroupLayout.TRAILING, sentRowsLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, durationLabel) .add(org.jdesktop.layout.GroupLayout.TRAILING, rowsLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(fileRunPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(durationValueLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(remainingRowsValueLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(sentRowsValueLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(remainingTimeValueLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(rowsValueLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 56, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); fileRunPanelLayout.setVerticalGroup(fileRunPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(fileRunPanelLayout.createSequentialGroup().addContainerGap() .add(fileRunPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(rowsValueLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(rowsLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(fileRunPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(sentRowsValueLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(sentRowsLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(fileRunPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(remainingRowsValueLabel).add(remainingRowsLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(fileRunPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(remainingTimeLabel).add(remainingTimeValueLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(fileRunPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(durationLabel).add(durationValueLabel)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; fileModePanel.add(fileRunPanel, gridBagConstraints); settingsMenu.setText("Settings"); grblConnectionSettingsMenuItem.setText("Sender Settings"); grblConnectionSettingsMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { grblConnectionSettingsMenuItemActionPerformed(evt); } }); settingsMenu.add(grblConnectionSettingsMenuItem); firmwareSettingsMenu.setText("Firmware Settings"); grblFirmwareSettingsMenuItem.setText("GRBL"); grblFirmwareSettingsMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { grblFirmwareSettingsMenuItemActionPerformed(evt); } }); firmwareSettingsMenu.add(grblFirmwareSettingsMenuItem); settingsMenu.add(firmwareSettingsMenu); mainMenuBar.add(settingsMenu); PendantMenu.setText("Pendant"); startPendantServerButton.setText("Start..."); startPendantServerButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { startPendantServerButtonActionPerformed(evt); } }); PendantMenu.add(startPendantServerButton); stopPendantServerButton.setText("Stop..."); stopPendantServerButton.setEnabled(false); stopPendantServerButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { stopPendantServerButtonActionPerformed(evt); } }); PendantMenu.add(stopPendantServerButton); mainMenuBar.add(PendantMenu); setJMenuBar(mainMenuBar); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(connectionPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(statusPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(fileModePanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, bottomTabbedPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createSequentialGroup().add(scrollWindowCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(showVerboseOutputCheckBox).add(18, 18, 18) .add(showCommandTableCheckBox).addContainerGap()) .add(controlContextTabbedPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))); layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup().addContainerGap() .add(layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout .createSequentialGroup() .add(connectionPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(statusPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .add(controlContextTabbedPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 283, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(scrollWindowCheckBox) .add(layout .createParallelGroup( org.jdesktop.layout.GroupLayout.BASELINE) .add(showVerboseOutputCheckBox) .add(showCommandTableCheckBox))))) .add(4, 4, 4) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(fileModePanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 203, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 0, Short.MAX_VALUE)) .add(bottomTabbedPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 407, Short.MAX_VALUE)) .add(4, 4, 4))); pack(); }
From source file:de.bwravencl.controllerbuddy.gui.Main.java
private void updateOverlayAlignment(final Rectangle maxWindowBounds) { final var inLowerHalf = overlayFrame.getY() + overlayFrame.getHeight() / 2 < maxWindowBounds.height / 2; overlayFrame.remove(labelCurrentMode); overlayFrame.add(labelCurrentMode, inLowerHalf ? BorderLayout.PAGE_START : BorderLayout.PAGE_END); var alignment = SwingConstants.RIGHT; var flowLayoutAlignment = FlowLayout.RIGHT; if (overlayFrame.getX() + overlayFrame.getWidth() / 2 < maxWindowBounds.width / 2) { alignment = SwingConstants.LEFT; flowLayoutAlignment = FlowLayout.LEFT; }/*from w w w. jav a2s . c o m*/ labelCurrentMode.setHorizontalAlignment(alignment); indicatorPanelFlowLayout.setAlignment(flowLayoutAlignment); indicatorPanel.invalidate(); overlayFrame.setBackground(TRANSPARENT); overlayFrame.pack(); }
From source file:course_generator.frmMain.java
/** * Add a tab to JTabbedPane. The icon is at the left of the text and there * some space between the icon and the label * /* w w w.j a v a 2 s .co m*/ * @param tabbedPane * JTabbedPane where we want to add the tab * @param tab * Tab to add * @param title * Title of the tab * @param icon * Icon of the tab */ private void addTab(JTabbedPane tabbedPane, Component tab, String title, Icon icon) { tabbedPane.add(tab); // Create bespoke component for rendering the tab. javax.swing.JLabel lbl = new javax.swing.JLabel(title); lbl.setIcon(icon); // Add some spacing between text and icon, and position text to the RHS. lbl.setIconTextGap(5); lbl.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); tabbedPane.setTabComponentAt(tabbedPane.getTabCount() - 1, lbl); }