List of usage examples for java.awt GridBagConstraints FIRST_LINE_START
int FIRST_LINE_START
To view the source code for java.awt GridBagConstraints FIRST_LINE_START.
Click Source Link
From source file:be.fedict.eid.tsl.tool.TslInternalFrame.java
private void addGenericTab(JTabbedPane tabbedPane) { GridBagLayout gridBagLayout = new GridBagLayout(); JPanel dataPanel = new JPanel(gridBagLayout); JPanel genericPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); tabbedPane.add("Generic", new JScrollPane(genericPanel)); genericPanel.add(dataPanel);//w ww . ja va 2s . co m GridBagConstraints constraints = new GridBagConstraints(); JLabel schemeNameLabel = new JLabel("Scheme Name"); constraints.anchor = GridBagConstraints.FIRST_LINE_START; constraints.gridx = 0; constraints.gridy = 0; constraints.ipadx = 10; dataPanel.add(schemeNameLabel, constraints); JLabel schemeName = new JLabel(this.trustServiceList.getSchemeName()); constraints.gridx++; dataPanel.add(schemeName, constraints); JLabel schemeOperatorNameLabel = new JLabel("Scheme Operator Name"); constraints.gridy++; constraints.gridx = 0; dataPanel.add(schemeOperatorNameLabel, constraints); JLabel schemeOperatorName = new JLabel(this.trustServiceList.getSchemeOperatorName()); constraints.gridx++; dataPanel.add(schemeOperatorName, constraints); constraints.gridy++; constraints.gridx = 0; dataPanel.add(new JLabel("Type"), constraints); constraints.gridx++; dataPanel.add( new JLabel(this.trustServiceList.getType() .substring(this.trustServiceList.getType().indexOf("TSLType/") + "TSLType/".length())), constraints); constraints.gridy++; constraints.gridx = 0; dataPanel.add(new JLabel("Sequence number"), constraints); constraints.gridx++; dataPanel.add(new JLabel(this.trustServiceList.getSequenceNumber().toString()), constraints); constraints.gridy++; constraints.gridx = 0; dataPanel.add(new JLabel("Issue date"), constraints); constraints.gridx++; dataPanel.add(new JLabel(this.trustServiceList.getIssueDate().toString()), constraints); constraints.gridy++; constraints.gridx = 0; dataPanel.add(new JLabel("Next update"), constraints); constraints.gridx++; dataPanel.add(new JLabel(this.trustServiceList.getNextUpdate().toString()), constraints); constraints.gridy++; constraints.gridx = 0; dataPanel.add(new JLabel("TSL SHA1 fingerprint"), constraints); constraints.gridx++; dataPanel.add(new JLabel(getSha1Fingerprint()), constraints); constraints.gridy++; constraints.gridx = 0; dataPanel.add(new JLabel("TSL SHA256 fingerprint"), constraints); constraints.gridx++; dataPanel.add(new JLabel(getSha256Fingerprint()), constraints); }
From source file:com.att.aro.ui.view.menu.tools.RegexWizard.java
private JPanel getFieldPanel() { if (fieldPanel == null) { fieldPanel = new JPanel(); fieldPanel.addComponentListener(this); fieldPanel.setLayout(new GridBagLayout()); GridBagConstraints constraint = new GridBagConstraints(); constraint.gridx = 0;//from w ww . j a v a 2 s .c o m constraint.gridy = 0; constraint.insets = new Insets(0, 5, 0, 5); constraint.anchor = GridBagConstraints.FIRST_LINE_START; constraint.weightx = 1; constraint.fill = GridBagConstraints.HORIZONTAL; cbRequest = new JCheckBox(ResourceBundleHelper.getMessageString("videotab.label.checkbox"), true); cbRequest.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { requestField.setEditable(cbRequest.isSelected()); } }); cbHeader = new JCheckBox(ResourceBundleHelper.getMessageString("videotab.label.checkbox"), true); cbHeader.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { headerField.setEditable(cbHeader.isSelected()); } }); cbResponse = new JCheckBox(ResourceBundleHelper.getMessageString("videotab.label.checkbox"), true); cbResponse.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { responseField.setEditable(cbResponse.isSelected()); } }); compileResultsField = new JTextField(); compileResultsField.setEditable(false); compileResultsField.setBackground(fieldPanel.getBackground()); compileResultsField.setForeground(Color.red); compileResultsField.setFont(compileResultsField.getFont().deriveFont(Font.BOLD)); requestField = createTextAreaAndProperties( ResourceBundleHelper.getMessageString("videotab.label.request")); requestField.setName(ResourceBundleHelper.getMessageString("videotab.field.request")); regexRequestField = createTextAreaAndProperties( ResourceBundleHelper.getMessageString("videotab.label.regex.request")); regexRequestField.setName(ResourceBundleHelper.getMessageString("videotab.field.regex.request")); responseField = createTextAreaAndProperties( ResourceBundleHelper.getMessageString("videotab.label.response")); responseField.setName(ResourceBundleHelper.getMessageString("videotab.field.response")); regexResponseField = createTextAreaAndProperties( ResourceBundleHelper.getMessageString("videotab.label.regex.response")); regexResponseField.setName(ResourceBundleHelper.getMessageString("videotab.field.regex.response")); headerField = createTextAreaAndProperties( ResourceBundleHelper.getMessageString("videotab.label.header")); headerField.setName(ResourceBundleHelper.getMessageString("videotab.field.header")); regexHeaderField = createTextAreaAndProperties( ResourceBundleHelper.getMessageString("videotab.label.regex.header")); regexHeaderField.setName(ResourceBundleHelper.getMessageString("videotab.field.regex.header")); fieldPanel.add(compileResultsField, constraint); constraint.gridy = 1; constraint.anchor = GridBagConstraints.WEST; constraint.fill = GridBagConstraints.NONE; constraint.anchor = GridBagConstraints.EAST; fieldPanel.add(cbRequest, constraint); constraint.gridy = 2; constraint.anchor = GridBagConstraints.WEST; constraint.fill = GridBagConstraints.HORIZONTAL; fieldPanel.add(requestField, constraint); constraint.gridy = 3; constraint.fill = GridBagConstraints.HORIZONTAL; constraint.anchor = GridBagConstraints.WEST; fieldPanel.add(regexRequestField, constraint); constraint.gridy = 4; constraint.fill = GridBagConstraints.NONE; constraint.anchor = GridBagConstraints.WEST; constraint.anchor = GridBagConstraints.EAST; fieldPanel.add(cbHeader, constraint); constraint.gridy = 5; constraint.fill = GridBagConstraints.HORIZONTAL; fieldPanel.add(headerField, constraint); constraint.gridy = 6; fieldPanel.add(regexHeaderField, constraint); constraint.gridy = 7; constraint.fill = GridBagConstraints.NONE; constraint.anchor = GridBagConstraints.WEST; constraint.anchor = GridBagConstraints.EAST; fieldPanel.add(cbResponse, constraint); constraint.gridy = 8; constraint.anchor = GridBagConstraints.WEST; constraint.fill = GridBagConstraints.HORIZONTAL; fieldPanel.add(responseField, constraint); constraint.gridy = 9; constraint.fill = GridBagConstraints.HORIZONTAL; fieldPanel.add(regexResponseField, constraint); } return fieldPanel; }
From source file:com._17od.upm.gui.MainWindow.java
private void addComponentsToPane() { // Ensure the layout manager is a BorderLayout if (!(getContentPane().getLayout() instanceof GridBagLayout)) { getContentPane().setLayout(new GridBagLayout()); }/*from w ww . j ava 2 s .com*/ // Create the menubar setJMenuBar(createMenuBar()); GridBagConstraints c = new GridBagConstraints(); // The toolbar Row c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.FIRST_LINE_START; c.insets = new Insets(0, 0, 0, 0); c.weightx = 0; c.weighty = 0; c.gridwidth = 3; c.fill = GridBagConstraints.HORIZONTAL; Component toolbar = createToolBar(); getContentPane().add(toolbar, c); // Keep the frame background color consistent getContentPane().setBackground(toolbar.getBackground()); // The seperator Row c.gridx = 0; c.gridy = 1; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 0); c.weightx = 1; c.weighty = 0; c.gridwidth = 3; c.fill = GridBagConstraints.HORIZONTAL; getContentPane().add(new JSeparator(), c); // The search field row searchIcon = new JLabel(Util.loadImage("search.gif")); searchIcon.setDisabledIcon(Util.loadImage("search_d.gif")); searchIcon.setEnabled(false); c.gridx = 0; c.gridy = 2; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(5, 1, 5, 1); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; getContentPane().add(searchIcon, c); searchField = new JTextField(15); searchField.setEnabled(false); searchField.setMinimumSize(searchField.getPreferredSize()); searchField.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { // This method never seems to be called } public void insertUpdate(DocumentEvent e) { dbActions.filter(); } public void removeUpdate(DocumentEvent e) { dbActions.filter(); } }); searchField.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { dbActions.resetSearch(); } else if (e.getKeyCode() == KeyEvent.VK_ENTER) { // If the user hits the enter key in the search field and // there's only one item // in the listview then open that item (this code assumes // that the one item in // the listview has already been selected. this is done // automatically in the // DatabaseActions.filter() method) if (accountsListview.getModel().getSize() == 1) { viewAccountMenuItem.doClick(); } } } }); c.gridx = 1; c.gridy = 2; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(5, 1, 5, 1); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; getContentPane().add(searchField, c); resetSearchButton = new JButton(Util.loadImage("stop.gif")); resetSearchButton.setDisabledIcon(Util.loadImage("stop_d.gif")); resetSearchButton.setEnabled(false); resetSearchButton.setToolTipText(Translator.translate(RESET_SEARCH_TXT)); resetSearchButton.setActionCommand(RESET_SEARCH_TXT); resetSearchButton.addActionListener(this); resetSearchButton.setBorder(BorderFactory.createEmptyBorder()); resetSearchButton.setFocusable(false); c.gridx = 2; c.gridy = 2; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(5, 1, 5, 1); c.weightx = 1; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; getContentPane().add(resetSearchButton, c); // The accounts listview row accountsListview = new JList(); accountsListview.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); accountsListview.setSelectedIndex(0); accountsListview.setVisibleRowCount(10); accountsListview.setModel(new SortedListModel()); JScrollPane accountsScrollList = new JScrollPane(accountsListview, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); accountsListview.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent e) { // If the listview gets focus, there is one ore more items in // the listview and there is nothing // already selected, then select the first item in the list if (accountsListview.getModel().getSize() > 0 && accountsListview.getSelectedIndex() == -1) { accountsListview.setSelectionInterval(0, 0); } } }); accountsListview.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { dbActions.setButtonState(); } }); accountsListview.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { viewAccountMenuItem.doClick(); } } }); accountsListview.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { viewAccountMenuItem.doClick(); } } }); // Create a shortcut to delete account functionality with DEL(delete) // key accountsListview.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_DELETE) { try { dbActions.reloadDatabaseBefore(new DeleteAccountAction()); } catch (InvalidPasswordException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (ProblemReadingDatabaseFile e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } } }); c.gridx = 0; c.gridy = 3; c.anchor = GridBagConstraints.CENTER; c.insets = new Insets(0, 1, 1, 1); c.weightx = 1; c.weighty = 1; c.gridwidth = 3; c.fill = GridBagConstraints.BOTH; getContentPane().add(accountsScrollList, c); // The "File Changed" panel c.gridx = 0; c.gridy = 4; c.anchor = GridBagConstraints.CENTER; c.insets = new Insets(0, 1, 0, 1); c.ipadx = 3; c.ipady = 3; c.weightx = 0; c.weighty = 0; c.gridwidth = 3; c.fill = GridBagConstraints.BOTH; databaseFileChangedPanel = new JPanel(); databaseFileChangedPanel.setLayout(new BoxLayout(databaseFileChangedPanel, BoxLayout.X_AXIS)); databaseFileChangedPanel.setBackground(new Color(249, 172, 60)); databaseFileChangedPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); JLabel fileChangedLabel = new JLabel("Database file changed"); fileChangedLabel.setAlignmentX(LEFT_ALIGNMENT); databaseFileChangedPanel.add(fileChangedLabel); databaseFileChangedPanel.add(Box.createHorizontalGlue()); JButton reloadButton = new JButton("Reload"); reloadButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { dbActions.reloadDatabaseFromDisk(); } catch (Exception ex) { dbActions.errorHandler(ex); } } }); databaseFileChangedPanel.add(reloadButton); databaseFileChangedPanel.setVisible(false); getContentPane().add(databaseFileChangedPanel, c); // Add the statusbar c.gridx = 0; c.gridy = 5; c.anchor = GridBagConstraints.CENTER; c.insets = new Insets(0, 1, 1, 1); c.weightx = 1; c.weighty = 0; c.gridwidth = 3; c.fill = GridBagConstraints.HORIZONTAL; getContentPane().add(statusBar, c); }
From source file:com._17od.upm.gui.AccountDialog.java
public AccountDialog(AccountInformation account, JFrame parentWindow, boolean readOnly, ArrayList existingAccounts) { super(parentWindow, true); boolean addingAccount = false; //Request focus on Account JDialog when mouse clicked this.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { requestFocus();//from w ww . j a v a 2 s. c o m } } }); // Set the title based on weather we've been opened in readonly mode and // weather the // Account passed in is empty or not String title = null; if (readOnly) { title = Translator.translate("viewAccount"); } else if (!readOnly && account.getAccountName().trim().equals("")) { title = Translator.translate("addAccount"); addingAccount = true; } else { title = Translator.translate("editAccount"); } setTitle(title); this.pAccount = account; this.existingAccounts = existingAccounts; this.parentWindow = parentWindow; getContentPane().setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); Container container = getContentPane(); // The AccountName Row JLabel accountLabel = new JLabel(Translator.translate("account")); c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(10, 10, 10, 10); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; container.add(accountLabel, c); // This panel will hold the Account field and the copy and paste // buttons. JPanel accountPanel = new JPanel(new GridBagLayout()); accountName = new JTextField(new String(pAccount.getAccountName()), 20); if (readOnly) { accountName.setEditable(false); } c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 1; c.weighty = 1; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; accountPanel.add(accountName, c); accountName.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent e) { accountName.selectAll(); } }); JButton acctCopyButton = new JButton(); acctCopyButton.setIcon(Util.loadImage("copy-icon.png")); acctCopyButton.setToolTipText("Copy"); acctCopyButton.setEnabled(true); acctCopyButton.setMargin(new Insets(0, 0, 0, 0)); acctCopyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { copyTextField(accountName); } }); c.gridx = 1; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; accountPanel.add(acctCopyButton, c); JButton acctPasteButton = new JButton(); acctPasteButton.setIcon(Util.loadImage("paste-icon.png")); acctPasteButton.setToolTipText("Paste"); acctPasteButton.setEnabled(!readOnly); acctPasteButton.setMargin(new Insets(0, 0, 0, 0)); acctPasteButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { pasteToTextField(accountName); } }); c.gridx = 2; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; accountPanel.add(acctPasteButton, c); c.gridx = 1; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(10, 10, 10, 10); c.weightx = 1; c.weighty = 1; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; container.add(accountPanel, c); // Userid Row JLabel useridLabel = new JLabel(Translator.translate("userid")); c.gridx = 0; c.gridy = 1; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(10, 10, 10, 10); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; container.add(useridLabel, c); // This panel will hold the User ID field and the copy and paste // buttons. JPanel idPanel = new JPanel(new GridBagLayout()); userId = new JTextField(new String(pAccount.getUserId()), 20); if (readOnly) { userId.setEditable(false); } c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 1; c.weighty = 1; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; idPanel.add(userId, c); userId.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent e) { userId.selectAll(); } }); JButton idCopyButton = new JButton(); idCopyButton.setIcon(Util.loadImage("copy-icon.png")); idCopyButton.setToolTipText("Copy"); idCopyButton.setEnabled(true); idCopyButton.setMargin(new Insets(0, 0, 0, 0)); idCopyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { copyTextField(userId); } }); c.gridx = 1; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; idPanel.add(idCopyButton, c); JButton idPasteButton = new JButton(); idPasteButton.setIcon(Util.loadImage("paste-icon.png")); idPasteButton.setToolTipText("Paste"); idPasteButton.setEnabled(!readOnly); idPasteButton.setMargin(new Insets(0, 0, 0, 0)); idPasteButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { pasteToTextField(userId); } }); c.gridx = 2; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; idPanel.add(idPasteButton, c); c.gridx = 1; c.gridy = 1; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(10, 10, 10, 10); c.weightx = 1; c.weighty = 1; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; container.add(idPanel, c); // Password Row JLabel passwordLabel = new JLabel(Translator.translate("password")); c.gridx = 0; c.gridy = 2; c.anchor = GridBagConstraints.FIRST_LINE_START; c.insets = new Insets(15, 10, 10, 10); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; container.add(passwordLabel, c); // This panel will hold the password, generate password button, copy and // paste buttons, and hide password checkbox JPanel passwordPanel = new JPanel(new GridBagLayout()); password = new JPasswordField(new String(pAccount.getPassword()), 20); // allow CTRL-C on the password field password.putClientProperty("JPasswordField.cutCopyAllowed", Boolean.TRUE); password.setEditable(!readOnly); password.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent e) { password.selectAll(); } }); c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 1; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; passwordPanel.add(password, c); JButton generateRandomPasswordButton = new JButton(Translator.translate("generate")); if (readOnly) { generateRandomPasswordButton.setEnabled(false); } generateRandomPasswordButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionevent) { // Get the user's preference about including or not Escape // Characters to generated passwords Boolean includeEscapeChars = new Boolean( Preferences.get(Preferences.ApplicationOptions.INCLUDE_ESCAPE_CHARACTERS, "true")); int pwLength = Preferences.getInt(Preferences.ApplicationOptions.ACCOUNT_PASSWORD_LENGTH, 8); String Password; if ((includeEscapeChars.booleanValue()) && (pwLength > 3)) { // Verify that the generated password satisfies the criteria // for strong passwords(including Escape Characters) do { Password = GeneratePassword(pwLength, includeEscapeChars.booleanValue()); } while (!(CheckPassStrong(Password, includeEscapeChars.booleanValue()))); } else if (!(includeEscapeChars.booleanValue()) && (pwLength > 2)) { // Verify that the generated password satisfies the criteria // for strong passwords(excluding Escape Characters) do { Password = GeneratePassword(pwLength, includeEscapeChars.booleanValue()); } while (!(CheckPassStrong(Password, includeEscapeChars.booleanValue()))); } else { // Else a weak password of 3 or less chars will be produced Password = GeneratePassword(pwLength, includeEscapeChars.booleanValue()); } password.setText(Password); } }); if (addingAccount) { generateRandomPasswordButton.doClick(); } c.gridx = 1; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; passwordPanel.add(generateRandomPasswordButton, c); JButton pwCopyButton = new JButton(); pwCopyButton.setIcon(Util.loadImage("copy-icon.png")); pwCopyButton.setToolTipText("Copy"); pwCopyButton.setEnabled(true); pwCopyButton.setMargin(new Insets(0, 0, 0, 0)); pwCopyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { copyTextField(password); } }); c.gridx = 2; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; passwordPanel.add(pwCopyButton, c); JButton pwPasteButton = new JButton(); pwPasteButton.setIcon(Util.loadImage("paste-icon.png")); pwPasteButton.setToolTipText("Paste"); pwPasteButton.setEnabled(!readOnly); pwPasteButton.setMargin(new Insets(0, 0, 0, 0)); pwPasteButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { pasteToTextField(password); } }); c.gridx = 3; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; passwordPanel.add(pwPasteButton, c); JCheckBox hidePasswordCheckbox = new JCheckBox(Translator.translate("hide"), true); defaultEchoChar = password.getEchoChar(); hidePasswordCheckbox.setMargin(new Insets(5, 0, 5, 0)); hidePasswordCheckbox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { password.setEchoChar(defaultEchoChar); } else { password.setEchoChar((char) 0); } } }); Boolean hideAccountPassword = new Boolean( Preferences.get(Preferences.ApplicationOptions.ACCOUNT_HIDE_PASSWORD, "true")); hidePasswordCheckbox.setSelected(hideAccountPassword.booleanValue()); c.gridx = 0; c.gridy = 1; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 0); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; passwordPanel.add(hidePasswordCheckbox, c); c.gridx = 1; c.gridy = 2; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(10, 10, 10, 10); c.weightx = 1; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; container.add(passwordPanel, c); // URL Row JLabel urlLabel = new JLabel(Translator.translate("url")); c.gridx = 0; c.gridy = 3; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(10, 10, 10, 10); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; container.add(urlLabel, c); // This panel will hold the URL field and the copy and paste buttons. JPanel urlPanel = new JPanel(new GridBagLayout()); url = new JTextField(new String(pAccount.getUrl()), 20); if (readOnly) { url.setEditable(false); } c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 1; c.weighty = 1; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; urlPanel.add(url, c); url.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent e) { url.selectAll(); } }); final JButton urlLaunchButton = new JButton(); urlLaunchButton.setIcon(Util.loadImage("launch-url-sm.png")); urlLaunchButton.setToolTipText("Launch URL"); urlLaunchButton.setEnabled(true); urlLaunchButton.setMargin(new Insets(0, 0, 0, 0)); urlLaunchButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { String urlText = url.getText(); // Check if the selected url is null or emty and inform the user // via JoptioPane message if ((urlText == null) || (urlText.length() == 0)) { JOptionPane.showMessageDialog(urlLaunchButton.getParent(), Translator.translate("EmptyUrlJoptionpaneMsg"), Translator.translate("UrlErrorJoptionpaneTitle"), JOptionPane.WARNING_MESSAGE); // Check if the selected url is a valid formated url(via // urlIsValid() method) and inform the user via JoptioPane // message } else if (!(urlIsValid(urlText))) { JOptionPane.showMessageDialog(urlLaunchButton.getParent(), Translator.translate("InvalidUrlJoptionpaneMsg"), Translator.translate("UrlErrorJoptionpaneTitle"), JOptionPane.WARNING_MESSAGE); // Call the method LaunchSelectedURL() using the selected // url as input } else { LaunchSelectedURL(urlText); } } }); c.gridx = 1; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; urlPanel.add(urlLaunchButton, c); JButton urlCopyButton = new JButton(); urlCopyButton.setIcon(Util.loadImage("copy-icon.png")); urlCopyButton.setToolTipText("Copy"); urlCopyButton.setEnabled(true); urlCopyButton.setMargin(new Insets(0, 0, 0, 0)); urlCopyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { copyTextField(url); } }); c.gridx = 2; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; urlPanel.add(urlCopyButton, c); JButton urlPasteButton = new JButton(); urlPasteButton.setIcon(Util.loadImage("paste-icon.png")); urlPasteButton.setToolTipText("Paste"); urlPasteButton.setEnabled(!readOnly); urlPasteButton.setMargin(new Insets(0, 0, 0, 0)); urlPasteButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { pasteToTextField(url); } }); c.gridx = 3; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; urlPanel.add(urlPasteButton, c); c.gridx = 1; c.gridy = 3; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(10, 10, 10, 10); c.weightx = 1; c.weighty = 1; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; container.add(urlPanel, c); // Notes Row JLabel notesLabel = new JLabel(Translator.translate("notes")); c.gridx = 0; c.gridy = 4; c.anchor = GridBagConstraints.FIRST_LINE_START; c.insets = new Insets(10, 10, 10, 10); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; container.add(notesLabel, c); // This panel will hold the Notes text area and the copy and paste // buttons. JPanel notesPanel = new JPanel(new GridBagLayout()); notes = new JTextArea(new String(pAccount.getNotes()), 10, 20); if (readOnly) { notes.setEditable(false); } notes.setLineWrap(true); // Enable line wrapping. notes.setWrapStyleWord(true); // Line wrap at whitespace. JScrollPane notesScrollPane = new JScrollPane(notes); c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 1; c.weighty = 1; c.gridwidth = 1; c.fill = GridBagConstraints.BOTH; notesPanel.add(notesScrollPane, c); JButton notesCopyButton = new JButton(); notesCopyButton.setIcon(Util.loadImage("copy-icon.png")); notesCopyButton.setToolTipText("Copy"); notesCopyButton.setEnabled(true); notesCopyButton.setMargin(new Insets(0, 0, 0, 0)); notesCopyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { copyTextArea(notes); } }); c.gridx = 1; c.gridy = 0; c.anchor = GridBagConstraints.FIRST_LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; notesPanel.add(notesCopyButton, c); JButton notesPasteButton = new JButton(); notesPasteButton.setIcon(Util.loadImage("paste-icon.png")); notesPasteButton.setToolTipText("Paste"); notesPasteButton.setEnabled(!readOnly); notesPasteButton.setMargin(new Insets(0, 0, 0, 0)); notesPasteButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { pasteToTextArea(notes); } }); c.gridx = 2; c.gridy = 0; c.anchor = GridBagConstraints.FIRST_LINE_START; c.insets = new Insets(0, 0, 0, 5); c.weightx = 0; c.weighty = 0; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; notesPanel.add(notesPasteButton, c); c.gridx = 1; c.gridy = 4; c.anchor = GridBagConstraints.LINE_START; c.insets = new Insets(10, 10, 10, 10); c.weightx = 1; c.weighty = 1; c.gridwidth = 1; c.fill = GridBagConstraints.HORIZONTAL; container.add(notesPanel, c); // Seperator Row JSeparator sep = new JSeparator(); c.gridx = 0; c.gridy = 5; c.anchor = GridBagConstraints.PAGE_END; c.insets = new Insets(0, 0, 0, 0); c.weightx = 0; c.weighty = 0; c.gridwidth = 3; c.fill = GridBagConstraints.HORIZONTAL; container.add(sep, c); // Button Row JPanel buttonPanel = new JPanel(); JButton okButton = new JButton(Translator.translate("ok")); // Link Enter key to okButton getRootPane().setDefaultButton(okButton); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okButtonAction(); } }); buttonPanel.add(okButton); if (!readOnly) { JButton cancelButton = new JButton(Translator.translate("cancel")); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { closeButtonAction(); } }); buttonPanel.add(cancelButton); } c.gridx = 0; c.gridy = 6; c.anchor = GridBagConstraints.PAGE_END; c.insets = new Insets(5, 0, 5, 0); c.weightx = 0; c.weighty = 0; c.gridwidth = 3; c.fill = GridBagConstraints.NONE; container.add(buttonPanel, c); }
From source file:com.att.aro.ui.view.menu.tools.RegexWizard.java
private JPanel getMatcherPanel() { if (matcherPanel == null) { matcherPanel = new JPanel(); matcherPanel.setLayout(new GridBagLayout()); Color bgColor = matcherPanel.getBackground(); matcherPanel.setBorder(new RoundedBorderPanel(bgColor)); GridBagConstraints constraint = new GridBagConstraints(); constraint.gridx = 0;/*from w w w .j a v a2 s.c o m*/ constraint.gridy = 0; constraint.insets = new Insets(0, 0, 0, 0); constraint.anchor = GridBagConstraints.FIRST_LINE_START; constraint.weightx = 0.5; ignore = new JRadioButton(ResourceBundleHelper.getMessageString("videoTab.ignore")); match = new JRadioButton(ResourceBundleHelper.getMessageString("videoTab.match")); ButtonGroup groupBtn = new ButtonGroup(); groupBtn.add(ignore); groupBtn.add(match); keep = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.keep")); alpha = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.alpha")); characters = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.characters")); charField = new JTextField(20); numeric = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.numeric")); lengthMin = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.min.length")); lengthMax = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.max.length")); lengthMinField = new JTextField(10); lengthMaxField = new JTextField(10); matcherPanel.add(ignore, constraint); constraint.gridy = 1; constraint.anchor = GridBagConstraints.WEST; matcherPanel.add(match, constraint); constraint.anchor = GridBagConstraints.EAST; enterBtn = new JButton(ResourceBundleHelper.getMessageString("videoTab.enter")); enterBtn.setName(ResourceBundleHelper.getMessageString("videoTab.enter")); enterBtn.addActionListener(this); matcherPanel.add(enterBtn, constraint); constraint.anchor = GridBagConstraints.WEST; constraint.gridy = 2; matcherPanel.add(keep, constraint); constraint.gridy = 3; matcherPanel.add(alpha, constraint); constraint.gridy = 4; JPanel panelChar = new JPanel(new FlowLayout()); panelChar.add(characters); panelChar.add(charField); matcherPanel.add(panelChar, constraint); constraint.gridy = 5; matcherPanel.add(numeric, constraint); constraint.gridy = 6; JPanel panelNumericLength = new JPanel(); panelNumericLength.setLayout(new BoxLayout(panelNumericLength, BoxLayout.Y_AXIS)); JPanel panelMinLength = new JPanel(new FlowLayout()); panelMinLength.add(lengthMin); panelMinLength.add(lengthMinField); panelNumericLength.add(panelMinLength); JPanel panelMaxLength = new JPanel(new FlowLayout()); panelMaxLength.add(lengthMax); panelMaxLength.add(lengthMaxField); panelNumericLength.add(panelMaxLength); matcherPanel.add(panelNumericLength, constraint); constraint.weighty = 1; matcherPanel.add(new JPanel(), constraint); } return matcherPanel; }
From source file:eu.ggnet.dwoss.receipt.unit.UnitView.java
/** * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form// w ww . j a v a 2 s .c o m * Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; manufacturerButtonGroup = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); unitSplitPane = new javax.swing.JSplitPane(); unitWritePanel = new javax.swing.JPanel(); internalCommentAreaScrollPane = new javax.swing.JScrollPane(); internalCommentArea = new javax.swing.JTextArea(); commentAreaScrollPane = new javax.swing.JScrollPane(); commentArea = new javax.swing.JTextArea(); unitItemLabel = new javax.swing.JLabel(); unitStatusLabel = new javax.swing.JLabel(); unitStateBox = new javax.swing.JComboBox(); editProductButton = new javax.swing.JButton(); partNoField = new javax.swing.JTextField(); refurbishedIdField = new javax.swing.JTextField(); unitSnLabel = new javax.swing.JLabel(); unitNumberLabel = new javax.swing.JLabel(); serialField = new javax.swing.JTextField(); editRefurbishedIdButton = new javax.swing.JButton(); mfgLabel = new javax.swing.JLabel(); mfgDateChooser = new com.toedter.calendar.JDateChooser(); jLabel3 = new javax.swing.JLabel(); warrantyTillChooser = new com.toedter.calendar.JDateChooser(); jLabel4 = new javax.swing.JLabel(); warrantyTypeChooser = new javax.swing.JComboBox(); manufacturerPanel = new javax.swing.JPanel(); contractorBox = new javax.swing.JComboBox(); jScrollPane3 = new javax.swing.JScrollPane(); equipmentTable = new javax.swing.JTable(); jScrollPane4 = new javax.swing.JScrollPane(); commentTable = new javax.swing.JTable(); jScrollPane5 = new javax.swing.JScrollPane(); internalCommentTable = new javax.swing.JTable(); unitReadPanel = new javax.swing.JPanel(); unitShipLabel = new javax.swing.JLabel(); unitShipField = new javax.swing.JTextField(); unitOwnerLabel = new javax.swing.JLabel(); unitOwnerField = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); detailArea = new javax.swing.JEditorPane(); messagesButton = new javax.swing.JButton(); operationButtonPanel = new javax.swing.JPanel(); cancelButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Gert bearbeiten/aufnehmen"); setMinimumSize(new java.awt.Dimension(1080, 700)); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); unitSplitPane.setDividerLocation(600); unitSplitPane.setResizeWeight(1.0); unitSplitPane.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); unitSplitPane.setDoubleBuffered(true); unitWritePanel.setBorder(javax.swing.BorderFactory.createTitledBorder( javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, new java.awt.Color(204, 204, 255), new java.awt.Color(51, 51, 51)))); unitWritePanel.setMinimumSize(new java.awt.Dimension(500, 400)); unitWritePanel.setPreferredSize(new java.awt.Dimension(500, 400)); unitWritePanel.setLayout(new java.awt.GridBagLayout()); internalCommentArea.setColumns(20); internalCommentArea.setLineWrap(true); internalCommentArea.setRows(5); internalCommentArea.setWrapStyleWord(true); internalCommentAreaScrollPane.setViewportView(internalCommentArea); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 10; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.weighty = 0.1; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(internalCommentAreaScrollPane, gridBagConstraints); commentArea.setColumns(20); commentArea.setLineWrap(true); commentArea.setRows(5); commentArea.setWrapStyleWord(true); commentAreaScrollPane.setViewportView(commentArea); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 10; gridBagConstraints.gridwidth = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.weighty = 0.1; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(commentAreaScrollPane, gridBagConstraints); unitItemLabel.setText("ArtikelNr:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(unitItemLabel, gridBagConstraints); unitStatusLabel.setText("Zustand:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 5; gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(unitStatusLabel, gridBagConstraints); unitStateBox.setNextFocusableComponent(warrantyTillChooser); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 5; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(unitStateBox, gridBagConstraints); editProductButton.setText("Edit"); editProductButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { editProductButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; unitWritePanel.add(editProductButton, gridBagConstraints); partNoField.setName("partNo"); // NOI18N partNoField.setNextFocusableComponent(unitStateBox); partNoField.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { partNoFieldFocusLost(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(partNoField, gridBagConstraints); refurbishedIdField.setName("refurbishId"); // NOI18N refurbishedIdField.setNextFocusableComponent(serialField); refurbishedIdField.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { refurbishedIdFieldFocusLost(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 0.1; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(refurbishedIdField, gridBagConstraints); unitSnLabel.setText("SerienNr:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; gridBagConstraints.insets = new java.awt.Insets(5, 2, 2, 2); unitWritePanel.add(unitSnLabel, gridBagConstraints); unitNumberLabel.setText("SopoNr:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(unitNumberLabel, gridBagConstraints); serialField.setName("serial"); // NOI18N serialField.setNextFocusableComponent(partNoField); serialField.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { serialFieldFocusLost(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(serialField, gridBagConstraints); editRefurbishedIdButton.setText("Edit"); editRefurbishedIdButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { editRefurbishedIdButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; unitWritePanel.add(editRefurbishedIdButton, gridBagConstraints); mfgLabel.setText("MFG Date:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; unitWritePanel.add(mfgLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(mfgDateChooser, gridBagConstraints); jLabel3.setText("Garantie bis:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 7; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END; gridBagConstraints.insets = new java.awt.Insets(8, 0, 0, 0); unitWritePanel.add(jLabel3, gridBagConstraints); warrantyTillChooser.setEnabled(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 7; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.PAGE_START; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(warrantyTillChooser, gridBagConstraints); jLabel4.setText("Garantietyp:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; unitWritePanel.add(jLabel4, gridBagConstraints); warrantyTypeChooser.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { warrantyTypeChooserActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 6; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(warrantyTypeChooser, gridBagConstraints); manufacturerPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Hersteller Support")); contractorBox.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); contractorBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { contractorBoxActionPerformed(evt); } }); javax.swing.GroupLayout manufacturerPanelLayout = new javax.swing.GroupLayout(manufacturerPanel); manufacturerPanel.setLayout(manufacturerPanelLayout); manufacturerPanelLayout.setHorizontalGroup( manufacturerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( contractorBox, javax.swing.GroupLayout.Alignment.TRAILING, 0, 333, Short.MAX_VALUE)); manufacturerPanelLayout.setVerticalGroup( manufacturerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(contractorBox, javax.swing.GroupLayout.Alignment.TRAILING)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; unitWritePanel.add(manufacturerPanel, gridBagConstraints); equipmentTable .setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane3.setViewportView(equipmentTable); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 0; gridBagConstraints.gridheight = 9; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 0.1; gridBagConstraints.weighty = 0.2; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(jScrollPane3, gridBagConstraints); commentTable .setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane4.setViewportView(commentTable); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 8; gridBagConstraints.gridwidth = 3; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weighty = 0.2; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(jScrollPane4, gridBagConstraints); internalCommentTable .setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane5.setViewportView(internalCommentTable); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 9; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 0.1; gridBagConstraints.weighty = 0.2; gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); unitWritePanel.add(jScrollPane5, gridBagConstraints); unitSplitPane.setLeftComponent(unitWritePanel); unitReadPanel.setBorder(javax.swing.BorderFactory.createTitledBorder( javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, new java.awt.Color(204, 204, 255), java.awt.Color.black))); unitShipLabel.setText("Shipment ID:"); unitShipField.setEditable(false); unitShipField.setFocusable(false); unitOwnerLabel.setText("Besitzer:"); unitOwnerField.setEditable(false); unitOwnerField.setFocusable(false); jLabel1.setText("Details:"); jScrollPane2.setFocusable(false); detailArea.setContentType("text/html"); // NOI18N detailArea.setFocusable(false); jScrollPane2.setViewportView(detailArea); messagesButton.setText("Meldungen"); messagesButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { messagesButtonActionPerformed(evt); } }); javax.swing.GroupLayout unitReadPanelLayout = new javax.swing.GroupLayout(unitReadPanel); unitReadPanel.setLayout(unitReadPanelLayout); unitReadPanelLayout.setHorizontalGroup(unitReadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE) .addGroup(unitReadPanelLayout.createSequentialGroup() .addGroup(unitReadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(unitShipLabel).addComponent(unitOwnerLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(unitReadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(unitShipField, javax.swing.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE) .addComponent(unitOwnerField, javax.swing.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE))) .addGroup(unitReadPanelLayout.createSequentialGroup().addComponent(jLabel1).addGap(0, 346, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, unitReadPanelLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE).addComponent(messagesButton))); unitReadPanelLayout.setVerticalGroup(unitReadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(unitReadPanelLayout.createSequentialGroup().addGroup(unitReadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(unitShipLabel) .addComponent(unitShipField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( unitReadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(unitOwnerLabel).addComponent(unitOwnerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 414, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(messagesButton))); unitSplitPane.setRightComponent(unitReadPanel); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(unitSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 1008, Short.MAX_VALUE) .addContainerGap())); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout .createSequentialGroup().addContainerGap().addComponent(unitSplitPane).addContainerGap())); operationButtonPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); operationButtonPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT)); cancelButton.setText("Abbrechen"); cancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButtonActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.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, layout.createSequentialGroup().addContainerGap().addComponent(cancelButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(operationButtonPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(operationButtonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cancelButton).addContainerGap())))); pack(); }
From source file:de.bwravencl.controllerbuddy.gui.Main.java
private Main() { Singleton.start(this, SINGLETON_ID); frame = new JFrame(); frame.addWindowListener(new WindowAdapter() { @Override/*from w ww . j av a2 s.c o m*/ public void windowClosing(final WindowEvent e) { super.windowClosing(e); if (showMenuItem != null) showMenuItem.setEnabled(true); } @Override public void windowDeiconified(final WindowEvent e) { super.windowDeiconified(e); if (showMenuItem != null) showMenuItem.setEnabled(false); } @Override public void windowIconified(final WindowEvent e) { super.windowIconified(e); if (showMenuItem != null) showMenuItem.setEnabled(true); } @Override public void windowOpened(final WindowEvent e) { super.windowOpened(e); if (showMenuItem != null) showMenuItem.setEnabled(false); } }); frame.setBounds(DIALOG_BOUNDS_X, DIALOG_BOUNDS_Y, DIALOG_BOUNDS_WIDTH, DIALOG_BOUNDS_HEIGHT); frame.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); final var icons = new ArrayList<Image>(); for (final var path : ICON_RESOURCE_PATHS) { final var icon = new ImageIcon(Main.class.getResource(path)); icons.add(icon.getImage()); } frame.setIconImages(icons); frame.setJMenuBar(menuBar); menuBar.add(fileMenu); final QuitAction quitAction = new QuitAction(); fileMenu.add(quitAction); menuBar.add(deviceMenu); if (windows) { menuBar.add(localMenu, 2); final var buttonGroupLocalState = new ButtonGroup(); startLocalRadioButtonMenuItem = new JRadioButtonMenuItem(rb.getString("START_MENU_ITEM")); startLocalRadioButtonMenuItem.setAction(new StartLocalAction()); buttonGroupLocalState.add(startLocalRadioButtonMenuItem); localMenu.add(startLocalRadioButtonMenuItem); stopLocalRadioButtonMenuItem = new JRadioButtonMenuItem(rb.getString("STOP_MENU_ITEM")); stopLocalRadioButtonMenuItem.setAction(new StopLocalAction()); buttonGroupLocalState.add(stopLocalRadioButtonMenuItem); localMenu.add(stopLocalRadioButtonMenuItem); menuBar.add(clientMenu); final var buttonGroupClientState = new ButtonGroup(); startClientRadioButtonMenuItem = new JRadioButtonMenuItem(rb.getString("START_MENU_ITEM")); startClientRadioButtonMenuItem.setAction(new StartClientAction()); buttonGroupClientState.add(startClientRadioButtonMenuItem); clientMenu.add(startClientRadioButtonMenuItem); stopClientRadioButtonMenuItem = new JRadioButtonMenuItem(rb.getString("STOP_MENU_ITEM")); stopClientRadioButtonMenuItem.setAction(new StopClientAction()); buttonGroupClientState.add(stopClientRadioButtonMenuItem); clientMenu.add(stopClientRadioButtonMenuItem); } final var buttonGroupServerState = new ButtonGroup(); startServerRadioButtonMenuItem = new JRadioButtonMenuItem(rb.getString("START_MENU_ITEM")); startServerRadioButtonMenuItem.setAction(new StartServerAction()); buttonGroupServerState.add(startServerRadioButtonMenuItem); serverMenu.add(startServerRadioButtonMenuItem); stopServerRadioButtonMenuItem = new JRadioButtonMenuItem(rb.getString("STOP_MENU_ITEM")); stopServerRadioButtonMenuItem.setAction(new StopServerAction()); buttonGroupServerState.add(stopServerRadioButtonMenuItem); serverMenu.add(stopServerRadioButtonMenuItem); final var helpMenu = new JMenu(rb.getString("HELP_MENU")); menuBar.add(helpMenu); helpMenu.add(new ShowAboutDialogAction()); frame.getContentPane().add(tabbedPane); settingsPanel = new JPanel(); settingsPanel.setLayout(new GridBagLayout()); settingsScrollPane.setViewportView(settingsPanel); tabbedPane.addTab(rb.getString("SETTINGS_TAB"), null, settingsScrollPane); final var panelGridBagConstraints = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.FIRST_LINE_START, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 5); final var panelFlowLayout = new FlowLayout(FlowLayout.LEADING, 10, 10); final var pollIntervalPanel = new JPanel(panelFlowLayout); settingsPanel.add(pollIntervalPanel, panelGridBagConstraints); final var pollIntervalLabel = new JLabel(rb.getString("POLL_INTERVAL_LABEL")); pollIntervalLabel.setPreferredSize(new Dimension(120, 15)); pollIntervalPanel.add(pollIntervalLabel); final var pollIntervalSpinner = new JSpinner(new SpinnerNumberModel( preferences.getInt(PREFERENCES_POLL_INTERVAL, OutputThread.DEFAULT_POLL_INTERVAL), 10, 500, 1)); final JSpinner.DefaultEditor pollIntervalSpinnerEditor = new JSpinner.NumberEditor(pollIntervalSpinner, "#"); ((DefaultFormatter) pollIntervalSpinnerEditor.getTextField().getFormatter()).setCommitsOnValidEdit(true); pollIntervalSpinner.setEditor(pollIntervalSpinnerEditor); pollIntervalSpinner.addChangeListener( e -> preferences.putInt(PREFERENCES_POLL_INTERVAL, (int) ((JSpinner) e.getSource()).getValue())); pollIntervalPanel.add(pollIntervalSpinner); if (windows) { final var vJoyDirectoryPanel = new JPanel(panelFlowLayout); settingsPanel.add(vJoyDirectoryPanel, panelGridBagConstraints); final var vJoyDirectoryLabel = new JLabel(rb.getString("VJOY_DIRECTORY_LABEL")); vJoyDirectoryLabel.setPreferredSize(new Dimension(120, 15)); vJoyDirectoryPanel.add(vJoyDirectoryLabel); vJoyDirectoryLabel1 = new JLabel( preferences.get(PREFERENCES_VJOY_DIRECTORY, VJoyOutputThread.getDefaultInstallationPath())); vJoyDirectoryPanel.add(vJoyDirectoryLabel1); final var vJoyDirectoryButton = new JButton(new ChangeVJoyDirectoryAction()); vJoyDirectoryPanel.add(vJoyDirectoryButton); final var vJoyDevicePanel = new JPanel(panelFlowLayout); settingsPanel.add(vJoyDevicePanel, panelGridBagConstraints); final var vJoyDeviceLabel = new JLabel(rb.getString("VJOY_DEVICE_LABEL")); vJoyDeviceLabel.setPreferredSize(new Dimension(120, 15)); vJoyDevicePanel.add(vJoyDeviceLabel); final var vJoyDeviceSpinner = new JSpinner(new SpinnerNumberModel( preferences.getInt(PREFERENCES_VJOY_DEVICE, VJoyOutputThread.DEFAULT_VJOY_DEVICE), 1, 16, 1)); final JSpinner.DefaultEditor vJoyDeviceSpinnerEditor = new JSpinner.NumberEditor(vJoyDeviceSpinner, "#"); ((DefaultFormatter) vJoyDeviceSpinnerEditor.getTextField().getFormatter()).setCommitsOnValidEdit(true); vJoyDeviceSpinner.setEditor(vJoyDeviceSpinnerEditor); vJoyDeviceSpinner.addChangeListener( e -> preferences.putInt(PREFERENCES_VJOY_DEVICE, (int) ((JSpinner) e.getSource()).getValue())); vJoyDevicePanel.add(vJoyDeviceSpinner); final var hostPanel = new JPanel(panelFlowLayout); settingsPanel.add(hostPanel, panelGridBagConstraints); final var hostLabel = new JLabel(rb.getString("HOST_LABEL")); hostLabel.setPreferredSize(new Dimension(120, 15)); hostPanel.add(hostLabel); hostTextField = new JTextField(preferences.get(PREFERENCES_HOST, ClientVJoyOutputThread.DEFAULT_HOST), 10); final var setHostAction = new SetHostAction(hostTextField); hostTextField.addActionListener(setHostAction); hostTextField.addFocusListener(setHostAction); hostPanel.add(hostTextField); } final var portPanel = new JPanel(panelFlowLayout); settingsPanel.add(portPanel, panelGridBagConstraints); final var portLabel = new JLabel(rb.getString("PORT_LABEL")); portLabel.setPreferredSize(new Dimension(120, 15)); portPanel.add(portLabel); final var portSpinner = new JSpinner(new SpinnerNumberModel( preferences.getInt(PREFERENCES_PORT, ServerOutputThread.DEFAULT_PORT), 1024, 65535, 1)); final JSpinner.DefaultEditor portSpinnerEditor = new JSpinner.NumberEditor(portSpinner, "#"); ((DefaultFormatter) portSpinnerEditor.getTextField().getFormatter()).setCommitsOnValidEdit(true); portSpinner.setEditor(portSpinnerEditor); portSpinner.addChangeListener( e -> preferences.putInt(PREFERENCES_PORT, (int) ((JSpinner) e.getSource()).getValue())); portPanel.add(portSpinner); final var timeoutPanel = new JPanel(panelFlowLayout); settingsPanel.add(timeoutPanel, panelGridBagConstraints); final var timeoutLabel = new JLabel(rb.getString("TIMEOUT_LABEL")); timeoutLabel.setPreferredSize(new Dimension(120, 15)); timeoutPanel.add(timeoutLabel); final var timeoutSpinner = new JSpinner(new SpinnerNumberModel( preferences.getInt(PREFERENCES_TIMEOUT, ServerOutputThread.DEFAULT_TIMEOUT), 10, 60000, 1)); final JSpinner.DefaultEditor timeoutSpinnerEditor = new JSpinner.NumberEditor(timeoutSpinner, "#"); ((DefaultFormatter) timeoutSpinnerEditor.getTextField().getFormatter()).setCommitsOnValidEdit(true); timeoutSpinner.setEditor(timeoutSpinnerEditor); timeoutSpinner.addChangeListener( e -> preferences.putInt(PREFERENCES_TIMEOUT, (int) ((JSpinner) e.getSource()).getValue())); timeoutPanel.add(timeoutSpinner); final var alwaysOnTopSupported = Toolkit.getDefaultToolkit().isAlwaysOnTopSupported(); if (alwaysOnTopSupported || preferences.getBoolean(PREFERENCES_SHOW_OVERLAY, alwaysOnTopSupported)) { final var overlaySettingsPanel = new JPanel(panelFlowLayout); settingsPanel.add(overlaySettingsPanel, panelGridBagConstraints); final var overlayLabel = new JLabel(rb.getString("OVERLAY_LABEL")); overlayLabel.setPreferredSize(new Dimension(120, 15)); overlaySettingsPanel.add(overlayLabel); final var showOverlayCheckBox = new JCheckBox(rb.getString("SHOW_OVERLAY_CHECK_BOX")); showOverlayCheckBox.setSelected(preferences.getBoolean(PREFERENCES_SHOW_OVERLAY, true)); showOverlayCheckBox.addActionListener(e -> { final boolean showOverlay = ((JCheckBox) e.getSource()).isSelected(); preferences.putBoolean(PREFERENCES_SHOW_OVERLAY, showOverlay); }); overlaySettingsPanel.add(showOverlayCheckBox); } if (windows) { if (preferences.getBoolean(PREFERENCES_SHOW_VR_OVERLAY, true)) { final var vrOverlaySettingsPanel = new JPanel(panelFlowLayout); settingsPanel.add(vrOverlaySettingsPanel, panelGridBagConstraints); final var vrOverlayLabel = new JLabel(rb.getString("VR_OVERLAY_LABEL")); vrOverlayLabel.setPreferredSize(new Dimension(120, 15)); vrOverlaySettingsPanel.add(vrOverlayLabel); final var showVrOverlayCheckBox = new JCheckBox(rb.getString("SHOW_VR_OVERLAY_CHECK_BOX")); showVrOverlayCheckBox.setSelected(preferences.getBoolean(PREFERENCES_SHOW_VR_OVERLAY, true)); showVrOverlayCheckBox.addActionListener(e -> { final var showVrOverlay = ((JCheckBox) e.getSource()).isSelected(); preferences.putBoolean(PREFERENCES_SHOW_VR_OVERLAY, showVrOverlay); }); vrOverlaySettingsPanel.add(showVrOverlayCheckBox); } final var preventPowerSaveModeSettingsPanel = new JPanel(panelFlowLayout); settingsPanel.add(preventPowerSaveModeSettingsPanel, panelGridBagConstraints); final var preventPowerSaveModeLabel = new JLabel(rb.getString("POWER_SAVE_MODE_LABEL")); preventPowerSaveModeLabel.setPreferredSize(new Dimension(120, 15)); preventPowerSaveModeSettingsPanel.add(preventPowerSaveModeLabel); final var preventPowerSaveModeCheckBox = new JCheckBox( rb.getString("PREVENT_POWER_SAVE_MODE_CHECK_BOX")); preventPowerSaveModeCheckBox .setSelected(preferences.getBoolean(PREFERENCES_PREVENT_POWER_SAVE_MODE, true)); preventPowerSaveModeCheckBox.addActionListener(e -> { final var preventPowerSaveMode = ((JCheckBox) e.getSource()).isSelected(); preferences.putBoolean(PREFERENCES_PREVENT_POWER_SAVE_MODE, preventPowerSaveMode); }); preventPowerSaveModeSettingsPanel.add(preventPowerSaveModeCheckBox); } if (SystemTray.isSupported()) { final var popupMenu = new PopupMenu(); final var showAction = new ShowAction(); showMenuItem = new MenuItem((String) showAction.getValue(Action.NAME)); showMenuItem.addActionListener(showAction); popupMenu.add(showMenuItem); popupMenu.addSeparator(); final var openMenuItem = new MenuItem((String) openAction.getValue(Action.NAME)); openMenuItem.addActionListener(openAction); popupMenu.add(openMenuItem); popupMenu.addSeparator(); final var quitMenuItem = new MenuItem((String) quitAction.getValue(Action.NAME)); quitMenuItem.addActionListener(quitAction); popupMenu.add(quitMenuItem); trayIcon = new TrayIcon(frame.getIconImage()); trayIcon.addActionListener(showAction); trayIcon.setPopupMenu(popupMenu); try { SystemTray.getSystemTray().add(trayIcon); } catch (final AWTException e) { log.log(Logger.Level.ERROR, e.getMessage(), e); } } updateTitleAndTooltip(); settingsPanel.add(Box.createGlue(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.FIRST_LINE_START, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); final var outsideBorder = BorderFactory.createEtchedBorder(EtchedBorder.RAISED); final var insideBorder = BorderFactory.createEmptyBorder(0, 5, 0, 5); statusLabel.setBorder(BorderFactory.createCompoundBorder(outsideBorder, insideBorder)); frame.add(statusLabel, BorderLayout.SOUTH); final var glfwInitialized = glfwInit(); if (!glfwInitialized) if (windows) JOptionPane.showMessageDialog(frame, rb.getString("COULD_NOT_INITIALIZE_GLFW_DIALOG_TEXT_WINDOWS"), rb.getString("ERROR_DIALOG_TITLE"), JOptionPane.ERROR_MESSAGE); else { JOptionPane.showMessageDialog(frame, rb.getString("COULD_NOT_INITIALIZE_GLFW_DIALOG_TEXT"), rb.getString("ERROR_DIALOG_TITLE"), JOptionPane.ERROR_MESSAGE); quit(); } final var presentJids = new HashSet<Integer>(); for (var jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) if (glfwJoystickPresent(jid) && glfwJoystickIsGamepad(jid)) presentJids.add(jid); final var lastControllerGuid = preferences.get(PREFERENCES_LAST_CONTROLLER, null); for (final var jid : presentJids) { final var lastControllerFound = lastControllerGuid != null ? lastControllerGuid.equals(glfwGetJoystickGUID(jid)) : false; if (!isSelectedJidValid() || lastControllerFound) selectedJid = jid; if (lastControllerFound) break; } newProfile(); onControllersChanged(true); glfwSetJoystickCallback(new GLFWJoystickCallback() { @Override public void invoke(final int jid, final int event) { final var disconnected = event == GLFW_DISCONNECTED; if (disconnected || glfwJoystickIsGamepad(jid)) { if (disconnected && selectedJid == jid) selectedJid = INVALID_JID; invokeOnEventDispatchThreadIfRequired(() -> onControllersChanged(false)); } } }); if (glfwInitialized && presentJids.isEmpty()) { if (windows) JOptionPane.showMessageDialog(frame, rb.getString("NO_CONTROLLER_CONNECTED_DIALOG_TEXT_WINDOWS"), rb.getString("INFORMATION_DIALOG_TITLE"), JOptionPane.INFORMATION_MESSAGE); else JOptionPane.showMessageDialog(frame, rb.getString("NO_CONTROLLER_CONNECTED_DIALOG_TEXT"), rb.getString("INFORMATION_DIALOG_TITLE"), JOptionPane.INFORMATION_MESSAGE); } else { final String path = preferences.get(PREFERENCES_LAST_PROFILE, null); if (path != null) loadProfile(new File(path)); } }
From source file:v800_trainer.JCicloTronic.java
/** This method is called from within the constructor to * initialize the form./*w w w.ja va2 s . c om*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the FormEditor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; buttonGroup_Karte = new javax.swing.ButtonGroup(); Hauptfenster = new javax.swing.JTabbedPane(); Datenliste_Panel = new javax.swing.JPanel(); Datenliste_scroll_Panel = new javax.swing.JScrollPane(); Datentabelle = new javax.swing.JTable(); Datenliste_Jahr = new javax.swing.JComboBox(); Datenliste_Monat = new javax.swing.JComboBox(); jLabel11 = new javax.swing.JLabel(); jLabel51 = new javax.swing.JLabel(); Datenliste_Zeitabschnitt = new javax.swing.JComboBox(); jLabel65 = new javax.swing.JLabel(); jLabel66 = new javax.swing.JLabel(); Datenliste_TourTyp = new javax.swing.JComboBox(); jLabel68 = new javax.swing.JLabel(); jLabel69_Selektiert = new javax.swing.JLabel(); Datenliste_search = new javax.swing.JTextField(); Datenliste_searchButton = new javax.swing.JButton(); jLabel_search = new javax.swing.JLabel(); Info_Panel = new javax.swing.JPanel(); Auswahl_Info = new javax.swing.JComboBox(); Info_Titel = new javax.swing.JTextField(); Info_Vorname = new javax.swing.JTextField(); Info_Name = new javax.swing.JTextField(); Info_GebTag = new javax.swing.JTextField(); Info_Gewicht = new javax.swing.JTextField(); Info_Verein = new javax.swing.JTextField(); Info_Material = new javax.swing.JTextField(); Info_Materialgewicht = new javax.swing.JTextField(); Info_Startort = new javax.swing.JTextField(); Info_Zielort = new javax.swing.JTextField(); jLabel24Uhrzeit = new javax.swing.JLabel(); jLabel24 = new javax.swing.JLabel(); jLabel52 = new javax.swing.JLabel(); jLabel53 = new javax.swing.JLabel(); jLabel54 = new javax.swing.JLabel(); jLabel55 = new javax.swing.JLabel(); jLabel56 = new javax.swing.JLabel(); jLabel57 = new javax.swing.JLabel(); jLabel58 = new javax.swing.JLabel(); jLabel59 = new javax.swing.JLabel(); jLabel60 = new javax.swing.JLabel(); jLabel61 = new javax.swing.JLabel(); Info_Button_kopieren = new javax.swing.JButton(); Info_Button_einfgen = new javax.swing.JButton(); jScrollPane2 = new javax.swing.JScrollPane(); Info_Notiz = new javax.swing.JTextArea(); Info_Button_speichern = new javax.swing.JButton(); jLabel63 = new javax.swing.JLabel(); jLabel64 = new javax.swing.JLabel(); jLabel65Typ = new javax.swing.JLabel(); jLabel69 = new javax.swing.JLabel(); Info_Button_Suche_TrackLog = new javax.swing.JButton(); Info_Track_Log = new javax.swing.JTextField(); Statistik_Panel = new javax.swing.JPanel(); Auswahl_Statistik = new javax.swing.JComboBox(); jPanel2 = new javax.swing.JPanel(); Statistik_Hhe = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); Statistik_Minimale_Hhe = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); Statistik_Maximale_Hhe = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); Statistik_Summe_Hm_Steigung = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); Statistik_Summe_Hm_Geflle = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); Statistik_HM_pro_km = new javax.swing.JLabel(); Statistik_Geschwindigkeit = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); Statistik_Max_Geschw = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); Statistik_av_Geschw = new javax.swing.JLabel(); Statistik_Herzfrequenz = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); Statistik_max_HF = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); Statistik_av_HF = new javax.swing.JLabel(); Statistik_Steigung_m = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); Statistik_max_Steigung_m = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); Statistik_av_Steigung_m = new javax.swing.JLabel(); Statistik_Geflle_m = new javax.swing.JPanel(); jLabel12 = new javax.swing.JLabel(); Statistik_max_Geflle_m = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); Statistik_av_Geflle_m = new javax.swing.JLabel(); Statistik_Temperatur = new javax.swing.JPanel(); jLabel14 = new javax.swing.JLabel(); Statistik_min_Temp = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); Statistik_max_Temp = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); Statistik_av_Temp = new javax.swing.JLabel(); Statistik_Cadence = new javax.swing.JPanel(); jLabel18 = new javax.swing.JLabel(); Statistik_max_Cadence = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); Statistik_av_Cadence = new javax.swing.JLabel(); Statistik_Steigung_p = new javax.swing.JPanel(); jLabel20 = new javax.swing.JLabel(); Statistik_max_Steigung_p = new javax.swing.JLabel(); jLabel21 = new javax.swing.JLabel(); Statistik_av_Steigung_p = new javax.swing.JLabel(); Statistik_Geflle_p = new javax.swing.JPanel(); jLabel22 = new javax.swing.JLabel(); Statistik_max_Geflle_p = new javax.swing.JLabel(); jLabel23 = new javax.swing.JLabel(); Statistik_av_Geflle_p = new javax.swing.JLabel(); Statistik_Zeit = new javax.swing.JPanel(); jLabel47 = new javax.swing.JLabel(); Statistik_Zeit_absolut = new javax.swing.JLabel(); jLabel48 = new javax.swing.JLabel(); Statistik_Zeit_aktiv = new javax.swing.JLabel(); jPanel5 = new javax.swing.JPanel(); jLabel25 = new javax.swing.JLabel(); Statistik_Teilstrecke = new javax.swing.JLabel(); Statistik_Schrittlnge = new javax.swing.JPanel(); jLabel26 = new javax.swing.JLabel(); Statistik_max_Schrittlnge = new javax.swing.JLabel(); jLabel28 = new javax.swing.JLabel(); Statistik_av_Schrittlnge = new javax.swing.JLabel(); Statistik_Training = new javax.swing.JPanel(); jLabel29 = new javax.swing.JLabel(); Statistik_Belastung = new javax.swing.JLabel(); jLabel30 = new javax.swing.JLabel(); Statistik_Erholungszeit = new javax.swing.JLabel(); jLabel35 = new javax.swing.JLabel(); Statistik_Lauf_Index = new javax.swing.JLabel(); Statistik_Kalorien = new javax.swing.JPanel(); jLabel31 = new javax.swing.JLabel(); Statistik_Kalorien_absolut = new javax.swing.JLabel(); jLabel34 = new javax.swing.JLabel(); Statistik_Kalorien_h = new javax.swing.JLabel(); jLabel32 = new javax.swing.JLabel(); Statistik_Fett = new javax.swing.JLabel(); jLabel33 = new javax.swing.JLabel(); Statistik_Protein = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); Statistik_Titel = new javax.swing.JLabel(); Graphik_Panel = new javax.swing.JPanel(); Auswahl_Graphik = new javax.swing.JComboBox(); Graphik_Sub_Panel = new javax.swing.JPanel(); Graphik_check_Geschwindigkeit = new javax.swing.JCheckBox(); Graphik_check_Hhe = new javax.swing.JCheckBox(); Graphik_check_HF = new javax.swing.JCheckBox(); Graphik_check_Temp = new javax.swing.JCheckBox(); Graphik_check_Steigung_p = new javax.swing.JCheckBox(); Graphik_check_Steigung_m = new javax.swing.JCheckBox(); Graphik_check_Cadence = new javax.swing.JCheckBox(); Graphik_Radio_Strecke = new javax.swing.JRadioButton(); Graphik_Radio_Zeit = new javax.swing.JRadioButton(); Graphik_check_Abstand = new javax.swing.JCheckBox(); Graphik_check_av_Geschw = new javax.swing.JCheckBox(); Graphik_check_Schrittlnge = new javax.swing.JCheckBox(); Histogramm_Panel = new javax.swing.JPanel(); Auswahl_Histogramm = new javax.swing.JComboBox(); Summenhistogramm_Check = new javax.swing.JCheckBox(); jPanel1 = new javax.swing.JPanel(); jPanel18_HistoSP = new javax.swing.JPanel(); jPanel17_HistoHM = new javax.swing.JPanel(); jPanel16_HistoHF = new javax.swing.JPanel(); jPanel19_HistoCd = new javax.swing.JPanel(); jLabel26_Histotitel = new javax.swing.JLabel(); Map_Panel = new javax.swing.JPanel(); Auswahl_Map = new javax.swing.JComboBox(); LoadGoogleEarth = new javax.swing.JButton(); Kein_kmz_text = new javax.swing.JLabel(); Map_internal_Panel = new javax.swing.JPanel(); jLabel_map_streckenlnge = new javax.swing.JLabel(); jLabel27 = new javax.swing.JLabel(); Map_Type = new javax.swing.JComboBox<>(); Jahresuebersicht_Panel = new javax.swing.JPanel(); Auswahl_bersicht = new javax.swing.JComboBox(); JahrVergleich = new javax.swing.JComboBox(); jLabel67 = new javax.swing.JLabel(); jLabel70 = new javax.swing.JLabel(); jRadioButton_jahresverlauf = new javax.swing.JRadioButton(); jRadioButton_monatsbersicht = new javax.swing.JRadioButton(); jPanel17bersichtchart = new javax.swing.JPanel(); jMenuHaupt = new javax.swing.JMenuBar(); jMenuDatei = new javax.swing.JMenu(); jMenuOpen = new javax.swing.JMenuItem(); jMenuOpenall = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JSeparator(); jMenuLschen = new javax.swing.JMenuItem(); jMenuExit = new javax.swing.JMenuItem(); jMenu_V800_Laden = new javax.swing.JMenu(); jMenuTourEditor = new javax.swing.JMenu(); jMenuEinstellungen = new javax.swing.JMenu(); jMenuHilfe = new javax.swing.JMenu(); setTitle("HWCyclingData"); setPreferredSize(new java.awt.Dimension(800, 600)); addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { formComponentResized(evt); } }); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { exitForm(evt); } }); java.awt.GridBagLayout layout = new java.awt.GridBagLayout(); layout.columnWidths = new int[] { 0 }; layout.rowHeights = new int[] { 0 }; getContentPane().setLayout(layout); Hauptfenster.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); Hauptfenster.setAlignmentX(0.0F); Hauptfenster.setAlignmentY(0.0F); Hauptfenster.setAutoscrolls(true); Hauptfenster.setPreferredSize(new java.awt.Dimension(10, 10)); java.awt.GridBagLayout Datenliste_PanelLayout = new java.awt.GridBagLayout(); Datenliste_PanelLayout.columnWidths = new int[] { 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0 }; Datenliste_PanelLayout.rowHeights = new int[] { 0, 5, 0, 5, 0 }; Datenliste_Panel.setLayout(Datenliste_PanelLayout); Datenliste_scroll_Panel.setAutoscrolls(true); Datentabelle.setAutoCreateColumnsFromModel(false); Datentabelle.setFont(Datentabelle.getFont()); Datentabelle.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN); Datentabelle.setRowHeight(25); //ChangeModel(); Datentabelle.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { DatentabelleMouseDragged(evt); } }); Datentabelle.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { DatentabelleMouseClicked(evt); } }); Datenliste_scroll_Panel.setViewportView(Datentabelle); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 19; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 1; gridBagConstraints.ipady = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Datenliste_Panel.add(Datenliste_scroll_Panel, gridBagConstraints); Datenliste_Jahr.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Datenliste_JahrActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_Jahr, gridBagConstraints); Datenliste_Monat.setEnabled(false); InitComboMonat(); Datenliste_Monat.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Datenliste_MonatActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 12; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_Monat, gridBagConstraints); jLabel11.setText("Jahr whlen"); jLabel11.setToolTipText("Selektier alle Daten des entsprechenden Jahres"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel11, gridBagConstraints); jLabel51.setText("Monat whlen"); jLabel51.setToolTipText("Selektiert alle Daten des entsprechenden Monats"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 12; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel51, gridBagConstraints); Datenliste_Zeitabschnitt.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Datenliste_ZeitabschnittActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_Zeitabschnitt, gridBagConstraints); jLabel65.setText("Zeitraum whlen"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel65, gridBagConstraints); jLabel66.setText("Tour-Typ"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel66, gridBagConstraints); Datenliste_TourTyp.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Datenliste_TourTypActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_TourTyp, gridBagConstraints); jLabel68.setText("Selektierte Daten / von"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 14; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel68, gridBagConstraints); jLabel69_Selektiert.setText("' '"); jLabel69_Selektiert.setMaximumSize(new java.awt.Dimension(300, 50)); jLabel69_Selektiert.setMinimumSize(new java.awt.Dimension(300, 50)); jLabel69_Selektiert.setVerticalTextPosition(javax.swing.SwingConstants.TOP); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 14; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; Datenliste_Panel.add(jLabel69_Selektiert, gridBagConstraints); Datenliste_search.setToolTipText("~ Vorstellen um zu Deselektieren"); Datenliste_search.setMaximumSize(new java.awt.Dimension(200, 23)); Datenliste_search.setMinimumSize(new java.awt.Dimension(200, 23)); Datenliste_search.setPreferredSize(new java.awt.Dimension(200, 23)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 16; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_search, gridBagConstraints); Datenliste_searchButton.setText("Suchen"); Datenliste_searchButton.setMaximumSize(new java.awt.Dimension(200, 23)); Datenliste_searchButton.setMinimumSize(new java.awt.Dimension(200, 23)); Datenliste_searchButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Datenliste_searchButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 18; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(Datenliste_searchButton, gridBagConstraints); jLabel_search.setText("Eintrag im Titel suchen"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 16; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Datenliste_Panel.add(jLabel_search, gridBagConstraints); Hauptfenster.addTab("Datenliste", null, Datenliste_Panel, ""); Info_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Info_PanelComponentShown(evt); } }); java.awt.GridBagLayout Info_PanelLayout = new java.awt.GridBagLayout(); Info_PanelLayout.columnWidths = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Info_PanelLayout.rowHeights = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Info_Panel.setLayout(Info_PanelLayout); Auswahl_Info.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_InfoActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 5; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Info_Panel.add(Auswahl_Info, gridBagConstraints); Info_Titel.setText("jTextField1"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 6; gridBagConstraints.gridwidth = 19; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Titel, gridBagConstraints); Info_Vorname.setText("jTextField4"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 10; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Vorname, gridBagConstraints); Info_Name.setText("jTextField5"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 10; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Name, gridBagConstraints); Info_GebTag.setText("jTextField6"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 14; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_GebTag, gridBagConstraints); Info_Gewicht.setText("jTextField7"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 14; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Gewicht, gridBagConstraints); Info_Verein.setText("jTextField8"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 18; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Verein, gridBagConstraints); Info_Material.setText("jTextField10"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 22; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Material, gridBagConstraints); Info_Materialgewicht.setText("jTextField9"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 22; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Materialgewicht, gridBagConstraints); Info_Startort.setText("jTextField2"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 26; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Startort, gridBagConstraints); Info_Zielort.setText("jTextField3"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 26; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Zielort, gridBagConstraints); jLabel24Uhrzeit.setText("jLabel24"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel24Uhrzeit, gridBagConstraints); jLabel24.setText("Titel"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel24, gridBagConstraints); jLabel52.setText("Vorname"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 8; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel52, gridBagConstraints); jLabel53.setText("Name"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 8; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel53, gridBagConstraints); jLabel54.setText("Geburtsdatum"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 12; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel54, gridBagConstraints); jLabel55.setText("Gewicht"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 12; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel55, gridBagConstraints); jLabel56.setText("Verein / Mitfahrer"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 16; gridBagConstraints.gridwidth = 17; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel56, gridBagConstraints); jLabel57.setText("Material"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 20; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel57, gridBagConstraints); jLabel58.setText("Materialgewicht"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 20; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel58, gridBagConstraints); jLabel59.setText("Startort"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 24; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel59, gridBagConstraints); jLabel60.setText("Zielort"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 24; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel60, gridBagConstraints); jLabel61.setText("Notiz"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 34; gridBagConstraints.gridwidth = 9; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel61, gridBagConstraints); Info_Button_kopieren.setText("Kopieren"); Info_Button_kopieren.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Info_Button_kopierenActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 18; gridBagConstraints.gridy = 18; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Button_kopieren, gridBagConstraints); Info_Button_einfgen.setText("Einfgen"); Info_Button_einfgen.setEnabled(false); Info_Button_einfgen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Info_Button_einfgenActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 18; gridBagConstraints.gridy = 22; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Button_einfgen, gridBagConstraints); Info_Notiz.setLineWrap(true); jScrollPane2.setViewportView(Info_Notiz); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 36; gridBagConstraints.gridwidth = 19; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Info_Panel.add(jScrollPane2, gridBagConstraints); Info_Button_speichern.setText("Speichern"); Info_Button_speichern.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Info_Button_speichernActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 18; gridBagConstraints.gridy = 26; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Button_speichern, gridBagConstraints); jLabel63.setText("Startzeit:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel63, gridBagConstraints); jLabel64.setText("Typ:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel64, gridBagConstraints); jLabel65Typ.setText("jLabel65"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 12; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel65Typ, gridBagConstraints); jLabel69.setText("Track Log"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 30; gridBagConstraints.gridwidth = 7; gridBagConstraints.ipady = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(jLabel69, gridBagConstraints); Info_Button_Suche_TrackLog.setText("..."); Info_Button_Suche_TrackLog.setToolTipText("Track Log ndern"); Info_Button_Suche_TrackLog.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Info_Button_Suche_TrackLogActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 18; gridBagConstraints.gridy = 32; gridBagConstraints.ipady = -3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Info_Panel.add(Info_Button_Suche_TrackLog, gridBagConstraints); Info_Track_Log.setText("jTextField1"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 32; gridBagConstraints.gridwidth = 17; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; Info_Panel.add(Info_Track_Log, gridBagConstraints); Hauptfenster.addTab("Infos", null, Info_Panel, ""); Statistik_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Statistik_PanelComponentShown_StatistikStarten(evt); } }); java.awt.GridBagLayout Statistik_PanelLayout1 = new java.awt.GridBagLayout(); Statistik_PanelLayout1.columnWidths = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Statistik_PanelLayout1.rowHeights = new int[] { 0, 10, 0, 10, 0, 10, 0, 10, 0 }; Statistik_Panel.setLayout(Statistik_PanelLayout1); Auswahl_Statistik.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_StatistikActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.BASELINE_LEADING; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Statistik_Panel.add(Auswahl_Statistik, gridBagConstraints); java.awt.GridBagLayout jPanel2Layout = new java.awt.GridBagLayout(); jPanel2Layout.columnWidths = new int[] { 0, 10, 0, 10, 0, 10, 0, 10, 0 }; jPanel2Layout.rowHeights = new int[] { 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0 }; jPanel2.setLayout(jPanel2Layout); Statistik_Hhe.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Hhe [m]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Hhe.setLayout(new java.awt.GridLayout(5, 2, 5, 5)); jLabel1.setText("min.:"); Statistik_Hhe.add(jLabel1); Statistik_Minimale_Hhe.setText("---"); Statistik_Minimale_Hhe.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); Statistik_Hhe.add(Statistik_Minimale_Hhe); jLabel2.setText("max.:"); Statistik_Hhe.add(jLabel2); Statistik_Maximale_Hhe.setText("---"); Statistik_Hhe.add(Statistik_Maximale_Hhe); jLabel3.setText("Hm +:"); Statistik_Hhe.add(jLabel3); Statistik_Summe_Hm_Steigung.setText("---"); Statistik_Hhe.add(Statistik_Summe_Hm_Steigung); jLabel4.setText("Hm -:"); Statistik_Hhe.add(jLabel4); Statistik_Summe_Hm_Geflle.setText("---"); Statistik_Hhe.add(Statistik_Summe_Hm_Geflle); jLabel17.setText("Hm/km:"); Statistik_Hhe.add(jLabel17); Statistik_HM_pro_km.setText("---"); Statistik_Hhe.add(Statistik_HM_pro_km); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 6; gridBagConstraints.gridheight = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Hhe, gridBagConstraints); Statistik_Geschwindigkeit .setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Geschwindigkeit [km/h]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Geschwindigkeit.setLayout(new java.awt.GridLayout(3, 2, 5, 5)); jLabel5.setText("max.:"); jLabel5.setToolTipText(""); Statistik_Geschwindigkeit.add(jLabel5); Statistik_Max_Geschw.setText("---"); Statistik_Geschwindigkeit.add(Statistik_Max_Geschw); jLabel6.setText("Durchschnitt:"); Statistik_Geschwindigkeit.add(jLabel6); Statistik_av_Geschw.setText("---"); Statistik_Geschwindigkeit.add(Statistik_av_Geschw); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Geschwindigkeit, gridBagConstraints); Statistik_Herzfrequenz.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Herzfrequenz [p/min]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Herzfrequenz.setLayout(new java.awt.GridLayout(3, 2, 5, 5)); jLabel7.setText("max.:"); Statistik_Herzfrequenz.add(jLabel7); Statistik_max_HF.setText("---"); Statistik_Herzfrequenz.add(Statistik_max_HF); jLabel8.setText("Durchschnitt:"); Statistik_Herzfrequenz.add(jLabel8); Statistik_av_HF.setText("---"); Statistik_Herzfrequenz.add(Statistik_av_HF); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Herzfrequenz, gridBagConstraints); Statistik_Steigung_m.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Steigung [m/min]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Steigung_m.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel9.setText("max.:"); Statistik_Steigung_m.add(jLabel9); Statistik_max_Steigung_m.setText("---"); Statistik_Steigung_m.add(Statistik_max_Steigung_m); jLabel10.setText("Durchschnitt:"); Statistik_Steigung_m.add(jLabel10); Statistik_av_Steigung_m.setText("---"); Statistik_Steigung_m.add(Statistik_av_Steigung_m); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 8; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Steigung_m, gridBagConstraints); Statistik_Geflle_m.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Geflle [m/min]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Geflle_m.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel12.setText("max.:"); Statistik_Geflle_m.add(jLabel12); Statistik_max_Geflle_m.setText("---"); Statistik_Geflle_m.add(Statistik_max_Geflle_m); jLabel13.setText("Durchschnitt:"); Statistik_Geflle_m.add(jLabel13); Statistik_av_Geflle_m.setText("---"); Statistik_Geflle_m.add(Statistik_av_Geflle_m); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 8; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Geflle_m, gridBagConstraints); Statistik_Temperatur.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Temperatur [C]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Temperatur.setLayout(new java.awt.GridLayout(3, 2, 5, 5)); jLabel14.setText("min.:"); Statistik_Temperatur.add(jLabel14); Statistik_min_Temp.setText("---"); Statistik_Temperatur.add(Statistik_min_Temp); jLabel15.setText("max.:"); Statistik_Temperatur.add(jLabel15); Statistik_max_Temp.setText("---"); Statistik_Temperatur.add(Statistik_max_Temp); jLabel16.setText("Durchschnitt:"); Statistik_Temperatur.add(jLabel16); Statistik_av_Temp.setText("---"); Statistik_Temperatur.add(Statistik_av_Temp); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Temperatur, gridBagConstraints); Statistik_Cadence.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cadence [n/min]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Cadence.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel18.setText("max.:"); Statistik_Cadence.add(jLabel18); Statistik_max_Cadence.setText("---"); Statistik_Cadence.add(Statistik_max_Cadence); jLabel19.setText("Durchschnitt:"); Statistik_Cadence.add(jLabel19); Statistik_av_Cadence.setText("---"); Statistik_Cadence.add(Statistik_av_Cadence); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 6; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Cadence, gridBagConstraints); Statistik_Steigung_p.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Steigung [%]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Steigung_p.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel20.setText("max.:"); Statistik_Steigung_p.add(jLabel20); Statistik_max_Steigung_p.setText("---"); Statistik_Steigung_p.add(Statistik_max_Steigung_p); jLabel21.setText("Durchschnitt:"); Statistik_Steigung_p.add(jLabel21); Statistik_av_Steigung_p.setText("---"); Statistik_Steigung_p.add(Statistik_av_Steigung_p); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 6; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Steigung_p, gridBagConstraints); Statistik_Geflle_p.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Geflle [%]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Geflle_p.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel22.setText("max.:"); Statistik_Geflle_p.add(jLabel22); Statistik_max_Geflle_p.setText("---"); Statistik_Geflle_p.add(Statistik_max_Geflle_p); jLabel23.setText("Durchschnitt:"); Statistik_Geflle_p.add(jLabel23); Statistik_av_Geflle_p.setText("---"); Statistik_Geflle_p.add(Statistik_av_Geflle_p); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 6; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Geflle_p, gridBagConstraints); Statistik_Zeit.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Zeit [hh:mm:ss]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Zeit.setLayout(new java.awt.GridLayout(3, 2, 5, 5)); jLabel47.setText("absolut:"); Statistik_Zeit.add(jLabel47); Statistik_Zeit_absolut.setText("---"); Statistik_Zeit.add(Statistik_Zeit_absolut); jLabel48.setText("gefahren:"); Statistik_Zeit.add(jLabel48); Statistik_Zeit_aktiv.setText("---"); Statistik_Zeit.add(Statistik_Zeit_aktiv); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Zeit, gridBagConstraints); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Zoom", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); jPanel5.setPreferredSize(new java.awt.Dimension(270, 65)); jPanel5.setLayout(new java.awt.GridLayout(1, 0)); jLabel25.setText("Teilstrecke: "); jLabel25.setMaximumSize(new java.awt.Dimension(200, 26)); jLabel25.setMinimumSize(new java.awt.Dimension(200, 26)); jLabel25.setPreferredSize(new java.awt.Dimension(200, 26)); jPanel5.add(jLabel25); Statistik_Teilstrecke.setText("jLabel26"); jPanel5.add(Statistik_Teilstrecke); Statistik_Teilstrecke.getAccessibleContext().setAccessibleName("jLabel26_Teilstrecke"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; jPanel2.add(jPanel5, gridBagConstraints); Statistik_Schrittlnge.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Schrittlnge [cm]", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Schrittlnge.setLayout(new java.awt.GridLayout(2, 2, 5, 5)); jLabel26.setText("max.:"); Statistik_Schrittlnge.add(jLabel26); Statistik_max_Schrittlnge.setText("---"); Statistik_Schrittlnge.add(Statistik_max_Schrittlnge); jLabel28.setText("Durchschnitt:"); Statistik_Schrittlnge.add(jLabel28); Statistik_av_Schrittlnge.setText("---"); Statistik_Schrittlnge.add(Statistik_av_Schrittlnge); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 8; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Schrittlnge, gridBagConstraints); Statistik_Training.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Training", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Training.setLayout(new java.awt.GridLayout(4, 2, 5, 5)); jLabel29.setText("Belastung:"); Statistik_Training.add(jLabel29); Statistik_Belastung.setText("---"); Statistik_Training.add(Statistik_Belastung); jLabel30.setText("Erholungszeit:"); Statistik_Training.add(jLabel30); Statistik_Erholungszeit.setText("---"); Statistik_Training.add(Statistik_Erholungszeit); jLabel35.setText("Lauf-Index:"); Statistik_Training.add(jLabel35); Statistik_Lauf_Index.setText("---"); Statistik_Training.add(Statistik_Lauf_Index); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 10; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Training, gridBagConstraints); Statistik_Kalorien.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Kalorien", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION)); Statistik_Kalorien.setLayout(new java.awt.GridLayout(4, 2, 5, 5)); jLabel31.setText("kCal"); Statistik_Kalorien.add(jLabel31); Statistik_Kalorien_absolut.setText("---"); Statistik_Kalorien.add(Statistik_Kalorien_absolut); jLabel34.setText("kCal/h"); Statistik_Kalorien.add(jLabel34); Statistik_Kalorien_h.setText("---"); Statistik_Kalorien.add(Statistik_Kalorien_h); jLabel32.setText("Fett [%]"); Statistik_Kalorien.add(jLabel32); Statistik_Fett.setText("---"); Statistik_Kalorien.add(Statistik_Fett); jLabel33.setText("Protein [%]"); Statistik_Kalorien.add(jLabel33); Statistik_Protein.setText("---"); Statistik_Kalorien.add(Statistik_Protein); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 10; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; jPanel2.add(Statistik_Kalorien, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 7; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Statistik_Panel.add(jPanel2, gridBagConstraints); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 8; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; gridBagConstraints.weighty = 100.0; Statistik_Panel.add(jPanel3, gridBagConstraints); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 100.0; Statistik_Panel.add(jPanel4, gridBagConstraints); Statistik_Titel.setText("jLabel26"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Statistik_Panel.add(Statistik_Titel, gridBagConstraints); Hauptfenster.addTab("Statistik", null, Statistik_Panel, ""); Graphik_Panel.setMinimumSize(new java.awt.Dimension(22, 22)); Graphik_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Graphik_PanelComponentShown(evt); } public void componentHidden(java.awt.event.ComponentEvent evt) { Graphik_PanelComponentHidden(evt); } }); java.awt.GridBagLayout Graphik_PanelLayout = new java.awt.GridBagLayout(); Graphik_PanelLayout.columnWidths = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Graphik_PanelLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0 }; Graphik_Panel.setLayout(Graphik_PanelLayout); Auswahl_Graphik.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_GraphikActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 1; gridBagConstraints.ipady = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Graphik_Panel.add(Auswahl_Graphik, gridBagConstraints); Graphik_Sub_Panel.setMinimumSize(new java.awt.Dimension(0, 0)); Graphik_Sub_Panel.setPreferredSize(new java.awt.Dimension(0, 0)); javax.swing.GroupLayout Graphik_Sub_PanelLayout = new javax.swing.GroupLayout(Graphik_Sub_Panel); Graphik_Sub_Panel.setLayout(Graphik_Sub_PanelLayout); Graphik_Sub_PanelLayout.setHorizontalGroup(Graphik_Sub_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Graphik_Sub_PanelLayout.setVerticalGroup(Graphik_Sub_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 15; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Graphik_Panel.add(Graphik_Sub_Panel, gridBagConstraints); Graphik_check_Geschwindigkeit.setText("Geschwindigkeit"); Graphik_check_Geschwindigkeit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_GeschwindigkeitActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 0; gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Geschwindigkeit, gridBagConstraints); Graphik_check_Hhe.setText("Hhe"); Graphik_check_Hhe.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_HheActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Hhe, gridBagConstraints); Graphik_check_HF.setText("Herzfrequenz"); Graphik_check_HF.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_HFActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_HF, gridBagConstraints); Graphik_check_Temp.setText("Temperatur"); Graphik_check_Temp.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_TempActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 14; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Temp, gridBagConstraints); Graphik_check_Steigung_p.setText("Steigung [%]"); Graphik_check_Steigung_p.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_Steigung_pActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 12; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Steigung_p, gridBagConstraints); Graphik_check_Steigung_m.setText("Steigung [m/min]"); Graphik_check_Steigung_m.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_Steigung_mActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 12; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Steigung_m, gridBagConstraints); Graphik_check_Cadence.setText("Cadence"); Graphik_check_Cadence.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_CadenceActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Cadence, gridBagConstraints); Graphik_Radio_Strecke.setSelected(true); Graphik_Radio_Strecke.setText("ber Strecke"); Graphik_Radio_Strecke.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_Radio_StreckeActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0); Graphik_Panel.add(Graphik_Radio_Strecke, gridBagConstraints); Graphik_Radio_Zeit.setText("ber Zeit"); Graphik_Radio_Zeit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_Radio_ZeitActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.ipady = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0); Graphik_Panel.add(Graphik_Radio_Zeit, gridBagConstraints); Graphik_check_Abstand.setText("Zeit- / Streckenabstand"); Graphik_check_Abstand.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_AbstandActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 14; gridBagConstraints.gridy = 0; gridBagConstraints.ipadx = 27; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Abstand, gridBagConstraints); Graphik_check_av_Geschw.setText("av-Geschw."); Graphik_check_av_Geschw.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_av_GeschwActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_av_Geschw, gridBagConstraints); Graphik_check_Schrittlnge.setText("Schrittlnge"); Graphik_check_Schrittlnge.setToolTipText(""); Graphik_check_Schrittlnge.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Graphik_check_SchrittlngeActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 2; gridBagConstraints.ipadx = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; Graphik_Panel.add(Graphik_check_Schrittlnge, gridBagConstraints); Hauptfenster.addTab("Graphik", null, Graphik_Panel, ""); Histogramm_Panel.setMinimumSize(new java.awt.Dimension(22, 22)); Histogramm_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Histogramm_PanelComponentShown(evt); } }); java.awt.GridBagLayout Histogramm_PanelLayout = new java.awt.GridBagLayout(); Histogramm_PanelLayout.columnWidths = new int[] { 0, 5, 0, 5, 0 }; Histogramm_PanelLayout.rowHeights = new int[] { 0, 0, 0, 0, 0 }; Histogramm_Panel.setLayout(Histogramm_PanelLayout); Auswahl_Histogramm.setAlignmentX(0.0F); Auswahl_Histogramm.setAlignmentY(0.0F); Auswahl_Histogramm.setMinimumSize(new java.awt.Dimension(200, 20)); Auswahl_Histogramm.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_HistogrammActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Histogramm_Panel.add(Auswahl_Histogramm, gridBagConstraints); Summenhistogramm_Check.setText("Summenhistogramme"); Summenhistogramm_Check.setAlignmentY(0.0F); Summenhistogramm_Check.setMaximumSize(new java.awt.Dimension(32767, 32767)); Summenhistogramm_Check.setMinimumSize(new java.awt.Dimension(300, 23)); Summenhistogramm_Check.setOpaque(false); Summenhistogramm_Check.setPreferredSize(new java.awt.Dimension(300, 23)); Summenhistogramm_Check.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Summenhistogramm_CheckActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Histogramm_Panel.add(Summenhistogramm_Check, gridBagConstraints); jPanel1.setLayout(new java.awt.GridBagLayout()); jPanel18_HistoSP.setAlignmentX(0.0F); jPanel18_HistoSP.setAlignmentY(0.0F); javax.swing.GroupLayout jPanel18_HistoSPLayout = new javax.swing.GroupLayout(jPanel18_HistoSP); jPanel18_HistoSP.setLayout(jPanel18_HistoSPLayout); jPanel18_HistoSPLayout.setHorizontalGroup(jPanel18_HistoSPLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel18_HistoSPLayout.setVerticalGroup(jPanel18_HistoSPLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; gridBagConstraints.weightx = 0.5; gridBagConstraints.weighty = 0.5; jPanel1.add(jPanel18_HistoSP, gridBagConstraints); jPanel17_HistoHM.setAlignmentX(0.0F); jPanel17_HistoHM.setAlignmentY(0.0F); javax.swing.GroupLayout jPanel17_HistoHMLayout = new javax.swing.GroupLayout(jPanel17_HistoHM); jPanel17_HistoHM.setLayout(jPanel17_HistoHMLayout); jPanel17_HistoHMLayout.setHorizontalGroup(jPanel17_HistoHMLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel17_HistoHMLayout.setVerticalGroup(jPanel17_HistoHMLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST; gridBagConstraints.weightx = 0.5; gridBagConstraints.weighty = 0.5; jPanel1.add(jPanel17_HistoHM, gridBagConstraints); jPanel16_HistoHF.setAlignmentX(0.0F); jPanel16_HistoHF.setAlignmentY(0.0F); javax.swing.GroupLayout jPanel16_HistoHFLayout = new javax.swing.GroupLayout(jPanel16_HistoHF); jPanel16_HistoHF.setLayout(jPanel16_HistoHFLayout); jPanel16_HistoHFLayout.setHorizontalGroup(jPanel16_HistoHFLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel16_HistoHFLayout.setVerticalGroup(jPanel16_HistoHFLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 0.5; gridBagConstraints.weighty = 0.5; jPanel1.add(jPanel16_HistoHF, gridBagConstraints); jPanel19_HistoCd.setAlignmentX(0.0F); jPanel19_HistoCd.setAlignmentY(0.0F); javax.swing.GroupLayout jPanel19_HistoCdLayout = new javax.swing.GroupLayout(jPanel19_HistoCd); jPanel19_HistoCd.setLayout(jPanel19_HistoCdLayout); jPanel19_HistoCdLayout.setHorizontalGroup(jPanel19_HistoCdLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); jPanel19_HistoCdLayout.setVerticalGroup(jPanel19_HistoCdLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST; gridBagConstraints.weightx = 0.5; gridBagConstraints.weighty = 0.5; jPanel1.add(jPanel19_HistoCd, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 5; gridBagConstraints.gridheight = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Histogramm_Panel.add(jPanel1, gridBagConstraints); jLabel26_Histotitel.setText("jLabel26"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; Histogramm_Panel.add(jLabel26_Histotitel, gridBagConstraints); Hauptfenster.addTab("Histogramme", null, Histogramm_Panel, ""); Map_Panel.setPreferredSize(new java.awt.Dimension(594, 400)); Map_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Map_PanelComponentShown(evt); } }); java.awt.GridBagLayout Map_PanelLayout = new java.awt.GridBagLayout(); Map_PanelLayout.columnWidths = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Map_PanelLayout.rowHeights = new int[] { 0, 5, 0, 5, 0 }; Map_Panel.setLayout(Map_PanelLayout); Auswahl_Map.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_MapActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Map_Panel.add(Auswahl_Map, gridBagConstraints); LoadGoogleEarth.setText("Google Earth"); LoadGoogleEarth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { LoadGoogleEarthActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Map_Panel.add(LoadGoogleEarth, gridBagConstraints); Kein_kmz_text.setText("Kein Log File"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Map_Panel.add(Kein_kmz_text, gridBagConstraints); Map_internal_Panel.setLayout(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 11; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Map_Panel.add(Map_internal_Panel, gridBagConstraints); jLabel_map_streckenlnge.setText("jLabel26"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 0; Map_Panel.add(jLabel_map_streckenlnge, gridBagConstraints); jLabel27.setText("GPS Lnge:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; Map_Panel.add(jLabel27, gridBagConstraints); Map_Type.setModel( new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); Map_Type.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Map_TypeActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Map_Panel.add(Map_Type, gridBagConstraints); Hauptfenster.addTab("Landkarte", Map_Panel); Jahresuebersicht_Panel.setPreferredSize(new java.awt.Dimension(688, 400)); Jahresuebersicht_Panel.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { Jahresuebersicht_PanelComponentShown(evt); } }); java.awt.GridBagLayout Jahresuebersicht_PanelLayout = new java.awt.GridBagLayout(); Jahresuebersicht_PanelLayout.columnWidths = new int[] { 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0 }; Jahresuebersicht_PanelLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; Jahresuebersicht_Panel.setLayout(Jahresuebersicht_PanelLayout); Auswahl_bersicht.setMinimumSize(new java.awt.Dimension(200, 20)); Auswahl_bersicht.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Auswahl_bersichtActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(Auswahl_bersicht, gridBagConstraints); JahrVergleich.setMinimumSize(new java.awt.Dimension(200, 20)); JahrVergleich.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { JahrVergleichActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(JahrVergleich, gridBagConstraints); jLabel67.setText("Vergleich mit Jahr:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(jLabel67, gridBagConstraints); jLabel70.setText(" Jahr:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(jLabel70, gridBagConstraints); jRadioButton_jahresverlauf.setSelected(true); jRadioButton_jahresverlauf.setText("Jahresverlauf"); jRadioButton_jahresverlauf.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton_jahresverlaufActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(jRadioButton_jahresverlauf, gridBagConstraints); jRadioButton_monatsbersicht.setText("Monatsbersicht"); jRadioButton_monatsbersicht.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton_monatsbersichtActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 10; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); Jahresuebersicht_Panel.add(jRadioButton_monatsbersicht, gridBagConstraints); jPanel17bersichtchart .setLayout(new javax.swing.BoxLayout(jPanel17bersichtchart, javax.swing.BoxLayout.LINE_AXIS)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 11; gridBagConstraints.gridheight = 7; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; Jahresuebersicht_Panel.add(jPanel17bersichtchart, gridBagConstraints); Hauptfenster.addTab("Jahresbersicht", null, Jahresuebersicht_Panel, ""); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(Hauptfenster, gridBagConstraints); jMenuDatei.setLabel("Datei "); jMenuOpen.setText("Rohdaten Importieren"); jMenuOpen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuOpenActionPerformed(evt); } }); jMenuDatei.add(jMenuOpen); jMenuOpenall.setText("Alle Rohdaten Importieren"); jMenuOpenall.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuOpenallActionPerformed(evt); } }); jMenuDatei.add(jMenuOpenall); jMenuDatei.add(jSeparator1); jMenuLschen.setText("Lschen"); jMenuLschen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuLschenActionPerformed(evt); } }); jMenuDatei.add(jMenuLschen); jMenuExit.setText("Beenden"); jMenuExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuExitActionPerformed(evt); } }); jMenuDatei.add(jMenuExit); jMenuHaupt.add(jMenuDatei); jMenu_V800_Laden.setText("Daten Empfangen "); jMenu_V800_Laden.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jMenu_V800_LadenMouseClicked(evt); } }); jMenuHaupt.add(jMenu_V800_Laden); jMenuTourEditor.setLabel("Tour Editor "); jMenuTourEditor.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jMenuTourEditorMouseClicked(evt); } }); jMenuHaupt.add(jMenuTourEditor); jMenuTourEditor.getAccessibleContext().setAccessibleName("Tour Editor"); jMenuEinstellungen.setLabel("Einstellungen "); jMenuEinstellungen.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jMenuEinstellungenMouseClicked(evt); } }); jMenuHaupt.add(jMenuEinstellungen); jMenuHilfe.setText("Hilfe"); jMenuHilfe.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jMenuHilfeMouseClicked(evt); } }); jMenuHaupt.add(jMenuHilfe); setJMenuBar(jMenuHaupt); pack(); }
From source file:de.bwravencl.controllerbuddy.gui.Main.java
void updateModesPanel() { if (modesListPanel == null) return;/*from w w w .j a v a2 s.c om*/ modesListPanel.removeAll(); final var modes = input.getProfile().getModes(); for (var i = 0; i < modes.size(); i++) { final var mode = modes.get(i); final var modePanel = new JPanel(new GridBagLayout()); modesListPanel.add(modePanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.FIRST_LINE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 5)); final var modeNoLabel = new JLabel(rb.getString("MODE_NO_LABEL_PREFIX") + (i + 1)); modeNoLabel.setPreferredSize(new Dimension(100, 15)); modePanel.add(modeNoLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BASELINE, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); modePanel.add(Box.createGlue(), new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.BASELINE, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); final var descriptionTextField = new JTextField(mode.getDescription(), 20); modePanel.add(descriptionTextField, new GridBagConstraints(2, 0, 1, 1, 1.0, 1.0, GridBagConstraints.BASELINE, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); final var setModeDescriptionAction = new SetModeDescriptionAction(mode, descriptionTextField); descriptionTextField.addActionListener(setModeDescriptionAction); descriptionTextField.getDocument().addDocumentListener(setModeDescriptionAction); modePanel.add(Box.createGlue(), new GridBagConstraints(3, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.BASELINE, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); if (Profile.defaultMode.equals(mode) || OnScreenKeyboard.onScreenKeyboardMode.equals(mode)) { descriptionTextField.setEditable(false); modePanel.add(Box.createHorizontalStrut(BUTTON_DIMENSION.width)); } else { final var deleteButton = new JButton(new RemoveModeAction(mode)); deleteButton.setPreferredSize(BUTTON_DIMENSION); modePanel.add(deleteButton, new GridBagConstraints(4, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.BASELINE, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } } modesListPanel.add(Box.createGlue(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.FIRST_LINE_START, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); modesScrollPane.setViewportView(modesListPanel); }
From source file:de.bwravencl.controllerbuddy.gui.Main.java
private void updateOverlayPanel() { if (indicatorsListPanel == null) return;// ww w . j a v a 2 s .c o m indicatorsListPanel.removeAll(); for (final var virtualAxis : Input.VirtualAxis.values()) { final var indicatorPanel = new JPanel(new GridBagLayout()); indicatorsListPanel.add(indicatorPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.FIRST_LINE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 5)); final var virtualAxisLabel = new JLabel(virtualAxis.toString() + rb.getString("AXIS_LABEL_SUFFIX")); virtualAxisLabel.setPreferredSize(new Dimension(100, 15)); indicatorPanel.add(virtualAxisLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BASELINE, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); final var virtualAxisToOverlayAxisMap = input.getProfile().getVirtualAxisToOverlayAxisMap(); final var overlayAxis = virtualAxisToOverlayAxisMap.get(virtualAxis); final var enabled = overlayAxis != null; final var colorLabel = new JLabel(); if (enabled) { colorLabel.setOpaque(true); colorLabel.setBackground(overlayAxis.color); } else colorLabel.setText(rb.getString("INDICATOR_DISABLED_LABEL")); colorLabel.setHorizontalAlignment(SwingConstants.CENTER); colorLabel.setPreferredSize(new Dimension(100, 15)); colorLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK)); indicatorPanel.add(colorLabel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.BASELINE, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); final var colorButton = new JButton(new SelectIndicatorColorAction(virtualAxis)); colorButton.setPreferredSize(BUTTON_DIMENSION); colorButton.setEnabled(enabled); indicatorPanel.add(colorButton, new GridBagConstraints(2, 0, 1, 1, 1.0, 0.0, GridBagConstraints.BASELINE, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); final var invertedCheckBox = new JCheckBox(new InvertIndicatorAction(virtualAxis)); invertedCheckBox.setSelected(enabled && overlayAxis.inverted); invertedCheckBox.setEnabled(enabled); indicatorPanel.add(invertedCheckBox, new GridBagConstraints(3, 0, 1, 1, 1.0, 0.0, GridBagConstraints.BASELINE, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); final var displayCheckBox = new JCheckBox(new DisplayIndicatorAction(virtualAxis)); displayCheckBox.setSelected(enabled); indicatorPanel.add(displayCheckBox, new GridBagConstraints(4, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.BASELINE, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } indicatorsListPanel.add(Box.createGlue(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.FIRST_LINE_START, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); indicatorsScrollPane.setViewportView(indicatorsListPanel); }