List of usage examples for java.awt GridBagConstraints WEST
int WEST
To view the source code for java.awt GridBagConstraints WEST.
Click Source Link
From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.script.PainelScript.java
private void initComponentsEscalavel(ArrayList<FerramentaDescricaoModel> erros) { Ferramenta_Scripts.carregaTexto(TokenLang.LANG); JPanel regraFonteBtn = new JPanel(); regraFonteBtn.setLayout(new BorderLayout()); textAreaSourceCode = new G_TextAreaSourceCode(); textAreaSourceCode.setTipoHTML();/*ww w . j a v a 2 s.c o m*/ new OnChange(textAreaSourceCode, this); tableLinCod = new TabelaDescricao(erros); arTextPainelCorrecao = new ArTextPainelCorrecao(); salvar = new JButton(); abrir = new JButton(); cancelar = new JButton(); strConteudoalt = new String(); btnSalvar = new JMenuItem("Salvar"); salvar.setEnabled(false); salvaAlteracoes = TxtBuffer.getInstanciaSalvaAlteracoes(textAreaSourceCode.getTextPane(), salvar, new JMenuItem(), parentFrame); pnRegra = new JPanel(); lbRegras1 = new JLabel(); lbRegras2 = new JLabel(); pnSetaDescricao = new JPanel(); new JScrollPane(); tArParticipRotulo = new TArParticipRotulo(); conteudoDoAlt = new JTextArea(); pnListaErros = new JPanel(); scrollPanetabLinCod = new JScrollPane(); pnBotoes = new JPanel(); new JButton(); aplicar = new JButton(); conteudoParticRotulo = new ArrayList<String>(); setBackground(CoresDefault.getCorPaineis()); Container contentPane = this;// ?? contentPane.setLayout(new GridLayout(2, 1)); { pnRegra.setBorder(criaBorda(Ferramenta_Scripts.TITULO_REGRA)); pnRegra.setLayout(new GridLayout(2, 1)); pnRegra.add(lbRegras1); lbRegras1.setText(Ferramenta_Scripts.REGRAP1); lbRegras2.setText(Ferramenta_Scripts.REGRAP2); lbRegras1.setHorizontalAlignment(SwingConstants.CENTER); lbRegras2.setHorizontalAlignment(SwingConstants.CENTER); pnRegra.add(lbRegras1); pnRegra.add(lbRegras2); pnRegra.setPreferredSize(new Dimension(700, 60)); } // ---- Salvar ---- salvar.setText(Ferramenta_Scripts.BTN_SALVAR); salvar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { salvarActionPerformed(e); } }); salvar.setToolTipText(Ferramenta_Scripts.DICA_SALVAR); salvar.getAccessibleContext().setAccessibleDescription(Ferramenta_Scripts.DICA_SALVAR); salvar.getAccessibleContext().setAccessibleName(Ferramenta_Scripts.DICA_SALVAR); salvar.setBounds(10, 0, 150, 25); abrir.setText(Ferramenta_Scripts.BTN_ABRIR); abrir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AbrirActionPerformed(e); } }); abrir.setToolTipText(Ferramenta_Scripts.DICA_ABRIR); abrir.getAccessibleContext().setAccessibleDescription(Ferramenta_Scripts.DICA_ABRIR_HTML); abrir.getAccessibleContext().setAccessibleName(Ferramenta_Scripts.DICA_ABRIR_HTML); abrir.setBounds(165, 0, 150, 25); cancelar.setText(Ferramenta_Imagens.TELA_ANTERIOR); cancelar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { CancelarActionPerformed(e); } }); cancelar.setToolTipText(Ferramenta_Imagens.DICA_TELA_ANTERIOR); cancelar.getAccessibleContext().setAccessibleDescription(Ferramenta_Imagens.DICA_TELA_ANTERIOR); cancelar.getAccessibleContext().setAccessibleName(Ferramenta_Imagens.DICA_TELA_ANTERIOR); cancelar.setBounds(320, 0, 150, 25); GridBagConstraints cons = new GridBagConstraints(); cons.fill = GridBagConstraints.BOTH; cons.weighty = 1; pnSetaDescricao.setLayout(new BorderLayout()); cons.anchor = GridBagConstraints.WEST; cons.insets = new Insets(0, 0, 0, 0); JScrollPane sp = new JScrollPane(); sp.setBorder(criaBorda(Ferramenta_Scripts.CONTEUDO_ALTER)); sp.setViewportView(conteudoDoAlt); sp.setPreferredSize(new Dimension(500, 300)); pnSetaDescricao.setPreferredSize(new Dimension(400, 60)); pnListaErros.setBorder(criaBorda(Ferramenta_Scripts.LISTA_ERROS)); pnListaErros.setLayout(new BorderLayout()); scrollPanetabLinCod.setViewportView(tableLinCod); pnListaErros.add(scrollPanetabLinCod, BorderLayout.CENTER); { pnBotoes.setLayout(null); aplicar.setEnabled(false); aplicar.setText(Ferramenta_Scripts.BTN_APLICAR); aplicar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { aplicarRotuloActionPerformed(e); } }); aplicar.setToolTipText(Ferramenta_Scripts.DICA_APLICAR); aplicar.getAccessibleContext().setAccessibleDescription(Ferramenta_Scripts.DICA_APLICAR); aplicar.getAccessibleContext().setAccessibleName(Ferramenta_Scripts.DICA_APLICAR); aplicar.setBounds(3, 3, 120, 30); pnBotoes.add(aplicar); } /* * Colocar os controles */ pnRegra.setBackground(CoresDefault.getCorPaineis()); regraFonteBtn.add(pnRegra, BorderLayout.NORTH); textAreaSourceCode.setBorder(criaBorda("")); textAreaSourceCode.setBackground(CoresDefault.getCorPaineis()); JSplitPane splitPane = null; Dimension minimumSize = new Dimension(0, 0); sp.setMinimumSize(minimumSize); sp.setPreferredSize(new Dimension(150, 90)); splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sp, textAreaSourceCode); splitPane.setOneTouchExpandable(true); int w = parentFrame.getWidth(); int s = w / 4; splitPane.setDividerLocation(s); regraFonteBtn.add(splitPane, BorderLayout.CENTER); pnBotoes.setPreferredSize(new Dimension(600, 35)); pnBotoes.setBackground(CoresDefault.getCorPaineis()); regraFonteBtn.setBackground(CoresDefault.getCorPaineis()); contentPane.add(regraFonteBtn); JPanel textoErrosBtn = new JPanel(); textoErrosBtn.setLayout(new BorderLayout()); pnSetaDescricao.setBackground(CoresDefault.getCorPaineis()); pnSetaDescricao.add(pnBotoes, BorderLayout.WEST); textoErrosBtn.add(pnSetaDescricao, BorderLayout.NORTH); textoErrosBtn.add(pnListaErros, BorderLayout.CENTER); JPanel pnSalvarCancelar = new JPanel(); pnSalvarCancelar.setLayout(null); pnSalvarCancelar.setPreferredSize(new Dimension(600, 35)); pnSalvarCancelar.add(salvar); pnSalvarCancelar.add(abrir); pnSalvarCancelar.add(cancelar); if (!original) { reverter = new JButton("Reverter"); reverter.setText(TradPainelRelatorio.REVERTER); reverter.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); TxtBuffer.setContent(TxtBuffer.getContentOriginal()); parentFrame.showPainelFerramentaScriptPArq(TxtBuffer.getContentOriginal()); setVisible(true); } }); reverter.setToolTipText(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleDescription(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleName(TradPainelRelatorio.DICA_REVERTER); reverter.setBounds(485, 0, 150, 25); pnSalvarCancelar.add(reverter); } pnSalvarCancelar.setBackground(CoresDefault.getCorPaineis()); textoErrosBtn.add(pnSalvarCancelar, BorderLayout.SOUTH); pnListaErros.setBackground(CoresDefault.getCorPaineis()); if (tableLinCod.getRowCount() == 0) tableLinCod.addLinha(0, 0, GERAL.DOC_SEM_ERROS); contentPane.setBackground(CoresDefault.getCorPaineis()); contentPane.add(textoErrosBtn); this.setVisible(true); }
From source file:com.sec.ose.osi.ui.frm.main.identification.patternmatch.JPanPatternMatchMain.java
/** * This method initializes jPanel // www . j a v a 2s.c o m * * @return javax.swing.JPanel */ private JPanel getJPanelTop() { if (jPanelTop == null) { GridBagConstraints gridBagConstraints91 = new GridBagConstraints(); gridBagConstraints91.gridx = 0; gridBagConstraints91.anchor = GridBagConstraints.WEST; gridBagConstraints91.gridy = 1; GridBagConstraints gridBagConstraints31 = new GridBagConstraints(); gridBagConstraints31.gridx = 0; gridBagConstraints31.gridwidth = 2; gridBagConstraints31.anchor = GridBagConstraints.WEST; gridBagConstraints31.insets = new Insets(0, 40, 0, 0); gridBagConstraints31.gridy = 3; GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); gridBagConstraints9.anchor = GridBagConstraints.WEST; gridBagConstraints9.gridx = 1; gridBagConstraints9.gridy = 4; gridBagConstraints9.weighty = 0.0; gridBagConstraints9.insets = new Insets(3, 10, 0, 0); GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.anchor = GridBagConstraints.NORTHWEST; gridBagConstraints2.gridx = 0; gridBagConstraints2.gridy = 4; gridBagConstraints2.weightx = 0.0; gridBagConstraints2.weighty = 0.0; gridBagConstraints2.insets = new Insets(0, 0, 0, 0); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.anchor = GridBagConstraints.NORTHWEST; gridBagConstraints.gridx = -1; gridBagConstraints.gridy = -1; gridBagConstraints.weightx = 0.0; gridBagConstraints.weighty = 0.0; gridBagConstraints.gridwidth = 2; jPanelTop = new JPanel(); jPanelTop.setLayout(new GridBagLayout()); jPanelTop.add(getJRadioButtonNotContain(), gridBagConstraints); jPanelTop.add(getJRadioButtonIKnow(), gridBagConstraints2); jPanelTop.add(getJButton(), gridBagConstraints9); jPanelTop.add(getJPanelThirdTitle(), gridBagConstraints91); } return jPanelTop; }
From source file:ffx.ui.KeywordPanel.java
private void initialize() { // Load the Keyword Definitions loadXML();/* w ww .j a v a 2s. c om*/ // TextAreas flatfileTextArea = new JTextArea(); flatfileTextArea.setEditable(false); flatfileTextArea.setFont(Font.decode("monospaced plain 12")); Insets insets = flatfileTextArea.getInsets(); insets.set(5, 5, 5, 5); flatfileTextArea.setMargin(insets); // Keyword Edit Panel editPanel = new JPanel(flowLayout); ClassLoader loader = getClass().getClassLoader(); ImageIcon icKeyPanel = new ImageIcon(loader.getResource("ffx/ui/icons/page_key.png")); noSystemLabel.setIcon(icKeyPanel); ImageIcon icon = new ImageIcon(loader.getResource("ffx/ui/icons/information.png")); noKeywordLabel.setIcon(icon); noKeywordPanel.add(noKeywordLabel); editScrollPane = new JScrollPane(editPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); descriptScrollPane = new JScrollPane(descriptTextArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); Border eb = BorderFactory.createEtchedBorder(EtchedBorder.RAISED); descriptScrollPane.setBorder(eb); // Add the Keyword Group Panel and Decription Panel to a JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, editScrollPane, descriptScrollPane); splitPane.setResizeWeight(1.0); splitPane.setOneTouchExpandable(true); statusLabel.setBorder(eb); // Add the main pieces to the overall KeywordPanel (except the ToolBar) setLayout(new BorderLayout()); add(splitPane, BorderLayout.CENTER); add(statusLabel, BorderLayout.SOUTH); // Init the GridBagContraints gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = GridBagConstraints.WEST; gridBagConstraints.gridheight = 1; gridBagConstraints.gridwidth = 1; gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; initToolBar(); add(toolBar, BorderLayout.NORTH); setParamPath(); loadPrefs(); loadKeywordGroup(); }
From source file:org.fhcrc.cpl.viewer.quant.gui.QuantitationReviewer.java
/** * Initialize all GUI components and display the UI *//*from w ww.j a v a 2s .c om*/ protected void initGUI() { settingsCLM = new ProteinQuantChartsCLM(false); setTitle("Qurate"); try { setIconImage(ImageIO.read(WorkbenchFrame.class.getResourceAsStream("icon.gif"))); } catch (Exception e) { } try { Localizer.renderSwixml("org/fhcrc/cpl/viewer/quant/gui/QuantitationReviewer.xml", this); assert null != contentPanel; } catch (Exception x) { ApplicationContext.errorMessage("error creating dialog", x); throw new RuntimeException(x); } //Menu openFileAction = new OpenFileAction(this); createChartsAction = new CreateChartsAction(); filterPepXMLAction = new FilterPepXMLAction(this); proteinSummaryAction = new ProteinSummaryAction(this); try { JMenuBar jmenu = (JMenuBar) Localizer.getSwingEngine(this) .render("org/fhcrc/cpl/viewer/quant/gui/QuantitationReviewerMenu.xml"); for (int i = 0; i < jmenu.getMenuCount(); i++) jmenu.getMenu(i).getPopupMenu().setLightWeightPopupEnabled(false); this.setJMenuBar(jmenu); } catch (Exception x) { ApplicationContext.errorMessage(TextProvider.getText("ERROR_LOADING_MENUS"), x); throw new RuntimeException(x); } //Global stuff setSize(fullWidth, fullHeight); setContentPane(contentPanel); ListenerHelper helper = new ListenerHelper(this); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.BOTH; gbc.anchor = GridBagConstraints.PAGE_START; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.insets = new Insets(5, 5, 5, 5); gbc.weighty = 1; gbc.weightx = 1; leftPanel.setLayout(new GridBagLayout()); leftPanel.setBorder(BorderFactory.createLineBorder(Color.gray)); //Properties panel stuff propertiesTable = new QuantEvent.QuantEventPropertiesTable(); propertiesScrollPane = new JScrollPane(); propertiesScrollPane.setViewportView(propertiesTable); propertiesScrollPane.setMinimumSize(new Dimension(propertiesWidth, propertiesHeight)); //event summary table; disembodied eventSummaryTable = new QuantEventsSummaryTable(); eventSummaryTable.setVisible(true); ListSelectionModel tableSelectionModel = eventSummaryTable.getSelectionModel(); tableSelectionModel.addListSelectionListener(new EventSummaryTableListSelectionHandler()); JScrollPane eventSummaryScrollPane = new JScrollPane(); eventSummaryScrollPane.setViewportView(eventSummaryTable); eventSummaryScrollPane.setSize(propertiesWidth, propertiesHeight); eventSummaryFrame = new Frame("All Events"); eventSummaryFrame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent event) { eventSummaryFrame.setVisible(false); } }); eventSummaryFrame.setSize(950, 450); eventSummaryFrame.add(eventSummaryScrollPane); //fields related to navigation navigationPanel = new JPanel(); backButton = new JButton("<"); backButton.setToolTipText("Previous Event"); backButton.setMaximumSize(new Dimension(50, 30)); backButton.setEnabled(false); forwardButton = new JButton(">"); forwardButton.setToolTipText("Next Event"); forwardButton.setMaximumSize(new Dimension(50, 30)); forwardButton.setEnabled(false); showEventSummaryButton = new JButton("Show All"); showEventSummaryButton.setToolTipText("Show all events in a table"); showEventSummaryButton.setEnabled(false); helper.addListener(backButton, "buttonBack_actionPerformed"); helper.addListener(forwardButton, "buttonForward_actionPerformed"); helper.addListener(showEventSummaryButton, "buttonShowEventSummary_actionPerformed"); gbc.fill = GridBagConstraints.NONE; gbc.gridwidth = GridBagConstraints.RELATIVE; gbc.anchor = GridBagConstraints.WEST; navigationPanel.add(backButton, gbc); gbc.gridwidth = GridBagConstraints.RELATIVE; navigationPanel.add(forwardButton, gbc); gbc.gridwidth = GridBagConstraints.REMAINDER; navigationPanel.add(showEventSummaryButton, gbc); gbc.fill = GridBagConstraints.BOTH; navigationPanel.setBorder(BorderFactory.createTitledBorder("Event")); gbc.anchor = GridBagConstraints.PAGE_START; //Fields related to curation of events curationPanel = new JPanel(); curationPanel.setLayout(new GridBagLayout()); curationPanel.setBorder(BorderFactory.createTitledBorder("Curation")); //Quantitation curation JPanel quantCurationPanel = new JPanel(); quantCurationPanel.setLayout(new GridBagLayout()); quantCurationPanel.setBorder(BorderFactory.createTitledBorder("Quantitation")); quantCurationButtonGroup = new ButtonGroup(); JRadioButton unknownRadioButton = new JRadioButton("?"); JRadioButton goodRadioButton = new JRadioButton("Good"); JRadioButton badRadioButton = new JRadioButton("Bad"); onePeakRatioRadioButton = new JRadioButton("1-Peak"); unknownRadioButton.setEnabled(false); goodRadioButton.setEnabled(false); badRadioButton.setEnabled(false); onePeakRatioRadioButton.setEnabled(false); quantCurationButtonGroup.add(unknownRadioButton); quantCurationButtonGroup.add(goodRadioButton); quantCurationButtonGroup.add(badRadioButton); quantCurationButtonGroup.add(onePeakRatioRadioButton); unknownRadioButtonModel = unknownRadioButton.getModel(); goodRadioButtonModel = goodRadioButton.getModel(); badRadioButtonModel = badRadioButton.getModel(); onePeakRadioButtonModel = onePeakRatioRadioButton.getModel(); helper.addListener(unknownRadioButton, "buttonCuration_actionPerformed"); helper.addListener(goodRadioButton, "buttonCuration_actionPerformed"); helper.addListener(badRadioButton, "buttonCuration_actionPerformed"); helper.addListener(onePeakRadioButtonModel, "buttonCuration_actionPerformed"); gbc.anchor = GridBagConstraints.WEST; quantCurationPanel.add(unknownRadioButton, gbc); quantCurationPanel.add(badRadioButton, gbc); quantCurationPanel.add(goodRadioButton, gbc); quantCurationPanel.add(onePeakRatioRadioButton, gbc); gbc.anchor = GridBagConstraints.PAGE_START; //ID curation JPanel idCurationPanel = new JPanel(); idCurationPanel.setLayout(new GridBagLayout()); idCurationPanel.setBorder(BorderFactory.createTitledBorder("ID")); idCurationButtonGroup = new ButtonGroup(); JRadioButton idUnknownRadioButton = new JRadioButton("?"); JRadioButton idGoodRadioButton = new JRadioButton("Good"); JRadioButton idBadRadioButton = new JRadioButton("Bad"); idUnknownRadioButton.setEnabled(false); idGoodRadioButton.setEnabled(false); idBadRadioButton.setEnabled(false); idCurationButtonGroup.add(idUnknownRadioButton); idCurationButtonGroup.add(idGoodRadioButton); idCurationButtonGroup.add(idBadRadioButton); idUnknownRadioButtonModel = idUnknownRadioButton.getModel(); idGoodRadioButtonModel = idGoodRadioButton.getModel(); idBadRadioButtonModel = idBadRadioButton.getModel(); helper.addListener(idUnknownRadioButton, "buttonIDCuration_actionPerformed"); helper.addListener(idGoodRadioButton, "buttonIDCuration_actionPerformed"); helper.addListener(idBadRadioButton, "buttonIDCuration_actionPerformed"); gbc.anchor = GridBagConstraints.WEST; idCurationPanel.add(idUnknownRadioButton, gbc); idCurationPanel.add(idBadRadioButton, gbc); idCurationPanel.add(idGoodRadioButton, gbc); gbc.gridwidth = GridBagConstraints.RELATIVE; curationPanel.add(quantCurationPanel, gbc); gbc.gridwidth = GridBagConstraints.REMAINDER; curationPanel.add(idCurationPanel, gbc); //curation comment commentTextField = new JTextField(); commentTextField.setToolTipText("Comment on this event"); //saves after every keypress. Would be more efficient to save when navigating away or saving to file commentTextField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { if (quantEvents == null) return; QuantEvent quantEvent = quantEvents.get(displayedEventIndex); //save the comment, being careful about tabs and new lines quantEvent.setComment(commentTextField.getText().replace("\t", " ").replace("\n", " ")); } public void keyTyped(KeyEvent e) { } public void keyPressed(KeyEvent e) { } }); curationPanel.add(commentTextField, gbc); assessmentPanel = new JPanel(); assessmentPanel.setLayout(new GridBagLayout()); assessmentPanel.setBorder(BorderFactory.createTitledBorder("Algorithmic Assessment")); assessmentTypeTextField = new JTextField(); assessmentTypeTextField.setEditable(false); assessmentPanel.add(assessmentTypeTextField, gbc); assessmentDescTextField = new JTextField(); assessmentDescTextField.setEditable(false); assessmentPanel.add(assessmentDescTextField, gbc); //Theoretical peak distribution gbc.fill = GridBagConstraints.NONE; gbc.anchor = GridBagConstraints.CENTER; theoreticalPeaksPanel = new JPanel(); theoreticalPeaksPanel.setBorder(BorderFactory.createTitledBorder("Theoretical Peaks")); theoreticalPeaksPanel.setLayout(new GridBagLayout()); theoreticalPeaksPanel.setMinimumSize(new Dimension(leftPanelWidth - 10, theoreticalPeaksPanelHeight)); theoreticalPeaksPanel.setMaximumSize(new Dimension(1200, theoreticalPeaksPanelHeight)); showTheoreticalPeaks(); //Add everything to the left panel gbc.insets = new Insets(0, 5, 0, 5); gbc.fill = GridBagConstraints.BOTH; gbc.anchor = GridBagConstraints.PAGE_START; leftPanel.addComponentListener(new LeftPanelResizeListener()); gbc.weighty = 10; gbc.fill = GridBagConstraints.VERTICAL; leftPanel.add(propertiesScrollPane, gbc); gbc.fill = GridBagConstraints.NONE; gbc.weighty = 1; gbc.anchor = GridBagConstraints.PAGE_END; gbc.fill = GridBagConstraints.HORIZONTAL; leftPanel.add(assessmentPanel, gbc); leftPanel.add(theoreticalPeaksPanel, gbc); gbc.fill = GridBagConstraints.HORIZONTAL; leftPanel.add(curationPanel, gbc); leftPanel.add(navigationPanel, gbc); gbc.fill = GridBagConstraints.BOTH; gbc.weighty = 1; gbc.anchor = GridBagConstraints.PAGE_START; //Chart display multiChartDisplay = new TabbedMultiChartDisplayPanel(); multiChartDisplay.setResizeDelayMS(0); rightPanel.addComponentListener(new RightPanelResizeListener()); rightPanel.add(multiChartDisplay, gbc); //status message messageLabel.setBackground(Color.WHITE); messageLabel.setFont(Font.decode("verdana plain 12")); messageLabel.setText(" "); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); //paranoia. Sometimes it seems Qurate doesn't exit when you close every window addWindowStateListener(new WindowStateListener() { public void windowStateChanged(WindowEvent e) { if (e.getNewState() == WindowEvent.WINDOW_CLOSED) { dispose(); System.exit(0); } } }); }
From source file:com.openbravo.pos.panels.JTicketsFinder.java
/** This method is called from within the constructor to * initialize the form.//from www . j a v a 2s . c o m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jPanel3 = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jtxtMoney = new com.openbravo.editor.JEditorCurrency(); jcboUser = new javax.swing.JComboBox(); jcboMoney = new javax.swing.JComboBox(); jtxtTicketID = new com.openbravo.editor.JEditorIntegerPositive(); labelCustomer = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jTxtStartDate = new javax.swing.JTextField(); jTxtEndDate = new javax.swing.JTextField(); btnDateStart = new javax.swing.JButton(); btnDateEnd = new javax.swing.JButton(); jtxtCustomer = new javax.swing.JTextField(); btnCustomer = new javax.swing.JButton(); jComboBoxTicket = new javax.swing.JComboBox(); jLabel2 = new javax.swing.JLabel(); jtxtCodebar = new javax.swing.JTextField(); jEditProduct = new javax.swing.JButton(); jPanel6 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jPanel4 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jListTickets = new javax.swing.JList(); jPanel8 = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); jcmdCancel = new javax.swing.JButton(); jcmdOK = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); m_jKeys = new com.openbravo.editor.JEditorKeys(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle(AppLocal.getIntString("form.tickettitle")); // NOI18N jPanel3.setLayout(new java.awt.BorderLayout()); jPanel5.setLayout(new java.awt.BorderLayout()); jPanel7.setPreferredSize(new java.awt.Dimension(10, 250)); jPanel7.setLayout(new java.awt.GridBagLayout()); jLabel1.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel1.setText(AppLocal.getIntString("label.ticketid")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jLabel1, gridBagConstraints); jLabel6.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel6.setText(AppLocal.getIntString("label.user")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jLabel6, gridBagConstraints); jLabel7.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel7.setText(AppLocal.getIntString("label.totalcash")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 5; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jLabel7, gridBagConstraints); jtxtMoney.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0); jPanel7.add(jtxtMoney, gridBagConstraints); jcboUser.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jcboUser.setPreferredSize(new java.awt.Dimension(200, 25)); jcboUser.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jcboUserItemStateChanged(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); jPanel7.add(jcboUser, gridBagConstraints); jcboMoney.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0); jPanel7.add(jcboMoney, gridBagConstraints); jtxtTicketID.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jtxtTicketID, gridBagConstraints); labelCustomer.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N labelCustomer.setText(AppLocal.getIntString("label.customer")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(labelCustomer, gridBagConstraints); jLabel3.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel3.setText(AppLocal.getIntString("Label.StartDate")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jLabel3, gridBagConstraints); jLabel4.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel4.setText(AppLocal.getIntString("Label.EndDate")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jLabel4, gridBagConstraints); jTxtStartDate.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jTxtStartDate.setPreferredSize(new java.awt.Dimension(200, 25)); jTxtStartDate.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { jTxtEndDateKeyReleased(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jTxtStartDate, gridBagConstraints); jTxtEndDate.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jTxtEndDate.setPreferredSize(new java.awt.Dimension(200, 25)); jTxtEndDate.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { jTxtEndDateKeyReleased(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jTxtEndDate, gridBagConstraints); btnDateStart.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/date.png"))); // NOI18N btnDateStart.setToolTipText("Open Calendar"); btnDateStart.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDateStartActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(btnDateStart, gridBagConstraints); btnDateEnd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/date.png"))); // NOI18N btnDateEnd.setToolTipText("Open Calendar"); btnDateEnd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDateEndActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(btnDateEnd, gridBagConstraints); jtxtCustomer.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jtxtCustomer.setPreferredSize(new java.awt.Dimension(200, 25)); jtxtCustomer.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { jTxtEndDateKeyReleased(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 3; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jtxtCustomer, gridBagConstraints); btnCustomer.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/customer_sml.png"))); // NOI18N btnCustomer.setToolTipText("Open Customers"); btnCustomer.setFocusPainted(false); btnCustomer.setFocusable(false); btnCustomer.setMargin(new java.awt.Insets(8, 14, 8, 14)); btnCustomer.setPreferredSize(new java.awt.Dimension(57, 33)); btnCustomer.setRequestFocusEnabled(false); btnCustomer.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCustomerActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(btnCustomer, gridBagConstraints); jComboBoxTicket.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jComboBoxTicket, gridBagConstraints); jLabel2.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel2.setText(AppLocal.getIntString("label.prodbarcode")); jLabel2.setPreferredSize(new java.awt.Dimension(95, 14)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jLabel2, gridBagConstraints); jtxtCodebar.setPreferredSize(new java.awt.Dimension(200, 25)); jtxtCodebar.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { jTxtEndDateKeyReleased(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.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); jPanel7.add(jtxtCodebar, gridBagConstraints); jEditProduct .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/search24.png"))); // NOI18N jEditProduct.setMargin(new java.awt.Insets(8, 14, 8, 14)); jEditProduct.setPreferredSize(new java.awt.Dimension(57, 33)); jEditProduct.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jEditProductActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; jPanel7.add(jEditProduct, gridBagConstraints); jPanel5.add(jPanel7, java.awt.BorderLayout.CENTER); jButton1.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/reload.png"))); // NOI18N jButton1.setText(AppLocal.getIntString("button.clean")); // NOI18N jButton1.setToolTipText("Clear Filter"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jPanel6.add(jButton1); jButton3.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/ok.png"))); // NOI18N jButton3.setText(AppLocal.getIntString("button.executefilter")); // NOI18N jButton3.setToolTipText("Execute Filter"); jButton3.setFocusPainted(false); jButton3.setFocusable(false); jButton3.setRequestFocusEnabled(false); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jPanel6.add(jButton3); jPanel5.add(jPanel6, java.awt.BorderLayout.SOUTH); jPanel3.add(jPanel5, java.awt.BorderLayout.PAGE_START); jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5)); jPanel4.setLayout(new java.awt.BorderLayout()); jListTickets.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N jListTickets.setFocusable(false); jListTickets.setRequestFocusEnabled(false); jListTickets.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jListTicketsMouseClicked(evt); } }); jListTickets.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { jListTicketsValueChanged(evt); } }); jScrollPane1.setViewportView(jListTickets); jPanel4.add(jScrollPane1, java.awt.BorderLayout.CENTER); jPanel3.add(jPanel4, java.awt.BorderLayout.CENTER); jPanel8.setLayout(new java.awt.BorderLayout()); jcmdCancel.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jcmdCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/cancel.png"))); // NOI18N jcmdCancel.setText(AppLocal.getIntString("Button.Cancel")); // NOI18N jcmdCancel.setFocusPainted(false); jcmdCancel.setFocusable(false); jcmdCancel.setMargin(new java.awt.Insets(8, 16, 8, 16)); jcmdCancel.setRequestFocusEnabled(false); jcmdCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcmdCancelActionPerformed(evt); } }); jPanel1.add(jcmdCancel); jcmdOK.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jcmdOK.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/ok.png"))); // NOI18N jcmdOK.setText(AppLocal.getIntString("Button.OK")); // NOI18N jcmdOK.setEnabled(false); jcmdOK.setFocusPainted(false); jcmdOK.setFocusable(false); jcmdOK.setMargin(new java.awt.Insets(8, 16, 8, 16)); jcmdOK.setMaximumSize(new java.awt.Dimension(103, 44)); jcmdOK.setMinimumSize(new java.awt.Dimension(103, 44)); jcmdOK.setPreferredSize(new java.awt.Dimension(103, 44)); jcmdOK.setRequestFocusEnabled(false); jcmdOK.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcmdOKActionPerformed(evt); } }); jPanel1.add(jcmdOK); jPanel8.add(jPanel1, java.awt.BorderLayout.LINE_END); jPanel3.add(jPanel8, java.awt.BorderLayout.SOUTH); getContentPane().add(jPanel3, java.awt.BorderLayout.CENTER); jPanel2.setPreferredSize(new java.awt.Dimension(200, 250)); jPanel2.setLayout(new java.awt.BorderLayout()); jPanel2.add(m_jKeys, java.awt.BorderLayout.NORTH); getContentPane().add(jPanel2, java.awt.BorderLayout.LINE_END); setSize(new java.awt.Dimension(690, 511)); setLocationRelativeTo(null); }
From source file:us.paulevans.basicxslt.TransformOutputPropertiesFrame.java
/** * Builds the method panel/* w w w.j a v a 2 s .c o m*/ * @return */ private JPanel buildMethodPanel() { int row; ButtonGroup group; GridBagLayout layout; GridBagConstraints constraints; JPanel panel; row = 0; group = new ButtonGroup(); layout = new GridBagLayout(); constraints = new GridBagConstraints(); panel = new JPanel(layout); GUIUtils.add(panel, xml = new JRadioButton( stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_METHODS_XML) + " | "), layout, constraints, row, 0, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.NO_INSETS); GUIUtils.add(panel, html = new JRadioButton( stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_METHODS_HTML) + " | "), layout, constraints, row, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.NO_INSETS); GUIUtils.add(panel, text = new JRadioButton( stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_METHODS_TEXT) + " | "), layout, constraints, row, 2, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.NO_INSETS); GUIUtils.add(panel, other = new JRadioButton( stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_METHODS_OTHER)), layout, constraints, row, 3, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.NO_INSETS); GUIUtils.add(panel, otherMethod = new JTextField(10), layout, constraints, row, 4, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.NO_INSETS); group.add(xml); group.add(html); group.add(text); group.add(other); xml.addActionListener(this); html.addActionListener(this); text.addActionListener(this); other.addActionListener(this); xml.setSelected(true); otherMethod.setEnabled(false); otherMethod.setBackground(Color.LIGHT_GRAY); return panel; }
From source file:org.openconcerto.erp.core.sales.shipment.component.BonDeLivraisonSQLComponent.java
public void addViews() { this.textTotalHT.setOpaque(false); this.textTotalTVA.setOpaque(false); this.textTotalTTC.setOpaque(false); this.selectCommande = new ElementComboBox(); this.setLayout(new GridBagLayout()); final GridBagConstraints c = new DefaultGridBagConstraints(); // Champ Module c.gridx = 0;/*from w ww . j a va2s .c o m*/ c.gridy++; c.gridwidth = GridBagConstraints.REMAINDER; final JPanel addP = ComptaSQLConfElement.createAdditionalPanel(); this.setAdditionalFieldsPanel(new FormLayouter(addP, 2)); this.add(addP, c); c.gridy++; c.gridwidth = 1; // Numero JLabel labelNum = new JLabel(getLabelFor("NUMERO")); labelNum.setHorizontalAlignment(SwingConstants.RIGHT); this.add(labelNum, c); this.textNumeroUnique = new JUniqueTextField(16); c.gridx++; c.weightx = 1; c.weighty = 0; c.fill = GridBagConstraints.NONE; DefaultGridBagConstraints.lockMinimumSize(textNumeroUnique); this.add(this.textNumeroUnique, c); // Date c.gridx++; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 0; this.add(new JLabel(getLabelFor("DATE"), SwingConstants.RIGHT), c); JDate date = new JDate(true); c.gridx++; c.weightx = 0; c.weighty = 0; c.fill = GridBagConstraints.NONE; this.add(date, c); // Reference c.gridy++; c.gridx = 0; c.fill = GridBagConstraints.HORIZONTAL; this.add(new JLabel(getLabelFor("NOM"), SwingConstants.RIGHT), c); c.gridx++; c.weightx = 1; this.add(this.textNom, c); if (getTable().contains("DATE_LIVRAISON")) { // Date livraison c.gridx++; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 0; this.add(new JLabel(getLabelFor("DATE_LIVRAISON"), SwingConstants.RIGHT), c); JDate dateLivraison = new JDate(true); c.gridx++; c.weightx = 0; c.weighty = 0; c.fill = GridBagConstraints.NONE; this.add(dateLivraison, c); this.addView(dateLivraison, "DATE_LIVRAISON"); } // Client JLabel labelClient = new JLabel(getLabelFor("ID_CLIENT"), SwingConstants.RIGHT); c.gridx = 0; c.gridy++; c.weightx = 0; c.fill = GridBagConstraints.HORIZONTAL; c.weighty = 0; this.add(labelClient, c); c.gridx++; c.weightx = 0; c.weighty = 0; c.fill = GridBagConstraints.NONE; this.comboClient = new ElementComboBox(); this.add(this.comboClient, c); if (getTable().contains("SPEC_LIVRAISON")) { // Date livraison c.gridx++; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 0; this.add(new JLabel(getLabelFor("SPEC_LIVRAISON"), SwingConstants.RIGHT), c); JTextField specLivraison = new JTextField(); c.gridx++; c.weightx = 0; c.weighty = 0; this.add(specLivraison, c); this.addView(specLivraison, "SPEC_LIVRAISON"); } final ElementComboBox boxTarif = new ElementComboBox(); this.comboClient.addValueListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (comboClient.getElement().getTable().contains("ID_TARIF")) { if (BonDeLivraisonSQLComponent.this.isFilling()) return; final SQLRow row = ((SQLRequestComboBox) evt.getSource()).getSelectedRow(); if (row != null) { // SQLRowAccessor foreignRow = row.getForeignRow("ID_TARIF"); // if (foreignRow.isUndefined() && // !row.getForeignRow("ID_DEVISE").isUndefined()) { // SQLRowValues rowValsD = new SQLRowValues(foreignRow.getTable()); // rowValsD.put("ID_DEVISE", row.getObject("ID_DEVISE")); // foreignRow = rowValsD; // // } // tableBonItem.setTarif(foreignRow, true); SQLRowAccessor foreignRow = row.getForeignRow("ID_TARIF"); if (!foreignRow.isUndefined() && (boxTarif.getSelectedRow() == null || boxTarif.getSelectedId() != foreignRow.getID()) && JOptionPane.showConfirmDialog(null, "Appliquer les tarifs associs au client?") == JOptionPane.YES_OPTION) { boxTarif.setValue(foreignRow.getID()); // SaisieVenteFactureSQLComponent.this.tableFacture.setTarif(foreignRow, // true); } else { boxTarif.setValue(foreignRow.getID()); } } } } }); // Bouton tout livrer JButton boutonAll = new JButton("Tout livrer"); boutonAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { RowValuesTableModel m = BonDeLivraisonSQLComponent.this.tableBonItem.getModel(); // on livre tout les lments for (int i = 0; i < m.getRowCount(); i++) { SQLRowValues rowVals = m.getRowValuesAt(i); Object o = rowVals.getObject("QTE"); int qte = o == null ? 0 : ((Number) o).intValue(); m.putValue(qte, i, "QTE_LIVREE"); } } }); // Tarif if (this.getTable().getFieldsName().contains("ID_TARIF")) { // TARIF c.gridy++; c.gridx = 0; c.weightx = 0; c.weighty = 0; c.gridwidth = 1; this.add(new JLabel("Tarif appliquer"), c); c.gridx++; c.gridwidth = 1; c.weightx = 1; this.add(boxTarif, c); this.addView(boxTarif, "ID_TARIF"); boxTarif.addModelListener("wantedID", new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { SQLRow selectedRow = boxTarif.getRequest().getPrimaryTable().getRow(boxTarif.getWantedID()); tableBonItem.setTarif(selectedRow, !isFilling()); } }); } if (getTable().contains("A_ATTENTION")) { // Date livraison c.gridx++; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 0; this.add(new JLabel(getLabelFor("A_ATTENTION"), SwingConstants.RIGHT), c); JTextField specLivraison = new JTextField(); c.gridx++; c.weightx = 0; c.weighty = 0; this.add(specLivraison, c); this.addView(specLivraison, "A_ATTENTION"); } // Element du bon List<JButton> l = new ArrayList<JButton>(); l.add(boutonAll); this.tableBonItem = new BonDeLivraisonItemTable(l); c.gridx = 0; c.gridy++; c.weightx = 1; c.weighty = 1; c.gridwidth = GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.BOTH; this.add(this.tableBonItem, c); c.anchor = GridBagConstraints.EAST; // Totaux reconfigure(this.textTotalHT); reconfigure(this.textTotalTVA); reconfigure(this.textTotalTTC); // Poids Total c.gridy++; c.gridx = 1; c.weightx = 0; c.weighty = 0; c.anchor = GridBagConstraints.EAST; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; this.addSQLObject(this.textPoidsTotal, "TOTAL_POIDS"); this.addRequiredSQLObject(this.textTotalHT, "TOTAL_HT"); this.addRequiredSQLObject(this.textTotalTVA, "TOTAL_TVA"); this.addRequiredSQLObject(this.textTotalTTC, "TOTAL_TTC"); TotalPanel panelTotal = new TotalPanel(tableBonItem, textTotalHT, textTotalTVA, textTotalTTC, new DeviseField(), new DeviseField(), new DeviseField(), new DeviseField(), new DeviseField(), textPoidsTotal, null); c.gridx = 2; c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 0; c.weighty = 0; c.anchor = GridBagConstraints.EAST; c.fill = GridBagConstraints.HORIZONTAL; this.add(panelTotal, c); c.anchor = GridBagConstraints.WEST; /******************************************************************************************* * * INFORMATIONS COMPLEMENTAIRES ******************************************************************************************/ c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 1; c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy++; TitledSeparator sep = new TitledSeparator("Informations complmentaires"); c.insets = new Insets(10, 2, 1, 2); this.add(sep, c); c.insets = new Insets(2, 2, 1, 2); ITextArea textInfos = new ITextArea(4, 4); c.gridx = 0; c.gridy++; c.gridheight = 1; c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 1; c.weighty = 0; c.fill = GridBagConstraints.BOTH; final JScrollPane scrollPane = new JScrollPane(textInfos); this.add(scrollPane, c); textInfos.setBorder(null); DefaultGridBagConstraints.lockMinimumSize(scrollPane); c.gridx = 0; c.gridy++; c.gridheight = 1; c.gridwidth = 4; c.weightx = 0; c.weighty = 0; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.EAST; this.panelOO = new PanelOOSQLComponent(this); this.add(this.panelOO, c); this.addRequiredSQLObject(date, "DATE"); this.addSQLObject(textInfos, "INFOS"); this.addSQLObject(this.textNom, "NOM"); this.addSQLObject(this.selectCommande, "ID_COMMANDE_CLIENT"); this.addRequiredSQLObject(this.textNumeroUnique, "NUMERO"); this.addRequiredSQLObject(this.comboClient, "ID_CLIENT"); // Doit etre lock a la fin DefaultGridBagConstraints.lockMinimumSize(comboClient); }
From source file:edu.harvard.mcz.imagecapture.VerbatimClassifyDialog.java
protected void init() { setTitle("Interpret verbatim data into fields."); setBounds(100, 100, 1203, 899);//from w w w. j a v a 2s. co m getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS)); { JPanel panelVerbatimValues = new JPanel(); contentPanel.add(panelVerbatimValues); GridBagLayout gbl_panelVerbatimValues = new GridBagLayout(); gbl_panelVerbatimValues.columnWidths = new int[] { 70, 0, 0, 0, 35, 0, 58, 0, 0, 0 }; gbl_panelVerbatimValues.rowHeights = new int[] { 15, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 0 }; gbl_panelVerbatimValues.columnWeights = new double[] { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0 }; gbl_panelVerbatimValues.rowWeights = new double[] { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE }; panelVerbatimValues.setLayout(gbl_panelVerbatimValues); { lblCount = new JLabel("New label"); GridBagConstraints gbc_lblNewLabel = new GridBagConstraints(); gbc_lblNewLabel.gridwidth = 2; gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel.anchor = GridBagConstraints.SOUTHWEST; gbc_lblNewLabel.gridx = 0; gbc_lblNewLabel.gridy = 0; panelVerbatimValues.add(lblCount, gbc_lblNewLabel); } JButton buttonFillFromLast = new JButton("Fill From Last"); GridBagConstraints gbc_buttonFillFromLast = new GridBagConstraints(); gbc_buttonFillFromLast.anchor = GridBagConstraints.SOUTH; gbc_buttonFillFromLast.insets = new Insets(0, 0, 5, 5); gbc_buttonFillFromLast.gridx = 3; gbc_buttonFillFromLast.gridy = 0; panelVerbatimValues.add(buttonFillFromLast, gbc_buttonFillFromLast); { JLabel lblNewLabel_1 = new JLabel("Field values to apply to all records."); GridBagConstraints gbc_lblNewLabel_1 = new GridBagConstraints(); gbc_lblNewLabel_1.anchor = GridBagConstraints.SOUTHEAST; gbc_lblNewLabel_1.gridwidth = 4; gbc_lblNewLabel_1.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel_1.gridx = 4; gbc_lblNewLabel_1.gridy = 0; panelVerbatimValues.add(lblNewLabel_1, gbc_lblNewLabel_1); } { JLabel lblNewLabel_2 = new JLabel("Verbatim Locality"); GridBagConstraints gbc_lblNewLabel_2 = new GridBagConstraints(); gbc_lblNewLabel_2.anchor = GridBagConstraints.EAST; gbc_lblNewLabel_2.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel_2.gridx = 0; gbc_lblNewLabel_2.gridy = 1; panelVerbatimValues.add(lblNewLabel_2, gbc_lblNewLabel_2); } { textFieldVerbLocality = new JTextArea(); textFieldVerbLocality.setEditable(false); textFieldVerbLocality.setRows(5); GridBagConstraints gbc_textField = new GridBagConstraints(); gbc_textField.gridheight = 3; gbc_textField.insets = new Insets(0, 0, 5, 5); gbc_textField.fill = GridBagConstraints.BOTH; gbc_textField.gridx = 1; gbc_textField.gridy = 1; panelVerbatimValues.add(textFieldVerbLocality, gbc_textField); textFieldVerbLocality.setColumns(30); } JLabel lblNewLabel = new JLabel("HigherGeography"); GridBagConstraints gbc_lblNewLabel = new GridBagConstraints(); gbc_lblNewLabel.anchor = GridBagConstraints.EAST; gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel.gridx = 3; gbc_lblNewLabel.gridy = 1; panelVerbatimValues.add(lblNewLabel, gbc_lblNewLabel); GridBagConstraints gbc_textFieldHigherGeography = new GridBagConstraints(); gbc_textFieldHigherGeography.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldHigherGeography.gridwidth = 5; gbc_textFieldHigherGeography.insets = new Insets(0, 0, 5, 5); gbc_textFieldHigherGeography.gridx = 4; gbc_textFieldHigherGeography.gridy = 1; panelVerbatimValues.add(getComboBoxHighGeog(), gbc_textFieldHigherGeography); JButton btnCopyLocality = new JButton(">"); btnCopyLocality.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (textFieldSpecificLocality.getText().isEmpty()) { textFieldSpecificLocality.setText(textFieldVerbLocality.getText().replace("\n", "").trim()); } } }); GridBagConstraints gbc_btnCopyLocality = new GridBagConstraints(); gbc_btnCopyLocality.insets = new Insets(0, 0, 5, 5); gbc_btnCopyLocality.gridx = 2; gbc_btnCopyLocality.gridy = 2; panelVerbatimValues.add(btnCopyLocality, gbc_btnCopyLocality); JLabel lblSpecificLocality = new JLabel("Specific Locality"); GridBagConstraints gbc_lblSpecificLocality = new GridBagConstraints(); gbc_lblSpecificLocality.anchor = GridBagConstraints.EAST; gbc_lblSpecificLocality.insets = new Insets(0, 0, 5, 5); gbc_lblSpecificLocality.gridx = 3; gbc_lblSpecificLocality.gridy = 2; panelVerbatimValues.add(lblSpecificLocality, gbc_lblSpecificLocality); JLabel lblElevation = new JLabel("Elevation"); GridBagConstraints gbc_lblElevation = new GridBagConstraints(); gbc_lblElevation.anchor = GridBagConstraints.EAST; gbc_lblElevation.insets = new Insets(0, 0, 5, 5); gbc_lblElevation.gridx = 3; gbc_lblElevation.gridy = 3; panelVerbatimValues.add(lblElevation, gbc_lblElevation); textFieldMinElevation = new JTextField(); textFieldMinElevation.setMinimumSize(new Dimension(60, 19)); GridBagConstraints gbc_textFieldMinElevation = new GridBagConstraints(); gbc_textFieldMinElevation.insets = new Insets(0, 0, 5, 5); gbc_textFieldMinElevation.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldMinElevation.gridx = 4; gbc_textFieldMinElevation.gridy = 3; panelVerbatimValues.add(textFieldMinElevation, gbc_textFieldMinElevation); textFieldMinElevation.setColumns(4); JLabel lblTo = new JLabel("to"); GridBagConstraints gbc_lblTo = new GridBagConstraints(); gbc_lblTo.anchor = GridBagConstraints.EAST; gbc_lblTo.insets = new Insets(0, 0, 5, 5); gbc_lblTo.gridx = 5; gbc_lblTo.gridy = 3; panelVerbatimValues.add(lblTo, gbc_lblTo); textFieldMaxElevation = new JTextField(); textFieldMaxElevation.setMinimumSize(new Dimension(60, 19)); GridBagConstraints gbc_textFieldMaxElevation = new GridBagConstraints(); gbc_textFieldMaxElevation.anchor = GridBagConstraints.WEST; gbc_textFieldMaxElevation.insets = new Insets(0, 0, 5, 5); gbc_textFieldMaxElevation.gridx = 6; gbc_textFieldMaxElevation.gridy = 3; panelVerbatimValues.add(textFieldMaxElevation, gbc_textFieldMaxElevation); textFieldMaxElevation.setColumns(5); comboBoxElevUnits = new JComboBox(); GridBagConstraints gbc_comboBoxElevUnits = new GridBagConstraints(); gbc_comboBoxElevUnits.insets = new Insets(0, 0, 5, 5); gbc_comboBoxElevUnits.fill = GridBagConstraints.HORIZONTAL; gbc_comboBoxElevUnits.gridx = 7; gbc_comboBoxElevUnits.gridy = 3; panelVerbatimValues.add(comboBoxElevUnits, gbc_comboBoxElevUnits); { JLabel lblVerbatimdate = new JLabel("VerbatimDate"); GridBagConstraints gbc_lblVerbatimdate = new GridBagConstraints(); gbc_lblVerbatimdate.anchor = GridBagConstraints.EAST; gbc_lblVerbatimdate.insets = new Insets(0, 0, 5, 5); gbc_lblVerbatimdate.gridx = 0; gbc_lblVerbatimdate.gridy = 4; panelVerbatimValues.add(lblVerbatimdate, gbc_lblVerbatimdate); } textFieldVerbDate = new JTextField(); GridBagConstraints gbc_textFieldVerbDate = new GridBagConstraints(); gbc_textFieldVerbDate.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbDate.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldVerbDate.gridx = 1; gbc_textFieldVerbDate.gridy = 4; panelVerbatimValues.add(textFieldVerbDate, gbc_textFieldVerbDate); textFieldVerbDate.setColumns(30); JButton btnCopyDate = new JButton(">"); btnCopyDate.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (textFieldISODate.getText().isEmpty()) { Map<String, String> extractResult = DateUtils .extractDateFromVerbatim(textFieldVerbDate.getText().trim()); if (extractResult.containsKey("result")) { textFieldISODate.setText(extractResult.get("result")); } if (extractResult.containsKey("resultState")) { // TODO: Report suspect etc } } } }); GridBagConstraints gbc_btnCopyDate = new GridBagConstraints(); gbc_btnCopyDate.insets = new Insets(0, 0, 5, 5); gbc_btnCopyDate.gridx = 2; gbc_btnCopyDate.gridy = 4; panelVerbatimValues.add(btnCopyDate, gbc_btnCopyDate); JLabel lblNewLabel_3 = new JLabel("ISO Date"); GridBagConstraints gbc_lblNewLabel_3 = new GridBagConstraints(); gbc_lblNewLabel_3.anchor = GridBagConstraints.EAST; gbc_lblNewLabel_3.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel_3.gridx = 3; gbc_lblNewLabel_3.gridy = 4; panelVerbatimValues.add(lblNewLabel_3, gbc_lblNewLabel_3); textFieldISODate = new JTextField(); textFieldISODate.setInputVerifier( MetadataRetriever.getInputVerifier(Specimen.class, "ISODate", textFieldISODate)); textFieldISODate.setToolTipText(MetadataRetriever.getFieldHelp(Specimen.class, "ISODate")); GridBagConstraints gbc_textFieldISODate = new GridBagConstraints(); gbc_textFieldISODate.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldISODate.gridwidth = 5; gbc_textFieldISODate.insets = new Insets(0, 0, 5, 5); gbc_textFieldISODate.gridx = 4; gbc_textFieldISODate.gridy = 4; panelVerbatimValues.add(textFieldISODate, gbc_textFieldISODate); textFieldISODate.setColumns(10); textFieldSpecificLocality = new JTextField(); GridBagConstraints gbc_textFieldSpecificLocality = new GridBagConstraints(); gbc_textFieldSpecificLocality.gridwidth = 5; gbc_textFieldSpecificLocality.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldSpecificLocality.insets = new Insets(0, 0, 5, 5); gbc_textFieldSpecificLocality.gridx = 4; gbc_textFieldSpecificLocality.gridy = 2; panelVerbatimValues.add(textFieldSpecificLocality, gbc_textFieldSpecificLocality); textFieldSpecificLocality.setColumns(25); { JLabel lblVerbatimCollector = new JLabel("Verbatim Collector"); GridBagConstraints gbc_lblVerbatimCollector = new GridBagConstraints(); gbc_lblVerbatimCollector.anchor = GridBagConstraints.EAST; gbc_lblVerbatimCollector.insets = new Insets(0, 0, 5, 5); gbc_lblVerbatimCollector.gridx = 0; gbc_lblVerbatimCollector.gridy = 6; panelVerbatimValues.add(lblVerbatimCollector, gbc_lblVerbatimCollector); } textFieldVerbCollector = new JTextArea(); textFieldVerbCollector.setEditable(false); textFieldVerbCollector.setRows(3); GridBagConstraints gbc_textFieldVerbCollector = new GridBagConstraints(); gbc_textFieldVerbCollector.gridheight = 2; gbc_textFieldVerbCollector.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbCollector.fill = GridBagConstraints.BOTH; gbc_textFieldVerbCollector.gridx = 1; gbc_textFieldVerbCollector.gridy = 6; panelVerbatimValues.add(textFieldVerbCollector, gbc_textFieldVerbCollector); textFieldVerbCollector.setColumns(30); JLabel lblCollectors = new JLabel("Collector(s)"); GridBagConstraints gbc_lblCollectors = new GridBagConstraints(); gbc_lblCollectors.anchor = GridBagConstraints.EAST; gbc_lblCollectors.insets = new Insets(0, 0, 5, 5); gbc_lblCollectors.gridx = 3; gbc_lblCollectors.gridy = 6; panelVerbatimValues.add(lblCollectors, gbc_lblCollectors); JButton btnAddCollector = new JButton("+"); btnAddCollector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { ((CollectorTableModel) jTableCollectors.getModel()).addCollector(new Collector(null, "")); } }); GridBagConstraints gbc_btnAddCollector = new GridBagConstraints(); gbc_btnAddCollector.anchor = GridBagConstraints.EAST; gbc_btnAddCollector.insets = new Insets(0, 0, 5, 5); gbc_btnAddCollector.gridx = 3; gbc_btnAddCollector.gridy = 7; panelVerbatimValues.add(btnAddCollector, gbc_btnAddCollector); GridBagConstraints gbc_collectorTable = new GridBagConstraints(); gbc_collectorTable.insets = new Insets(0, 0, 5, 5); gbc_collectorTable.fill = GridBagConstraints.BOTH; gbc_collectorTable.gridx = 4; gbc_collectorTable.gridy = 6; gbc_collectorTable.gridheight = 2; gbc_collectorTable.gridwidth = 5; panelVerbatimValues.add(getJScrollPaneCollectors(), gbc_collectorTable); JLabel lblVerbatimCollection = new JLabel("Verbatim Collection"); GridBagConstraints gbc_lblVerbatimCollection = new GridBagConstraints(); gbc_lblVerbatimCollection.anchor = GridBagConstraints.EAST; gbc_lblVerbatimCollection.insets = new Insets(0, 0, 5, 5); gbc_lblVerbatimCollection.gridx = 0; gbc_lblVerbatimCollection.gridy = 8; panelVerbatimValues.add(lblVerbatimCollection, gbc_lblVerbatimCollection); textFieldVerbCollection = new JTextArea(); textFieldVerbCollection.setEditable(false); textFieldVerbCollection.setRows(3); GridBagConstraints gbc_textFieldVerbCollection = new GridBagConstraints(); gbc_textFieldVerbCollection.gridheight = 2; gbc_textFieldVerbCollection.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbCollection.fill = GridBagConstraints.BOTH; gbc_textFieldVerbCollection.gridx = 1; gbc_textFieldVerbCollection.gridy = 8; panelVerbatimValues.add(textFieldVerbCollection, gbc_textFieldVerbCollection); textFieldVerbCollection.setColumns(30); JLabel lblCollection = new JLabel("Collection"); GridBagConstraints gbc_lblCollection = new GridBagConstraints(); gbc_lblCollection.anchor = GridBagConstraints.EAST; gbc_lblCollection.insets = new Insets(0, 0, 5, 5); gbc_lblCollection.gridx = 3; gbc_lblCollection.gridy = 8; panelVerbatimValues.add(lblCollection, gbc_lblCollection); GridBagConstraints gbc_textFieldCollection = new GridBagConstraints(); gbc_textFieldCollection.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldCollection.gridwidth = 5; gbc_textFieldCollection.insets = new Insets(0, 0, 5, 5); gbc_textFieldCollection.gridx = 4; gbc_textFieldCollection.gridy = 8; panelVerbatimValues.add(getJComboBoxCollection(), gbc_textFieldCollection); JLabel lblVerbatimNumbers = new JLabel("Verbatim Numbers"); GridBagConstraints gbc_lblVerbatimNumbers = new GridBagConstraints(); gbc_lblVerbatimNumbers.anchor = GridBagConstraints.EAST; gbc_lblVerbatimNumbers.insets = new Insets(0, 0, 5, 5); gbc_lblVerbatimNumbers.gridx = 0; gbc_lblVerbatimNumbers.gridy = 10; panelVerbatimValues.add(lblVerbatimNumbers, gbc_lblVerbatimNumbers); textFieldVerbNumbers = new JTextArea(); textFieldVerbNumbers.setRows(3); textFieldVerbNumbers.setEditable(false); GridBagConstraints gbc_textFieldVerbNumbers = new GridBagConstraints(); gbc_textFieldVerbNumbers.gridheight = 2; gbc_textFieldVerbNumbers.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbNumbers.fill = GridBagConstraints.BOTH; gbc_textFieldVerbNumbers.gridx = 1; gbc_textFieldVerbNumbers.gridy = 10; panelVerbatimValues.add(textFieldVerbNumbers, gbc_textFieldVerbNumbers); textFieldVerbNumbers.setColumns(30); JLabel lblNumbers = new JLabel("Numbers"); GridBagConstraints gbc_lblNumbers = new GridBagConstraints(); gbc_lblNumbers.anchor = GridBagConstraints.EAST; gbc_lblNumbers.insets = new Insets(0, 0, 5, 5); gbc_lblNumbers.gridx = 3; gbc_lblNumbers.gridy = 10; panelVerbatimValues.add(lblNumbers, gbc_lblNumbers); JButton btnAddNumber = new JButton("+"); btnAddNumber.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { ((NumberTableModel) jTableNumbers.getModel()) .addNumber(new edu.harvard.mcz.imagecapture.data.Number(null, "", "")); } }); GridBagConstraints gbc_btnAddNumber = new GridBagConstraints(); gbc_btnAddNumber.anchor = GridBagConstraints.EAST; gbc_btnAddNumber.insets = new Insets(0, 0, 5, 5); gbc_btnAddNumber.gridx = 3; gbc_btnAddNumber.gridy = 11; panelVerbatimValues.add(btnAddNumber, gbc_btnAddNumber); GridBagConstraints gbc_numberTable = new GridBagConstraints(); gbc_numberTable.insets = new Insets(0, 0, 5, 5); gbc_numberTable.fill = GridBagConstraints.BOTH; gbc_numberTable.gridx = 4; gbc_numberTable.gridy = 10; gbc_numberTable.gridheight = 2; gbc_numberTable.gridwidth = 5; panelVerbatimValues.add(this.getJScrollPaneNumbers(), gbc_numberTable); JLabel lblVerbatimOtherText = new JLabel("Verbatim Other Text"); GridBagConstraints gbc_lblVerbatimOtherText = new GridBagConstraints(); gbc_lblVerbatimOtherText.anchor = GridBagConstraints.EAST; gbc_lblVerbatimOtherText.insets = new Insets(0, 0, 5, 5); gbc_lblVerbatimOtherText.gridx = 0; gbc_lblVerbatimOtherText.gridy = 12; panelVerbatimValues.add(lblVerbatimOtherText, gbc_lblVerbatimOtherText); textFieldVerbUnclassifiedText = new JTextArea(); textFieldVerbUnclassifiedText.setEditable(false); textFieldVerbUnclassifiedText.setRows(5); GridBagConstraints gbc_textFieldVerbUnclassifiedText = new GridBagConstraints(); gbc_textFieldVerbUnclassifiedText.gridheight = 3; gbc_textFieldVerbUnclassifiedText.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbUnclassifiedText.fill = GridBagConstraints.BOTH; gbc_textFieldVerbUnclassifiedText.gridx = 1; gbc_textFieldVerbUnclassifiedText.gridy = 12; panelVerbatimValues.add(textFieldVerbUnclassifiedText, gbc_textFieldVerbUnclassifiedText); textFieldVerbUnclassifiedText.setColumns(30); JLabel lblHabitat = new JLabel("Habitat"); GridBagConstraints gbc_lblHabitat = new GridBagConstraints(); gbc_lblHabitat.anchor = GridBagConstraints.EAST; gbc_lblHabitat.insets = new Insets(0, 0, 5, 5); gbc_lblHabitat.gridx = 3; gbc_lblHabitat.gridy = 12; panelVerbatimValues.add(lblHabitat, gbc_lblHabitat); textFieldHabitat = new JTextField(); GridBagConstraints gbc_textFieldHabitat = new GridBagConstraints(); gbc_textFieldHabitat.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldHabitat.gridwidth = 4; gbc_textFieldHabitat.insets = new Insets(0, 0, 5, 5); gbc_textFieldHabitat.gridx = 4; gbc_textFieldHabitat.gridy = 12; panelVerbatimValues.add(textFieldHabitat, gbc_textFieldHabitat); textFieldHabitat.setColumns(10); JLabel lblMicrohabitat = new JLabel("Microhabitat"); GridBagConstraints gbc_lblMicrohabitat = new GridBagConstraints(); gbc_lblMicrohabitat.anchor = GridBagConstraints.EAST; gbc_lblMicrohabitat.insets = new Insets(0, 0, 5, 5); gbc_lblMicrohabitat.gridx = 3; gbc_lblMicrohabitat.gridy = 13; panelVerbatimValues.add(lblMicrohabitat, gbc_lblMicrohabitat); textFieldMicrohabitat = new JTextField(); GridBagConstraints gbc_textFieldMicrohabitat = new GridBagConstraints(); gbc_textFieldMicrohabitat.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldMicrohabitat.gridwidth = 4; gbc_textFieldMicrohabitat.insets = new Insets(0, 0, 5, 5); gbc_textFieldMicrohabitat.gridx = 4; gbc_textFieldMicrohabitat.gridy = 13; panelVerbatimValues.add(textFieldMicrohabitat, gbc_textFieldMicrohabitat); textFieldMicrohabitat.setColumns(10); JLabel lblNewLabel_4 = new JLabel("Workflow Status"); GridBagConstraints gbc_lblNewLabel_4 = new GridBagConstraints(); gbc_lblNewLabel_4.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel_4.gridx = 3; gbc_lblNewLabel_4.gridy = 15; panelVerbatimValues.add(lblNewLabel_4, gbc_lblNewLabel_4); comboBoxWorkflowStatus = new JComboBox(WorkFlowStatus.getVerbatimClassifiedWorkFlowStatusValues()); comboBoxWorkflowStatus.setSelectedItem(WorkFlowStatus.STAGE_CLASSIFIED); GridBagConstraints gbc_comboBoxWorkflowStatus = new GridBagConstraints(); gbc_comboBoxWorkflowStatus.gridwidth = 4; gbc_comboBoxWorkflowStatus.fill = GridBagConstraints.HORIZONTAL; gbc_comboBoxWorkflowStatus.insets = new Insets(0, 0, 5, 5); gbc_comboBoxWorkflowStatus.gridx = 4; gbc_comboBoxWorkflowStatus.gridy = 15; panelVerbatimValues.add(comboBoxWorkflowStatus, gbc_comboBoxWorkflowStatus); JButton btnApplyToAll = new JButton("Apply To All Records"); GridBagConstraints gbc_btnApplyToAll = new GridBagConstraints(); gbc_btnApplyToAll.gridwidth = 4; gbc_btnApplyToAll.insets = new Insets(0, 0, 5, 5); gbc_btnApplyToAll.gridx = 4; gbc_btnApplyToAll.gridy = 16; panelVerbatimValues.add(btnApplyToAll, gbc_btnApplyToAll); btnApplyToAll.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { saveChanges(); } }); } { JPanel panelRelatedData = new JPanel(); contentPanel.add(panelRelatedData); GridBagLayout gbl_panelRelatedData = new GridBagLayout(); gbl_panelRelatedData.maximumLayoutSize(panelRelatedData); gbl_panelRelatedData.columnWidths = new int[] { 20, 33, 1, 0 }; gbl_panelRelatedData.rowHeights = new int[] { 25, 0 }; gbl_panelRelatedData.columnWeights = new double[] { 0.0, 1.0, 0.0, Double.MIN_VALUE }; gbl_panelRelatedData.rowWeights = new double[] { 1.0, Double.MIN_VALUE }; panelRelatedData.setLayout(gbl_panelRelatedData); { JLabel lblTaxa = new JLabel("Taxa"); GridBagConstraints gbc_lblTaxa = new GridBagConstraints(); gbc_lblTaxa.anchor = GridBagConstraints.NORTHEAST; gbc_lblTaxa.insets = new Insets(0, 0, 0, 5); gbc_lblTaxa.gridx = 0; gbc_lblTaxa.gridy = 0; panelRelatedData.add(lblTaxa, gbc_lblTaxa); } JScrollPane scrollPane = new JScrollPane(); // scrollPane.setPreferredSize(new Dimension(1000,100)); GridBagConstraints gbc_scrollPane = new GridBagConstraints(); gbc_scrollPane.anchor = GridBagConstraints.NORTH; gbc_scrollPane.insets = new Insets(0, 0, 0, 5); gbc_scrollPane.fill = GridBagConstraints.BOTH; gbc_scrollPane.gridx = 1; gbc_scrollPane.gridy = 0; panelRelatedData.add(scrollPane, gbc_scrollPane); tableTaxa = new JTable(); SpecimenLifeCycle sls = new SpecimenLifeCycle(); tableTaxa.setModel(new CountValueTableModel(sls.findTaxaFromVerbatim(this.verbatimData), "Current Idenfifications for these verbatim values.")); scrollPane.setViewportView(tableTaxa); } { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { JButton cancelButton = new JButton("Close"); cancelButton.setActionCommand("Close"); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setVisible(false); } }); buttonPane.add(cancelButton); } } }
From source file:net.sourceforge.squirrel_sql.client.gui.ProgressAbortDialog.java
private void createGUI() { JPanel dialogPanel = new JPanel(new GridBagLayout()); dialogPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); GridBagConstraints c;/* ww w . j a v a2 s . c o m*/ c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.BOTH; c.weightx = 1.0; c.weighty = 0.5; c.anchor = GridBagConstraints.WEST; c.insets = new Insets(4, 0, 4, 0); taskDescriptionComponent = createTaskDescripion(); dialogPanel.add(taskDescriptionComponent, c); c.gridy++; JPanel progressPanel = new JPanel(new GridBagLayout()); progressPanel.setMinimumSize(new Dimension(400, 200)); progressPanel.setPreferredSize(new Dimension(400, 200)); progressPanel.setBorder(BorderFactory.createTitledBorder("Progress")); dialogPanel.add(progressPanel, c); c.gridy = 0; c.gridx = 0; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 0.0; c.weighty = 0.0; c.insets = new Insets(4, 10, 4, 10); statusLabel = new JLabel(i18n.INITIAL_LOADING_PREFIX); progressPanel.add(statusLabel, c); c.gridy++; c.insets = new Insets(4, 10, 4, 10); additionalStatusLabel = new JLabel(" "); // Must be a space :-) progressPanel.add(additionalStatusLabel, c); c.gridy++; c.weightx = 1.0; progressBar = new JProgressBar(0, itemCount); progressBar.setIndeterminate(indeterminate); progressPanel.add(progressBar, c); c.gridy++; c.fill = GridBagConstraints.BOTH; c.weightx = 1.0; c.weighty = 1.0; historyArea = new JTextArea(); historyArea.setEditable(false); JScrollPane jScrollPane = new JScrollPane(historyArea); progressPanel.add(jScrollPane, c); if (abortHandler != null) { cancelButton = new JButton(new CancelAction()); c.gridy++; c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 0.0; c.weighty = 0.0; dialogPanel.add(cancelButton, c); } super.getContentPane().add(dialogPanel); super.pack(); super.setSize(new Dimension(450, 450)); super.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); super.addWindowListener(new WindowCloseListener()); }
From source file:com.sec.ose.osi.ui.frm.main.identification.codematch.JPanCodeMatchMain.java
/** * This method initializes jPanel // w w w. ja v a 2 s .c o m * * @return javax.swing.JPanel */ private JPanel getJPanel() { if (jPanelBottom == null) { GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); gridBagConstraints11.gridx = 0; gridBagConstraints11.anchor = GridBagConstraints.WEST; gridBagConstraints11.gridy = 2; GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); gridBagConstraints5.gridx = 0; gridBagConstraints5.anchor = GridBagConstraints.WEST; gridBagConstraints5.insets = new Insets(0, 30, 0, 0); gridBagConstraints5.gridy = 3; GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); gridBagConstraints9.fill = GridBagConstraints.BOTH; gridBagConstraints9.gridx = 0; gridBagConstraints9.gridy = 0; gridBagConstraints9.weightx = 1.0; gridBagConstraints9.weighty = 1.0; gridBagConstraints9.gridwidth = 1; GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.gridx = 0; gridBagConstraints4.anchor = GridBagConstraints.WEST; gridBagConstraints4.insets = new Insets(0, 0, 3, 0); gridBagConstraints4.gridwidth = 1; gridBagConstraints4.gridy = 5; GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.gridx = 0; gridBagConstraints2.anchor = GridBagConstraints.WEST; gridBagConstraints2.insets = new Insets(3, 0, 0, 0); gridBagConstraints2.gridwidth = 1; gridBagConstraints2.gridy = 1; GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.gridx = 0; gridBagConstraints1.anchor = GridBagConstraints.WEST; gridBagConstraints1.gridwidth = 1; gridBagConstraints1.gridy = 4; jPanelBottom = new JPanel(); jPanelBottom.setLayout(new GridBagLayout()); jPanelBottom.add(getJRadioButtonOpt3(), gridBagConstraints1); jPanelBottom.add(getJRadioButtonOpt1(), gridBagConstraints2); jPanelBottom.add(getJRadioButtonOpt4(), gridBagConstraints4); jPanelBottom.add(getJPanelTableForCardLayout(), gridBagConstraints9); jPanelBottom.add(getJPanelFolder(), gridBagConstraints5); jPanelBottom.add(getJPanelFolderTitle(), gridBagConstraints11); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { log.debug("code match source code divider resized..."); jSplitPaneSourceCode.setDividerLocation(jSplitPaneSourceCode.getSize().width / 2); } }); } return jPanelBottom; }