List of usage examples for javax.swing SwingConstants TRAILING
int TRAILING
To view the source code for javax.swing SwingConstants TRAILING.
Click Source Link
From source file:greenfoot.gui.export.ExportPublishPane.java
/** * Creates the scenario information display including information such as title, description, url. * For an update (isUpdate = true), the displayed options are slightly different. *//*w w w. j a v a2s . com*/ private void createScenarioDisplay() { leftPanel = new Box(BoxLayout.Y_AXIS); JLabel text; MiksGridLayout titleAndDescLayout = new MiksGridLayout(6, 2, 8, 8); titleAndDescLayout.setVerticallyExpandingRow(3); titleAndDescPanel = new JPanel(titleAndDescLayout); titleAndDescPanel.setBackground(background); if (imagePanel == null) { imagePanel = new ImageEditPanel(IMAGE_WIDTH, IMAGE_HEIGHT); imagePanel.setBackground(background); } Box textPanel = new Box(BoxLayout.Y_AXIS); { text = new JLabel(Config.getString("export.publish.image1")); text.setAlignmentX(Component.RIGHT_ALIGNMENT); text.setFont(font); textPanel.add(text); text = new JLabel(Config.getString("export.publish.image2")); text.setAlignmentX(Component.RIGHT_ALIGNMENT); text.setFont(font); textPanel.add(text); } titleAndDescPanel.add(textPanel); titleAndDescPanel.add(imagePanel); if (isUpdate) { text = new JLabel(Config.getString("export.snapshot.label"), SwingConstants.TRAILING); text.setFont(font); titleAndDescPanel.add(text); keepScenarioScreenshot = new JCheckBox(); keepScenarioScreenshot.setSelected(true); // "keep screenshot" defaults to true, therefore the image panel should be disabled imagePanel.enableImageEditPanel(false); keepScenarioScreenshot.setName(Config.getString("export.publish.keepScenario")); keepScenarioScreenshot.setOpaque(false); keepScenarioScreenshot.addChangeListener(this); titleAndDescPanel.add(keepScenarioScreenshot); } text = new JLabel(Config.getString("export.publish.title"), SwingConstants.TRAILING); text.setFont(font); titleAndDescPanel.add(text); String title = project.getName(); if (getTitle() != null) { title = getTitle(); } titleField = new JTextField(title); titleField.setInputVerifier(new InputVerifier() { @Override public boolean verify(JComponent input) { String text = titleField.getText(); return text.length() > 0; } }); titleField.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { checkForExistingScenario(); } }); titleAndDescPanel.add(titleField); // If there is an update a "changes" description area is shown. // If not there a short description and long description area are shown. if (isUpdate) { JLabel updateLabel = new JLabel(Config.getString("export.publish.update"), SwingConstants.TRAILING); updateLabel.setVerticalAlignment(SwingConstants.TOP); updateLabel.setFont(font); updateArea = new JTextArea(); updateArea.setRows(6); updateArea.setLineWrap(true); updateArea.setWrapStyleWord(true); JScrollPane updatePane = new JScrollPane(updateArea); titleAndDescPanel.add(updateLabel); titleAndDescPanel.add(updatePane); titleAndDescLayout.setVerticallyExpandingRow(4); } else { text = new JLabel(Config.getString("export.publish.shortDescription"), SwingConstants.TRAILING); text.setFont(font); shortDescriptionField = new JTextField(); titleAndDescPanel.add(text); titleAndDescPanel.add(shortDescriptionField); text = new JLabel(Config.getString("export.publish.longDescription"), SwingConstants.TRAILING); text.setVerticalAlignment(SwingConstants.TOP); text.setFont(font); descriptionArea = new JTextArea(); descriptionArea.setRows(6); descriptionArea.setLineWrap(true); descriptionArea.setWrapStyleWord(true); JScrollPane description = new JScrollPane(descriptionArea); titleAndDescPanel.add(text); titleAndDescPanel.add(description); } text = new JLabel(Config.getString("export.publish.url"), SwingConstants.TRAILING); text.setFont(font); titleAndDescPanel.add(text); urlField = new JTextField(); titleAndDescPanel.add(urlField); leftPanel.add(titleAndDescPanel, BorderLayout.SOUTH); JComponent sourceAndLockPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 8, 0)); { sourceAndLockPanel.setBackground(background); includeSource = new JCheckBox(Config.getString("export.publish.includeSource")); includeSource.setOpaque(false); includeSource.setSelected(false); includeSource.setFont(font); sourceAndLockPanel.add(includeSource); lockScenario.setFont(font); sourceAndLockPanel.add(lockScenario); sourceAndLockPanel.setMaximumSize(sourceAndLockPanel.getPreferredSize()); } leftPanel.add(sourceAndLockPanel, BorderLayout.SOUTH); }
From source file:md.mclama.com.ModManager.java
/** * Create the frame.//from ww w. ja v a2s. c o m */ @SuppressWarnings("serial") public ModManager() throws MalformedURLException { setResizable(false); setTitle("McLauncher " + McVersion); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 700, 400); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); tabbedPane.setBounds(0, 0, 694, 372); contentPane.add(tabbedPane); profileListMdl = new DefaultListModel<String>(); ModListModel = new DefaultListModel<String>(); listModel = new DefaultListModel<String>(); getCurrentMods(); panelLauncher = new JPanel(); tabbedPane.addTab("Launcher", null, panelLauncher, null); panelLauncher.setLayout(null); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(556, 36, 132, 248); panelLauncher.add(scrollPane); profileList = new JList<String>(profileListMdl); profileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); scrollPane.setViewportView(profileList); btnNewProfile = new JButton("New"); btnNewProfile.setFont(new Font("SansSerif", Font.PLAIN, 12)); btnNewProfile.setBounds(479, 4, 76, 20); panelLauncher.add(btnNewProfile); btnNewProfile.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { newProfile(txtProfile.getText()); } }); btnNewProfile.setToolTipText("Click to create a new profile."); JButton btnRenameProfile = new JButton("Rename"); btnRenameProfile.setBounds(479, 25, 76, 20); panelLauncher.add(btnRenameProfile); btnRenameProfile.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { renameProfile(); } }); btnRenameProfile.setToolTipText("Click to rename the selected profile"); JButton btnDelProfile = new JButton("Delete"); btnDelProfile.setBounds(479, 50, 76, 20); panelLauncher.add(btnDelProfile); btnDelProfile.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { deleteProfile(); } }); btnDelProfile.setToolTipText("Click to delete the selected profile."); JButton btnLaunch = new JButton("Launch"); btnLaunch.setBounds(605, 319, 89, 23); panelLauncher.add(btnLaunch); btnLaunch.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (selProfile != null) { LaunchFactorioWithSelectedMods(false); //dont ignore } } }); btnLaunch.setToolTipText("Click to launch factorio with the selected mod profile."); lblAvailableMods = new JLabel("Available Mods"); lblAvailableMods.setBounds(4, 155, 144, 14); panelLauncher.add(lblAvailableMods); lblAvailableMods.setFont(new Font("SansSerif", Font.PLAIN, 10)); lblAvailableMods.setText("Available Mods: " + -1); txtGamePath = new JTextField(); txtGamePath.setBounds(4, 5, 211, 23); panelLauncher.add(txtGamePath); txtGamePath.setToolTipText("Select tha path to your game!"); txtGamePath.setFont(new Font("Tahoma", Font.PLAIN, 8)); txtGamePath.setText("Game Path"); txtGamePath.setColumns(10); JButton btnFind = new JButton("find"); btnFind.setBounds(227, 3, 32, 23); panelLauncher.add(btnFind); txtProfile = new JTextField(); txtProfile.setBounds(556, 2, 132, 22); panelLauncher.add(txtProfile); txtProfile.setToolTipText("The name of NEW or RENAME profiles"); txtProfile.setText("Profile1"); txtProfile.setColumns(10); lblModsEnabled = new JLabel("Mods Enabled: -1"); lblModsEnabled.setBounds(335, 155, 95, 16); panelLauncher.add(lblModsEnabled); lblModsEnabled.setFont(new Font("SansSerif", Font.PLAIN, 10)); JScrollPane scrollPane_1 = new JScrollPane(); scrollPane_1.setBounds(0, 167, 211, 165); panelLauncher.add(scrollPane_1); modsList = new JList<String>(listModel); modsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); modsList.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { String modName = util.getModVersion(modsList.getSelectedValue()); lblModVersion.setText("Mod Version: " + modName); checkDependency(modsList); if (modName.contains(".zip")) { new File(System.getProperty("java.io.tmpdir") + modName.replace(".zip", "")).delete(); } if (System.currentTimeMillis() - lastClickTime <= 300) { //Double click addMod(); } lastClickTime = System.currentTimeMillis(); } }); scrollPane_1.setViewportView(modsList); modsList.setFont(new Font("Tahoma", Font.PLAIN, 9)); JScrollPane scrollPane_2 = new JScrollPane(); scrollPane_2.setBounds(333, 167, 211, 165); panelLauncher.add(scrollPane_2); enabledModsList = new JList<String>(ModListModel); enabledModsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); enabledModsList.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { lblModVersion.setText("Mod Version: " + util.getModVersion(enabledModsList.getSelectedValue())); checkDependency(enabledModsList); if (System.currentTimeMillis() - lastClickTime <= 300) { //Double click removeMod(); } lastClickTime = System.currentTimeMillis(); } }); enabledModsList.setFont(new Font("SansSerif", Font.PLAIN, 10)); scrollPane_2.setViewportView(enabledModsList); JButton btnEnable = new JButton("Enable"); btnEnable.setBounds(223, 200, 90, 28); panelLauncher.add(btnEnable); btnEnable.setToolTipText("Add mod -->"); JButton btnDisable = new JButton("Disable"); btnDisable.setBounds(223, 240, 90, 28); panelLauncher.add(btnDisable); btnDisable.setToolTipText("Disable mod "); JLabel lblModsAvailable = new JLabel("Mods available"); lblModsAvailable.setBounds(4, 329, 89, 14); panelLauncher.add(lblModsAvailable); lblModsAvailable.setFont(new Font("SansSerif", Font.PLAIN, 10)); JLabel lblEnabledMods = new JLabel("Enabled Mods"); lblEnabledMods.setBounds(337, 329, 89, 16); panelLauncher.add(lblEnabledMods); lblEnabledMods.setFont(new Font("SansSerif", Font.PLAIN, 10)); lblModVersion = new JLabel("Mod Version: (select a mod first)"); lblModVersion.setBounds(4, 117, 183, 14); panelLauncher.add(lblModVersion); lblModVersion.setFont(new Font("SansSerif", Font.PLAIN, 10)); lblRequiredMods = new JLabel("Required Mods: " + reqModsStr); lblRequiredMods.setBounds(6, 143, 538, 14); panelLauncher.add(lblRequiredMods); lblRequiredMods.setHorizontalAlignment(SwingConstants.RIGHT); lblRequiredMods.setFont(new Font("SansSerif", Font.PLAIN, 10)); JButton btnNewButton = new JButton("TEST"); btnNewButton.setVisible(testBtnEnabled); btnNewButton.setEnabled(testBtnEnabled); btnNewButton.setBounds(338, 61, 90, 28); panelLauncher.add(btnNewButton); btnUpdate.setBounds(218, 322, 103, 20); panelLauncher.add(btnUpdate); btnUpdate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { util.updateLauncher(); } }); btnUpdate.setVisible(false); btnUpdate.setFont(new Font("SansSerif", Font.PLAIN, 9)); lblModRequires = new JLabel("Mod Requires: (Select a mod first)"); lblModRequires.setBounds(4, 127, 317, 16); panelLauncher.add(lblModRequires); btnLaunchIgnore = new JButton("Launch + ignore"); btnLaunchIgnore.setToolTipText("Ignore any errors that McLauncher may not correctly account for."); btnLaunchIgnore.setFont(new Font("SansSerif", Font.PLAIN, 11)); btnLaunchIgnore.setBounds(556, 284, 133, 23); panelLauncher.add(btnLaunchIgnore); JButton btnConsole = new JButton("Console"); btnConsole.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { boolean changeto = !con.isVisible(); con.setVisible(changeto); con.updateConsole(); } }); btnConsole.setBounds(335, 0, 90, 28); panelLauncher.add(btnConsole); JPanel panelDownloadMods = new JPanel(); tabbedPane.addTab("Download Mods", null, panelDownloadMods, null); panelDownloadMods.setLayout(null); scrollPane_3 = new JScrollPane(); scrollPane_3.setBounds(0, 0, 397, 303); panelDownloadMods.add(scrollPane_3); dlModel = new DefaultTableModel(new Object[][] {}, new String[] { "Mod Name", "Author", "Version", "Tags" }) { Class[] columnTypes = new Class[] { String.class, String.class, String.class, Object.class }; public Class getColumnClass(int columnIndex) { return columnTypes[columnIndex]; } boolean[] columnEditables = new boolean[] { false, false, false, false }; public boolean isCellEditable(int row, int column) { return columnEditables[column]; }; }; tSorter = new TableRowSorter<DefaultTableModel>(dlModel); tableDownloads = new JTable(); tableDownloads.setRowSorter(tSorter); tableDownloads.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { trow = tableDownloads.getSelectedRow(); trow = tableDownloads.getRowSorter().convertRowIndexToModel(trow); getDlModData(); canDownloadMod = true; } }); tableDownloads.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { trow = tableDownloads.getSelectedRow(); trow = tableDownloads.getRowSorter().convertRowIndexToModel(trow); getDlModData(); canDownloadMod = true; } }); tableDownloads.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); tableDownloads.setShowVerticalLines(true); tableDownloads.setShowHorizontalLines(true); tableDownloads.setModel(dlModel); tableDownloads.getColumnModel().getColumn(0).setPreferredWidth(218); tableDownloads.getColumnModel().getColumn(1).setPreferredWidth(97); tableDownloads.getColumnModel().getColumn(2).setPreferredWidth(77); scrollPane_3.setViewportView(tableDownloads); btnDownload = new JButton("Download"); btnDownload.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (canDownloadMod && !CurrentlyDownloading) { String dlUrl = getModDownloadUrl(); try { if (dlUrl.equals("") || dlUrl.equals(" ") || dlUrl == null) { con.log("Log", "No download link for mod, got... '" + dlUrl + "'"); } else { CurrentlyDownloading = true; CurrentDownload = new Download(new URL(dlUrl), McLauncher); } } catch (MalformedURLException e1) { con.log("Log", "Failed to download mod... No download URL?"); } } } }); btnDownload.setBounds(307, 308, 90, 28); panelDownloadMods.add(btnDownload); btnGotoMod = new JButton("Mod Page"); btnGotoMod.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { util.openWebpage(modPageUrl); } }); btnGotoMod.setEnabled(false); btnGotoMod.setBounds(134, 308, 90, 28); panelDownloadMods.add(btnGotoMod); pBarDownloadMod = new JProgressBar(); pBarDownloadMod.setBounds(538, 308, 150, 10); panelDownloadMods.add(pBarDownloadMod); pBarExtractMod = new JProgressBar(); pBarExtractMod.setBounds(538, 314, 150, 10); panelDownloadMods.add(pBarExtractMod); lblDownloadModInfo = new JLabel("Download progress"); lblDownloadModInfo.setBounds(489, 326, 199, 16); panelDownloadMods.add(lblDownloadModInfo); lblDownloadModInfo.setHorizontalAlignment(SwingConstants.TRAILING); panelModImg = new JPanel(); panelModImg.setBounds(566, 0, 128, 128); panelDownloadMods.add(panelModImg); txtFilterText = new JTextField(); txtFilterText.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { if (txtFilterText.getText().equals("Filter Text")) { txtFilterText.setText(""); newFilter(); } } }); txtFilterText.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { if (!txtFilterText.getText().equals("Filter Text")) { newFilter(); } } }); txtFilterText.setText("Filter Text"); txtFilterText.setBounds(0, 308, 122, 28); panelDownloadMods.add(txtFilterText); txtFilterText.setColumns(10); comboBox = new JComboBox(); comboBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { newFilter(); } }); comboBox.setModel(new DefaultComboBoxModel(new String[] { "No tag filter", "Vanilla", "Machine", "Mechanic", "New Ore", "Module", "Big Mod", "Power", "GUI", "Map-Gen", "Must-Have", "Equipment" })); comboBox.setBounds(403, 44, 150, 26); panelDownloadMods.add(comboBox); lblModDlCounter = new JLabel("Mod database: "); lblModDlCounter.setFont(new Font("SansSerif", Font.PLAIN, 10)); lblModDlCounter.setBounds(403, 5, 162, 16); panelDownloadMods.add(lblModDlCounter); txtrDMModDescription = new JTextArea(); txtrDMModDescription.setBackground(Color.LIGHT_GRAY); txtrDMModDescription.setBorder(new LineBorder(new Color(0, 0, 0))); txtrDMModDescription.setFocusable(false); txtrDMModDescription.setEditable(false); txtrDMModDescription.setLineWrap(true); txtrDMModDescription.setWrapStyleWord(true); txtrDMModDescription.setText("Mod Description: "); txtrDMModDescription.setBounds(403, 132, 285, 75); panelDownloadMods.add(txtrDMModDescription); lblDMModTags = new JTextArea(); lblDMModTags.setFocusable(false); lblDMModTags.setEditable(false); lblDMModTags.setBorder(new LineBorder(new Color(0, 0, 0))); lblDMModTags.setWrapStyleWord(true); lblDMModTags.setLineWrap(true); lblDMModTags.setBackground(Color.LIGHT_GRAY); lblDMModTags.setText("Mod Tags: "); lblDMModTags.setBounds(403, 71, 160, 60); panelDownloadMods.add(lblDMModTags); lblDMRequiredMods = new JTextArea(); lblDMRequiredMods.setFocusable(false); lblDMRequiredMods.setEditable(false); lblDMRequiredMods.setText("Required Mods: "); lblDMRequiredMods.setWrapStyleWord(true); lblDMRequiredMods.setLineWrap(true); lblDMRequiredMods.setBorder(new LineBorder(new Color(0, 0, 0))); lblDMRequiredMods.setBackground(Color.LIGHT_GRAY); lblDMRequiredMods.setBounds(403, 208, 285, 57); panelDownloadMods.add(lblDMRequiredMods); lblDLModLicense = new JLabel(""); lblDLModLicense.setHorizontalAlignment(SwingConstants.RIGHT); lblDLModLicense.setBounds(403, 294, 285, 16); panelDownloadMods.add(lblDLModLicense); lblWipmod = new JLabel(""); lblWipmod.setBounds(395, 314, 64, 16); panelDownloadMods.add(lblWipmod); JButton btnCancel = new JButton("Cancel"); btnCancel.setToolTipText("Stop downloading"); btnCancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { CurrentDownload.cancel(); } }); btnCancel.setBounds(230, 308, 72, 28); panelDownloadMods.add(btnCancel); panelOptions = new JPanel(); tabbedPane.addTab("Options", null, panelOptions, null); panelOptions.setLayout(null); scrollPane_4.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane_4.setBounds(0, 0, 694, 342); panelOptions.add(scrollPane_4); panel = new JPanel(); scrollPane_4.setViewportView(panel); panel.setLayout(null); lblCloseMclauncherAfter = new JLabel("Close McLauncher after launching Factorio?"); lblCloseMclauncherAfter.setBounds(6, 6, 274, 16); panel.add(lblCloseMclauncherAfter); lblCloseMclauncherAfter_1 = new JLabel("Close McLauncher after updating?"); lblCloseMclauncherAfter_1.setBounds(6, 34, 274, 16); panel.add(lblCloseMclauncherAfter_1); lblSortNewestDownloadable = new JLabel("Sort newest downloadable mods first?"); lblSortNewestDownloadable.setBounds(6, 62, 274, 16); panel.add(lblSortNewestDownloadable); tglbtnNewModsFirst = new JToggleButton("Toggle"); tglbtnNewModsFirst.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { lblNeedrestart.setText("McLauncher needs to restart for that to work"); writeData(); } }); tglbtnNewModsFirst.setSelected(true); tglbtnNewModsFirst.setBounds(281, 56, 66, 28); panel.add(tglbtnNewModsFirst); tglbtnCloseAfterUpdate = new JToggleButton("Toggle"); tglbtnCloseAfterUpdate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { writeData(); } }); tglbtnCloseAfterUpdate.setBounds(281, 28, 66, 28); panel.add(tglbtnCloseAfterUpdate); tglbtnCloseAfterLaunch = new JToggleButton("Toggle"); tglbtnCloseAfterLaunch.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { writeData(); } }); tglbtnCloseAfterLaunch.setBounds(281, 0, 66, 28); panel.add(tglbtnCloseAfterLaunch); tglbtnDisplayon = new JToggleButton("On"); tglbtnDisplayon.setFont(new Font("SansSerif", Font.PLAIN, 10)); tglbtnDisplayon.setSelected(true); tglbtnDisplayon.setBounds(588, 308, 44, 28); panel.add(tglbtnDisplayon); tglbtnDisplayoff = new JToggleButton("Off"); tglbtnDisplayoff.setFont(new Font("SansSerif", Font.PLAIN, 10)); tglbtnDisplayoff.setBounds(644, 308, 44, 28); panel.add(tglbtnDisplayoff); lblInfo = new JLabel("What enabled and disabled look like"); lblInfo.setFont(new Font("SansSerif", Font.PLAIN, 10)); lblInfo.setHorizontalAlignment(SwingConstants.TRAILING); lblInfo.setBounds(359, 314, 231, 16); panel.add(lblInfo); JSeparator separator = new JSeparator(); separator.setBounds(6, 55, 676, 24); panel.add(separator); JSeparator separator_1 = new JSeparator(); separator_1.setBounds(6, 27, 676, 18); panel.add(separator_1); JSeparator separator_2 = new JSeparator(); separator_2.setBounds(6, 84, 676, 24); panel.add(separator_2); JSeparator separator_3 = new JSeparator(); separator_3.setOrientation(SwingConstants.VERTICAL); separator_3.setBounds(346, 0, 16, 336); panel.add(separator_3); lblNeedrestart = new JLabel(""); lblNeedrestart.setBounds(6, 314, 341, 16); panel.add(lblNeedrestart); tglbtnSendAnonData = new JToggleButton("Toggle"); tglbtnSendAnonData.setToolTipText("Information regarding the activity of McLauncher."); tglbtnSendAnonData.setSelected(true); //set enabled by default. tglbtnSendAnonData.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { writeData(); } }); tglbtnSendAnonData.setBounds(622, 0, 66, 28); panel.add(tglbtnSendAnonData); lblSendAnonymousUse = new JLabel("Send anonymous use data?"); lblSendAnonymousUse.setBounds(359, 6, 251, 16); panel.add(lblSendAnonymousUse); lblDeleteOldMod = new JLabel("Delete old mod before updating?"); lblDeleteOldMod.setBounds(359, 34, 251, 16); panel.add(lblDeleteOldMod); tglbtnDeleteBeforeUpdate = new JToggleButton("Toggle"); tglbtnDeleteBeforeUpdate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { writeData(); } }); tglbtnDeleteBeforeUpdate.setBounds(622, 28, 66, 28); panel.add(tglbtnDeleteBeforeUpdate); tglbtnAlertOnModUpdateAvailable = new JToggleButton("Toggle"); tglbtnAlertOnModUpdateAvailable.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { writeData(); } }); tglbtnAlertOnModUpdateAvailable.setSelected(true); tglbtnAlertOnModUpdateAvailable.setBounds(281, 86, 66, 28); panel.add(tglbtnAlertOnModUpdateAvailable); separator_4 = new JSeparator(); separator_4.setBounds(0, 112, 676, 24); panel.add(separator_4); JLabel lblAlertModHas = new JLabel("Alert mod has update on launch?"); lblAlertModHas.setBounds(6, 92, 231, 16); panel.add(lblAlertModHas); panelChangelog = new JPanel(); tabbedPane.addTab("Changelog", null, panelChangelog, null); panelChangelog.setLayout(new BoxLayout(panelChangelog, BoxLayout.X_AXIS)); scrollPane_6 = new JScrollPane(); panelChangelog.add(scrollPane_6); textChangelog = new JTextArea(); scrollPane_6.setViewportView(textChangelog); textChangelog.setEditable(false); textChangelog.setText( "v0.4.6\r\n\r\n+Fix problem where config file would not save in the correct location. (Thanks Arano-kai)\r\n+McLauncher will now save when you select a path, or profile. (Thanks Arano-kai)\r\n+Fixed an issue where McLauncher could not get the version from a .zip mod. (Thanks Arano-kai)\r\n+Added a Cancel button to stop downloading the current mod. (Suggested by Arano-kai)\r\n\r\n\r\n\r\nv0.4.5\r\n\r\n+McLauncher should now correctly warn you on failed write/read access.\r\n+McLauncher should now work when a user has both zip and installer versions of factorio. (Thanks Jeroon)\r\n+Attempt to fix an error with dependency and .zip files, With versions. (Thanks Arano-kai)\r\n+Fix only allow single selection of mods. (Thanks Arano-kai)\r\n+Fix for the Launch+Ignore button problem on linux being cut off. (Thanks Arano-kai)\r\n+Display download progress.\r\n+Fixed an error that was thrown when clicking on some mods that had a single dependency mod.\r\n+Double clicking on a mod will now enable or disable the mod. (Thanks Arano-kai)"); btnLaunchIgnore.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (selProfile != null) { LaunchFactorioWithSelectedMods(true); //ignore errors, launch. } } }); btnLaunchIgnore.setVisible(false); //This is my test button. I use this to test things then implement them into the swing. btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { testButtonCode(e); } }); //Disable mods button. (from profile) btnDisable.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { removeMod(); } }); //Enable mods button. (to profile) btnEnable.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { addMod(); } }); //Game path button btnFind.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { findPath(); } }); //mouseClick event lister for when you click on a new profile profileList.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { selectedProfile(); } }); readData(); //Load settings init(); //some extra init getMods(); //Get the mods the user has installed }
From source file:edu.snu.leader.discrete.simulator.SimulatorLauncherGUI.java
/** * Create the frame.// w w w. java2 s. c om */ public SimulatorLauncherGUI() { NumberFormat countFormat = NumberFormat.getNumberInstance(); countFormat.setParseIntegerOnly(true); NumberFormat doubleFormat = NumberFormat.getNumberInstance(); doubleFormat.setMinimumIntegerDigits(1); doubleFormat.setMaximumFractionDigits(10); setTitle("Simulator"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 515, 340); setResizable(false); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new BorderLayout(0, 0)); setContentPane(contentPane); tabbedPane = new JTabbedPane(JTabbedPane.TOP); contentPane.add(tabbedPane, BorderLayout.CENTER); JPanel panelTab1 = new JPanel(); tabbedPane.addTab("Simulator", null, panelTab1, null); JPanel panelAgentCount = new JPanel(); panelTab1.add(panelAgentCount); JLabel lblNewLabel = new JLabel("Agent Count"); panelAgentCount.add(lblNewLabel); sliderAgent = new JSlider(); panelAgentCount.add(sliderAgent); sliderAgent.setValue(10); sliderAgent.setSnapToTicks(true); sliderAgent.setPaintTicks(true); sliderAgent.setPaintLabels(true); sliderAgent.setMinorTickSpacing(10); sliderAgent.setMajorTickSpacing(10); sliderAgent.setMinimum(10); sliderAgent.setMaximum(70); sliderAgent.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent arg0) { Integer spinnerValue = (Integer) spinnerMaxEaten.getValue(); if (spinnerValue > sliderAgent.getValue()) { spinnerValue = sliderAgent.getValue(); } spinnerMaxEaten.setModel(new SpinnerNumberModel(spinnerValue, new Integer(0), new Integer(sliderAgent.getValue()), new Integer(1))); JFormattedTextField tfMaxEaten = ((JSpinner.DefaultEditor) spinnerMaxEaten.getEditor()) .getTextField(); tfMaxEaten.setEditable(false); } }); JPanel panelCommType = new JPanel(); panelTab1.add(panelCommType); JLabel lblNewLabel_1 = new JLabel("Communication Type"); panelCommType.add(lblNewLabel_1); comboBoxCommType = new JComboBox<String>(); panelCommType.add(comboBoxCommType); comboBoxCommType .setModel(new DefaultComboBoxModel<String>(new String[] { "Global", "Topological", "Metric" })); comboBoxCommType.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { String item = (String) comboBoxCommType.getSelectedItem(); if (item.equals("Topological")) { panelNearestNeighborCount.setVisible(true); panelMaxLocationRadius.setVisible(false); } else if (item.equals("Metric")) { panelNearestNeighborCount.setVisible(false); panelMaxLocationRadius.setVisible(true); } else if (item.equals("Global")) { panelNearestNeighborCount.setVisible(false); panelMaxLocationRadius.setVisible(false); } } }); JPanel panelDestinationRadius = new JPanel(); panelTab1.add(panelDestinationRadius); JLabel lblDestinationRadius = new JLabel("Destination Radius"); panelDestinationRadius.add(lblDestinationRadius); frmtdtxtfldDestinationRadius = new JFormattedTextField(doubleFormat); frmtdtxtfldDestinationRadius.setColumns(4); frmtdtxtfldDestinationRadius.setValue((Number) 10); panelDestinationRadius.add(frmtdtxtfldDestinationRadius); JPanel panelResultsOutput = new JPanel(); panelTab1.add(panelResultsOutput); JLabel lblResultsOutput = new JLabel("Results Output"); panelResultsOutput.add(lblResultsOutput); final JCheckBox chckbxEskridge = new JCheckBox("Eskridge"); panelResultsOutput.add(chckbxEskridge); final JCheckBox chckbxConflict = new JCheckBox("Conflict"); panelResultsOutput.add(chckbxConflict); final JCheckBox chckbxPosition = new JCheckBox("Position"); panelResultsOutput.add(chckbxPosition); final JCheckBox chckbxPredationResults = new JCheckBox("Predation"); panelResultsOutput.add(chckbxPredationResults); JPanel panelMisc = new JPanel(); panelTab1.add(panelMisc); JLabel lblNewLabel_3 = new JLabel("Misc"); panelMisc.add(lblNewLabel_3); chckbxGraphical = new JCheckBox("Graphical?"); chckbxGraphical.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { if (chckbxGraphical.isSelected()) { frmtdtxtfldRunCount.setValue((Number) 1); frmtdtxtfldRunCount.setEnabled(false); chckbxEskridge.setSelected(false); chckbxEskridge.setEnabled(false); String agentBuilder = (String) comboBoxAgentBuilder.getSelectedItem(); if (agentBuilder.equals("Default")) { comboBoxAgentBuilder.setSelectedIndex(1); } } else { chckbxEskridge.setEnabled(true); frmtdtxtfldRunCount.setEnabled(true); } } }); panelMisc.add(chckbxGraphical); chckbxRandomSeed = new JCheckBox("Random Seed?"); panelMisc.add(chckbxRandomSeed); chckbxPredationEnable = new JCheckBox("Predation?"); chckbxPredationEnable.setSelected(true); chckbxPredationEnable.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { if (chckbxPredationEnable.isSelected()) { panelPredationStuff.setVisible(true); panelPredationBoxes.setVisible(true); panelPredationConstant.setVisible(true); panelNonMoversSurvive.setVisible(true); } else { panelPredationStuff.setVisible(false); panelPredationBoxes.setVisible(false); panelPredationConstant.setVisible(false); panelNonMoversSurvive.setVisible(false); } } }); panelMisc.add(chckbxPredationEnable); JPanel panelCounts = new JPanel(); panelTab1.add(panelCounts); JLabel lblNewLabel_4 = new JLabel("Run Count"); panelCounts.add(lblNewLabel_4); frmtdtxtfldRunCount = new JFormattedTextField(countFormat); frmtdtxtfldRunCount.setToolTipText("The number of runs. Each run has a different random seed."); panelCounts.add(frmtdtxtfldRunCount); frmtdtxtfldRunCount.setColumns(4); frmtdtxtfldRunCount.setValue((Number) 1); JLabel lblNewLabel_5 = new JLabel("Sim Count"); panelCounts.add(lblNewLabel_5); frmtdtxtfldSimCount = new JFormattedTextField(countFormat); frmtdtxtfldSimCount .setToolTipText("The number of simulations per run. Each simulation uses the same random seed."); frmtdtxtfldSimCount.setColumns(4); frmtdtxtfldSimCount.setValue((Number) 1); panelCounts.add(frmtdtxtfldSimCount); JLabel lblNewLabel_6 = new JLabel("Max Time Steps"); panelCounts.add(lblNewLabel_6); frmtdtxtfldMaxTimeSteps = new JFormattedTextField(countFormat); frmtdtxtfldMaxTimeSteps.setToolTipText("The max number of time steps per simulation."); frmtdtxtfldMaxTimeSteps.setColumns(6); frmtdtxtfldMaxTimeSteps.setValue((Number) 20000); panelCounts.add(frmtdtxtfldMaxTimeSteps); ////////Panel tab 2 JPanel panelTab2 = new JPanel(); tabbedPane.addTab("Parameters", null, panelTab2, null); JPanel panelDecisionCalculator = new JPanel(); panelTab2.add(panelDecisionCalculator); JLabel lblDecisionCalculator = new JLabel("Decision Calculator"); panelDecisionCalculator.add(lblDecisionCalculator); final JComboBox<String> comboBoxDecisionCalculator = new JComboBox<String>(); panelDecisionCalculator.add(comboBoxDecisionCalculator); comboBoxDecisionCalculator.setModel( new DefaultComboBoxModel<String>(new String[] { "Default", "Conflict", "Conflict Uninformed" })); JPanel panelAgentBuilder = new JPanel(); panelTab2.add(panelAgentBuilder); JLabel lblAgentBuilder = new JLabel("Agent Builder"); panelAgentBuilder.add(lblAgentBuilder); comboBoxAgentBuilder = new JComboBox<String>(); panelAgentBuilder.add(comboBoxAgentBuilder); comboBoxAgentBuilder.setModel(new DefaultComboBoxModel<String>(new String[] { "Default", "Simple Angular", "Personality Simple Angular", "Simple Angular Uninformed" })); comboBoxAgentBuilder.setSelectedIndex(1); comboBoxAgentBuilder.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { if (chckbxGraphical.isSelected()) { String agentBuilder = (String) comboBoxAgentBuilder.getSelectedItem(); if (agentBuilder.equals("Default")) { comboBoxAgentBuilder.setSelectedIndex(1); } } } }); JPanel panelModel = new JPanel(); panelTab2.add(panelModel); JLabel lblModel = new JLabel("Model"); panelModel.add(lblModel); comboBoxModel = new JComboBox<String>(); panelModel.add(comboBoxModel); comboBoxModel.setModel(new DefaultComboBoxModel<String>(new String[] { "Sueur", "Gautrais" })); comboBoxModel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { String item = (String) comboBoxModel.getSelectedItem(); if (item.equals("Sueur")) { panelSueurValues.setVisible(true); panelGautraisValues.setVisible(false); } else if (item.equals("Gautrais")) { panelSueurValues.setVisible(false); panelGautraisValues.setVisible(true); } } }); JPanel panelEnvironment = new JPanel(); panelTab2.add(panelEnvironment); JLabel lblEnvironment = new JLabel("Environment"); panelEnvironment.add(lblEnvironment); comboBoxEnvironment = new JComboBox<String>(); comboBoxEnvironment.setModel( new DefaultComboBoxModel<String>(new String[] { "Minimum", "Medium", "Maximum", "Uninformed" })); comboBoxEnvironment.setSelectedIndex(1); comboBoxEnvironment.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { String item = (String) comboBoxEnvironment.getSelectedItem(); if (!item.equals("Uninformed")) { comboBoxDecisionCalculator.setEnabled(true); comboBoxAgentBuilder.setEnabled(true); } if (item.equals("Medium")) { panelAngle.setVisible(true); panelDistance.setVisible(true); panelPercentage.setVisible(true); panelNumberOfDestinations.setVisible(false); panelInformedCount.setVisible(false); } else if (item.equals("Minimum")) { panelAngle.setVisible(false); panelDistance.setVisible(false); panelPercentage.setVisible(true); panelNumberOfDestinations.setVisible(false); panelInformedCount.setVisible(false); } else if (item.equals("Maximum")) { panelAngle.setVisible(false); panelDistance.setVisible(false); panelPercentage.setVisible(true); panelNumberOfDestinations.setVisible(false); panelInformedCount.setVisible(false); } else if (item.equals("Uninformed")) { panelAngle.setVisible(true); panelDistance.setVisible(true); panelPercentage.setVisible(true); panelNumberOfDestinations.setVisible(false); panelInformedCount.setVisible(true); comboBoxDecisionCalculator.setSelectedIndex(2); comboBoxDecisionCalculator.setEnabled(false); comboBoxAgentBuilder.setSelectedIndex(3); comboBoxAgentBuilder.setEnabled(false); } } }); panelEnvironment.add(comboBoxEnvironment); JPanel panelDefaultConflict = new JPanel(); panelTab2.add(panelDefaultConflict); JLabel lblDefaultConflict = new JLabel("Default Conflict"); panelDefaultConflict.add(lblDefaultConflict); final JSpinner spinnerDefaultConflict = new JSpinner(); panelDefaultConflict.add(spinnerDefaultConflict); spinnerDefaultConflict.setModel( new SpinnerNumberModel(new Float(0.9f), new Float(0.1f), new Float(0.91f), new Float(0.05))); JFormattedTextField tfSpinnerConflict = ((JSpinner.DefaultEditor) spinnerDefaultConflict.getEditor()) .getTextField(); tfSpinnerConflict.setEditable(false); JPanel panelCancelationThreshold = new JPanel(); panelTab2.add(panelCancelationThreshold); JLabel lblCancelationThreshold = new JLabel("Cancelation Threshold"); panelCancelationThreshold.add(lblCancelationThreshold); final JSpinner spinnerCancelationThreshold = new JSpinner(); panelCancelationThreshold.add(spinnerCancelationThreshold); spinnerCancelationThreshold.setModel( new SpinnerNumberModel(new Float(1.0f), new Float(0.0f), new Float(1.01f), new Float(0.05))); JFormattedTextField tfCancelationThreshold = ((JSpinner.DefaultEditor) spinnerCancelationThreshold .getEditor()).getTextField(); tfCancelationThreshold.setEditable(false); JPanel panelStopAnywhere = new JPanel(); panelTab2.add(panelStopAnywhere); final JCheckBox chckbxStopAnywhere = new JCheckBox("Stop Anywhere?"); panelStopAnywhere.add(chckbxStopAnywhere); panelNearestNeighborCount = new JPanel(); panelNearestNeighborCount.setVisible(false); panelTab2.add(panelNearestNeighborCount); JLabel lblNearestNeighborCount = new JLabel("Nearest Neighbor Count"); panelNearestNeighborCount.add(lblNearestNeighborCount); frmtdtxtfldNearestNeighborCount = new JFormattedTextField(countFormat); panelNearestNeighborCount.add(frmtdtxtfldNearestNeighborCount); frmtdtxtfldNearestNeighborCount.setColumns(3); frmtdtxtfldNearestNeighborCount.setValue((Number) 10); panelMaxLocationRadius = new JPanel(); panelMaxLocationRadius.setVisible(false); panelTab2.add(panelMaxLocationRadius); JLabel lblMaxLocationRadius = new JLabel("Max Location Radius"); panelMaxLocationRadius.add(lblMaxLocationRadius); frmtdtxtfldMaxLocationRadius = new JFormattedTextField(doubleFormat); panelMaxLocationRadius.add(frmtdtxtfldMaxLocationRadius); frmtdtxtfldMaxLocationRadius.setColumns(5); frmtdtxtfldMaxLocationRadius.setValue((Number) 10.0); panelPredationBoxes = new JPanel(); panelTab2.add(panelPredationBoxes); final JCheckBox chckbxUsePredationThreshold = new JCheckBox("Use Predation Threshold"); panelPredationBoxes.add(chckbxUsePredationThreshold); final JCheckBox chckbxPopulationIndependent = new JCheckBox("Population Independent"); chckbxPopulationIndependent.setSelected(true); panelPredationBoxes.add(chckbxPopulationIndependent); chckbxPopulationIndependent.setToolTipText( "Select this to allow predation to be independent of population size. Max predation for 10 agents will be the same as for 50 agents. "); panelPredationStuff = new JPanel(); panelTab2.add(panelPredationStuff); JLabel lblPredationMinimum = new JLabel("Predation Minimum"); panelPredationStuff.add(lblPredationMinimum); frmtdtxtfldPredationMinimum = new JFormattedTextField(doubleFormat); frmtdtxtfldPredationMinimum.setColumns(4); frmtdtxtfldPredationMinimum.setValue((Number) 0.0); panelPredationStuff.add(frmtdtxtfldPredationMinimum); JLabel lblPredationThreshold = new JLabel("Predation Threshold"); panelPredationStuff.add(lblPredationThreshold); final JSpinner spinnerPredationThreshold = new JSpinner(); panelPredationStuff.add(spinnerPredationThreshold); spinnerPredationThreshold.setModel( new SpinnerNumberModel(new Float(1.0f), new Float(0.0f), new Float(1.01f), new Float(0.05))); JFormattedTextField tfPredationThreshold = ((JSpinner.DefaultEditor) spinnerPredationThreshold.getEditor()) .getTextField(); tfPredationThreshold.setEditable(false); JLabel lblMaxEaten = new JLabel("Max Eaten"); panelPredationStuff.add(lblMaxEaten); spinnerMaxEaten = new JSpinner(); spinnerMaxEaten.setToolTipText("The max number eaten per time step."); panelPredationStuff.add(spinnerMaxEaten); spinnerMaxEaten.setModel(new SpinnerNumberModel(new Integer(10), new Integer(0), new Integer(sliderAgent.getValue()), new Integer(1))); JFormattedTextField tfMaxEaten = ((JSpinner.DefaultEditor) spinnerMaxEaten.getEditor()).getTextField(); tfMaxEaten.setEditable(false); panelPredationConstant = new JPanel(); panelTab2.add(panelPredationConstant); JLabel lblPredationConstant = new JLabel("Predation Constant"); panelPredationConstant.add(lblPredationConstant); frmtdtxtfldPredationConstant = new JFormattedTextField(doubleFormat); panelPredationConstant.add(frmtdtxtfldPredationConstant); frmtdtxtfldPredationConstant.setToolTipText("Value should be positive. Recommended values are near 0.001"); frmtdtxtfldPredationConstant.setColumns(4); frmtdtxtfldPredationConstant.setValue((Number) 0.001); panelNonMoversSurvive = new JPanel(); panelTab2.add(panelNonMoversSurvive); final JCheckBox chckbxNonMoversSurvive = new JCheckBox("Non-movers Survive?"); chckbxNonMoversSurvive.setSelected(false); panelNonMoversSurvive.add(chckbxNonMoversSurvive); ////////Tab 3 JPanel panelTab3 = new JPanel(); tabbedPane.addTab("Environment", null, panelTab3, null); panelTab3.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); panelSueurValues = new JPanel(); panelTab3.add(panelSueurValues); panelSueurValues.setLayout(new BoxLayout(panelSueurValues, BoxLayout.Y_AXIS)); JLabel lblSueurValues = new JLabel("Sueur Values"); lblSueurValues.setHorizontalAlignment(SwingConstants.TRAILING); lblSueurValues.setAlignmentX(Component.CENTER_ALIGNMENT); panelSueurValues.add(lblSueurValues); JPanel panelAlpha = new JPanel(); FlowLayout flowLayout = (FlowLayout) panelAlpha.getLayout(); flowLayout.setAlignment(FlowLayout.RIGHT); panelSueurValues.add(panelAlpha); JLabel lblAlpha = new JLabel("alpha"); lblAlpha.setHorizontalAlignment(SwingConstants.CENTER); panelAlpha.add(lblAlpha); final JFormattedTextField frmtdtxtfldAlpha = new JFormattedTextField(doubleFormat); frmtdtxtfldAlpha.setHorizontalAlignment(SwingConstants.TRAILING); lblAlpha.setLabelFor(frmtdtxtfldAlpha); panelAlpha.add(frmtdtxtfldAlpha); frmtdtxtfldAlpha.setColumns(6); frmtdtxtfldAlpha.setValue((Number) 0.006161429); JPanel panelAlphaC = new JPanel(); FlowLayout flowLayout_2 = (FlowLayout) panelAlphaC.getLayout(); flowLayout_2.setAlignment(FlowLayout.RIGHT); panelSueurValues.add(panelAlphaC); JLabel lblAlphaC = new JLabel("alpha c"); panelAlphaC.add(lblAlphaC); final JFormattedTextField frmtdtxtfldAlphaC = new JFormattedTextField(doubleFormat); frmtdtxtfldAlphaC.setHorizontalAlignment(SwingConstants.TRAILING); lblAlphaC.setLabelFor(frmtdtxtfldAlphaC); panelAlphaC.add(frmtdtxtfldAlphaC); frmtdtxtfldAlphaC.setColumns(6); frmtdtxtfldAlphaC.setValue((Number) 0.009); JPanel panelBeta = new JPanel(); FlowLayout flowLayout_1 = (FlowLayout) panelBeta.getLayout(); flowLayout_1.setAlignment(FlowLayout.RIGHT); panelSueurValues.add(panelBeta); JLabel lblBeta = new JLabel("beta"); panelBeta.add(lblBeta); final JFormattedTextField frmtdtxtfldBeta = new JFormattedTextField(doubleFormat); frmtdtxtfldBeta.setHorizontalAlignment(SwingConstants.TRAILING); panelBeta.add(frmtdtxtfldBeta); frmtdtxtfldBeta.setColumns(6); frmtdtxtfldBeta.setValue((Number) 0.013422819); JPanel panelBetaC = new JPanel(); FlowLayout flowLayout_14 = (FlowLayout) panelBetaC.getLayout(); flowLayout_14.setAlignment(FlowLayout.RIGHT); panelSueurValues.add(panelBetaC); JLabel lblBetaC = new JLabel("beta c"); panelBetaC.add(lblBetaC); final JFormattedTextField frmtdtxtfldBetaC = new JFormattedTextField(doubleFormat); frmtdtxtfldBetaC.setHorizontalAlignment(SwingConstants.TRAILING); panelBetaC.add(frmtdtxtfldBetaC); frmtdtxtfldBetaC.setColumns(6); frmtdtxtfldBetaC.setValue((Number) (-0.009)); JPanel panelS = new JPanel(); FlowLayout flowLayout_3 = (FlowLayout) panelS.getLayout(); flowLayout_3.setAlignment(FlowLayout.RIGHT); panelSueurValues.add(panelS); JLabel lblS = new JLabel("S"); panelS.add(lblS); final JFormattedTextField frmtdtxtfldS = new JFormattedTextField(countFormat); frmtdtxtfldS.setHorizontalAlignment(SwingConstants.TRAILING); panelS.add(frmtdtxtfldS); frmtdtxtfldS.setColumns(6); frmtdtxtfldS.setValue((Number) 2); JPanel panelQ = new JPanel(); FlowLayout flowLayout_4 = (FlowLayout) panelQ.getLayout(); flowLayout_4.setAlignment(FlowLayout.RIGHT); panelSueurValues.add(panelQ); JLabel lblQ = new JLabel("q"); panelQ.add(lblQ); final JFormattedTextField frmtdtxtfldQ = new JFormattedTextField(doubleFormat); frmtdtxtfldQ.setHorizontalAlignment(SwingConstants.TRAILING); panelQ.add(frmtdtxtfldQ); frmtdtxtfldQ.setColumns(6); frmtdtxtfldQ.setValue((Number) 2.3); panelGautraisValues = new JPanel(); panelGautraisValues.setVisible(false); panelTab3.add(panelGautraisValues); panelGautraisValues.setLayout(new BoxLayout(panelGautraisValues, BoxLayout.Y_AXIS)); JLabel label = new JLabel("Gautrais Values"); label.setAlignmentX(Component.CENTER_ALIGNMENT); panelGautraisValues.add(label); JPanel panelTauO = new JPanel(); FlowLayout flowLayout_5 = (FlowLayout) panelTauO.getLayout(); flowLayout_5.setAlignment(FlowLayout.RIGHT); panelGautraisValues.add(panelTauO); JLabel lblTauO = new JLabel("tau o"); panelTauO.add(lblTauO); final JFormattedTextField frmtdtxtfldTaoO = new JFormattedTextField(doubleFormat); frmtdtxtfldTaoO.setHorizontalAlignment(SwingConstants.TRAILING); panelTauO.add(frmtdtxtfldTaoO); frmtdtxtfldTaoO.setColumns(4); frmtdtxtfldTaoO.setValue((Number) 1290); JPanel panelGammaC = new JPanel(); FlowLayout flowLayout_6 = (FlowLayout) panelGammaC.getLayout(); flowLayout_6.setAlignment(FlowLayout.RIGHT); panelGautraisValues.add(panelGammaC); JLabel lblGammaC = new JLabel("gamma c"); panelGammaC.add(lblGammaC); final JFormattedTextField frmtdtxtfldGammaC = new JFormattedTextField(doubleFormat); frmtdtxtfldGammaC.setHorizontalAlignment(SwingConstants.TRAILING); panelGammaC.add(frmtdtxtfldGammaC); frmtdtxtfldGammaC.setColumns(4); frmtdtxtfldGammaC.setValue((Number) 2.0); JPanel panelEpsilonC = new JPanel(); FlowLayout flowLayout_7 = (FlowLayout) panelEpsilonC.getLayout(); flowLayout_7.setAlignment(FlowLayout.RIGHT); panelGautraisValues.add(panelEpsilonC); JLabel lblEpsilonC = new JLabel("epsilon c"); panelEpsilonC.add(lblEpsilonC); final JFormattedTextField frmtdtxtfldEpsilonC = new JFormattedTextField(doubleFormat); frmtdtxtfldEpsilonC.setHorizontalAlignment(SwingConstants.TRAILING); panelEpsilonC.add(frmtdtxtfldEpsilonC); frmtdtxtfldEpsilonC.setColumns(4); frmtdtxtfldEpsilonC.setValue((Number) 2.3); JPanel panelAlphaF = new JPanel(); FlowLayout flowLayout_8 = (FlowLayout) panelAlphaF.getLayout(); flowLayout_8.setAlignment(FlowLayout.RIGHT); panelGautraisValues.add(panelAlphaF); JLabel lblAlphaF = new JLabel("alpha f"); panelAlphaF.add(lblAlphaF); final JFormattedTextField frmtdtxtfldAlphaF = new JFormattedTextField(doubleFormat); frmtdtxtfldAlphaF.setHorizontalAlignment(SwingConstants.TRAILING); panelAlphaF.add(frmtdtxtfldAlphaF); frmtdtxtfldAlphaF.setColumns(4); frmtdtxtfldAlphaF.setValue((Number) 162.3); JPanel panelBetaF = new JPanel(); FlowLayout flowLayout_9 = (FlowLayout) panelBetaF.getLayout(); flowLayout_9.setAlignment(FlowLayout.RIGHT); panelGautraisValues.add(panelBetaF); JLabel lblBetaF = new JLabel("beta f"); panelBetaF.add(lblBetaF); final JFormattedTextField frmtdtxtfldBetaF = new JFormattedTextField(doubleFormat); frmtdtxtfldBetaF.setHorizontalAlignment(SwingConstants.TRAILING); panelBetaF.add(frmtdtxtfldBetaF); frmtdtxtfldBetaF.setColumns(4); frmtdtxtfldBetaF.setValue((Number) 75.4); JPanel panelEnvironmentVariables = new JPanel(); panelTab3.add(panelEnvironmentVariables); panelEnvironmentVariables.setLayout(new BoxLayout(panelEnvironmentVariables, BoxLayout.Y_AXIS)); JLabel lblEnvironmentVariables = new JLabel("Environment Variables"); lblEnvironmentVariables.setAlignmentX(Component.CENTER_ALIGNMENT); panelEnvironmentVariables.add(lblEnvironmentVariables); panelAngle = new JPanel(); FlowLayout flowLayout_10 = (FlowLayout) panelAngle.getLayout(); flowLayout_10.setAlignment(FlowLayout.RIGHT); panelEnvironmentVariables.add(panelAngle); JLabel lblAngle = new JLabel("Angle"); panelAngle.add(lblAngle); final JFormattedTextField frmtdtxtfldAngle = new JFormattedTextField(doubleFormat); frmtdtxtfldAngle.setHorizontalAlignment(SwingConstants.TRAILING); frmtdtxtfldAngle.setToolTipText("Angle between destinations"); panelAngle.add(frmtdtxtfldAngle); frmtdtxtfldAngle.setColumns(3); frmtdtxtfldAngle.setValue((Number) 72.00); panelNumberOfDestinations = new JPanel(); FlowLayout flowLayout_13 = (FlowLayout) panelNumberOfDestinations.getLayout(); flowLayout_13.setAlignment(FlowLayout.RIGHT); panelNumberOfDestinations.setVisible(false); panelEnvironmentVariables.add(panelNumberOfDestinations); JLabel lblNumberOfDestinations = new JLabel("Number of Destinations"); panelNumberOfDestinations.add(lblNumberOfDestinations); JFormattedTextField frmtdtxtfldNumberOfDestinations = new JFormattedTextField(countFormat); frmtdtxtfldNumberOfDestinations.setHorizontalAlignment(SwingConstants.TRAILING); panelNumberOfDestinations.add(frmtdtxtfldNumberOfDestinations); frmtdtxtfldNumberOfDestinations.setColumns(3); frmtdtxtfldNumberOfDestinations.setValue((Number) 2); panelDistance = new JPanel(); FlowLayout flowLayout_11 = (FlowLayout) panelDistance.getLayout(); flowLayout_11.setAlignment(FlowLayout.RIGHT); panelEnvironmentVariables.add(panelDistance); JLabel lblDistance = new JLabel("Distance"); panelDistance.add(lblDistance); frmtdtxtfldDistance = new JFormattedTextField(doubleFormat); frmtdtxtfldDistance.setHorizontalAlignment(SwingConstants.TRAILING); frmtdtxtfldDistance.setToolTipText("Distance the destination is from origin (0,0)"); panelDistance.add(frmtdtxtfldDistance); frmtdtxtfldDistance.setColumns(3); frmtdtxtfldDistance.setValue((Number) 150.0); panelPercentage = new JPanel(); FlowLayout flowLayout_12 = (FlowLayout) panelPercentage.getLayout(); flowLayout_12.setAlignment(FlowLayout.RIGHT); panelEnvironmentVariables.add(panelPercentage); JLabel lblPercentage = new JLabel("Percentage"); panelPercentage.add(lblPercentage); frmtdtxtfldPercentage = new JFormattedTextField(doubleFormat); frmtdtxtfldPercentage.setHorizontalAlignment(SwingConstants.TRAILING); frmtdtxtfldPercentage.setToolTipText( "The percentage moving to one of the two destinations ( The other gets 1 - percentage)."); panelPercentage.add(frmtdtxtfldPercentage); frmtdtxtfldPercentage.setColumns(3); frmtdtxtfldPercentage.setValue((Number) 0.500); panelInformedCount = new JPanel(); panelEnvironmentVariables.add(panelInformedCount); JLabel lblInformedCount = new JLabel("Informed Count"); panelInformedCount.add(lblInformedCount); final JFormattedTextField frmtdtxtfldInformedCount = new JFormattedTextField(countFormat); frmtdtxtfldInformedCount.setHorizontalAlignment(SwingConstants.TRAILING); frmtdtxtfldInformedCount.setColumns(3); frmtdtxtfldInformedCount.setToolTipText( "The number of agents moving toward a preferred destination. This number is duplicated on the southern pole as well."); frmtdtxtfldInformedCount.setValue((Number) 4); panelInformedCount.setVisible(false); panelInformedCount.add(frmtdtxtfldInformedCount); JPanel panelStartButtons = new JPanel(); JButton btnStartSimulation = new JButton("Create Simulator Instance"); btnStartSimulation.setToolTipText("Creates a new simulator instance from the settings provided."); btnStartSimulation.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { boolean isReady = true; ErrorPacketContainer errorPacketContainer = new ErrorPacketContainer(); if (jframeErrorMessages != null && jframeErrorMessages.isVisible()) { jframeErrorMessages.dispose(); } frmtdtxtfldRunCount.setBackground(Color.WHITE); frmtdtxtfldSimCount.setBackground(Color.WHITE); frmtdtxtfldMaxTimeSteps.setBackground(Color.WHITE); frmtdtxtfldPredationMinimum.setBackground(Color.WHITE); frmtdtxtfldPredationConstant.setBackground(Color.WHITE); frmtdtxtfldNearestNeighborCount.setBackground(Color.WHITE); frmtdtxtfldMaxLocationRadius.setBackground(Color.WHITE); frmtdtxtfldPercentage.setBackground(Color.WHITE); frmtdtxtfldDistance.setBackground(Color.WHITE); frmtdtxtfldDestinationRadius.setBackground(Color.WHITE); frmtdtxtfldAngle.setBackground(Color.WHITE); frmtdtxtfldInformedCount.setBackground(Color.WHITE); StringBuilder errorMessages = new StringBuilder(); if (((Number) frmtdtxtfldRunCount.getValue()).intValue() <= 0) { errorMessages.append("Run Count must be positive\n"); frmtdtxtfldRunCount.setBackground(Color.YELLOW); errorPacketContainer.addPacket("Run Count must be positive", frmtdtxtfldRunCount, 0); isReady = false; } if (((Number) frmtdtxtfldSimCount.getValue()).intValue() <= 0) { errorMessages.append("Sim Count must be positive\n"); frmtdtxtfldSimCount.setBackground(Color.YELLOW); errorPacketContainer.addPacket("Sim Count must be positive", frmtdtxtfldSimCount, 0); isReady = false; } if (((Number) frmtdtxtfldMaxTimeSteps.getValue()).intValue() <= 0) { errorMessages.append("Max Time Steps must be positive\n"); frmtdtxtfldMaxTimeSteps.setBackground(Color.YELLOW); errorPacketContainer.addPacket("Max Time Steps must be positive", frmtdtxtfldMaxTimeSteps, 0); isReady = false; } if (((Number) frmtdtxtfldPredationMinimum.getValue()).doubleValue() < 0 && chckbxPredationEnable.isSelected()) { errorMessages.append("Predation Minimum must be positive\n"); frmtdtxtfldPredationMinimum.setBackground(Color.YELLOW); errorPacketContainer.addPacket("Predation Minimum must be positive", frmtdtxtfldPredationMinimum, 1); isReady = false; } if (((Number) frmtdtxtfldPredationConstant.getValue()).doubleValue() <= 0 && chckbxPredationEnable.isSelected()) { errorMessages.append("Predation Constant must be positive\n"); frmtdtxtfldPredationConstant.setBackground(Color.YELLOW); errorPacketContainer.addPacket("Predation Constant must be positive", frmtdtxtfldPredationConstant, 1); isReady = false; } if (((Number) frmtdtxtfldNearestNeighborCount.getValue()).intValue() < 0 && panelNearestNeighborCount.isVisible()) { errorMessages.append("Nearest Neighbor Count must be positive\n"); frmtdtxtfldNearestNeighborCount.setBackground(Color.YELLOW); errorPacketContainer.addPacket("Nearest Neighbor Count must be positive", frmtdtxtfldNearestNeighborCount, 1); isReady = false; } if (((Number) frmtdtxtfldMaxLocationRadius.getValue()).doubleValue() < 0 && panelMaxLocationRadius.isVisible()) { errorMessages.append("Max Location Radius must be positive\n"); frmtdtxtfldMaxLocationRadius.setBackground(Color.YELLOW); errorPacketContainer.addPacket("Max Location Radius must be positive", frmtdtxtfldMaxLocationRadius, 1); isReady = false; } if ((((Number) frmtdtxtfldPercentage.getValue()).doubleValue() < 0.0 || ((Number) frmtdtxtfldPercentage.getValue()).doubleValue() > 1.0) && panelPercentage.isVisible()) { errorMessages.append( "Percentage needs to be greater than or equal to 0 and less than or equal to 1\n"); frmtdtxtfldPercentage.setBackground(Color.YELLOW); errorPacketContainer.addPacket( "Percentage needs to be greater than or equal to 0 and less than or equal to 1", frmtdtxtfldPercentage, 2); isReady = false; } if (((Number) frmtdtxtfldDistance.getValue()).doubleValue() <= 0 && frmtdtxtfldDistance.isVisible()) { errorMessages.append("Distance must be positive\n"); frmtdtxtfldDistance.setBackground(Color.YELLOW); errorPacketContainer.addPacket("Distance must be positive", frmtdtxtfldDistance, 2); isReady = false; } if (((Number) frmtdtxtfldDestinationRadius.getValue()).doubleValue() <= 0) { errorMessages.append("Destination Radius must be positive\n"); frmtdtxtfldDestinationRadius.setBackground(Color.YELLOW); errorPacketContainer.addPacket("Destination Radius must be positive", frmtdtxtfldDestinationRadius, 0); isReady = false; } if (((Number) frmtdtxtfldAngle.getValue()).doubleValue() < 0) { errorMessages.append("Angle must be positive or zero\n"); frmtdtxtfldAngle.setBackground(Color.YELLOW); errorPacketContainer.addPacket("Angle must be positive", frmtdtxtfldAngle, 2); isReady = false; } if (((Number) frmtdtxtfldInformedCount.getValue()).intValue() <= 0) { errorMessages.append("Informed Count must be positive\n"); frmtdtxtfldInformedCount.setBackground(Color.YELLOW); errorPacketContainer.addPacket("Informed Count must be positive", frmtdtxtfldInformedCount, 2); isReady = false; } else if (((Number) frmtdtxtfldInformedCount.getValue()).intValue() * 2 > sliderAgent.getValue()) { errorMessages.append("Informed Count should at most be half the count of total agents\n"); frmtdtxtfldInformedCount.setBackground(Color.YELLOW); errorPacketContainer.addPacket( "Informed Count should at most be half the count of total agents", frmtdtxtfldInformedCount, 2); isReady = false; } if (!isReady) { jframeErrorMessages = createJFrameErrorMessages(errorPacketContainer, tabbedPane); jframeErrorMessages.setVisible(true); } else { _simulatorProperties = new Properties(); _simulatorProperties.put("run-count", String.valueOf(frmtdtxtfldRunCount.getValue())); _simulatorProperties.put("simulation-count", String.valueOf(frmtdtxtfldSimCount.getValue())); _simulatorProperties.put("max-simulation-time-steps", String.valueOf(frmtdtxtfldMaxTimeSteps.getValue())); _simulatorProperties.put("random-seed", String.valueOf(1)); // Doesn't change _simulatorProperties.put("individual-count", String.valueOf(sliderAgent.getValue())); _simulatorProperties.put("run-graphical", String.valueOf(chckbxGraphical.isSelected())); _simulatorProperties.put("pre-calculate-probabilities", String.valueOf(false)); // Doesn't change _simulatorProperties.put("use-random-random-seed", String.valueOf(chckbxRandomSeed.isSelected())); _simulatorProperties.put("can-multiple-initiate", String.valueOf(true)); // Doesn't change _simulatorProperties.put("eskridge-results", String.valueOf(chckbxEskridge.isSelected())); _simulatorProperties.put("conflict-results", String.valueOf(chckbxConflict.isSelected())); _simulatorProperties.put("position-results", String.valueOf(chckbxPosition.isSelected())); _simulatorProperties.put("predation-results", String.valueOf(chckbxPredationResults.isSelected())); _simulatorProperties.put("communication-type", String.valueOf(comboBoxCommType.getSelectedItem()).toLowerCase()); _simulatorProperties.put("nearest-neighbor-count", String.valueOf(frmtdtxtfldNearestNeighborCount.getValue())); _simulatorProperties.put("max-location-radius", String.valueOf(frmtdtxtfldMaxLocationRadius.getValue())); _simulatorProperties.put("destination-size-radius", String.valueOf(frmtdtxtfldDestinationRadius.getValue())); _simulatorProperties.put("max-agents-eaten-per-step", String.valueOf(spinnerMaxEaten.getValue())); _simulatorProperties.put("enable-predator", String.valueOf(chckbxPredationEnable.isSelected())); _simulatorProperties.put("predation-probability-minimum", String.valueOf(frmtdtxtfldPredationMinimum.getValue())); _simulatorProperties.put("predation-multiplier", String.valueOf(frmtdtxtfldPredationConstant.getValue())); _simulatorProperties.put("use-predation-threshold", String.valueOf(chckbxUsePredationThreshold.isSelected())); _simulatorProperties.put("predation-threshold", String.valueOf(spinnerPredationThreshold.getValue())); _simulatorProperties.put("predation-by-population", String.valueOf(chckbxPopulationIndependent.isSelected())); _simulatorProperties.put("count-non-movers-as-survivors", String.valueOf(chckbxNonMoversSurvive.isSelected())); _simulatorProperties.put("stop-at-any-destination", String.valueOf(chckbxStopAnywhere.isSelected())); _simulatorProperties.put("adhesion-time-limit", String.valueOf(frmtdtxtfldMaxTimeSteps.getValue())); _simulatorProperties.put("alpha", String.valueOf(frmtdtxtfldAlpha.getValue())); _simulatorProperties.put("alpha-c", String.valueOf(frmtdtxtfldAlphaC.getValue())); _simulatorProperties.put("beta", String.valueOf(frmtdtxtfldBeta.getValue())); _simulatorProperties.put("beta-c", String.valueOf(frmtdtxtfldBetaC.getValue())); _simulatorProperties.put("S", String.valueOf(frmtdtxtfldS.getValue())); _simulatorProperties.put("q", String.valueOf(frmtdtxtfldQ.getValue())); _simulatorProperties.put("lambda", String.valueOf(0.2)); _simulatorProperties.put("tau-o", String.valueOf(frmtdtxtfldTaoO.getValue())); _simulatorProperties.put("gamma-c", String.valueOf(frmtdtxtfldGammaC.getValue())); _simulatorProperties.put("epsilon-c", String.valueOf(frmtdtxtfldEpsilonC.getValue())); _simulatorProperties.put("alpha-f", String.valueOf(frmtdtxtfldAlphaF.getValue())); _simulatorProperties.put("beta-f", String.valueOf(frmtdtxtfldBetaF.getValue())); _simulatorProperties.put("default-conflict-value", String.valueOf(spinnerDefaultConflict.getValue())); _simulatorProperties.put("cancellation-threshold", String.valueOf(spinnerCancelationThreshold.getValue())); StringBuilder sbAgentBuilder = new StringBuilder(); sbAgentBuilder.append("edu.snu.leader.discrete.simulator.Sueur"); sbAgentBuilder.append(comboBoxAgentBuilder.getSelectedItem().toString().replace(" ", "")); sbAgentBuilder.append("AgentBuilder"); _simulatorProperties.put("agent-builder", String.valueOf(sbAgentBuilder.toString())); StringBuilder sbDecisionCalculator = new StringBuilder(); sbDecisionCalculator.append("edu.snu.leader.discrete.simulator."); sbDecisionCalculator.append(comboBoxModel.getSelectedItem()); // sbDecisionCalculator.append(comboBoxDecisionCalculator.getSelectedItem()); sbDecisionCalculator .append(comboBoxDecisionCalculator.getSelectedItem().toString().replace(" ", "")); sbDecisionCalculator.append("DecisionCalculator"); _simulatorProperties.put("decision-calculator", String.valueOf(sbDecisionCalculator.toString())); StringBuilder sbLocationsFile = new StringBuilder(); sbLocationsFile.append("cfg/sim/locations/metric/valid-metric-loc-"); sbLocationsFile.append(String.format("%03d", sliderAgent.getValue())); sbLocationsFile.append("-seed-00001.dat"); _simulatorProperties.put("locations-file", String.valueOf(sbLocationsFile.toString())); //create destination file DestinationBuilder db = new DestinationBuilder(sliderAgent.getValue(), 1L); StringBuilder sbDestinationsFile = new StringBuilder(); sbDestinationsFile.append("cfg/sim/destinations/destinations-"); switch (comboBoxEnvironment.getSelectedItem().toString()) { case ("Minimum"): sbDestinationsFile.append("diffdis-" + sliderAgent.getValue()); sbDestinationsFile.append("-per-" + frmtdtxtfldPercentage.getValue()); sbDestinationsFile.append("-seed-1.dat"); db.generateDifferentDistance(((Number) frmtdtxtfldPercentage.getValue()).doubleValue(), 200, 100, 75); break; case ("Medium"): sbDestinationsFile.append("split-" + sliderAgent.getValue()); sbDestinationsFile.append("-dis-" + frmtdtxtfldDistance.getValue()); sbDestinationsFile.append("-ang-" + String.format("%.2f", ((Number) frmtdtxtfldAngle.getValue()).doubleValue())); sbDestinationsFile.append("-per-" + String.format("%.3f", ((Number) frmtdtxtfldPercentage.getValue()).doubleValue())); sbDestinationsFile.append("-seed-1.dat"); db.generateSplitNorth(((Number) frmtdtxtfldDistance.getValue()).doubleValue(), ((Number) frmtdtxtfldAngle.getValue()).doubleValue(), ((Number) frmtdtxtfldPercentage.getValue()).doubleValue()); break; case ("Maximum"): sbDestinationsFile.append("poles-" + sliderAgent.getValue()); sbDestinationsFile.append("-per-" + frmtdtxtfldPercentage.getValue()); sbDestinationsFile.append("-seed-1.dat"); db.generatePoles(50, 100, ((Number) frmtdtxtfldPercentage.getValue()).doubleValue()); break; case ("Uninformed"): sbDestinationsFile.append("split-poles-" + frmtdtxtfldInformedCount.getValue()); sbDestinationsFile.append("-dis-" + String.format("%.1f", ((Number) frmtdtxtfldDistance.getValue()).doubleValue())); sbDestinationsFile.append("-ang-" + String.format("%.2f", ((Number) frmtdtxtfldAngle.getValue()).doubleValue())); sbDestinationsFile.append("-per-" + String.format("%.3f", ((Number) frmtdtxtfldPercentage.getValue()).doubleValue())); sbDestinationsFile.append("-seed-1.dat"); db.generateSplitPoles(((Number) frmtdtxtfldDistance.getValue()).doubleValue(), ((Number) frmtdtxtfldAngle.getValue()).doubleValue(), ((Number) frmtdtxtfldPercentage.getValue()).doubleValue(), ((Number) frmtdtxtfldInformedCount.getValue()).intValue()); break; default: //Should never happen break; } _simulatorProperties.put("destinations-file", String.valueOf(sbDestinationsFile.toString())); _simulatorProperties.put("live-delay", String.valueOf(15)); //Doesn't change _simulatorProperties.put("results-dir", "results"); //Doesn't change new Thread(new Runnable() { public void run() { try { runSimulation(); } catch (Exception e) { e.printStackTrace(); } } }).start(); } } }); panelStartButtons.add(btnStartSimulation); JButton btnStartSimulationFrom = new JButton("Run Simulation from Properties File"); btnStartSimulationFrom .setToolTipText("Runs the simulator with the values provided in the properties file."); btnStartSimulationFrom.setEnabled(false); panelStartButtons.add(btnStartSimulationFrom); panelTab3.add(panelStartButtons); }
From source file:at.becast.youploader.gui.FrmMain.java
public void initQueuetab() { JScrollPane TabQueues = new JScrollPane(); QueuePanel = new JPanel(); TabQueues.setViewportView(QueuePanel); QueuePanel.setLayout(new MigLayout("", "[875px,grow,fill]", "[][][][]")); JPanel buttonPanel = new JPanel(); GridBagConstraints gbc_panel_2 = new GridBagConstraints(); gbc_panel_2.fill = GridBagConstraints.BOTH; gbc_panel_2.gridx = 0;/*from w w w .j av a 2 s . c om*/ gbc_panel_2.gridy = 1; buttonPanel.setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(39dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(92dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(46dlu;min)"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("left:max(22dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("max(0dlu;default)"), })); JButton btnStart = new JButton(LANG.getString("frmMain.start")); btnStart.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { startUploads(); } }); JLabel lblAfterUploadsFinish = new JLabel(LANG.getString("frmMain.afterfinish")); buttonPanel.add(lblAfterUploadsFinish, "10, 2, 7, 1"); buttonPanel.add(btnStart, "2, 4"); JButton btnStop = new JButton(LANG.getString("frmMain.stop")); btnStop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UploadMgr.stop(); } }); buttonPanel.add(btnStop, "6, 4"); cmbAfterFinish = new JComboBox<Object>(); cmbAfterFinish.setModel(new DefaultComboBoxModel<Object>(new String[] { LANG.getString("frmMain.afterfinish.donothing"), LANG.getString("frmMain.afterfinish.suspend"), LANG.getString("frmMain.afterfinish.shutdown") })); buttonPanel.add(cmbAfterFinish, "10, 4, 7, 1, fill, default"); JLabel lblUploads = new JLabel(LANG.getString("frmMain.uploads") + ":"); buttonPanel.add(lblUploads, "18, 4, right, fill"); JSlider slider = new JSlider(); slider.setPaintTicks(true); slider.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { JSlider s = (JSlider) evt.getSource(); UploadMgr.setUploadlimit(s.getValue()); } }); slider.setMajorTickSpacing(1); slider.setMinorTickSpacing(1); slider.setMinimum(1); slider.setMaximum(5); slider.setValue(1); slider.setSnapToTicks(true); slider.setPaintLabels(true); buttonPanel.add(slider, "20, 4, fill, fill"); JLabel lblUploadSpeed = new JLabel(LANG.getString("frmMain.uploadspeed") + ":"); lblUploadSpeed.setHorizontalAlignment(SwingConstants.TRAILING); buttonPanel.add(lblUploadSpeed, "24, 4"); spinner = new JSpinner(); spinner.setModel(new SpinnerNumberModel(new Integer(0), new Integer(0), null, new Integer(10))); spinner.setEditor(new SpeedValuesSpinnerEditor(spinner)); spinner.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { JSpinner s = (JSpinner) e.getSource(); speed = Integer.parseInt(s.getValue().toString()); Main.s.put("speed", String.valueOf(speed)); UploadMgr.setLimit(speed); } }); spinner.setValue(speed); buttonPanel.add(spinner, "26, 4"); JLabel lblKbps = new JLabel("kbps"); buttonPanel.add(lblKbps, "28, 4"); JPanel TabQueue = new JPanel(); TabbedPane.addTab(LANG.getString("frmMain.Tabs.Queue"), null, TabQueue, null); TabQueue.setLayout(new BorderLayout(0, 0)); TabQueue.add(buttonPanel, BorderLayout.SOUTH); TabQueue.add(TabQueues, BorderLayout.CENTER); }
From source file:jeplus.JEPlusFrameMain.java
/** This method is called from within the constructor to * initialize the form.//from www .j a va2s.c om * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { btg = new javax.swing.ButtonGroup(); rdoExportIndividual = new javax.swing.JRadioButton(); rdoCombineResults = new javax.swing.JRadioButton(); rdoTestFirstN = new javax.swing.JRadioButton(); txtTestFirstN = new javax.swing.JTextField(); jLabel9 = new javax.swing.JLabel(); chkLHS = new javax.swing.JCheckBox(); jSplitPane1 = new javax.swing.JSplitPane(); tpnMain = new javax.swing.JTabbedPane(); pnlProject = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); jplTree = new javax.swing.JPanel(); jplProjectFilesPanelHolder = new javax.swing.JPanel(); jPanel_EPlusProjectFiles2 = new jeplus.gui.JPanel_EPlusProjectFiles(); cboProjectType = new javax.swing.JComboBox(); jLabel2 = new javax.swing.JLabel(); cmdValidate = new javax.swing.JButton(); pnlExecution = new javax.swing.JPanel(); cboExecutionType = new javax.swing.JComboBox(); jLabel27 = new javax.swing.JLabel(); jplSettings = new javax.swing.JPanel(); jplEPlusSettings = new jeplus.gui.JPanel_EPlusSettings(); jplOptions = new javax.swing.JPanel(); jplLocalControllerSettings = new jeplus.gui.JPanel_LocalControllerOptions(); jPanel3 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); rdoTestChains = new javax.swing.JRadioButton(); rdoTestRandomN = new javax.swing.JRadioButton(); txtTestRandomN = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); txtRandomSeed = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); cmdStart = new javax.swing.JButton(); rdoJobListFile = new javax.swing.JRadioButton(); rdoAllJobs = new javax.swing.JRadioButton(); txtJobListFile = new javax.swing.JTextField(); cmdSelectJobListFile = new javax.swing.JButton(); cmdEditJobListFile = new javax.swing.JButton(); chkOverride = new javax.swing.JCheckBox(); cboSampleOpt = new javax.swing.JComboBox(); pnlUtilities = new javax.swing.JPanel(); TpnUtilities = new javax.swing.JTabbedPane(); TpnEditors = new javax.swing.JTabbedPane(); jMenuBarMain = new javax.swing.JMenuBar(); jMenuFile = new javax.swing.JMenu(); jMenuItemNew = new javax.swing.JMenuItem(); jMenuItemOpen = new javax.swing.JMenuItem(); jMenuRecent = new javax.swing.JMenu(); jMenuItemSave = new javax.swing.JMenuItem(); jMenuItemSaveAs = new javax.swing.JMenuItem(); jSeparator2 = new javax.swing.JSeparator(); jMenuItemImportJson = new javax.swing.JMenuItem(); jMenuItemExportJson = new javax.swing.JMenuItem(); jSeparator10 = new javax.swing.JPopupMenu.Separator(); jMenuItemOpenTree = new javax.swing.JMenuItem(); jMenuItemSaveTree = new javax.swing.JMenuItem(); jSeparator3 = new javax.swing.JSeparator(); jMenuItemExit = new javax.swing.JMenuItem(); jMenuEdit = new javax.swing.JMenu(); jMenuItemImportTable = new javax.swing.JMenuItem(); jMenuItemExportTable = new javax.swing.JMenuItem(); jMenuItemResetTree = new javax.swing.JMenuItem(); jSeparator7 = new javax.swing.JPopupMenu.Separator(); jMenuItemToRelative = new javax.swing.JMenuItem(); jMenuItemToAbsolute = new javax.swing.JMenuItem(); jMenuAction = new javax.swing.JMenu(); jMenuItemValidate = new javax.swing.JMenuItem(); jMenuItemSimulate = new javax.swing.JMenuItem(); jMenuItemPostprocess = new javax.swing.JMenuItem(); jSeparator6 = new javax.swing.JPopupMenu.Separator(); jMenuItemMonitor = new javax.swing.JMenuItem(); jMenuItemStop = new javax.swing.JMenuItem(); jMenuViewResult = new javax.swing.JMenu(); jMenuItemViewFolder = new javax.swing.JMenuItem(); jMenuItemViewIndex = new javax.swing.JMenuItem(); jMenuItemViewReports = new javax.swing.JMenuItem(); jSeparator9 = new javax.swing.JPopupMenu.Separator(); jMenuItemCreateJobList = new javax.swing.JMenuItem(); jMenuItemCreateIndex = new javax.swing.JMenuItem(); jSeparator12 = new javax.swing.JPopupMenu.Separator(); jMenuItemJESSClient = new javax.swing.JMenuItem(); jMenuItemJEPlusEA = new javax.swing.JMenuItem(); jMenuTools = new javax.swing.JMenu(); jMenuItemConfig = new javax.swing.JMenuItem(); jSeparator4 = new javax.swing.JSeparator(); jMenuItemViewErr = new javax.swing.JMenuItem(); jMenuItemViewLog = new javax.swing.JMenuItem(); jSeparator8 = new javax.swing.JPopupMenu.Separator(); jMenuItemVersionConverter = new javax.swing.JMenuItem(); jMenuItemRunPython = new javax.swing.JMenuItem(); jMenuItemRunReadVars = new javax.swing.JMenuItem(); jSeparator5 = new javax.swing.JPopupMenu.Separator(); jMenuItemMemoryUsage = new javax.swing.JMenuItem(); jMenuItemDefaultLaF = new javax.swing.JMenuItem(); jMenuItemEditorTheme = new javax.swing.JMenuItem(); jMenuHelp = new javax.swing.JMenu(); jMenuItemUserGuide = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JSeparator(); jMenuItemAbout = new javax.swing.JMenuItem(); rdoExportIndividual.setText("Export individual results as: [job-id]_"); rdoExportIndividual.setEnabled(false); rdoExportIndividual.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rdoExportIndividualActionPerformed(evt); } }); rdoCombineResults.setSelected(true); rdoCombineResults.setText("Assemble results into CSV"); rdoCombineResults.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rdoCombineResultsActionPerformed(evt); } }); btg.add(rdoTestFirstN); rdoTestFirstN.setText("The first "); rdoTestFirstN.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rdoTestFirstNActionPerformed(evt); } }); txtTestFirstN.setText("10"); txtTestFirstN.setEnabled(false); jLabel9.setText("jobs"); chkLHS.setText("LHS"); chkLHS.setEnabled(false); chkLHS.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chkLHSActionPerformed(evt); } }); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setMinimumSize(new java.awt.Dimension(1000, 740)); setPreferredSize(new java.awt.Dimension(1200, 760)); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); jSplitPane1.setBorder(null); jSplitPane1.setDividerLocation(580); jSplitPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jSplitPane1.setOpaque(false); jSplitPane1.setPreferredSize(new java.awt.Dimension(1024, 719)); tpnMain.setToolTipText("Project specifications / Execution settings / optional Post process"); tpnMain.setPreferredSize(new java.awt.Dimension(450, 708)); tpnMain.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { tpnMainStateChanged(evt); } }); pnlProject.setPreferredSize(new java.awt.Dimension(450, 688)); jplTree.setBorder(javax.swing.BorderFactory.createTitledBorder("Parameter Tree")); jplTree.setLayout(new java.awt.BorderLayout()); javax.swing.GroupLayout jplProjectFilesPanelHolderLayout = new javax.swing.GroupLayout( jplProjectFilesPanelHolder); jplProjectFilesPanelHolder.setLayout(jplProjectFilesPanelHolderLayout); jplProjectFilesPanelHolderLayout.setHorizontalGroup(jplProjectFilesPanelHolderLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel_EPlusProjectFiles2, javax.swing.GroupLayout.DEFAULT_SIZE, 485, Short.MAX_VALUE)); jplProjectFilesPanelHolderLayout.setVerticalGroup( jplProjectFilesPanelHolderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel_EPlusProjectFiles2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jplProjectFilesPanelHolder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(jplTree, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE) .addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(jplProjectFilesPanelHolder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jplTree, javax.swing.GroupLayout.DEFAULT_SIZE, 482, Short.MAX_VALUE) .addContainerGap())); cboProjectType.setModel(new javax.swing.DefaultComboBoxModel( new String[] { "EnergyPlus Project", "TRNSYS Project", "INSEL Project" })); cboProjectType.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cboProjectTypeActionPerformed(evt); } }); jLabel2.setText("Select Project type:"); cmdValidate.setText("Validate project"); cmdValidate.setToolTipText("Validate the configuration"); cmdValidate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmdValidateActionPerformed(evt); } }); javax.swing.GroupLayout pnlProjectLayout = new javax.swing.GroupLayout(pnlProject); pnlProject.setLayout(pnlProjectLayout); pnlProjectLayout.setHorizontalGroup(pnlProjectLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlProjectLayout.createSequentialGroup() .addContainerGap().addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(cboProjectType, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 92, Short.MAX_VALUE) .addComponent(cmdValidate).addContainerGap())); pnlProjectLayout.setVerticalGroup(pnlProjectLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnlProjectLayout.createSequentialGroup().addContainerGap().addGroup(pnlProjectLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cboProjectType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2).addComponent(cmdValidate)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); tpnMain.addTab("Project", pnlProject); pnlExecution.setPreferredSize(new java.awt.Dimension(500, 688)); cboExecutionType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Local batch controller", "Offline PBS script generator", "Local PBS controller", "JEPlusPlus Job Server (PBS only)", "JEPlusPlus Job Server (Windows only)", "JEPlusPlus Job Server" })); cboExecutionType.setToolTipText("Select execution type here"); cboExecutionType.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cboExecutionTypeActionPerformed(evt); } }); jLabel27.setText("Select execution controller: "); jplSettings.setBorder(javax.swing.BorderFactory.createTitledBorder("Executables")); jplSettings.setLayout(new java.awt.BorderLayout()); jplSettings.add(jplEPlusSettings, java.awt.BorderLayout.CENTER); jplOptions.setBorder(javax.swing.BorderFactory.createTitledBorder("Options")); jplOptions.setLayout(new java.awt.BorderLayout()); jplOptions.add(jplLocalControllerSettings, java.awt.BorderLayout.CENTER); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Actions")); btg.add(rdoTestChains); rdoTestChains.setSelected(true); rdoTestChains.setText("The first job of each parameter chain (see validation report for parameter chains)"); rdoTestChains.setToolTipText( "This option is for testing jobs only. The job IDs it uses may be different to other modes."); rdoTestChains.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rdoTestChainsActionPerformed(evt); } }); btg.add(rdoTestRandomN); rdoTestRandomN.setText("A random sample of "); rdoTestRandomN.setToolTipText("Run a random sample of the whole project."); rdoTestRandomN.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rdoTestRandomNActionPerformed(evt); } }); txtTestRandomN.setText("1000"); txtTestRandomN.setToolTipText("Sample size"); txtTestRandomN.setEnabled(false); jLabel5.setText(" jobs, using: "); txtRandomSeed.setText("12345"); txtRandomSeed.setToolTipText( "Set a random seed to fix the job sequence. If a negative value is specified, the current time is used as the seed."); txtRandomSeed.setEnabled(false); jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel4.setText("Random Seed:"); cmdStart.setText("Run Batch"); cmdStart.setToolTipText("Start batch simulation"); cmdStart.setActionCommand("start"); cmdStart.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmdStartActionPerformed(evt); } }); btg.add(rdoJobListFile); rdoJobListFile.setText("Job list in file: "); rdoJobListFile.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rdoJobListFileActionPerformed(evt); } }); btg.add(rdoAllJobs); rdoAllJobs.setText("All jobs"); rdoAllJobs.setToolTipText("This option will start ALL jobs in the project."); rdoAllJobs.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rdoAllJobsActionPerformed(evt); } }); txtJobListFile.setText("jobs.csv"); txtJobListFile.setToolTipText("For the format of a job list file, please refer to the users manual."); txtJobListFile.setEnabled(false); cmdSelectJobListFile.setText("..."); cmdSelectJobListFile.setToolTipText("Select a job list file"); cmdSelectJobListFile.setEnabled(false); cmdSelectJobListFile.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmdSelectJobListFileActionPerformed(evt); } }); cmdEditJobListFile .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/page_white_edit.png"))); // NOI18N cmdEditJobListFile.setToolTipText("Edit the contents of the file"); cmdEditJobListFile.setEnabled(false); cmdEditJobListFile.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmdEditJobListFileActionPerformed(evt); } }); chkOverride.setSelected(true); chkOverride.setText("Override existing results"); chkOverride.setToolTipText( "If unchecked, jEPlus will skip the cases whose results are already present in the output folder."); chkOverride.setEnabled(false); cboSampleOpt.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); cboSampleOpt.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cboSampleOptActionPerformed(evt); } }); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rdoTestChains, javax.swing.GroupLayout.DEFAULT_SIZE, 507, Short.MAX_VALUE) .addGroup(jPanel4Layout.createSequentialGroup().addComponent(rdoTestRandomN) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(txtTestRandomN, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(cboSampleOpt, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(18, 18, 18).addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtRandomSeed, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel4Layout.createSequentialGroup().addComponent(rdoJobListFile) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(txtJobListFile) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cmdSelectJobListFile, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cmdEditJobListFile, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(rdoAllJobs, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addComponent(chkOverride, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(18, 18, 18).addComponent(cmdStart, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap())); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addComponent(rdoTestChains) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rdoTestRandomN) .addComponent(txtTestRandomN, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtRandomSeed, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4).addComponent(jLabel5).addComponent(cboSampleOpt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rdoJobListFile).addComponent(txtJobListFile, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(cmdSelectJobListFile, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cmdEditJobListFile)) .addGap(7, 7, 7).addComponent(rdoAllJobs).addGap(18, 18, 18) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cmdStart).addComponent(chkOverride)) .addContainerGap(115, Short.MAX_VALUE))); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); javax.swing.GroupLayout pnlExecutionLayout = new javax.swing.GroupLayout(pnlExecution); pnlExecution.setLayout(pnlExecutionLayout); pnlExecutionLayout.setHorizontalGroup(pnlExecutionLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlExecutionLayout.createSequentialGroup() .addContainerGap() .addGroup(pnlExecutionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pnlExecutionLayout.createSequentialGroup().addComponent(jLabel27) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cboExecutionType, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jplSettings, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addComponent(jplOptions, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) .addContainerGap())); pnlExecutionLayout.setVerticalGroup(pnlExecutionLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnlExecutionLayout.createSequentialGroup().addContainerGap() .addGroup(pnlExecutionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cboExecutionType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel27)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jplSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jplOptions, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); tpnMain.addTab("Execution", pnlExecution); javax.swing.GroupLayout pnlUtilitiesLayout = new javax.swing.GroupLayout(pnlUtilities); pnlUtilities.setLayout(pnlUtilitiesLayout); pnlUtilitiesLayout .setHorizontalGroup( pnlUtilitiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlUtilitiesLayout .createSequentialGroup().addContainerGap().addComponent(TpnUtilities, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE) .addContainerGap())); pnlUtilitiesLayout.setVerticalGroup(pnlUtilitiesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnlUtilitiesLayout.createSequentialGroup().addContainerGap() .addComponent(TpnUtilities, javax.swing.GroupLayout.DEFAULT_SIZE, 669, Short.MAX_VALUE) .addContainerGap())); tpnMain.addTab("Utilities", pnlUtilities); jSplitPane1.setLeftComponent(tpnMain); TpnEditors.setMaximumSize(new java.awt.Dimension(900, 1200)); TpnEditors.setPreferredSize(null); jSplitPane1.setRightComponent(TpnEditors); TpnEditors.getAccessibleContext().setAccessibleName("Information"); jMenuFile.setText("File"); jMenuItemNew .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/page_white_add.png"))); // NOI18N jMenuItemNew.setText("New"); jMenuItemNew.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemNewActionPerformed(evt); } }); jMenuFile.add(jMenuItemNew); jMenuItemOpen .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/folder_explore.png"))); // NOI18N jMenuItemOpen.setText("Open ..."); jMenuItemOpen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemOpenActionPerformed(evt); } }); jMenuFile.add(jMenuItemOpen); jMenuRecent.setText("Open recent"); jMenuFile.add(jMenuRecent); jMenuItemSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/save1.png"))); // NOI18N jMenuItemSave.setText("Save "); jMenuItemSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemSaveActionPerformed(evt); } }); jMenuFile.add(jMenuItemSave); jMenuItemSaveAs.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/disk.png"))); // NOI18N jMenuItemSaveAs.setText("Save as ... "); jMenuItemSaveAs.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemSaveAsActionPerformed(evt); } }); jMenuFile.add(jMenuItemSaveAs); jMenuFile.add(jSeparator2); jMenuItemImportJson .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/view_as_json.png"))); // NOI18N jMenuItemImportJson.setText("Import JSON project ..."); jMenuItemImportJson.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemImportJsonActionPerformed(evt); } }); jMenuFile.add(jMenuItemImportJson); jMenuItemExportJson .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/view_as_json.png"))); // NOI18N jMenuItemExportJson.setText("Export JSON project ..."); jMenuItemExportJson.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemExportJsonActionPerformed(evt); } }); jMenuFile.add(jMenuItemExportJson); jMenuFile.add(jSeparator10); jMenuItemOpenTree .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/page_white_get.png"))); // NOI18N jMenuItemOpenTree.setText("Import jE+ v0.5 OBJ file ..."); jMenuItemOpenTree .setToolTipText("Import contents of an .obj file (including v0.5 objs) into this project."); jMenuItemOpenTree.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemOpenTreeActionPerformed(evt); } }); jMenuFile.add(jMenuItemOpenTree); jMenuItemSaveTree .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/page_white_put.png"))); // NOI18N jMenuItemSaveTree.setText("Export jE+ v0.5 OBJ file ..."); jMenuItemSaveTree.setToolTipText("Export the current project to an .obj file."); jMenuItemSaveTree.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemSaveTreeActionPerformed(evt); } }); jMenuFile.add(jMenuItemSaveTree); jMenuFile.add(jSeparator3); jMenuItemExit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/cross.png"))); // NOI18N jMenuItemExit.setText("Exit"); jMenuItemExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemExitActionPerformed(evt); } }); jMenuFile.add(jMenuItemExit); jMenuBarMain.add(jMenuFile); jMenuEdit.setText("Edit"); jMenuItemImportTable .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/page_white_get.png"))); // NOI18N jMenuItemImportTable.setText("Import parameters from CSV ..."); jMenuItemImportTable.setToolTipText("Import parameter definitions from a CSV table."); jMenuItemImportTable.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemImportTableActionPerformed(evt); } }); jMenuEdit.add(jMenuItemImportTable); jMenuItemExportTable .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/page_white_go.png"))); // NOI18N jMenuItemExportTable.setText("Export parameters to CSV ..."); jMenuItemExportTable.setToolTipText("Export parameters in this project to a CSV table"); jMenuItemExportTable.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemExportTableActionPerformed(evt); } }); jMenuEdit.add(jMenuItemExportTable); jMenuItemResetTree.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/cross.png"))); // NOI18N jMenuItemResetTree.setText("Reset parameter tree"); jMenuItemResetTree.setToolTipText("Clear the parameter tree"); jMenuItemResetTree.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemResetTreeActionPerformed(evt); } }); jMenuEdit.add(jMenuItemResetTree); jMenuEdit.add(jSeparator7); jMenuItemToRelative .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/document-save.png"))); // NOI18N jMenuItemToRelative.setText("Change all paths to relative form"); jMenuItemToRelative.setToolTipText( "Change paths in the project to a relative form relative to the location of the project file."); jMenuItemToRelative.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemToRelativeActionPerformed(evt); } }); jMenuEdit.add(jMenuItemToRelative); jMenuItemToAbsolute .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/document-save-as.png"))); // NOI18N jMenuItemToAbsolute.setText("Change all paths to absolute form"); jMenuItemToAbsolute.setToolTipText("Change the path to absolute form."); jMenuItemToAbsolute.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemToAbsoluteActionPerformed(evt); } }); jMenuEdit.add(jMenuItemToAbsolute); jMenuBarMain.add(jMenuEdit); jMenuAction.setText("Action"); jMenuItemValidate.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/check.png"))); // NOI18N jMenuItemValidate.setText("Validate jobs"); jMenuItemValidate.setToolTipText("Validate the current project and count jobs."); jMenuItemValidate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemValidateActionPerformed(evt); } }); jMenuAction.add(jMenuItemValidate); jMenuItemSimulate .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/lightening2.png"))); // NOI18N jMenuItemSimulate.setText("Simulate "); jMenuItemSimulate.setToolTipText("Start simulation."); jMenuItemSimulate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemSimulateActionPerformed(evt); } }); jMenuAction.add(jMenuItemSimulate); jMenuItemPostprocess.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/chart.png"))); // NOI18N jMenuItemPostprocess.setText("Post-process"); jMenuItemPostprocess.setToolTipText("Go to the post process / utilities tab"); jMenuItemPostprocess.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemPostprocessActionPerformed1(evt); } }); jMenuAction.add(jMenuItemPostprocess); jMenuAction.add(jSeparator6); jMenuItemMonitor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/tool.png"))); // NOI18N jMenuItemMonitor.setText("Show Monitor"); jMenuItemMonitor.setToolTipText("Show simulation monitor."); jMenuItemMonitor.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemMonitorActionPerformed(evt); } }); jMenuAction.add(jMenuItemMonitor); jMenuItemStop.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/cross.png"))); // NOI18N jMenuItemStop.setText("Stop Simulation"); jMenuItemStop.setToolTipText("Cancel the current simulation jobs."); jMenuItemStop.setEnabled(false); jMenuItemStop.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemStopActionPerformed(evt); } }); jMenuAction.add(jMenuItemStop); jMenuViewResult.setText("View results"); jMenuViewResult.setToolTipText("View result folder and files"); jMenuViewResult.setEnabled(false); jMenuItemViewFolder .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/folder_explore.png"))); // NOI18N jMenuItemViewFolder.setText("Go to output folder"); jMenuItemViewFolder.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemViewFolderActionPerformed(evt); } }); jMenuViewResult.add(jMenuItemViewFolder); jMenuItemViewIndex.setIcon( new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/page_white_magnify.png"))); // NOI18N jMenuItemViewIndex.setText("View Job Index (JobIndex.csv)"); jMenuItemViewIndex.setActionCommand("View Job Index (SimJobIndex.csv)"); jMenuItemViewIndex.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemViewIndexActionPerformed(evt); } }); jMenuViewResult.add(jMenuItemViewIndex); jMenuItemViewReports.setIcon( new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/page_white_magnify.png"))); // NOI18N jMenuItemViewReports.setText("View Simulation Reports (RunTimes.csv)"); jMenuItemViewReports.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemViewReportsActionPerformed(evt); } }); jMenuViewResult.add(jMenuItemViewReports); jMenuAction.add(jMenuViewResult); jMenuAction.add(jSeparator9); jMenuItemCreateJobList .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/page_key.png"))); // NOI18N jMenuItemCreateJobList.setText("Create the full job list..."); jMenuItemCreateJobList.setToolTipText( "Create the list of jobs in the current project and save it in a CSV file. This list or part of it can be used as a job list file in the future."); jMenuItemCreateJobList.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemCreateJobListActionPerformed(evt); } }); jMenuAction.add(jMenuItemCreateJobList); jMenuItemCreateIndex .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/page_white_key.png"))); // NOI18N jMenuItemCreateIndex.setText("Create parameter indexes"); jMenuItemCreateIndex.setToolTipText("Create index tables for the parameters in this project."); jMenuItemCreateIndex.setEnabled(false); jMenuItemCreateIndex.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemCreateIndexActionPerformed(evt); } }); jMenuAction.add(jMenuItemCreateIndex); jMenuAction.add(jSeparator12); jMenuItemJESSClient.setText("Launch JESS Client"); jMenuItemJESSClient.setEnabled(false); jMenuItemJESSClient.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemJESSClientActionPerformed(evt); } }); jMenuAction.add(jMenuItemJESSClient); jMenuItemJEPlusEA.setText("Launch jEPlus+EA"); jMenuItemJEPlusEA.setEnabled(false); jMenuItemJEPlusEA.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemJEPlusEAActionPerformed(evt); } }); jMenuAction.add(jMenuItemJEPlusEA); jMenuBarMain.add(jMenuAction); jMenuTools.setText("Tools "); jMenuItemConfig.setIcon( new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/hammer_screwdriver.png"))); // NOI18N jMenuItemConfig.setText("Configure External Programs ..."); jMenuItemConfig.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemConfigActionPerformed(evt); } }); jMenuTools.add(jMenuItemConfig); jMenuTools.add(jSeparator4); jMenuItemViewErr.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/bug.png"))); // NOI18N jMenuItemViewErr.setText("View jEPlus error log (jeplus.err)"); jMenuItemViewErr.setToolTipText("Open jeplus.err file to check errors."); jMenuItemViewErr.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemViewErrActionPerformed(evt); } }); jMenuTools.add(jMenuItemViewErr); jMenuItemViewLog.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/bug.png"))); // NOI18N jMenuItemViewLog.setText("View E+ console log (console.log)"); jMenuItemViewLog.setEnabled(false); jMenuItemViewLog.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemViewLogActionPerformed(evt); } }); jMenuTools.add(jMenuItemViewLog); jMenuTools.add(jSeparator8); jMenuItemVersionConverter .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/go-up.png"))); // NOI18N jMenuItemVersionConverter.setText("IDF Version Converter ..."); jMenuItemVersionConverter.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemVersionConverterActionPerformed(evt); } }); jMenuTools.add(jMenuItemVersionConverter); jMenuItemRunPython .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/16px-Icon-Python.png"))); // NOI18N jMenuItemRunPython.setText("Run Python script ..."); jMenuItemRunPython.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemRunPythonActionPerformed(evt); } }); jMenuTools.add(jMenuItemRunPython); jMenuItemRunReadVars .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/edit-clear.png"))); // NOI18N jMenuItemRunReadVars.setText("Run ReadVars ..."); jMenuItemRunReadVars.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemRunReadVarsActionPerformed(evt); } }); jMenuTools.add(jMenuItemRunReadVars); jMenuTools.add(jSeparator5); jMenuItemMemoryUsage .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/ddr_memory.png"))); // NOI18N jMenuItemMemoryUsage.setText("Memory Usage"); jMenuItemMemoryUsage.setToolTipText("Show memory usage dialog to check available resources"); jMenuItemMemoryUsage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemMemoryUsageActionPerformed(evt); } }); jMenuTools.add(jMenuItemMemoryUsage); jMenuItemDefaultLaF.setIcon(new javax.swing.ImageIcon( getClass().getResource("/jeplus/images/preferences-desktop-wallpaper.png"))); // NOI18N jMenuItemDefaultLaF.setText("Switch to defaul Look and Feel (Metal)"); jMenuItemDefaultLaF.setToolTipText("Change GUI style"); jMenuItemDefaultLaF.setActionCommand("default"); jMenuItemDefaultLaF.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemDefaultLaFActionPerformed(evt); } }); jMenuTools.add(jMenuItemDefaultLaF); jMenuItemEditorTheme .setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/page_gear.png"))); // NOI18N jMenuItemEditorTheme.setText("Edit syntax highlighting theme"); jMenuItemEditorTheme.setToolTipText("The syntax highlighting style can be edited to your preference."); jMenuItemEditorTheme.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemEditorThemeActionPerformed(evt); } }); jMenuTools.add(jMenuItemEditorTheme); jMenuBarMain.add(jMenuTools); jMenuHelp.setText("Help"); jMenuItemUserGuide.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.CTRL_MASK)); jMenuItemUserGuide.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/bulb.png"))); // NOI18N jMenuItemUserGuide.setText("User's Guide Online"); jMenuItemUserGuide.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemUserGuideActionPerformed(evt); } }); jMenuHelp.add(jMenuItemUserGuide); jMenuHelp.add(jSeparator1); jMenuItemAbout.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK)); jMenuItemAbout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/mail.png"))); // NOI18N jMenuItemAbout.setText("About"); jMenuItemAbout.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemAboutActionPerformed(evt); } }); jMenuHelp.add(jMenuItemAbout); jMenuBarMain.add(jMenuHelp); setJMenuBar(jMenuBarMain); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap() .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 989, Short.MAX_VALUE) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); pack(); }
From source file:edu.ku.brc.ui.UIHelper.java
public static JLabel createLabel(final String text, final ImageIcon icon) { JLabel lbl = new JLabel(text, icon, SwingConstants.TRAILING); setControlSize(lbl);//from w w w. j av a 2 s.c om return lbl; }
From source file:com.openbravo.pos.sales.JRetailPanelTicket.java
/** * This method is called from within the constructor to Tinitialize the * form. WARNING: Do NOT modify this code. The content of this method is * always regenerated by the FormEditor. *//*w w w. j a v a 2 s . c om*/ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { m_jPanContainer = new javax.swing.JPanel(); m_jOptions = new javax.swing.JPanel(); m_jButtons = new javax.swing.JPanel(); m_jPanelScripts = new javax.swing.JPanel(); m_jButtonsExt = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); m_jbtnScale = new javax.swing.JButton(); m_jLogout = new javax.swing.JButton(); m_jbtnPrintBill = new javax.swing.JButton(); m_jSettleBill = new javax.swing.JButton(); m_jSplitBtn = new javax.swing.JButton(); m_jBtnDiscount = new javax.swing.JButton(); m_jBtnCancelBill = new javax.swing.JButton(); m_jBtnBillOnHold = new javax.swing.JButton(); m_jPanelBag = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); m_jLblUserInfo = new javax.swing.JLabel(); m_jUser = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); m_jTable = new javax.swing.JLabel(); m_jLblCurrentDate = new javax.swing.JLabel(); m_jLblTime = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); m_jLblBillNo = new javax.swing.JLabel(); m_jPanTicket = new javax.swing.JPanel(); jPanel10 = new javax.swing.JPanel(); jButtonAddon = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); m_jLblItemCode = new javax.swing.JLabel(); m_jTxtItemCode = new javax.swing.JTextField(); m_jLblItemName = new javax.swing.JLabel(); m_jCboItemName = new javax.swing.JComboBox(); m_jPanelCentral = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); m_jPlus = new javax.swing.JButton(); m_jMinus = new javax.swing.JButton(); m_jEditLine = new javax.swing.JButton(); m_jCalculatePromotion = new javax.swing.JButton(); m_jAction = new javax.swing.JButton(); m_jDelete = new javax.swing.JButton(); m_jBtnServed = new javax.swing.JButton(); m_jKot = new javax.swing.JButton(); m_jEraser = new javax.swing.JButton(); m_jContEntries = new javax.swing.JPanel(); m_jPanEntries = new javax.swing.JPanel(); catcontainer = new javax.swing.JPanel(); jPanel12 = new javax.swing.JPanel(); jLayeredPane1 = new javax.swing.JLayeredPane(); jPanel4 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); m_jTxtTotalPaid = new javax.swing.JLabel(); m_jTxtChange = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); m_jTax = new javax.swing.JComboBox(); m_jPor = new javax.swing.JLabel(); m_jaddtax = new javax.swing.JToggleButton(); jLblPrinterStatus = new javax.swing.JLabel(); m_jKeyFactory = new javax.swing.JTextField(); jPanel8 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); m_jSubtotalEuros1 = new javax.swing.JLabel(); m_jLblTotalEuros4 = new javax.swing.JLabel(); m_jTaxesEuros1 = new javax.swing.JLabel(); m_jLblTotalEuros5 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); m_jLblTotalEuros6 = new javax.swing.JLabel(); m_jDiscount1 = new javax.swing.JLabel(); m_jTotalEuros = new javax.swing.JLabel(); jTaxPanel = new javax.swing.JPanel(); m_jServiceTaxLbl = new javax.swing.JLabel(); m_jServiceTax = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); m_jTaxList = new javax.swing.JList(); m_jSwachBharatLbl = new javax.swing.JLabel(); m_jSwachBharat = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); m_jPromoDiscount = new javax.swing.JLabel(); m_jProducts = new javax.swing.JPanel(); setBackground(new java.awt.Color(222, 232, 231)); setPreferredSize(new java.awt.Dimension(1024, 768)); setLayout(new java.awt.CardLayout()); m_jPanContainer.setBackground(new java.awt.Color(222, 232, 231)); m_jPanContainer.setLayout(new java.awt.BorderLayout()); m_jOptions.setBackground(new java.awt.Color(222, 232, 231)); m_jOptions.setLayout(new java.awt.BorderLayout()); m_jButtons.setBackground(new java.awt.Color(222, 232, 231)); m_jButtons.setPreferredSize(new java.awt.Dimension(4, 10)); m_jOptions.add(m_jButtons, java.awt.BorderLayout.LINE_START); m_jPanelScripts.setBackground(new java.awt.Color(222, 232, 231)); m_jPanelScripts.setLayout(new java.awt.BorderLayout()); m_jButtonsExt.setBackground(new java.awt.Color(222, 232, 231)); m_jButtonsExt.setLayout(new javax.swing.BoxLayout(m_jButtonsExt, javax.swing.BoxLayout.LINE_AXIS)); jPanel1.setBackground(new java.awt.Color(222, 232, 231)); jPanel1.setPreferredSize(new java.awt.Dimension(620, 47)); jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); m_jbtnScale.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/ark216.png"))); // NOI18N m_jbtnScale.setText(AppLocal.getIntString("button.scale")); // NOI18N m_jbtnScale.setFocusPainted(false); m_jbtnScale.setFocusable(false); m_jbtnScale.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jbtnScale.setRequestFocusEnabled(false); m_jbtnScale.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jbtnScaleActionPerformed(evt); } }); jPanel1.add(m_jbtnScale, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 5, -1)); m_jLogout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1logout.png"))); // NOI18N m_jLogout.setToolTipText("Logout"); m_jLogout.setFocusable(false); m_jLogout.setPreferredSize(new java.awt.Dimension(40, 40)); m_jLogout.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jLogoutActionPerformed(evt); } }); jPanel1.add(m_jLogout, new org.netbeans.lib.awtextra.AbsoluteConstraints(575, 0, -1, -1)); m_jbtnPrintBill.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1Print-Bill.png"))); // NOI18N m_jbtnPrintBill.setPreferredSize(new java.awt.Dimension(90, 40)); m_jbtnPrintBill.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jbtnPrintBillActionPerformed(evt); } }); jPanel1.add(m_jbtnPrintBill, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 0, -1, -1)); m_jSettleBill.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1Settle-Bill.png"))); // NOI18N m_jSettleBill.setPreferredSize(new java.awt.Dimension(90, 40)); m_jSettleBill.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jSettleBillActionPerformed(evt); } }); jPanel1.add(m_jSettleBill, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 0, -1, -1)); m_jSplitBtn.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/190-40-BUTTON.png"))); // NOI18N m_jSplitBtn.setMnemonic('f'); m_jSplitBtn.setFocusPainted(false); m_jSplitBtn.setFocusable(false); m_jSplitBtn.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jSplitBtn.setPreferredSize(new java.awt.Dimension(90, 40)); m_jSplitBtn.setRequestFocusEnabled(false); m_jSplitBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jSplitBtnActionPerformed(evt); } }); jPanel1.add(m_jSplitBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(195, 0, -1, -1)); m_jBtnDiscount.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/bill-discount.png"))); // NOI18N m_jBtnDiscount.setMnemonic('i'); m_jBtnDiscount.setToolTipText("Add Discount"); m_jBtnDiscount.setFocusPainted(false); m_jBtnDiscount.setFocusable(false); m_jBtnDiscount.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jBtnDiscount.setPreferredSize(new java.awt.Dimension(90, 40)); m_jBtnDiscount.setRequestFocusEnabled(false); m_jBtnDiscount.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jBtnDiscountActionPerformed(evt); } }); jPanel1.add(m_jBtnDiscount, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 0, -1, -1)); m_jBtnCancelBill.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/pos/templates/can-bill.png"))); // NOI18N m_jBtnCancelBill.setToolTipText("Cancel the Bill"); m_jBtnCancelBill.setPreferredSize(new java.awt.Dimension(90, 40)); m_jBtnCancelBill.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jBtnCancelBillActionPerformed(evt); } }); jPanel1.add(m_jBtnCancelBill, new org.netbeans.lib.awtextra.AbsoluteConstraints(385, 0, -1, -1)); m_jBtnBillOnHold.setBackground(new java.awt.Color(130, 130, 65)); m_jBtnBillOnHold.setForeground(new java.awt.Color(153, 153, 136)); m_jBtnBillOnHold .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/HOLD-BILL.png"))); // NOI18N m_jBtnBillOnHold.setToolTipText(""); m_jBtnBillOnHold.setPreferredSize(new java.awt.Dimension(90, 40)); m_jBtnBillOnHold.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jBtnBillOnHoldActionPerformed(evt); } }); jPanel1.add(m_jBtnBillOnHold, new org.netbeans.lib.awtextra.AbsoluteConstraints(5, 0, 90, 40)); m_jButtonsExt.add(jPanel1); m_jPanelScripts.add(m_jButtonsExt, java.awt.BorderLayout.LINE_END); m_jOptions.add(m_jPanelScripts, java.awt.BorderLayout.LINE_END); m_jPanelBag.setBackground(new java.awt.Color(222, 232, 231)); m_jPanelBag.setFocusable(false); m_jPanelBag.setPreferredSize(new java.awt.Dimension(800, 35)); m_jPanelBag.setRequestFocusEnabled(false); m_jPanelBag.setLayout(new java.awt.BorderLayout()); m_jOptions.add(m_jPanelBag, java.awt.BorderLayout.CENTER); jPanel6.setBackground(new java.awt.Color(80, 102, 116)); jPanel6.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jPanel6.setPreferredSize(new java.awt.Dimension(1024, 90)); jPanel6.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel3.setBackground(new java.awt.Color(222, 232, 231)); jLabel3.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jLabel3.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/openbravo/pos/templates/1header-habanero.png"))); // NOI18N jLabel3.setAutoscrolls(true); jLabel3.setFocusable(false); jLabel3.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); jLabel3.setMaximumSize(new java.awt.Dimension(1450, 61)); jLabel3.setMinimumSize(new java.awt.Dimension(1024, 61)); jLabel3.setPreferredSize(new java.awt.Dimension(1024, 45)); jLabel3.setRequestFocusEnabled(false); jLabel3.setVerticalTextPosition(javax.swing.SwingConstants.TOP); jPanel6.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1551, -1)); m_jLblUserInfo.setBackground(new java.awt.Color(80, 102, 160)); m_jLblUserInfo.setForeground(new java.awt.Color(255, 255, 255)); m_jLblUserInfo.setText(" LOGGED IN USER:"); m_jLblUserInfo.setFocusable(false); m_jLblUserInfo.setPreferredSize(new java.awt.Dimension(340, 16)); m_jLblUserInfo.setRequestFocusEnabled(false); jPanel6.add(m_jLblUserInfo, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 40, 140, 50)); m_jUser.setForeground(new java.awt.Color(252, 248, 0)); m_jUser.setText("jLabel6"); jPanel6.add(m_jUser, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 40, 70, 50)); jLabel6.setForeground(new java.awt.Color(255, 255, 255)); jLabel6.setText("Table:"); jPanel6.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 40, 50, 50)); m_jTable.setForeground(new java.awt.Color(252, 248, 0)); m_jTable.setText("jLabel9"); jPanel6.add(m_jTable, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 40, 60, 50)); m_jLblCurrentDate.setBackground(new java.awt.Color(80, 102, 160)); m_jLblCurrentDate.setForeground(new java.awt.Color(255, 255, 255)); m_jLblCurrentDate.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jLblCurrentDate .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/Date-icon.png"))); // NOI18N m_jLblCurrentDate.setFocusable(false); m_jLblCurrentDate.setPreferredSize(new java.awt.Dimension(300, 16)); m_jLblCurrentDate.setRequestFocusEnabled(false); jPanel6.add(m_jLblCurrentDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 45, 180, 45)); m_jLblTime.setBackground(new java.awt.Color(80, 102, 160)); m_jLblTime.setForeground(new java.awt.Color(255, 255, 255)); m_jLblTime.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jLblTime .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/Clock-icon.png"))); // NOI18N m_jLblTime.setText( " jLabel2"); m_jLblTime.setFocusable(false); m_jLblTime.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); m_jLblTime.setPreferredSize(new java.awt.Dimension(300, 16)); m_jLblTime.setRequestFocusEnabled(false); jPanel6.add(m_jLblTime, new org.netbeans.lib.awtextra.AbsoluteConstraints(780, 45, 230, 45)); jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Bill No:"); jPanel6.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 40, 50, 50)); m_jLblBillNo.setForeground(new java.awt.Color(252, 248, 0)); jPanel6.add(m_jLblBillNo, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 40, 90, 50)); m_jOptions.add(jPanel6, java.awt.BorderLayout.NORTH); m_jPanContainer.add(m_jOptions, java.awt.BorderLayout.NORTH); m_jPanTicket.setBackground(new java.awt.Color(222, 232, 231)); m_jPanTicket.setLayout(new java.awt.BorderLayout()); jPanel10.setBackground(new java.awt.Color(222, 232, 231)); jPanel10.setPreferredSize(new java.awt.Dimension(803, 48)); jPanel10.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jButtonAddon .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1Add-on.png"))); // NOI18N jButtonAddon.setPreferredSize(new java.awt.Dimension(90, 40)); jButtonAddon.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonAddonActionPerformed(evt); } }); jPanel10.add(jButtonAddon, new org.netbeans.lib.awtextra.AbsoluteConstraints(690, 0, 90, 40)); jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1Category.png"))); // NOI18N jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel10.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(790, 0, 90, 40)); jButton3.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/subcategory.png"))); // NOI18N jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jPanel10.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(890, 0, 90, 40)); m_jLblItemCode.setText("ITEM CODE"); jPanel10.add(m_jLblItemCode, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 8, 90, 20)); m_jTxtItemCode.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1))); m_jTxtItemCode.setMinimumSize(new java.awt.Dimension(123, 20)); m_jTxtItemCode.setPreferredSize(new java.awt.Dimension(123, 20)); m_jTxtItemCode.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jTxtItemCodeActionPerformed(evt); } }); jPanel10.add(m_jTxtItemCode, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 10, -1, 20)); m_jLblItemName.setText("ITEM NAME"); jPanel10.add(m_jLblItemName, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 10, -1, 20)); m_jCboItemName.setEditable(true); m_jCboItemName.setAutoscrolls(true); m_jCboItemName.setMaximumSize(new java.awt.Dimension(123, 20)); m_jCboItemName.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { m_jCboItemNameItemStateChanged(evt); } }); m_jCboItemName.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jCboItemNameActionPerformed(evt); } }); jPanel10.add(m_jCboItemName, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 10, 340, -1)); m_jPanTicket.add(jPanel10, java.awt.BorderLayout.PAGE_START); m_jPanelCentral.setFocusable(false); m_jPanelCentral.setRequestFocusEnabled(false); m_jPanelCentral.setLayout(new java.awt.BorderLayout()); jPanel5.setLayout(new java.awt.BorderLayout()); jPanel2.setBackground(new java.awt.Color(222, 232, 231)); jPanel2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 0, 5)); jPanel2.setMinimumSize(new java.awt.Dimension(66, 338)); jPanel2.setPreferredSize(new java.awt.Dimension(61, 400)); m_jPlus.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/TPlus.png"))); // NOI18N m_jPlus.setToolTipText("Increase selected item quantity by one"); m_jPlus.setFocusPainted(false); m_jPlus.setFocusable(false); m_jPlus.setMaximumSize(new java.awt.Dimension(51, 42)); m_jPlus.setMinimumSize(new java.awt.Dimension(51, 42)); m_jPlus.setPreferredSize(new java.awt.Dimension(51, 42)); m_jPlus.setRequestFocusEnabled(false); m_jPlus.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jPlusActionPerformed(evt); } }); m_jMinus.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/TMinus.png"))); // NOI18N m_jMinus.setToolTipText("Decrease selected item's quantity by one"); m_jMinus.setFocusPainted(false); m_jMinus.setFocusable(false); m_jMinus.setMaximumSize(new java.awt.Dimension(51, 42)); m_jMinus.setMinimumSize(new java.awt.Dimension(51, 42)); m_jMinus.setPreferredSize(new java.awt.Dimension(51, 42)); m_jMinus.setRequestFocusEnabled(false); m_jMinus.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jMinusActionPerformed(evt); } }); m_jEditLine.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/TEdit.png"))); // NOI18N m_jEditLine.setMnemonic('e'); m_jEditLine.setToolTipText("Edit Properties of selected item"); m_jEditLine.setFocusPainted(false); m_jEditLine.setFocusable(false); m_jEditLine.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jEditLine.setRequestFocusEnabled(false); m_jEditLine.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jEditLineActionPerformed(evt); } }); m_jCalculatePromotion .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/pramo.png"))); // NOI18N m_jCalculatePromotion.setMnemonic('f'); m_jCalculatePromotion.setFocusPainted(false); m_jCalculatePromotion.setFocusable(false); m_jCalculatePromotion.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jCalculatePromotion.setPreferredSize(new java.awt.Dimension(51, 42)); m_jCalculatePromotion.setRequestFocusEnabled(false); m_jCalculatePromotion.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jCalculatePromotionActionPerformed(evt); } }); m_jAction.setBorder(null); m_jAction.setBorderPainted(false); m_jAction.setPreferredSize(new java.awt.Dimension(10, 2)); m_jAction.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jActionActionPerformed(evt); } }); m_jDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/Tclose.png"))); // NOI18N m_jDelete.setMnemonic('d'); m_jDelete.setToolTipText("Remove total quantity of selected item"); m_jDelete.setFocusPainted(false); m_jDelete.setFocusable(false); m_jDelete.setMinimumSize(new java.awt.Dimension(51, 42)); m_jDelete.setPreferredSize(new java.awt.Dimension(51, 42)); m_jDelete.setRequestFocusEnabled(false); m_jDelete.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jDeleteActionPerformed(evt); } }); m_jBtnServed.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/servedsymbol.png"))); // NOI18N m_jBtnServed.setToolTipText("Serve Selected Item"); m_jBtnServed.setPreferredSize(new java.awt.Dimension(91, 73)); m_jBtnServed.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jBtnServedActionPerformed(evt); } }); m_jKot.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/TKOT.png"))); // NOI18N m_jKot.setToolTipText("Send All Fresh Items to Kitchen"); m_jKot.setPreferredSize(new java.awt.Dimension(51, 42)); m_jKot.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jBtnKotActionPerformed(evt); } }); m_jEraser.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/TDelete.png"))); // NOI18N m_jEraser.setMnemonic('i'); m_jEraser.setToolTipText("Clear All Non KOT Items"); m_jEraser.setFocusPainted(false); m_jEraser.setFocusable(false); m_jEraser.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jEraser.setRequestFocusEnabled(false); m_jEraser.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jEraserActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup().add(168, 168, 168).add(m_jAction, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(m_jBtnServed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 51, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jEraser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 51, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jKot, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jCalculatePromotion, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jEditLine, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 51, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jMinus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jPlus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup() .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup().add(242, 242, 242) .add(m_jAction, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(jPanel2Layout.createSequentialGroup() .add(m_jPlus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(3, 3, 3) .add(m_jMinus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(3, 3, 3) .add(m_jDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(2, 2, 2) .add(m_jEditLine, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 42, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(3, 3, 3) .add(m_jCalculatePromotion, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 7, Short.MAX_VALUE) .add(m_jBtnServed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 40, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))) .add(m_jKot, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(3, 3, 3).add(m_jEraser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(36, 36, 36))); jPanel5.add(jPanel2, java.awt.BorderLayout.NORTH); m_jPanelCentral.add(jPanel5, java.awt.BorderLayout.LINE_END); m_jPanTicket.add(m_jPanelCentral, java.awt.BorderLayout.CENTER); m_jContEntries.setFocusable(false); m_jContEntries.setPreferredSize(new java.awt.Dimension(501, 500)); m_jContEntries.setRequestFocusEnabled(false); m_jContEntries.setLayout(new java.awt.BorderLayout()); m_jPanEntries.setMinimumSize(new java.awt.Dimension(508, 500)); m_jPanEntries.setPreferredSize(new java.awt.Dimension(495, 525)); m_jPanEntries.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); catcontainer.setPreferredSize(new java.awt.Dimension(300, 200)); catcontainer.setLayout(new java.awt.BorderLayout()); m_jPanEntries.add(catcontainer, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 508, 510)); m_jContEntries.add(m_jPanEntries, java.awt.BorderLayout.PAGE_START); m_jPanTicket.add(m_jContEntries, java.awt.BorderLayout.LINE_END); jPanel12.setBackground(new java.awt.Color(222, 232, 231)); jPanel12.setFocusable(false); jPanel12.setPreferredSize(new java.awt.Dimension(600, 5)); jPanel12.setRequestFocusEnabled(false); jPanel12.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLayeredPane1.setPreferredSize(new java.awt.Dimension(300, 402)); jPanel12.add(jLayeredPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, -500, 989, 509)); m_jPanTicket.add(jPanel12, java.awt.BorderLayout.PAGE_END); m_jPanContainer.add(m_jPanTicket, java.awt.BorderLayout.CENTER); jPanel4.setBackground(new java.awt.Color(222, 232, 231)); jPanel4.setPreferredSize(new java.awt.Dimension(1024, 210)); jPanel4.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jPanel7.setBorder( javax.swing.BorderFactory.createMatteBorder(0, 1, 1, 1, new java.awt.Color(204, 204, 204))); jPanel7.setMaximumSize(new java.awt.Dimension(700, 158)); jPanel7.setPreferredSize(new java.awt.Dimension(320, 158)); jLabel7.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N jLabel7.setText("TOTAL PAID"); jLabel8.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N jLabel8.setText("CHANGE"); m_jTxtTotalPaid.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N m_jTxtTotalPaid.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jTxtTotalPaid.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jTxtTotalPaid.setFocusable(false); m_jTxtTotalPaid.setOpaque(true); m_jTxtTotalPaid.setPreferredSize(new java.awt.Dimension(123, 25)); m_jTxtTotalPaid.setRequestFocusEnabled(false); m_jTxtChange.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N m_jTxtChange.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jTxtChange.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jTxtChange.setFocusable(false); m_jTxtChange.setOpaque(true); m_jTxtChange.setPreferredSize(new java.awt.Dimension(123, 25)); m_jTxtChange.setRequestFocusEnabled(false); jPanel3.setPreferredSize(new java.awt.Dimension(228, 100)); m_jTax.setFocusable(false); m_jTax.setRequestFocusEnabled(false); m_jPor.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jPor.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jPor.setFocusable(false); m_jPor.setOpaque(true); m_jPor.setPreferredSize(new java.awt.Dimension(22, 22)); m_jPor.setRequestFocusEnabled(false); m_jaddtax.setText("+"); m_jaddtax.setFocusPainted(false); m_jaddtax.setFocusable(false); m_jaddtax.setRequestFocusEnabled(false); jLblPrinterStatus.setForeground(new java.awt.Color(255, 0, 0)); m_jKeyFactory.setBackground(javax.swing.UIManager.getDefaults().getColor("Panel.background")); m_jKeyFactory.setForeground(javax.swing.UIManager.getDefaults().getColor("Panel.background")); m_jKeyFactory.setBorder(null); m_jKeyFactory.setCaretColor(javax.swing.UIManager.getDefaults().getColor("Panel.background")); m_jKeyFactory.setPreferredSize(new java.awt.Dimension(4, 4)); m_jKeyFactory.setRequestFocusEnabled(false); m_jKeyFactory.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { m_jKeyFactoryKeyTyped(evt); } }); org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup().addContainerGap() .add(m_jKeyFactory, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 239, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(65, 65, 65).add(jLblPrinterStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 68, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel3Layout.createSequentialGroup().add(20, 20, 20) .add(m_jaddtax, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(m_jPor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel3Layout.createSequentialGroup().addContainerGap().add(m_jTax, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup().add(6, 6, 6).add(jLblPrinterStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(m_jKeyFactory, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(m_jTax, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(21, 21, 21) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(m_jPor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jaddtax, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); org.jdesktop.layout.GroupLayout jPanel7Layout = new org.jdesktop.layout.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel7Layout.createSequentialGroup().add(10, 10, 10) .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel7Layout.createSequentialGroup() .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 126, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(3, 3, 3) .add(m_jTxtTotalPaid, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel7Layout.createSequentialGroup() .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 110, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(19, 19, 19).add(m_jTxtChange, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel7Layout.createSequentialGroup() .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 392, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap())); jPanel7Layout .setVerticalGroup(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel7Layout.createSequentialGroup() .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 89, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(270, 270, 270) .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jTxtTotalPaid, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(10, 10, 10) .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jTxtChange, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))); jPanel4.add(jPanel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(1325, 1, 170, 160)); jPanel8.setBackground(new java.awt.Color(255, 255, 255)); jPanel8.setBorder( javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(204, 204, 204))); jPanel8.setPreferredSize(new java.awt.Dimension(1551, 193)); jPanel8.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("Bill Details"); jPanel8.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(15, 12, 188, -1)); m_jSubtotalEuros1.setBackground(new java.awt.Color(255, 255, 255)); m_jSubtotalEuros1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); m_jSubtotalEuros1.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jSubtotalEuros1.setFocusable(false); m_jSubtotalEuros1.setOpaque(true); m_jSubtotalEuros1.setPreferredSize(new java.awt.Dimension(123, 25)); m_jSubtotalEuros1.setRequestFocusEnabled(false); jPanel8.add(m_jSubtotalEuros1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 40, 80, 23)); m_jLblTotalEuros4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); m_jLblTotalEuros4.setText("SUB TOTAL"); jPanel8.add(m_jLblTotalEuros4, new org.netbeans.lib.awtextra.AbsoluteConstraints(11, 37, 94, 23)); m_jTaxesEuros1.setBackground(new java.awt.Color(255, 255, 255)); m_jTaxesEuros1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); m_jTaxesEuros1.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jTaxesEuros1.setFocusable(false); m_jTaxesEuros1.setOpaque(true); m_jTaxesEuros1.setPreferredSize(new java.awt.Dimension(123, 25)); m_jTaxesEuros1.setRequestFocusEnabled(false); jPanel8.add(m_jTaxesEuros1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 70, 80, 23)); m_jLblTotalEuros5.setBackground(new java.awt.Color(255, 255, 255)); m_jLblTotalEuros5.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); m_jLblTotalEuros5.setText("TAXES"); jPanel8.add(m_jLblTotalEuros5, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 70, 60, 23)); jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jLabel5.setText("DISCOUNT"); jPanel8.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, 80, 23)); m_jLblTotalEuros6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); m_jLblTotalEuros6.setText("TOTAL SALES"); jPanel8.add(m_jLblTotalEuros6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 160, 80, 20)); m_jDiscount1.setBackground(new java.awt.Color(255, 255, 255)); m_jDiscount1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); m_jDiscount1.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jDiscount1.setFocusable(false); m_jDiscount1.setOpaque(true); m_jDiscount1.setPreferredSize(new java.awt.Dimension(123, 25)); m_jDiscount1.setRequestFocusEnabled(false); jPanel8.add(m_jDiscount1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 100, 80, 23)); m_jTotalEuros.setBackground(new java.awt.Color(255, 255, 255)); m_jTotalEuros.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jTotalEuros.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jTotalEuros.setFocusable(false); m_jTotalEuros.setOpaque(true); m_jTotalEuros.setPreferredSize(new java.awt.Dimension(123, 25)); m_jTotalEuros.setRequestFocusEnabled(false); jPanel8.add(m_jTotalEuros, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 160, 80, 23)); jTaxPanel.setBackground(new java.awt.Color(255, 255, 255)); jTaxPanel.setPreferredSize(new java.awt.Dimension(202, 157)); jTaxPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); m_jServiceTaxLbl.setText("SERVICE TAX"); jTaxPanel.add(m_jServiceTaxLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 40, 100, 23)); m_jServiceTax.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jTaxPanel.add(m_jServiceTax, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 40, 70, 23)); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel4.setText("Tax Breakup"); jTaxPanel.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 11, 194, -1)); jScrollPane1.setBorder(null); jScrollPane1.setViewportView(m_jTaxList); jTaxPanel.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 37, 200, 140)); m_jSwachBharatLbl.setText("SWACHH BHARAT TAX"); jTaxPanel.add(m_jSwachBharatLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 70, 130, 20)); m_jSwachBharat.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jTaxPanel.add(m_jSwachBharat, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 70, 70, 20)); jPanel8.add(jTaxPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(221, 1, -1, 178)); jLabel9.setText("PROMO DISCOUNT"); jPanel8.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 130, 120, 20)); m_jPromoDiscount.setBackground(new java.awt.Color(255, 255, 255)); m_jPromoDiscount.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jPromoDiscount.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jPromoDiscount.setFocusable(false); m_jPromoDiscount.setOpaque(true); m_jPromoDiscount.setPreferredSize(new java.awt.Dimension(123, 25)); m_jPromoDiscount.setRequestFocusEnabled(false); jPanel8.add(m_jPromoDiscount, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 130, 80, 23)); jPanel4.add(jPanel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(7, 1, 434, -1)); m_jProducts.setBackground(new java.awt.Color(255, 255, 255)); m_jProducts.setLayout(new java.awt.CardLayout()); jPanel4.add(m_jProducts, new org.netbeans.lib.awtextra.AbsoluteConstraints(447, 1, 551, 190)); m_jPanContainer.add(jPanel4, java.awt.BorderLayout.SOUTH); add(m_jPanContainer, "ticket"); }
From source file:com.openbravo.pos.sales.JRetailPanelTakeAway.java
/** * This method is called from within the constructor to Tinitialize the * form. WARNING: Do NOT modify this code. The content of this method is * always regenerated by the FormEditor. *//*from w ww . jav a 2 s. c o m*/ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { m_jPanContainer = new javax.swing.JPanel(); m_jOptions = new javax.swing.JPanel(); m_jButtons = new javax.swing.JPanel(); m_jPanelScripts = new javax.swing.JPanel(); m_jButtonsExt = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); m_jbtnScale = new javax.swing.JButton(); m_jLogout = new javax.swing.JButton(); m_jbtnPrintBill = new javax.swing.JButton(); m_jSettleBill = new javax.swing.JButton(); m_jSplitBtn = new javax.swing.JButton(); m_jBtnCancelBill = new javax.swing.JButton(); m_jBtnBillOnHold = new javax.swing.JButton(); m_jBtnDiscount = new javax.swing.JButton(); m_jPanelBag = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); m_jLblUserInfo = new javax.swing.JLabel(); m_jUser = new javax.swing.JLabel(); m_jLblCurrentDate = new javax.swing.JLabel(); m_jLblTime = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); m_jLblBillNo = new javax.swing.JLabel(); m_jPanTicket = new javax.swing.JPanel(); jPanel10 = new javax.swing.JPanel(); jButtonAddon = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); m_jLblItemCode = new javax.swing.JLabel(); m_jTxtItemCode = new javax.swing.JTextField(); m_jLblItemName = new javax.swing.JLabel(); m_jCboItemName = new javax.swing.JComboBox(); m_jPanelCentral = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); m_jPlus = new javax.swing.JButton(); m_jMinus = new javax.swing.JButton(); m_jEditLine = new javax.swing.JButton(); m_jCalculatePromotion = new javax.swing.JButton(); m_jAction = new javax.swing.JButton(); m_jDelete = new javax.swing.JButton(); m_jKot = new javax.swing.JButton(); m_jBtnServed = new javax.swing.JButton(); m_jEraser = new javax.swing.JButton(); m_jContEntries = new javax.swing.JPanel(); m_jPanEntries = new javax.swing.JPanel(); catcontainer = new javax.swing.JPanel(); jPanel12 = new javax.swing.JPanel(); jLayeredPane1 = new javax.swing.JLayeredPane(); jPanel4 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); m_jTxtTotalPaid = new javax.swing.JLabel(); m_jTxtChange = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); m_jTax = new javax.swing.JComboBox(); m_jPor = new javax.swing.JLabel(); m_jaddtax = new javax.swing.JToggleButton(); jLblPrinterStatus = new javax.swing.JLabel(); m_jKeyFactory = new javax.swing.JTextField(); jPanel8 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); m_jSubtotalEuros1 = new javax.swing.JLabel(); m_jLblTotalEuros4 = new javax.swing.JLabel(); m_jTaxesEuros1 = new javax.swing.JLabel(); m_jLblTotalEuros5 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); m_jLblTotalEuros6 = new javax.swing.JLabel(); m_jDiscount1 = new javax.swing.JLabel(); m_jTotalEuros = new javax.swing.JLabel(); jTaxPanel = new javax.swing.JPanel(); m_jServiceTaxLbl = new javax.swing.JLabel(); m_jServiceTax = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); m_jTaxList = new javax.swing.JList(); m_jSwachBharatLbl = new javax.swing.JLabel(); m_jSwachBharat = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); m_jPromoDiscount = new javax.swing.JLabel(); m_jProducts = new javax.swing.JPanel(); setBackground(new java.awt.Color(222, 232, 231)); setPreferredSize(new java.awt.Dimension(1024, 768)); setLayout(new java.awt.CardLayout()); m_jPanContainer.setBackground(new java.awt.Color(222, 232, 231)); m_jPanContainer.setLayout(new java.awt.BorderLayout()); m_jOptions.setBackground(new java.awt.Color(222, 232, 231)); m_jOptions.setLayout(new java.awt.BorderLayout()); m_jButtons.setBackground(new java.awt.Color(222, 232, 231)); m_jButtons.setPreferredSize(new java.awt.Dimension(4, 10)); m_jOptions.add(m_jButtons, java.awt.BorderLayout.LINE_START); m_jPanelScripts.setBackground(new java.awt.Color(222, 232, 231)); m_jPanelScripts.setLayout(new java.awt.BorderLayout()); m_jButtonsExt.setBackground(new java.awt.Color(222, 232, 231)); m_jButtonsExt.setLayout(new javax.swing.BoxLayout(m_jButtonsExt, javax.swing.BoxLayout.LINE_AXIS)); jPanel1.setBackground(new java.awt.Color(222, 232, 231)); jPanel1.setPreferredSize(new java.awt.Dimension(620, 47)); jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); m_jbtnScale.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/ark216.png"))); // NOI18N m_jbtnScale.setText(AppLocal.getIntString("button.scale")); // NOI18N m_jbtnScale.setFocusPainted(false); m_jbtnScale.setFocusable(false); m_jbtnScale.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jbtnScale.setRequestFocusEnabled(false); m_jbtnScale.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jbtnScaleActionPerformed(evt); } }); jPanel1.add(m_jbtnScale, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 5, -1)); m_jLogout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1logout.png"))); // NOI18N m_jLogout.setToolTipText("Logout"); m_jLogout.setFocusable(false); m_jLogout.setPreferredSize(new java.awt.Dimension(40, 40)); m_jLogout.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jLogoutActionPerformed(evt); } }); jPanel1.add(m_jLogout, new org.netbeans.lib.awtextra.AbsoluteConstraints(575, 0, -1, -1)); m_jbtnPrintBill.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1Print-Bill.png"))); // NOI18N m_jbtnPrintBill.setPreferredSize(new java.awt.Dimension(90, 40)); m_jbtnPrintBill.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jbtnPrintBillActionPerformed(evt); } }); jPanel1.add(m_jbtnPrintBill, new org.netbeans.lib.awtextra.AbsoluteConstraints(385, 0, -1, -1)); m_jSettleBill.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1Settle-Bill.png"))); // NOI18N m_jSettleBill.setPreferredSize(new java.awt.Dimension(90, 40)); m_jSettleBill.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jSettleBillActionPerformed(evt); } }); jPanel1.add(m_jSettleBill, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 0, -1, -1)); m_jSplitBtn.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/190-40-BUTTON.png"))); // NOI18N m_jSplitBtn.setMnemonic('f'); m_jSplitBtn.setFocusPainted(false); m_jSplitBtn.setFocusable(false); m_jSplitBtn.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jSplitBtn.setPreferredSize(new java.awt.Dimension(90, 40)); m_jSplitBtn.setRequestFocusEnabled(false); m_jSplitBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jSplitBtnActionPerformed(evt); } }); jPanel1.add(m_jSplitBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 0, -1, -1)); m_jBtnCancelBill.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/pos/templates/can-bill.png"))); // NOI18N m_jBtnCancelBill.setToolTipText("Cancel the Bill"); m_jBtnCancelBill.setPreferredSize(new java.awt.Dimension(90, 40)); m_jBtnCancelBill.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jBtnCancelBillActionPerformed(evt); } }); jPanel1.add(m_jBtnCancelBill, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 0, -1, -1)); m_jBtnBillOnHold.setBackground(new java.awt.Color(130, 130, 65)); m_jBtnBillOnHold.setForeground(new java.awt.Color(153, 153, 136)); m_jBtnBillOnHold .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/HOLD-BILL.png"))); // NOI18N m_jBtnBillOnHold.setToolTipText(""); m_jBtnBillOnHold.setPreferredSize(new java.awt.Dimension(90, 40)); m_jBtnBillOnHold.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jBtnBillOnHoldActionPerformed(evt); } }); jPanel1.add(m_jBtnBillOnHold, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 0, 90, 40)); m_jBtnDiscount.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/bill-discount.png"))); // NOI18N m_jBtnDiscount.setMnemonic('i'); m_jBtnDiscount.setToolTipText("Add Discount"); m_jBtnDiscount.setFocusPainted(false); m_jBtnDiscount.setFocusable(false); m_jBtnDiscount.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jBtnDiscount.setPreferredSize(new java.awt.Dimension(90, 40)); m_jBtnDiscount.setRequestFocusEnabled(false); m_jBtnDiscount.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jBtnDiscountActionPerformed(evt); } }); jPanel1.add(m_jBtnDiscount, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 0, -1, -1)); m_jButtonsExt.add(jPanel1); m_jPanelScripts.add(m_jButtonsExt, java.awt.BorderLayout.LINE_END); m_jOptions.add(m_jPanelScripts, java.awt.BorderLayout.LINE_END); m_jPanelBag.setBackground(new java.awt.Color(222, 232, 231)); m_jPanelBag.setFocusable(false); m_jPanelBag.setPreferredSize(new java.awt.Dimension(800, 35)); m_jPanelBag.setRequestFocusEnabled(false); m_jPanelBag.setLayout(new java.awt.BorderLayout()); m_jOptions.add(m_jPanelBag, java.awt.BorderLayout.CENTER); jPanel6.setBackground(new java.awt.Color(80, 102, 116)); jPanel6.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jPanel6.setPreferredSize(new java.awt.Dimension(1024, 90)); jPanel6.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel3.setBackground(new java.awt.Color(222, 232, 231)); jLabel3.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jLabel3.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/openbravo/pos/templates/1header-habanero.png"))); // NOI18N jLabel3.setAutoscrolls(true); jLabel3.setFocusable(false); jLabel3.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); jLabel3.setMaximumSize(new java.awt.Dimension(1450, 61)); jLabel3.setMinimumSize(new java.awt.Dimension(1024, 61)); jLabel3.setPreferredSize(new java.awt.Dimension(1024, 45)); jLabel3.setRequestFocusEnabled(false); jLabel3.setVerticalTextPosition(javax.swing.SwingConstants.TOP); jPanel6.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1551, -1)); m_jLblUserInfo.setBackground(new java.awt.Color(80, 102, 160)); m_jLblUserInfo.setForeground(new java.awt.Color(255, 255, 255)); m_jLblUserInfo.setText(" LOGGED IN USER:"); m_jLblUserInfo.setFocusable(false); m_jLblUserInfo.setPreferredSize(new java.awt.Dimension(340, 16)); m_jLblUserInfo.setRequestFocusEnabled(false); jPanel6.add(m_jLblUserInfo, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 40, 140, 50)); m_jUser.setForeground(new java.awt.Color(252, 248, 0)); m_jUser.setText("jLabel6"); jPanel6.add(m_jUser, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 40, 70, 50)); m_jLblCurrentDate.setBackground(new java.awt.Color(80, 102, 160)); m_jLblCurrentDate.setForeground(new java.awt.Color(255, 255, 255)); m_jLblCurrentDate.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jLblCurrentDate .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/Date-icon.png"))); // NOI18N m_jLblCurrentDate.setFocusable(false); m_jLblCurrentDate.setPreferredSize(new java.awt.Dimension(300, 16)); m_jLblCurrentDate.setRequestFocusEnabled(false); jPanel6.add(m_jLblCurrentDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 45, 180, 45)); m_jLblTime.setBackground(new java.awt.Color(80, 102, 160)); m_jLblTime.setForeground(new java.awt.Color(255, 255, 255)); m_jLblTime.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jLblTime .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/Clock-icon.png"))); // NOI18N m_jLblTime.setText( " jLabel2"); m_jLblTime.setFocusable(false); m_jLblTime.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); m_jLblTime.setPreferredSize(new java.awt.Dimension(300, 16)); m_jLblTime.setRequestFocusEnabled(false); jPanel6.add(m_jLblTime, new org.netbeans.lib.awtextra.AbsoluteConstraints(780, 45, 230, 45)); jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Bill No:"); jPanel6.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 40, 50, 50)); m_jLblBillNo.setForeground(new java.awt.Color(252, 248, 0)); jPanel6.add(m_jLblBillNo, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 40, 90, 50)); m_jOptions.add(jPanel6, java.awt.BorderLayout.NORTH); m_jPanContainer.add(m_jOptions, java.awt.BorderLayout.NORTH); m_jPanTicket.setBackground(new java.awt.Color(222, 232, 231)); m_jPanTicket.setLayout(new java.awt.BorderLayout()); jPanel10.setBackground(new java.awt.Color(222, 232, 231)); jPanel10.setPreferredSize(new java.awt.Dimension(803, 48)); jPanel10.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jButtonAddon .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1Add-on.png"))); // NOI18N jButtonAddon.setPreferredSize(new java.awt.Dimension(90, 40)); jButtonAddon.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonAddonActionPerformed(evt); } }); jPanel10.add(jButtonAddon, new org.netbeans.lib.awtextra.AbsoluteConstraints(793, 2, 90, 40)); jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/1Category.png"))); // NOI18N jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel10.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(888, 2, 90, 40)); jButton3.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/subcategory.png"))); // NOI18N jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jPanel10.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(983, 2, 90, 40)); m_jLblItemCode.setText("ITEM CODE"); jPanel10.add(m_jLblItemCode, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 8, 90, 20)); m_jTxtItemCode.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1))); m_jTxtItemCode.setMinimumSize(new java.awt.Dimension(123, 20)); m_jTxtItemCode.setPreferredSize(new java.awt.Dimension(123, 20)); m_jTxtItemCode.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jTxtItemCodeActionPerformed(evt); } }); jPanel10.add(m_jTxtItemCode, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 10, -1, 20)); m_jLblItemName.setText("ITEM NAME"); jPanel10.add(m_jLblItemName, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 10, -1, 20)); m_jCboItemName.setEditable(true); m_jCboItemName.setAutoscrolls(true); m_jCboItemName.setMaximumSize(new java.awt.Dimension(123, 20)); m_jCboItemName.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { m_jCboItemNameItemStateChanged(evt); } }); m_jCboItemName.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jCboItemNameActionPerformed(evt); } }); jPanel10.add(m_jCboItemName, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 10, 340, -1)); m_jPanTicket.add(jPanel10, java.awt.BorderLayout.PAGE_START); m_jPanelCentral.setFocusable(false); m_jPanelCentral.setRequestFocusEnabled(false); m_jPanelCentral.setLayout(new java.awt.BorderLayout()); jPanel5.setLayout(new java.awt.BorderLayout()); jPanel2.setBackground(new java.awt.Color(222, 232, 231)); jPanel2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 0, 5)); jPanel2.setMinimumSize(new java.awt.Dimension(66, 338)); jPanel2.setPreferredSize(new java.awt.Dimension(61, 400)); m_jPlus.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/TPlus.png"))); // NOI18N m_jPlus.setToolTipText("Increase selected item quantity by one"); m_jPlus.setFocusPainted(false); m_jPlus.setFocusable(false); m_jPlus.setMaximumSize(new java.awt.Dimension(51, 42)); m_jPlus.setMinimumSize(new java.awt.Dimension(51, 42)); m_jPlus.setPreferredSize(new java.awt.Dimension(51, 42)); m_jPlus.setRequestFocusEnabled(false); m_jPlus.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jPlusActionPerformed(evt); } }); m_jMinus.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/TMinus.png"))); // NOI18N m_jMinus.setToolTipText("Decrease selected item's quantity by one"); m_jMinus.setFocusPainted(false); m_jMinus.setFocusable(false); m_jMinus.setMaximumSize(new java.awt.Dimension(51, 42)); m_jMinus.setMinimumSize(new java.awt.Dimension(51, 42)); m_jMinus.setPreferredSize(new java.awt.Dimension(51, 42)); m_jMinus.setRequestFocusEnabled(false); m_jMinus.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jMinusActionPerformed(evt); } }); m_jEditLine.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/TEdit.png"))); // NOI18N m_jEditLine.setMnemonic('e'); m_jEditLine.setToolTipText("Edit Properties of selected item"); m_jEditLine.setFocusPainted(false); m_jEditLine.setFocusable(false); m_jEditLine.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jEditLine.setRequestFocusEnabled(false); m_jEditLine.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jEditLineActionPerformed(evt); } }); m_jCalculatePromotion .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/pramo.png"))); // NOI18N m_jCalculatePromotion.setMnemonic('f'); m_jCalculatePromotion.setFocusPainted(false); m_jCalculatePromotion.setFocusable(false); m_jCalculatePromotion.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jCalculatePromotion.setPreferredSize(new java.awt.Dimension(51, 42)); m_jCalculatePromotion.setRequestFocusEnabled(false); m_jCalculatePromotion.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jCalculatePromotionActionPerformed(evt); } }); m_jAction.setBorder(null); m_jAction.setBorderPainted(false); m_jAction.setPreferredSize(new java.awt.Dimension(10, 2)); m_jAction.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jActionActionPerformed(evt); } }); m_jDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/Tclose.png"))); // NOI18N m_jDelete.setMnemonic('d'); m_jDelete.setToolTipText("Remove total quantity of selected item"); m_jDelete.setFocusPainted(false); m_jDelete.setFocusable(false); m_jDelete.setMinimumSize(new java.awt.Dimension(51, 42)); m_jDelete.setPreferredSize(new java.awt.Dimension(51, 42)); m_jDelete.setRequestFocusEnabled(false); m_jDelete.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jDeleteActionPerformed(evt); } }); m_jKot.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/TKOT.png"))); // NOI18N m_jKot.setToolTipText("Send All Fresh Items to Kitchen"); m_jKot.setPreferredSize(new java.awt.Dimension(51, 42)); m_jKot.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jBtnKotActionPerformed(evt); } }); m_jBtnServed.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/servedsymbol.png"))); // NOI18N m_jBtnServed.setToolTipText("Serve Selected Item"); m_jBtnServed.setPreferredSize(new java.awt.Dimension(91, 73)); m_jBtnServed.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jBtnServedActionPerformed(evt); } }); m_jEraser.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/TDelete.png"))); // NOI18N m_jEraser.setMnemonic('i'); m_jEraser.setToolTipText("Clear All Non KOT Items"); m_jEraser.setFocusPainted(false); m_jEraser.setFocusable(false); m_jEraser.setMargin(new java.awt.Insets(8, 14, 8, 14)); m_jEraser.setRequestFocusEnabled(false); m_jEraser.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { m_jEraserActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup().add(5, 5, 5).add(jPanel2Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(m_jPlus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jMinus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup() .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(m_jEraser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 51, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jCalculatePromotion, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jKot, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jBtnServed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 51, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(112, 112, 112).add(m_jAction, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(m_jEditLine, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 51, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup() .add(m_jPlus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(5, 5, 5) .add(m_jMinus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(4, 4, 4) .add(m_jDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(4, 4, 4) .add(m_jEditLine, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 42, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup().add(61, 61, 61).add(m_jAction, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel2Layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(m_jEraser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(m_jCalculatePromotion, 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(m_jKot, 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(m_jBtnServed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 40, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(26, Short.MAX_VALUE))); jPanel5.add(jPanel2, java.awt.BorderLayout.NORTH); m_jPanelCentral.add(jPanel5, java.awt.BorderLayout.LINE_END); m_jPanTicket.add(m_jPanelCentral, java.awt.BorderLayout.CENTER); m_jContEntries.setFocusable(false); m_jContEntries.setPreferredSize(new java.awt.Dimension(501, 500)); m_jContEntries.setRequestFocusEnabled(false); m_jContEntries.setLayout(new java.awt.BorderLayout()); m_jPanEntries.setMinimumSize(new java.awt.Dimension(508, 500)); m_jPanEntries.setPreferredSize(new java.awt.Dimension(495, 525)); m_jPanEntries.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); catcontainer.setPreferredSize(new java.awt.Dimension(300, 200)); catcontainer.setLayout(new java.awt.BorderLayout()); m_jPanEntries.add(catcontainer, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 508, 510)); m_jContEntries.add(m_jPanEntries, java.awt.BorderLayout.PAGE_START); m_jPanTicket.add(m_jContEntries, java.awt.BorderLayout.LINE_END); jPanel12.setBackground(new java.awt.Color(222, 232, 231)); jPanel12.setFocusable(false); jPanel12.setPreferredSize(new java.awt.Dimension(600, 5)); jPanel12.setRequestFocusEnabled(false); jPanel12.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLayeredPane1.setPreferredSize(new java.awt.Dimension(300, 402)); jPanel12.add(jLayeredPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, -500, 989, 509)); m_jPanTicket.add(jPanel12, java.awt.BorderLayout.PAGE_END); m_jPanContainer.add(m_jPanTicket, java.awt.BorderLayout.CENTER); jPanel4.setBackground(new java.awt.Color(222, 232, 231)); jPanel4.setPreferredSize(new java.awt.Dimension(1024, 210)); jPanel4.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jPanel7.setBorder( javax.swing.BorderFactory.createMatteBorder(0, 1, 1, 1, new java.awt.Color(204, 204, 204))); jPanel7.setMaximumSize(new java.awt.Dimension(700, 158)); jPanel7.setPreferredSize(new java.awt.Dimension(320, 158)); jLabel7.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N jLabel7.setText("TOTAL PAID"); jLabel8.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N jLabel8.setText("CHANGE"); m_jTxtTotalPaid.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N m_jTxtTotalPaid.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jTxtTotalPaid.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jTxtTotalPaid.setFocusable(false); m_jTxtTotalPaid.setOpaque(true); m_jTxtTotalPaid.setPreferredSize(new java.awt.Dimension(123, 25)); m_jTxtTotalPaid.setRequestFocusEnabled(false); m_jTxtChange.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N m_jTxtChange.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jTxtChange.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jTxtChange.setFocusable(false); m_jTxtChange.setOpaque(true); m_jTxtChange.setPreferredSize(new java.awt.Dimension(123, 25)); m_jTxtChange.setRequestFocusEnabled(false); jPanel3.setPreferredSize(new java.awt.Dimension(228, 100)); m_jTax.setFocusable(false); m_jTax.setRequestFocusEnabled(false); m_jPor.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jPor.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jPor.setFocusable(false); m_jPor.setOpaque(true); m_jPor.setPreferredSize(new java.awt.Dimension(22, 22)); m_jPor.setRequestFocusEnabled(false); m_jaddtax.setText("+"); m_jaddtax.setFocusPainted(false); m_jaddtax.setFocusable(false); m_jaddtax.setRequestFocusEnabled(false); jLblPrinterStatus.setForeground(new java.awt.Color(255, 0, 0)); m_jKeyFactory.setBackground(javax.swing.UIManager.getDefaults().getColor("Panel.background")); m_jKeyFactory.setForeground(javax.swing.UIManager.getDefaults().getColor("Panel.background")); m_jKeyFactory.setBorder(null); m_jKeyFactory.setCaretColor(javax.swing.UIManager.getDefaults().getColor("Panel.background")); m_jKeyFactory.setPreferredSize(new java.awt.Dimension(4, 4)); m_jKeyFactory.setRequestFocusEnabled(false); m_jKeyFactory.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { m_jKeyFactoryKeyTyped(evt); } }); org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup().addContainerGap() .add(m_jKeyFactory, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 239, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(65, 65, 65).add(jLblPrinterStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 68, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel3Layout.createSequentialGroup().add(20, 20, 20) .add(m_jaddtax, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(m_jPor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel3Layout.createSequentialGroup().addContainerGap().add(m_jTax, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup().add(6, 6, 6).add(jLblPrinterStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(m_jKeyFactory, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(m_jTax, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(21, 21, 21) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(m_jPor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jaddtax, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); org.jdesktop.layout.GroupLayout jPanel7Layout = new org.jdesktop.layout.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel7Layout.createSequentialGroup().add(10, 10, 10) .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel7Layout.createSequentialGroup() .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 126, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(3, 3, 3) .add(m_jTxtTotalPaid, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel7Layout.createSequentialGroup() .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 110, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(19, 19, 19).add(m_jTxtChange, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel7Layout.createSequentialGroup() .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 392, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap())); jPanel7Layout .setVerticalGroup(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel7Layout.createSequentialGroup() .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 89, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(270, 270, 270) .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jTxtTotalPaid, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(10, 10, 10) .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(m_jTxtChange, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))); jPanel4.add(jPanel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(1325, 1, 170, 160)); jPanel8.setBackground(new java.awt.Color(255, 255, 255)); jPanel8.setBorder( javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(204, 204, 204))); jPanel8.setPreferredSize(new java.awt.Dimension(1551, 193)); jPanel8.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("Bill Details"); jPanel8.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(15, 12, 188, -1)); m_jSubtotalEuros1.setBackground(new java.awt.Color(255, 255, 255)); m_jSubtotalEuros1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); m_jSubtotalEuros1.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jSubtotalEuros1.setFocusable(false); m_jSubtotalEuros1.setOpaque(true); m_jSubtotalEuros1.setPreferredSize(new java.awt.Dimension(123, 25)); m_jSubtotalEuros1.setRequestFocusEnabled(false); jPanel8.add(m_jSubtotalEuros1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 40, 80, 23)); m_jLblTotalEuros4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); m_jLblTotalEuros4.setText("SUB TOTAL"); jPanel8.add(m_jLblTotalEuros4, new org.netbeans.lib.awtextra.AbsoluteConstraints(11, 37, 94, 23)); m_jTaxesEuros1.setBackground(new java.awt.Color(255, 255, 255)); m_jTaxesEuros1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); m_jTaxesEuros1.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jTaxesEuros1.setFocusable(false); m_jTaxesEuros1.setOpaque(true); m_jTaxesEuros1.setPreferredSize(new java.awt.Dimension(123, 25)); m_jTaxesEuros1.setRequestFocusEnabled(false); jPanel8.add(m_jTaxesEuros1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 70, 80, 23)); m_jLblTotalEuros5.setBackground(new java.awt.Color(255, 255, 255)); m_jLblTotalEuros5.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); m_jLblTotalEuros5.setText("TAXES"); jPanel8.add(m_jLblTotalEuros5, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 70, 60, 23)); jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jLabel5.setText("DISCOUNT"); jPanel8.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, 80, 23)); m_jLblTotalEuros6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); m_jLblTotalEuros6.setText("TOTAL SALES"); jPanel8.add(m_jLblTotalEuros6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 160, 80, 20)); m_jDiscount1.setBackground(new java.awt.Color(255, 255, 255)); m_jDiscount1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); m_jDiscount1.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jDiscount1.setFocusable(false); m_jDiscount1.setOpaque(true); m_jDiscount1.setPreferredSize(new java.awt.Dimension(123, 25)); m_jDiscount1.setRequestFocusEnabled(false); jPanel8.add(m_jDiscount1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 100, 80, 23)); m_jTotalEuros.setBackground(new java.awt.Color(255, 255, 255)); m_jTotalEuros.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jTotalEuros.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jTotalEuros.setFocusable(false); m_jTotalEuros.setOpaque(true); m_jTotalEuros.setPreferredSize(new java.awt.Dimension(123, 25)); m_jTotalEuros.setRequestFocusEnabled(false); jPanel8.add(m_jTotalEuros, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 160, 80, 23)); jTaxPanel.setBackground(new java.awt.Color(255, 255, 255)); jTaxPanel.setPreferredSize(new java.awt.Dimension(202, 157)); jTaxPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); m_jServiceTaxLbl.setText("SERVICE TAX"); jTaxPanel.add(m_jServiceTaxLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 40, 100, 23)); m_jServiceTax.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jTaxPanel.add(m_jServiceTax, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 40, 73, 23)); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel4.setText("Tax Breakup"); jTaxPanel.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 11, 194, -1)); jScrollPane1.setBorder(null); jScrollPane1.setViewportView(m_jTaxList); jTaxPanel.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 37, 200, 140)); m_jSwachBharatLbl.setText("SWACHH BHARAT TAX"); jTaxPanel.add(m_jSwachBharatLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 70, 130, 20)); m_jSwachBharat.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jTaxPanel.add(m_jSwachBharat, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 70, 70, 20)); jPanel8.add(jTaxPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(221, 1, -1, 178)); jLabel6.setText("PROMO DISCOUNT"); jPanel8.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 130, 120, 20)); m_jPromoDiscount.setBackground(new java.awt.Color(255, 255, 255)); m_jPromoDiscount.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); m_jPromoDiscount.setBorder(javax.swing.BorderFactory.createCompoundBorder( javax.swing.BorderFactory .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4))); m_jPromoDiscount.setFocusable(false); m_jPromoDiscount.setOpaque(true); m_jPromoDiscount.setPreferredSize(new java.awt.Dimension(123, 25)); m_jPromoDiscount.setRequestFocusEnabled(false); jPanel8.add(m_jPromoDiscount, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 130, 80, 23)); jPanel4.add(jPanel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(7, 1, 434, -1)); m_jProducts.setBackground(new java.awt.Color(255, 255, 255)); m_jProducts.setLayout(new java.awt.CardLayout()); jPanel4.add(m_jProducts, new org.netbeans.lib.awtextra.AbsoluteConstraints(447, 1, 551, 190)); m_jPanContainer.add(jPanel4, java.awt.BorderLayout.SOUTH); add(m_jPanContainer, "ticket"); }
From source file:op.care.med.inventory.DlgCloseStock.java
/** * This method is called from within the constructor to * initialize the form.//ww w . ja va 2 s . com * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the PrinterForm Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new JPanel(); jScrollPane1 = new JScrollPane(); txtInfo = new JTextPane(); rbLeer = new JRadioButton(); rbStellen = new JRadioButton(); txtLetzte = new JTextField(); lblEinheiten = new JLabel(); rbAbgelaufen = new JRadioButton(); jSeparator1 = new JSeparator(); jLabel2 = new JLabel(); jLabel3 = new JLabel(); rbGefallen = new JRadioButton(); cmbBestID = new JComboBox(); panel1 = new JPanel(); btnClose = new JButton(); btnOk = new JButton(); //======== this ======== setResizable(false); setModalityType(Dialog.ModalityType.APPLICATION_MODAL); Container contentPane = getContentPane(); contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS)); //======== jPanel1 ======== { jPanel1.setBorder(null); jPanel1.setLayout(new FormLayout("14dlu, $lcgap, 145dlu, $lcgap, 41dlu, $lcgap, 93dlu, $lcgap, 14dlu", "14dlu, $lgap, fill:70dlu:grow, 4*($lgap, fill:default), $lgap, $rgap, $lgap, fill:default, $lgap, $rgap, $lgap, default, $lgap, 14dlu")); //======== jScrollPane1 ======== { //---- txtInfo ---- txtInfo.setEditable(false); txtInfo.setFont(new Font("Arial", Font.PLAIN, 14)); jScrollPane1.setViewportView(txtInfo); } jPanel1.add(jScrollPane1, CC.xywh(3, 3, 5, 1)); //---- rbLeer ---- rbLeer.setSelected(true); rbLeer.setText("Die Packung ist nun leer"); rbLeer.setFont(new Font("Arial", Font.PLAIN, 14)); rbLeer.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rbLeerActionPerformed(e); } }); jPanel1.add(rbLeer, CC.xy(3, 5)); //---- rbStellen ---- rbStellen.setText("Beim Vorab Stellen haben Sie die letzten "); rbStellen.setFont(new Font("Arial", Font.PLAIN, 14)); rbStellen.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rbStellenActionPerformed(e); } }); jPanel1.add(rbStellen, CC.xywh(3, 7, 2, 1)); //---- txtLetzte ---- txtLetzte.setText("jTextField1"); txtLetzte.setFont(new Font("Arial", Font.PLAIN, 14)); txtLetzte.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { txtLetzteFocusLost(e); } }); jPanel1.add(txtLetzte, CC.xy(5, 7)); //---- lblEinheiten ---- lblEinheiten.setText("Einheiten verbraucht."); lblEinheiten.setFont(new Font("Arial", Font.PLAIN, 14)); jPanel1.add(lblEinheiten, CC.xy(7, 7)); //---- rbAbgelaufen ---- rbAbgelaufen.setText( "Die Packung ist abgelaufen oder wird nicht mehr ben\u00f6tigt. Bereit zur Entsorgung."); rbAbgelaufen.setFont(new Font("Arial", Font.PLAIN, 14)); rbAbgelaufen.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rbAbgelaufenActionPerformed(e); } }); jPanel1.add(rbAbgelaufen, CC.xywh(3, 9, 5, 1)); jPanel1.add(jSeparator1, CC.xywh(3, 13, 5, 1)); //---- jLabel2 ---- jLabel2.setText("Als n\u00e4chstes Packung soll die Nummer"); jLabel2.setFont(new Font("Arial", Font.PLAIN, 14)); jLabel2.setHorizontalAlignment(SwingConstants.TRAILING); jPanel1.add(jLabel2, CC.xy(3, 15)); //---- jLabel3 ---- jLabel3.setText("angebrochen werden."); jLabel3.setFont(new Font("Arial", Font.PLAIN, 14)); jPanel1.add(jLabel3, CC.xy(7, 15)); //---- rbGefallen ---- rbGefallen.setText( "<html>Die Packung ist <font color=\"red\">runter gefallen</font> oder <font color=\"red\">verschwunden</font> und muss ausgebucht werden.</html>"); rbGefallen.setFont(new Font("Arial", Font.PLAIN, 14)); rbGefallen.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rbGefallenActionPerformed(e); } }); jPanel1.add(rbGefallen, CC.xywh(3, 11, 5, 1)); //---- cmbBestID ---- cmbBestID.setModel(new DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); cmbBestID.setFont(new Font("Arial", Font.PLAIN, 14)); cmbBestID.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { cmbBestIDItemStateChanged(e); } }); jPanel1.add(cmbBestID, CC.xy(5, 15)); //======== panel1 ======== { panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS)); //---- btnClose ---- btnClose.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/cancel.png"))); btnClose.setText(null); btnClose.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnCloseActionPerformed(e); } }); panel1.add(btnClose); //---- btnOk ---- btnOk.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/apply.png"))); btnOk.setText(null); btnOk.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnOkActionPerformed(e); } }); panel1.add(btnOk); } jPanel1.add(panel1, CC.xy(7, 19, CC.RIGHT, CC.DEFAULT)); } contentPane.add(jPanel1); pack(); setLocationRelativeTo(getOwner()); //---- buttonGroup1 ---- ButtonGroup buttonGroup1 = new ButtonGroup(); buttonGroup1.add(rbLeer); buttonGroup1.add(rbStellen); buttonGroup1.add(rbAbgelaufen); buttonGroup1.add(rbGefallen); }
From source file:op.care.med.inventory.DlgTX.java
/** * This method is called from within the constructor to * initialize the form.// ww w . ja va 2 s . c o m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the PrinterForm Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { lblText = new JLabel(); txtText = new JTextField(); txtValue = new JTextField(); lblValue = new JLabel(); lblUnit = new JLabel(); lblWeightControl = new JLabel(); txtWeightControlled = new JTextField(); lblUnit2 = new JLabel(); panel1 = new JPanel(); btnCancel = new JButton(); btnBuchung = new JButton(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout( new FormLayout("default, $lcgap, default, $ugap, 141dlu:grow, $rgap, default, $lcgap, default", "2*(default, $lgap), fill:default, $lgap, default, $lgap, fill:default")); //---- lblText ---- lblText.setText("Buchungstext"); lblText.setFont(new Font("Arial", Font.PLAIN, 14)); contentPane.add(lblText, CC.xy(3, 3, CC.DEFAULT, CC.TOP)); //---- txtText ---- txtText.setColumns(100); txtText.addActionListener(e -> txtTextActionPerformed(e)); contentPane.add(txtText, CC.xywh(5, 3, 3, 1)); //---- txtValue ---- txtValue.setHorizontalAlignment(SwingConstants.RIGHT); txtValue.setText("jTextField1"); txtValue.setFont(new Font("Arial", Font.PLAIN, 14)); txtValue.addCaretListener(e -> txtMengeCaretUpdate(e)); txtValue.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtMengeFocusGained(e); } }); txtValue.addActionListener(e -> txtValueActionPerformed(e)); contentPane.add(txtValue, CC.xy(5, 5)); //---- lblValue ---- lblValue.setText("Menge"); lblValue.setFont(new Font("Arial", Font.PLAIN, 14)); contentPane.add(lblValue, CC.xy(3, 5)); //---- lblUnit ---- lblUnit.setHorizontalAlignment(SwingConstants.TRAILING); lblUnit.setText("jLabel4"); lblUnit.setFont(new Font("Arial", Font.PLAIN, 14)); contentPane.add(lblUnit, CC.xy(7, 5)); //---- lblWeightControl ---- lblWeightControl.setText("Menge"); lblWeightControl.setFont(new Font("Arial", Font.PLAIN, 14)); contentPane.add(lblWeightControl, CC.xy(3, 7)); //---- txtWeightControlled ---- txtWeightControlled.setHorizontalAlignment(SwingConstants.RIGHT); txtWeightControlled.setText("jTextField1"); txtWeightControlled.setFont(new Font("Arial", Font.PLAIN, 14)); txtWeightControlled.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtWeightControlledFocusGained(e); } }); txtWeightControlled.addCaretListener(e -> txtWeightControlledCaretUpdate(e)); contentPane.add(txtWeightControlled, CC.xy(5, 7)); //---- lblUnit2 ---- lblUnit2.setHorizontalAlignment(SwingConstants.TRAILING); lblUnit2.setText("g"); lblUnit2.setFont(new Font("Arial", Font.PLAIN, 14)); contentPane.add(lblUnit2, CC.xy(7, 7, CC.LEFT, CC.DEFAULT)); //======== panel1 ======== { panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS)); //---- btnCancel ---- btnCancel.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/cancel.png"))); btnCancel.addActionListener(e -> btnCancelActionPerformed(e)); panel1.add(btnCancel); //---- btnBuchung ---- btnBuchung.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/apply.png"))); btnBuchung.addActionListener(e -> btnBuchungActionPerformed(e)); panel1.add(btnBuchung); } contentPane.add(panel1, CC.xywh(5, 9, 3, 1, CC.RIGHT, CC.DEFAULT)); setSize(600, 165); setLocationRelativeTo(getOwner()); }