public void setup() { setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); title = new JLabel(SHTML + TITLE + elem.title + EHTML); gbc.fill = GridBagConstraints.NONE; gbc.anchor = GridBagConstraints.WEST; gbc.gridy = 4; gbc.gridx = 0; gbc.gridwidth = 2; gbc.gridheight = 1; gbc.weighty = 1.0; add(title, gbc); donor = new JLabel(SHTML + DONOR + elem.donor + EHTML); gbc.gridy = 5; add(donor, gbc); subDate = new JLabel(SHTML + SUB_DATE + elem.subDate.toString() + EHTML); gbc.gridy = 6; add(subDate, gbc); objDate = new JLabel(SHTML + OBJ_DATE + elem.objDate.toString() + EHTML); gbc.gridy = 7; add(objDate, gbc); medium = new JLabel(SHTML + MEDIUM + elem.medium + EHTML); gbc.gridy = 8; add(medium, gbc); accNum = new JLabel(SHTML + ACC_NUM + elem.accNum + EHTML); gbc.gridy = 9; add(accNum, gbc); desc = new JLabel(SHTML + DESC + EHTML); // gbc.anchor = GridBagConstraints.PAGE_START; gbc.insets = new Insets(0, 50, 0, 0); gbc.gridy = 4; gbc.gridx = 2; add(desc, gbc); descView = new JTextArea(); descView.setLineWrap(true); descView.setWrapStyleWord(true); descView.setEditable(false); descView.setText(elem.desc); descView.setFont(new Font("Times New Roman", Font.PLAIN, 13)); JScrollPane scrollPane = new JScrollPane(descView); scrollPane.setPreferredSize(new Dimension(225, 100)); // scrollPane.setBorder(null); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); descView.setCaretPosition(0); gbc.gridy = 5; gbc.gridheight = 4; gbc.gridx = 2; add(scrollPane, gbc); gbc.insets = null; gbc.gridy = 0; gbc.gridx = 0; gbc.gridwidth = 4; gbc.gridheight = 4; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 0, 10, 0); vpan = new V3DPanel(elem, provider); vpan.setPreferredSize(new Dimension(500, 300)); setBackground(BACKGROUND); add(vpan, gbc); validate(); }
/////////////////////////////////// // member functions ////////////////////////////////// protected final void initForm() { thisPanel = new JPanel(); thisPanel.setName("Import Range Data"); thisPanel.setLayout(new java.awt.BorderLayout()); _thePanel.add(thisPanel); _theWarning = new JTextArea(); _theWarning.setEditable(false); String theMessage = "Warning, data imported through this panel has"; theMessage += " speed and course calculated as over the ground."; theMessage += System.getProperties().getProperty("line.separator"); theMessage += "Debrief recognises PC Argos (RAO) and PMRF (PRN) files."; theMessage += System.getProperties().getProperty("line.separator"); theMessage += "See Debrief Help File for file format and details."; _theWarning.setText(theMessage); _theWarning.setLineWrap(true); _theWarning.setBorder(BorderFactory.createLoweredBevelBorder()); _theWarning.setWrapStyleWord(true); thisPanel.add("North", _theWarning); //////////////////////////////////////////// // auto generated stuff //////////////////////////////////////////// ButtonPanel = new javax.swing.JPanel(); importBtn = new javax.swing.JButton(); closeBtn = new javax.swing.JButton(); PropertiesList = new javax.swing.JPanel(); FilenamePanel = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); FilenameLabel = new javax.swing.JLabel(); selectFileBtn = new javax.swing.JButton(); FrequencyPanel = new javax.swing.JPanel(); FrequencyLabel = new javax.swing.JLabel(); FrequencyCombo = new TimeFrequencyCombo(); OriginPanel = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); OriginLabel = new javax.swing.JLabel(); selectOriginBtn = new javax.swing.JButton(); DTGPanel = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); _theDate = new javax.swing.JTextField("2001/01/30"); ///////////////////////////////////////////////// // button panel first ////////////////////////////////////////////////// importBtn.setText("Import"); ButtonPanel.add(importBtn); closeBtn.setText("Close"); ButtonPanel.add(closeBtn); thisPanel.add(ButtonPanel, java.awt.BorderLayout.SOUTH); closeBtn.addActionListener( new ActionListener() { public void actionPerformed(final ActionEvent e) { doClose(); } }); importBtn.addActionListener( new ActionListener() { public void actionPerformed(final ActionEvent e) { doImport(); } }); /////////////////////////////////////////////////// // now the properties panel /////////////////////////////////////////////////// PropertiesList.setLayout(new java.awt.GridLayout(0, 1)); jLabel3.setText("Filename:"); FilenamePanel.add(jLabel3); FilenameLabel.setText(" blank "); FilenamePanel.add(FilenameLabel); selectFileBtn.setPreferredSize(new java.awt.Dimension(33, 27)); selectFileBtn.setToolTipText("Select file"); selectFileBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); selectFileBtn.setText("..."); selectFileBtn.addActionListener( new ActionListener() { public void actionPerformed(final ActionEvent e) { doEditFilename(); } }); FilenamePanel.add(selectFileBtn); PropertiesList.add(FilenamePanel); FrequencyLabel.setText("Frequency:"); FrequencyPanel.add(FrequencyLabel); FrequencyCombo.setPreferredSize(new java.awt.Dimension(100, 25)); FrequencyPanel.add(FrequencyCombo); PropertiesList.add(FrequencyPanel); jLabel7.setText("Origin:"); OriginPanel.add(jLabel7); OriginLabel.setText(" blank "); OriginPanel.add(OriginLabel); selectOriginBtn.setPreferredSize(new java.awt.Dimension(33, 27)); selectOriginBtn.setToolTipText("Select file"); selectOriginBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); selectOriginBtn.setText("..."); selectOriginBtn.addActionListener( new ActionListener() { public void actionPerformed(final ActionEvent e) { editOrigin(); } }); OriginPanel.add(selectOriginBtn); PropertiesList.add(OriginPanel); ////////////////////////////////////////////////////// // DTG ///////////////////////////////////////////////////// jLabel9.setText("DTG (yyyy/mm/dd):"); _theDate.setText("2001/01/30"); _theDate.addFocusListener( new FocusAdapter() { public void focusLost(final FocusEvent e) { checkDTG(); } }); DTGPanel.add(jLabel9); DTGPanel.add(_theDate); PropertiesList.add(DTGPanel); final JPanel jp = new JPanel(); jp.setLayout(new FlowLayout()); jp.add(PropertiesList); thisPanel.add(jp, java.awt.BorderLayout.CENTER); }