List of usage examples for javax.swing SwingConstants LEFT
int LEFT
To view the source code for javax.swing SwingConstants LEFT.
Click Source Link
From source file:com.intellij.lang.jsgraphql.ide.project.JSGraphQLLanguageUIProjectService.java
private void createToolWindowResultEditor(ToolWindow toolWindow) { final LightVirtualFile virtualFile = new LightVirtualFile("GraphQL.result.json", JsonFileType.INSTANCE, ""); fileEditor = PsiAwareTextEditorProvider.getInstance().createEditor(myProject, virtualFile); if (fileEditor instanceof TextEditor) { final Editor editor = ((TextEditor) fileEditor).getEditor(); final EditorEx editorEx = (EditorEx) editor; // set read-only mode editorEx.setViewer(true);/*from w ww . j ava 2 s. c om*/ editorEx.getSettings().setShowIntentionBulb(false); editor.getSettings().setAdditionalLinesCount(0); editor.getSettings().setCaretRowShown(false); editor.getSettings().setBlinkCaret(false); // query result header final JSGraphQLEditorHeaderComponent header = new JSGraphQLEditorHeaderComponent(); querySuccessLabel = new JBLabel(); querySuccessLabel.setVisible(false); querySuccessLabel.setIconTextGap(0); header.add(querySuccessLabel, BorderLayout.WEST); queryResultLabel = new JBLabel("", null, SwingConstants.LEFT); queryResultLabel.setBorder(new EmptyBorder(4, 6, 4, 6)); queryResultLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); queryResultLabel.setVisible(false); queryResultLabel.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { final String fileUrl = (String) queryResultLabel.getClientProperty(FILE_URL_PROPERTY); if (fileUrl != null) { final VirtualFile queryFile = VirtualFileManager.getInstance().findFileByUrl(fileUrl); if (queryFile != null) { final FileEditorManager fileEditorManager = FileEditorManager.getInstance(myProject); fileEditorManager.openFile(queryFile, true, true); } } } }); header.add(queryResultLabel, BorderLayout.CENTER); // finally set the header as permanent such that it's restored after searches editor.setHeaderComponent(header); editorEx.setPermanentHeaderComponent(header); } Disposer.register(this, fileEditor); final ContentImpl content = new ContentImpl(fileEditor.getComponent(), "Query result", true); content.setCloseable(false); toolWindow.getContentManager().addContent(content); }
From source file:edu.ku.brc.specify.tasks.subpane.ESResultsTablePanel.java
/** * @param table/*from w w w.java 2 s. c om*/ * @param model */ protected void autoResizeColWidth(final JTable table, final DefaultTableModel model) { table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); table.setModel(model); int margin = 5; DefaultTableColumnModel colModel = (DefaultTableColumnModel) table.getColumnModel(); int preferredWidthTotal = 0; int renderedWidthTotal = 0; int[] colWidths = new int[table.getColumnCount()]; int[] strWidths = new int[table.getColumnCount()]; for (int i = 0; i < table.getColumnCount(); i++) { int vColIndex = i; TableColumn col = colModel.getColumn(vColIndex); int width = 0; TableCellRenderer headerRenderer = col.getHeaderRenderer(); if (headerRenderer instanceof JLabel) { ((JLabel) headerRenderer).setHorizontalAlignment(SwingConstants.CENTER); } // Get width of column header TableCellRenderer renderer = col.getCellRenderer(); if (renderer == null) { renderer = table.getTableHeader().getDefaultRenderer(); } Component comp = renderer.getTableCellRendererComponent(table, col.getHeaderValue(), false, false, 0, 0); width = comp.getPreferredSize().width; // Get maximum width of column data int strWidth = 0; boolean isString = model.getColumnClass(i) == String.class; for (int r = 0; r < table.getRowCount(); r++) { renderer = table.getCellRenderer(r, vColIndex); Object objVal = table.getValueAt(r, vColIndex); if (isString && objVal != null) { strWidth = Math.max(strWidth, ((String) objVal).length()); } comp = renderer.getTableCellRendererComponent(table, objVal, false, false, r, vColIndex); width = Math.max(width, comp.getPreferredSize().width); } // Add margin width += 2 * margin; preferredWidthTotal += col.getPreferredWidth(); colWidths[i] = width; strWidths[i] = strWidth; renderedWidthTotal += width; } if (renderedWidthTotal > preferredWidthTotal) { for (int i = 0; i < table.getColumnCount(); i++) { TableColumn col = colModel.getColumn(i); TableCellRenderer renderer = col.getCellRenderer(); if (renderer != null) { ((JLabel) renderer).setHorizontalAlignment( strWidths[i] > 20 ? SwingConstants.LEFT : SwingConstants.CENTER); //((JLabel)renderer).setHorizontalAlignment(SwingConstants.LEFT); } if (model.getColumnCount() > 3 && renderedWidthTotal > preferredWidthTotal) { col.setPreferredWidth(colWidths[i]); } } } ((DefaultTableCellRenderer) table.getTableHeader().getDefaultRenderer()) .setHorizontalAlignment(SwingConstants.LEFT); // table.setAutoCreateRowSorter(true); table.getTableHeader().setReorderingAllowed(false); }
From source file:ca.phon.ipamap.IpaMap.java
private JXButton getToggleButton(Grid grid, JXCollapsiblePane cp) { Action toggleAction = cp.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION); // use the collapse/expand icons from the JTree UI toggleAction.putValue(JXCollapsiblePane.COLLAPSE_ICON, UIManager.getIcon("Tree.expandedIcon")); toggleAction.putValue(JXCollapsiblePane.EXPAND_ICON, UIManager.getIcon("Tree.collapsedIcon")); toggleAction.putValue(Action.NAME, grid.getName()); JXButton btn = new JXButton(toggleAction) { @Override//w ww . j av a 2 s. c om public Insets getInsets() { Insets retVal = super.getInsets(); retVal.top = 0; retVal.bottom = 0; return retVal; } @Override public Dimension getPreferredSize() { return new Dimension(0, 20); } }; btn.setHorizontalAlignment(SwingConstants.LEFT); btn.setBackgroundPainter(new Painter<JXButton>() { @Override public void paint(Graphics2D g, JXButton object, int width, int height) { MattePainter mp = new MattePainter(UIManager.getColor("Button.background")); mp.paint(g, object, width, height); } }); btn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); btn.setBorderPainted(false); btn.setFocusable(false); btn.putClientProperty("JComponent.sizeVariant", "small"); btn.revalidate(); return btn; }
From source file:de.tor.tribes.ui.views.DSWorkbenchStatsFrame.java
/** This method is called from within the constructor to * initialize the form.//www.ja va 2 s.c o m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jMainStatPanel = new javax.swing.JPanel(); jChartPanel = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jAllyList = new javax.swing.JList(); jScrollPane2 = new javax.swing.JScrollPane(); jTribeList = new javax.swing.JList(); jShowPoints = new javax.swing.JCheckBox(); jShowRank = new javax.swing.JCheckBox(); jShowVillages = new javax.swing.JCheckBox(); jShowKillsOff = new javax.swing.JCheckBox(); jShowRankOff = new javax.swing.JCheckBox(); jShowKillsDef = new javax.swing.JCheckBox(); jShowRankDef = new javax.swing.JCheckBox(); jShowItemValues = new javax.swing.JCheckBox(); jShowLegend = new javax.swing.JCheckBox(); jShowLines = new javax.swing.JCheckBox(); jShowDataPoints = new javax.swing.JCheckBox(); jViewSelectionBox = new javax.swing.JComboBox(); jStatCreatePanel = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jTabbedPane1 = new javax.swing.JTabbedPane(); jScrollPane7 = new javax.swing.JScrollPane(); jPointsPane = new javax.swing.JEditorPane(); jScrollPane10 = new javax.swing.JScrollPane(); jBashOffPane = new javax.swing.JEditorPane(); jScrollPane11 = new javax.swing.JScrollPane(); jBashDefPane = new javax.swing.JEditorPane(); jScrollPane12 = new javax.swing.JScrollPane(); jWinnerLoserPane = new javax.swing.JEditorPane(); jButton8 = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); jStartDate = new de.tor.tribes.ui.components.DateTimeField(); jLabel5 = new javax.swing.JLabel(); jEndDate = new de.tor.tribes.ui.components.DateTimeField(); jPanel11 = new javax.swing.JPanel(); jWeeklyStats = new javax.swing.JButton(); jMonthlyStats = new javax.swing.JButton(); jUseTop10Box = new javax.swing.JCheckBox(); jAlwaysOnTopBox = new javax.swing.JCheckBox(); jStatsPanel = new org.jdesktop.swingx.JXPanel(); capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel(); jMainStatPanel.setMinimumSize(new java.awt.Dimension(516, 300)); jMainStatPanel.setLayout(new java.awt.BorderLayout()); jChartPanel.setBackground(new java.awt.Color(239, 235, 223)); jChartPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jChartPanel.setPreferredSize(new java.awt.Dimension(499, 300)); jChartPanel.setLayout(new java.awt.BorderLayout()); jMainStatPanel.add(jChartPanel, java.awt.BorderLayout.CENTER); jPanel7.setPreferredSize(new java.awt.Dimension(516, 150)); jPanel7.setLayout(new java.awt.GridBagLayout()); jScrollPane1.setBorder(javax.swing.BorderFactory.createTitledBorder("berwachte Stmme")); jScrollPane1.setMinimumSize(new java.awt.Dimension(258, 100)); jScrollPane1.setPreferredSize(new java.awt.Dimension(258, 150)); jScrollPane1.setViewportView(jAllyList); 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; jPanel7.add(jScrollPane1, gridBagConstraints); jScrollPane2.setBorder(javax.swing.BorderFactory.createTitledBorder("berwachte Spieler")); jScrollPane2.setMinimumSize(new java.awt.Dimension(258, 100)); jScrollPane2.setPreferredSize(new java.awt.Dimension(258, 150)); jScrollPane2.setViewportView(jTribeList); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel7.add(jScrollPane2, gridBagConstraints); jMainStatPanel.add(jPanel7, java.awt.BorderLayout.NORTH); jShowPoints.setSelected(true); jShowPoints.setText("Punkte anzeigen"); jShowPoints.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireUpdateChartEvent(evt); } }); jShowRank.setText("Rang anzeigen"); jShowRank.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireUpdateChartEvent(evt); } }); jShowVillages.setText("Drfer anzeigen"); jShowVillages.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireUpdateChartEvent(evt); } }); jShowKillsOff.setText("Kills (Off) anzeigen"); jShowKillsOff.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireUpdateChartEvent(evt); } }); jShowRankOff.setText("Rang (Off) anzeigen"); jShowRankOff.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireUpdateChartEvent(evt); } }); jShowKillsDef.setText("Kills (Deff) anzeigen"); jShowKillsDef.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireUpdateChartEvent(evt); } }); jShowRankDef.setText("Rang (Deff) anzeigen"); jShowRankDef.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireUpdateChartEvent(evt); } }); jShowItemValues.setText("Werte anzeigen"); jShowItemValues.setToolTipText("Zeigt die Werte der Datenpunkte im Diagramm an"); jShowItemValues.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireUpdateChartEvent(evt); } }); jShowLegend.setSelected(true); jShowLegend.setText("Legende anzeigen"); jShowLegend.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireUpdateChartEvent(evt); } }); jShowLines.setSelected(true); jShowLines.setText("Linien anzeigen"); jShowLines.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireUpdateChartEvent(evt); } }); jShowDataPoints.setSelected(true); jShowDataPoints.setText("Datenpunkte anzeigen"); jShowDataPoints.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireUpdateChartEvent(evt); } }); jViewSelectionBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Punkte", "Rang (Punkte)", "Drfer", "Kills (Off)", "Rang (Off)", "Kills (Def)", "Rang (Def)" })); jViewSelectionBox.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireViewChangedEvent(evt); } }); jStatCreatePanel.setBackground(new java.awt.Color(239, 235, 223)); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Auswertung")); jPointsPane.setContentType("text/html"); // NOI18N jPointsPane.setEditable(false); jScrollPane7.setViewportView(jPointsPane); jTabbedPane1.addTab("Punkte", new javax.swing.ImageIcon(getClass().getResource("/res/goblet_gold.png")), jScrollPane7); // NOI18N jBashOffPane.setContentType("text/html"); // NOI18N jBashOffPane.setEditable(false); jScrollPane10.setViewportView(jBashOffPane); jTabbedPane1.addTab("Bash (Off)", new javax.swing.ImageIcon(getClass().getResource("/res/barracks.png")), jScrollPane10); // NOI18N jBashDefPane.setContentType("text/html"); // NOI18N jBashDefPane.setEditable(false); jScrollPane11.setViewportView(jBashDefPane); jTabbedPane1.addTab("Bash (Deff)", new javax.swing.ImageIcon(getClass().getResource("/res/ally.png")), jScrollPane11); // NOI18N jWinnerLoserPane.setContentType("text/html"); // NOI18N jWinnerLoserPane.setEditable(false); jScrollPane12.setViewportView(jWinnerLoserPane); jTabbedPane1.addTab("Gewinner/Verlierer", new javax.swing.ImageIcon(getClass().getResource("/res/up_plus.png")), jScrollPane12); // NOI18N javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap() .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 553, Short.MAX_VALUE) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap() .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE) .addContainerGap())); jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/select.png"))); // NOI18N jButton8.setText("Auswertung erstellen"); jButton8.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { fireGenerateStatsEvent(evt); } }); jPanel1.setOpaque(false); jPanel1.setLayout(new java.awt.GridBagLayout()); jLabel4.setText("Zeitraum (Start)"); jPanel1.add(jLabel4, new java.awt.GridBagConstraints()); jStartDate.setTimeEnabled(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 10); jPanel1.add(jStartDate, gridBagConstraints); jLabel5.setText("Zeitraum (Ende)"); jPanel1.add(jLabel5, new java.awt.GridBagConstraints()); jEndDate.setTimeEnabled(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0); jPanel1.add(jEndDate, gridBagConstraints); jPanel11.setOpaque(false); jPanel11.setPreferredSize(new java.awt.Dimension(520, 100)); jPanel11.setLayout(new java.awt.GridBagLayout()); jWeeklyStats.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/calendar_7.png"))); // NOI18N jWeeklyStats.setText("Statistik fr eine Woche (Heute - 7 Tage)"); jWeeklyStats.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); jWeeklyStats.setMaximumSize(new java.awt.Dimension(40, 25)); jWeeklyStats.setMinimumSize(new java.awt.Dimension(40, 25)); jWeeklyStats.setPreferredSize(new java.awt.Dimension(260, 25)); jWeeklyStats.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { fireChangeStatTimeEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5); jPanel11.add(jWeeklyStats, gridBagConstraints); jMonthlyStats.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/calendar_31.png"))); // NOI18N jMonthlyStats.setText("Statistik fr einen Monat (Heute - 31 Tage)"); jMonthlyStats.setMaximumSize(new java.awt.Dimension(40, 25)); jMonthlyStats.setMinimumSize(new java.awt.Dimension(40, 25)); jMonthlyStats.setPreferredSize(new java.awt.Dimension(260, 25)); jMonthlyStats.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { fireChangeStatTimeEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0); jPanel11.add(jMonthlyStats, gridBagConstraints); jUseTop10Box.setText("Nur Top-10 anzeigen"); javax.swing.GroupLayout jStatCreatePanelLayout = new javax.swing.GroupLayout(jStatCreatePanel); jStatCreatePanel.setLayout(jStatCreatePanelLayout); jStatCreatePanelLayout.setHorizontalGroup(jStatCreatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jStatCreatePanelLayout.createSequentialGroup().addContainerGap() .addGroup(jStatCreatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jStatCreatePanelLayout.createSequentialGroup() .addGroup(jStatCreatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 589, Short.MAX_VALUE) .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, 589, Short.MAX_VALUE)) .addContainerGap()) .addGroup(jStatCreatePanelLayout.createSequentialGroup() .addGroup(jStatCreatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jStatCreatePanelLayout.createSequentialGroup() .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 287, Short.MAX_VALUE) .addComponent(jUseTop10Box).addGap(18, 18, 18) .addComponent(jButton8))) .addGap(14, 14, 14))))); jStatCreatePanelLayout.setVerticalGroup(jStatCreatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jStatCreatePanelLayout.createSequentialGroup().addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jStatCreatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jUseTop10Box, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton8)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); setTitle("Statistiken"); getContentPane().setLayout(new java.awt.GridBagLayout()); jAlwaysOnTopBox.setText("Immer im Vordergrund"); jAlwaysOnTopBox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { fireAlwaysOnTopEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(jAlwaysOnTopBox, gridBagConstraints); jStatsPanel.setBackground(new java.awt.Color(239, 235, 223)); jStatsPanel.setMinimumSize(new java.awt.Dimension(700, 500)); jStatsPanel.setPreferredSize(new java.awt.Dimension(700, 500)); jStatsPanel.setLayout(new java.awt.BorderLayout()); 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(jStatsPanel, gridBagConstraints); capabilityInfoPanel1.setCopyable(false); capabilityInfoPanel1.setPastable(false); capabilityInfoPanel1.setSearchable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(capabilityInfoPanel1, gridBagConstraints); pack(); }
From source file:com.openbravo.pos.imports.JPanelCSVImport.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//from ww w. ja v a 2 s.c om */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jFileChooserPanel = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jFileName = new javax.swing.JTextField(); jbtnDbDriverLib = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); jComboReference = new javax.swing.JComboBox(); jComboBarcode = new javax.swing.JComboBox(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jCheckInCatalogue = new javax.swing.JCheckBox(); jLabel8 = new javax.swing.JLabel(); jCheckSellIncTax = new javax.swing.JCheckBox(); jLabel12 = new javax.swing.JLabel(); jComboBuy = new javax.swing.JComboBox(); jLabel11 = new javax.swing.JLabel(); jComboTax = new javax.swing.JComboBox(); jLabel10 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jComboSell = new javax.swing.JComboBox(); jComboDefaultCategory = new javax.swing.JComboBox(); jLabel20 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jComboCategory = new javax.swing.JComboBox(); jComboName = new javax.swing.JComboBox(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jHeaderRead = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jTextUpdates = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); jTextRecords = new javax.swing.JTextField(); jTextNew = new javax.swing.JTextField(); jTextInvalid = new javax.swing.JTextField(); jTextUpdate = new javax.swing.JTextField(); jTextMissing = new javax.swing.JTextField(); jTextBadPrice = new javax.swing.JTextField(); jTextNoChange = new javax.swing.JTextField(); jLabel19 = new javax.swing.JLabel(); jTextBadCats = new javax.swing.JTextField(); jComboSeparator = new javax.swing.JComboBox(); jImport = new javax.swing.JButton(); setOpaque(false); setPreferredSize(new java.awt.Dimension(630, 430)); jLabel1.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("pos_messages"); // NOI18N jLabel1.setText(bundle.getString("label.csvfile")); // NOI18N jLabel1.setPreferredSize(new java.awt.Dimension(100, 30)); jFileName.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jFileName.setPreferredSize(new java.awt.Dimension(275, 30)); jFileName.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jFileNameActionPerformed(evt); } }); jbtnDbDriverLib .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/fileopen.png"))); // NOI18N jbtnDbDriverLib.setMaximumSize(new java.awt.Dimension(64, 32)); jbtnDbDriverLib.setMinimumSize(new java.awt.Dimension(64, 32)); jbtnDbDriverLib.setPreferredSize(new java.awt.Dimension(64, 32)); jbtnDbDriverLib.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnDbDriverLibActionPerformed(evt); } }); javax.swing.GroupLayout jFileChooserPanelLayout = new javax.swing.GroupLayout(jFileChooserPanel); jFileChooserPanel.setLayout(jFileChooserPanelLayout); jFileChooserPanelLayout.setHorizontalGroup(jFileChooserPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jFileChooserPanelLayout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jFileName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jbtnDbDriverLib, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(116, 116, 116))); jFileChooserPanelLayout.setVerticalGroup(jFileChooserPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jFileChooserPanelLayout.createSequentialGroup().addGroup(jFileChooserPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jFileName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jbtnDbDriverLib, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jComboReference.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboReference.setEnabled(false); jComboReference.setMinimumSize(new java.awt.Dimension(32, 25)); jComboReference.setOpaque(false); jComboReference.setPreferredSize(new java.awt.Dimension(275, 30)); jComboReference.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboReferenceItemStateChanged(evt); } }); jComboReference.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboReferenceFocusGained(evt); } }); jComboBarcode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboBarcode.setEnabled(false); jComboBarcode.setMinimumSize(new java.awt.Dimension(32, 25)); jComboBarcode.setPreferredSize(new java.awt.Dimension(275, 30)); jComboBarcode.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboBarcodeItemStateChanged(evt); } }); jComboBarcode.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboBarcodeFocusGained(evt); } }); jLabel3.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel3.setText(bundle.getString("label.prodref")); // NOI18N jLabel3.setPreferredSize(new java.awt.Dimension(100, 30)); jLabel4.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel4.setText(bundle.getString("label.prodbarcode")); // NOI18N jLabel4.setPreferredSize(new java.awt.Dimension(100, 30)); jCheckInCatalogue.setEnabled(false); jLabel8.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jLabel8.setText(bundle.getString("label.prodincatalog")); // NOI18N jCheckSellIncTax.setEnabled(false); jLabel12.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jLabel12.setText(bundle.getString("label.csvsellingintax")); // NOI18N jComboBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboBuy.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "" })); jComboBuy.setSelectedIndex(-1); jComboBuy.setEnabled(false); jComboBuy.setMinimumSize(new java.awt.Dimension(32, 25)); jComboBuy.setPreferredSize(new java.awt.Dimension(275, 30)); jComboBuy.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboBuyItemStateChanged(evt); } }); jComboBuy.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboBuyFocusGained(evt); } }); jLabel11.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel11.setText(bundle.getString("label.prodcategory")); // NOI18N jLabel11.setPreferredSize(new java.awt.Dimension(100, 30)); jComboTax.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboTax.setEnabled(false); jComboTax.setPreferredSize(new java.awt.Dimension(275, 30)); jLabel10.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel10.setText(bundle.getString("label.prodpricebuy")); // NOI18N jLabel10.setPreferredSize(new java.awt.Dimension(100, 30)); jLabel7.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel7.setText(bundle.getString("label.prodtaxcode")); // NOI18N jLabel7.setPreferredSize(new java.awt.Dimension(100, 30)); jComboSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboSell.setEnabled(false); jComboSell.setMinimumSize(new java.awt.Dimension(32, 25)); jComboSell.setPreferredSize(new java.awt.Dimension(275, 30)); jComboSell.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboSellItemStateChanged(evt); } }); jComboSell.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboSellFocusGained(evt); } }); jComboDefaultCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboDefaultCategory.setEnabled(false); jComboDefaultCategory.setMinimumSize(new java.awt.Dimension(32, 25)); jComboDefaultCategory.setPreferredSize(new java.awt.Dimension(275, 30)); jComboDefaultCategory.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboDefaulrCategoryItemStateChanged(evt); } }); jComboDefaultCategory.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jComboDefaultCategoryActionPerformed(evt); } }); jLabel20.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel20.setText(bundle.getString("label.prodpricesell")); // NOI18N jLabel20.setPreferredSize(new java.awt.Dimension(100, 30)); jLabel5.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel5.setText(bundle.getString("label.prodname")); // NOI18N jLabel5.setPreferredSize(new java.awt.Dimension(100, 30)); jLabel6.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel6.setText(bundle.getString("label.proddefaultcategory")); // NOI18N jLabel6.setPreferredSize(new java.awt.Dimension(100, 30)); jComboCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboCategory.setEnabled(false); jComboCategory.setMinimumSize(new java.awt.Dimension(32, 25)); jComboCategory.setName(""); // NOI18N jComboCategory.setPreferredSize(new java.awt.Dimension(275, 30)); jComboCategory.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboCategoryItemStateChanged(evt); } }); jComboCategory.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboCategoryFocusGained(evt); } }); jComboName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N jComboName.setEnabled(false); jComboName.setMinimumSize(new java.awt.Dimension(32, 25)); jComboName.setPreferredSize(new java.awt.Dimension(275, 30)); jComboName.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboNameItemStateChanged(evt); } }); jComboName.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jComboNameFocusGained(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout .createSequentialGroup().addGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jComboDefaultCategory, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboTax, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel20, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jComboSell, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBuy, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboName, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboCategory, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jComboReference, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jComboBarcode, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jCheckInCatalogue, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jCheckSellIncTax) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboReference, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBarcode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(8, 8, 8) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboDefaultCategory, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboTax, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckInCatalogue) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jCheckSellIncTax).addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jLabel17.setFont(new java.awt.Font("Arial", 0, 10)); // NOI18N jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel17.setText("Import Version v2.3"); jLabel18.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel18.setText(bundle.getString("label.csvdelimit")); // NOI18N jLabel18.setPreferredSize(new java.awt.Dimension(100, 30)); jHeaderRead.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N jHeaderRead.setText(bundle.getString("label.csvread")); // NOI18N jHeaderRead.setEnabled(false); jHeaderRead.setPreferredSize(new java.awt.Dimension(120, 30)); jHeaderRead.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jHeaderReadActionPerformed(evt); } }); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder( new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true), bundle.getString("title.CSVImport"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(102, 102, 102))); // NOI18N jLabel9.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel9.setText(bundle.getString("label.csvrecordsfound")); // NOI18N jLabel9.setPreferredSize(new java.awt.Dimension(100, 25)); jLabel14.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel14.setText(bundle.getString("label.csvnewproducts")); // NOI18N jLabel14.setMaximumSize(new java.awt.Dimension(77, 14)); jLabel14.setMinimumSize(new java.awt.Dimension(77, 14)); jLabel14.setPreferredSize(new java.awt.Dimension(100, 25)); jLabel16.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel16.setText(bundle.getString("label.cvsinvalid")); // NOI18N jLabel16.setPreferredSize(new java.awt.Dimension(100, 25)); jTextUpdates.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jTextUpdates.setText(bundle.getString("label.csvpriceupdated")); // NOI18N jTextUpdates.setPreferredSize(new java.awt.Dimension(100, 25)); jLabel2.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel2.setText(bundle.getString("label.csvmissing")); // NOI18N jLabel2.setPreferredSize(new java.awt.Dimension(100, 25)); jLabel15.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel15.setText(bundle.getString("label.csvbad")); // NOI18N jLabel15.setPreferredSize(new java.awt.Dimension(100, 25)); jLabel13.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel13.setText(bundle.getString("label.cvsnotchanged")); // NOI18N jLabel13.setPreferredSize(new java.awt.Dimension(100, 25)); jTextRecords.setBackground(new java.awt.Color(224, 223, 227)); jTextRecords.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextRecords.setForeground(new java.awt.Color(102, 102, 102)); jTextRecords.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextRecords.setBorder(null); jTextRecords.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextRecords.setEnabled(false); jTextRecords.setPreferredSize(new java.awt.Dimension(70, 25)); jTextNew.setBackground(new java.awt.Color(224, 223, 227)); jTextNew.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextNew.setForeground(new java.awt.Color(102, 102, 102)); jTextNew.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextNew.setBorder(null); jTextNew.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextNew.setEnabled(false); jTextNew.setPreferredSize(new java.awt.Dimension(70, 25)); jTextInvalid.setBackground(new java.awt.Color(224, 223, 227)); jTextInvalid.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextInvalid.setForeground(new java.awt.Color(102, 102, 102)); jTextInvalid.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextInvalid.setBorder(null); jTextInvalid.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextInvalid.setEnabled(false); jTextInvalid.setPreferredSize(new java.awt.Dimension(70, 25)); jTextUpdate.setBackground(new java.awt.Color(224, 223, 227)); jTextUpdate.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextUpdate.setForeground(new java.awt.Color(102, 102, 102)); jTextUpdate.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextUpdate.setBorder(null); jTextUpdate.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextUpdate.setEnabled(false); jTextUpdate.setPreferredSize(new java.awt.Dimension(70, 25)); jTextUpdate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextUpdateActionPerformed(evt); } }); jTextMissing.setBackground(new java.awt.Color(224, 223, 227)); jTextMissing.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextMissing.setForeground(new java.awt.Color(102, 102, 102)); jTextMissing.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextMissing.setBorder(null); jTextMissing.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextMissing.setEnabled(false); jTextMissing.setPreferredSize(new java.awt.Dimension(70, 25)); jTextBadPrice.setBackground(new java.awt.Color(224, 223, 227)); jTextBadPrice.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextBadPrice.setForeground(new java.awt.Color(102, 102, 102)); jTextBadPrice.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextBadPrice.setBorder(null); jTextBadPrice.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextBadPrice.setEnabled(false); jTextBadPrice.setPreferredSize(new java.awt.Dimension(70, 25)); jTextNoChange.setBackground(new java.awt.Color(224, 223, 227)); jTextNoChange.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextNoChange.setForeground(new java.awt.Color(102, 102, 102)); jTextNoChange.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextNoChange.setBorder(null); jTextNoChange.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextNoChange.setEnabled(false); jTextNoChange.setPreferredSize(new java.awt.Dimension(70, 25)); jLabel19.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLabel19.setText(bundle.getString("label.cvsbadcats")); // NOI18N jLabel19.setPreferredSize(new java.awt.Dimension(100, 25)); jTextBadCats.setBackground(new java.awt.Color(224, 223, 227)); jTextBadCats.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N jTextBadCats.setForeground(new java.awt.Color(102, 102, 102)); jTextBadCats.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jTextBadCats.setBorder(null); jTextBadCats.setDisabledTextColor(new java.awt.Color(0, 0, 0)); jTextBadCats.setEnabled(false); jTextBadCats.setPreferredSize(new java.awt.Dimension(70, 25)); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextRecords, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel16, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTextUpdates, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel15, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextBadCats, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextNew, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextInvalid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextMissing, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextBadPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextNoChange, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(26, Short.MAX_VALUE))); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGap(0, 0, 0).addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextRecords, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextNew, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextInvalid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextUpdates, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextMissing, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextBadPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextNoChange, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextBadCats, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jComboSeparator.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jComboSeparator.setPreferredSize(new java.awt.Dimension(50, 30)); jImport.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N jImport.setText(bundle.getString("label.csvimpostbtn")); // NOI18N jImport.setEnabled(false); jImport.setPreferredSize(new java.awt.Dimension(120, 30)); jImport.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jImportActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(10, 10, 10).addComponent( jFileChooserPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout .createSequentialGroup() .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jComboSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(106, 106, 106).addComponent(jHeaderRead, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jImport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(8, 8, 8))) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 394, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE).addComponent(jLabel17))) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addComponent(jLabel17) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jFileChooserPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jHeaderRead, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jImport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); }
From source file:io.heming.accountbook.ui.MainFrame.java
private void initStatusBar() { statusBar = Box.createHorizontalBox(); statusBar.setPreferredSize(new Dimension(getWidth(), 26)); statusBar.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0), BorderFactory.createEtchedBorder(EtchedBorder.LOWERED))); ImageIcon loading = new ImageIcon(getClass().getResource("stopped-loader.png")); statusLabel = new JLabel("", loading, JLabel.LEFT); statusLabel.setHorizontalAlignment(SwingConstants.LEFT); statusBar.add(statusLabel);//from www .j ava2s.co m statusBar.add(Box.createHorizontalGlue()); infoLabel = new JLabel(); infoLabel.setForeground(Color.GRAY); infoLabel.setPreferredSize(new Dimension(270, 20)); infoLabel.setMaximumSize(infoLabel.getPreferredSize()); statusBar.add(infoLabel); statusBar.add(Box.createHorizontalStrut(20)); pageLabel = new JLabel(); pageLabel.setForeground(Color.GRAY); pageLabel.setPreferredSize(new Dimension(80, 20)); pageLabel.setMaximumSize(pageLabel.getPreferredSize()); statusBar.add(pageLabel); Insets insets = new Insets(2, 10, 2, 10); firstPageButton = new JButton(); firstPageButton.setMargin(insets); firstPageButton.setActionCommand(""); firstPageButton.setToolTipText(""); firstPageButton.setIcon(new ImageIcon(getClass().getResource("go-first.png"))); firstPageButton.addActionListener(e -> firstPage()); prevPageButton = new JButton(); prevPageButton.setMargin(insets); prevPageButton.setActionCommand("?"); prevPageButton.setToolTipText("?"); prevPageButton.setIcon(new ImageIcon(getClass().getResource("go-previous-2.png"))); prevPageButton.addActionListener(e -> prevPage()); nextPageButton = new JButton(); nextPageButton.setMargin(insets); nextPageButton.setActionCommand(""); nextPageButton.setToolTipText(""); nextPageButton.setIcon(new ImageIcon(getClass().getResource("go-next-2.png"))); nextPageButton.addActionListener(e -> nextPage()); lastPageButton = new JButton(); lastPageButton.setMargin(insets); lastPageButton.setActionCommand(""); lastPageButton.setToolTipText(""); lastPageButton.setIcon(new ImageIcon(getClass().getResource("go-last.png"))); lastPageButton.addActionListener(e -> lastPage()); statusBar.add(firstPageButton); statusBar.add(prevPageButton); statusBar.add(nextPageButton); statusBar.add(lastPageButton); add(statusBar, BorderLayout.SOUTH); }
From source file:com.tiempometa.muestradatos.JMuestraDatos.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY // //GEN-BEGIN:initComponents ResourceBundle bundle = ResourceBundle.getBundle("com.tiempometa.muestradatos.muestradatos"); menuBar1 = new JMenuBar(); menu1 = new JMenu(); configMenuItem = new JMenuItem(); importTagsMenuItem = new JMenuItem(); exportTagsMenuItem = new JMenuItem(); clearTagsMenuItem = new JMenuItem(); exitMenuItem = new JMenuItem(); menu3 = new JMenu(); aboutUsMenuItem = new JMenuItem(); configureJavaMenuItem = new JMenuItem(); panel5 = new JPanel(); panel3 = new JPanel(); panel4 = new JPanel(); tabbedPane1 = new JTabbedPane(); panel2 = new JPanel(); label9 = new JLabel(); label10 = new JLabel(); label3 = new JLabel(); readerPortLabel = new JLabel(); label11 = new JLabel(); boxIpAddressLabel = new JLabel(); label4 = new JLabel(); readerStatusLabel = new JLabel(); label12 = new JLabel(); boxTypeLabel = new JLabel(); label2 = new JLabel(); rssiLevelLabel = new JLabel(); label13 = new JLabel(); preferredReaderLabel = new JLabel(); label5 = new JLabel(); regionLabel = new JLabel(); label14 = new JLabel(); preferredAntenaLabel = new JLabel(); label6 = new JLabel(); readPowerLabel = new JLabel(); label7 = new JLabel(); writePowerLevel = new JLabel(); usbConnectButton = new JButton(); boxConnectButton = new JButton(); panel1 = new JPanel(); verifyDataButton = new JButton(); loadReadingsButton = new JButton(); readTagButton = new JButton(); countTagsButton = new JButton(); programTagButton = new JButton(); panel8 = new JPanel(); setBoxTimeButton = new JButton(); getBoxTimeButton = new JButton(); label20 = new JLabel(); label19 = new JLabel(); systemTimeLabel = new JLabel(); foxberryTimeLabel = new JLabel(); foxberryTimeDiffLabel = new JLabel(); panel6 = new JPanel(); label21 = new JLabel(); label1 = new JLabel(); usbStatusLabel = new JLabel(); label16 = new JLabel(); tcpStatusLabel = new JLabel(); label8 = new JLabel(); databaseLabel = new JLabel(); panel7 = new JPanel(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle(bundle.getString("JMuestraDatos.this.title")); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); setIconImage(//w w w . j av a2s . co m new ImageIcon(getClass().getResource("/com/tiempometa/resources/tiempometa_icon_large_alpha.png")) .getImage()); setResizable(false); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== menuBar1 ======== { //======== menu1 ======== { menu1.setText(bundle.getString("JMuestraDatos.menu1.text")); //---- configMenuItem ---- configMenuItem.setText(bundle.getString("JMuestraDatos.configMenuItem.text")); configMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { configMenuItemActionPerformed(e); } }); menu1.add(configMenuItem); //---- importTagsMenuItem ---- importTagsMenuItem.setText(bundle.getString("JMuestraDatos.importTagsMenuItem.text")); importTagsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { importTagsMenuItemActionPerformed(e); } }); menu1.add(importTagsMenuItem); //---- exportTagsMenuItem ---- exportTagsMenuItem.setText(bundle.getString("JMuestraDatos.exportTagsMenuItem.text")); exportTagsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { exportTagsMenuItemActionPerformed(e); } }); menu1.add(exportTagsMenuItem); //---- clearTagsMenuItem ---- clearTagsMenuItem.setText(bundle.getString("JMuestraDatos.clearTagsMenuItem.text")); clearTagsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { clearTagsMenuItemActionPerformed(e); } }); menu1.add(clearTagsMenuItem); menu1.addSeparator(); //---- exitMenuItem ---- exitMenuItem.setText(bundle.getString("JMuestraDatos.exitMenuItem.text")); exitMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem2ActionPerformed(e); } }); menu1.add(exitMenuItem); } menuBar1.add(menu1); //======== menu3 ======== { menu3.setText(bundle.getString("JMuestraDatos.menu3.text")); //---- aboutUsMenuItem ---- aboutUsMenuItem.setText(bundle.getString("JMuestraDatos.aboutUsMenuItem.text")); aboutUsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { aboutUsMenuItemActionPerformed(e); } }); menu3.add(aboutUsMenuItem); //---- configureJavaMenuItem ---- configureJavaMenuItem.setText(bundle.getString("JMuestraDatos.configureJavaMenuItem.text")); configureJavaMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { configureJavaMenuItemActionPerformed(e); } }); menu3.add(configureJavaMenuItem); } menuBar1.add(menu3); } setJMenuBar(menuBar1); //======== panel5 ======== { panel5.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(18)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(343)) }, new RowSpec[] { new RowSpec(Sizes.dluY(17)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(17)) })); } contentPane.add(panel5, BorderLayout.NORTH); //======== panel3 ======== { panel3.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(16)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); } contentPane.add(panel3, BorderLayout.WEST); //======== panel4 ======== { panel4.setLayout( new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(410)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("245dlu"))); //======== tabbedPane1 ======== { tabbedPane1.setFont(new Font("Tahoma", Font.BOLD, 16)); //======== panel2 ======== { panel2.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(25)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(89)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(73)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(17)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(84)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(80)) }, new RowSpec[] { new RowSpec(Sizes.dluY(20)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.DLUY8) })); //---- label9 ---- label9.setText(bundle.getString("JMuestraDatos.label9.text")); label9.setFont(new Font("Tahoma", Font.BOLD, 16)); label9.setIcon(new ImageIcon(getClass().getResource("/com/tiempometa/resources/usb_128.png"))); label9.setHorizontalAlignment(SwingConstants.CENTER); panel2.add(label9, cc.xywh(3, 3, 3, 1)); //---- label10 ---- label10.setText(bundle.getString("JMuestraDatos.label10.text")); label10.setFont(new Font("Tahoma", Font.BOLD, 16)); label10.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/briefcase_128.png"))); label10.setHorizontalAlignment(SwingConstants.CENTER); panel2.add(label10, cc.xywh(9, 3, 3, 1)); //---- label3 ---- label3.setText(bundle.getString("JMuestraDatos.label3.text")); label3.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label3, cc.xy(3, 5)); //---- readerPortLabel ---- readerPortLabel.setText(bundle.getString("JMuestraDatos.readerPortLabel.text")); panel2.add(readerPortLabel, cc.xy(5, 5)); //---- label11 ---- label11.setText(bundle.getString("JMuestraDatos.label11.text")); label11.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label11, cc.xy(9, 5)); //---- boxIpAddressLabel ---- boxIpAddressLabel.setText(bundle.getString("JMuestraDatos.boxIpAddressLabel.text")); panel2.add(boxIpAddressLabel, cc.xy(11, 5)); //---- label4 ---- label4.setText(bundle.getString("JMuestraDatos.label4.text")); label4.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label4, cc.xy(3, 7)); //---- readerStatusLabel ---- readerStatusLabel.setText(bundle.getString("JMuestraDatos.readerStatusLabel.text")); panel2.add(readerStatusLabel, cc.xy(5, 7)); //---- label12 ---- label12.setText(bundle.getString("JMuestraDatos.label12.text")); label12.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label12, cc.xy(9, 7)); //---- boxTypeLabel ---- boxTypeLabel.setText(bundle.getString("JMuestraDatos.boxTypeLabel.text")); panel2.add(boxTypeLabel, cc.xy(11, 7)); //---- label2 ---- label2.setText(bundle.getString("JMuestraDatos.label2.text")); label2.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label2, cc.xy(3, 9)); //---- rssiLevelLabel ---- rssiLevelLabel.setText(bundle.getString("JMuestraDatos.rssiLevelLabel.text")); panel2.add(rssiLevelLabel, cc.xy(5, 9)); //---- label13 ---- label13.setText(bundle.getString("JMuestraDatos.label13.text")); label13.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label13, cc.xy(9, 9)); //---- preferredReaderLabel ---- preferredReaderLabel.setText(bundle.getString("JMuestraDatos.preferredReaderLabel.text")); panel2.add(preferredReaderLabel, cc.xy(11, 9)); //---- label5 ---- label5.setText(bundle.getString("JMuestraDatos.label5.text")); label5.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label5, cc.xy(3, 11)); //---- regionLabel ---- regionLabel.setText(bundle.getString("JMuestraDatos.regionLabel.text")); panel2.add(regionLabel, cc.xy(5, 11)); //---- label14 ---- label14.setText(bundle.getString("JMuestraDatos.label14.text")); label14.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label14, cc.xy(9, 11)); //---- preferredAntenaLabel ---- preferredAntenaLabel.setText(bundle.getString("JMuestraDatos.preferredAntenaLabel.text")); panel2.add(preferredAntenaLabel, cc.xy(11, 11)); //---- label6 ---- label6.setText(bundle.getString("JMuestraDatos.label6.text")); label6.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label6, cc.xy(3, 13)); //---- readPowerLabel ---- readPowerLabel.setText(bundle.getString("JMuestraDatos.readPowerLabel.text")); panel2.add(readPowerLabel, cc.xy(5, 13)); //---- label7 ---- label7.setText(bundle.getString("JMuestraDatos.label7.text")); label7.setFont(new Font("Tahoma", Font.BOLD, 14)); panel2.add(label7, cc.xy(3, 15)); //---- writePowerLevel ---- writePowerLevel.setText(bundle.getString("JMuestraDatos.writePowerLevel.text")); panel2.add(writePowerLevel, cc.xy(5, 15)); //---- usbConnectButton ---- usbConnectButton.setText(bundle.getString("JMuestraDatos.usbConnectButton.text")); usbConnectButton.setFont(new Font("Tahoma", Font.BOLD, 14)); usbConnectButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { usbConnectButtonActionPerformed(e); } }); panel2.add(usbConnectButton, cc.xywh(3, 17, 3, 1)); //---- boxConnectButton ---- boxConnectButton.setText(bundle.getString("JMuestraDatos.boxConnectButton.text")); boxConnectButton.setFont(new Font("Tahoma", Font.BOLD, 14)); boxConnectButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { boxConnectButtonActionPerformed(e); } }); panel2.add(boxConnectButton, cc.xywh(9, 17, 3, 1)); } tabbedPane1.addTab(bundle.getString("JMuestraDatos.panel2.tab.title"), panel2); //======== panel1 ======== { panel1.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(35)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(120)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(47)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(130)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(28)) }, new RowSpec[] { new RowSpec(Sizes.dluY(15)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- verifyDataButton ---- verifyDataButton.setText(bundle.getString("JMuestraDatos.verifyDataButton.text")); verifyDataButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/check_64.png"))); verifyDataButton.setHorizontalAlignment(SwingConstants.LEFT); verifyDataButton.setRolloverIcon(null); verifyDataButton.setPressedIcon(null); verifyDataButton.setFont(new Font("Tahoma", Font.BOLD, 16)); verifyDataButton.setEnabled(false); verifyDataButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { verifyDataButtonActionPerformed(e); } }); panel1.add(verifyDataButton, cc.xywh(3, 3, 3, 1)); //---- loadReadingsButton ---- loadReadingsButton.setText(bundle.getString("JMuestraDatos.loadReadingsButton.text")); loadReadingsButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/load_64.png"))); loadReadingsButton.setHorizontalAlignment(SwingConstants.LEFT); loadReadingsButton.setFont(new Font("Tahoma", Font.BOLD, 16)); loadReadingsButton.setEnabled(false); loadReadingsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { loadReadingsButtonActionPerformed(e); } }); panel1.add(loadReadingsButton, cc.xywh(7, 3, 3, 1)); //---- readTagButton ---- readTagButton.setText(bundle.getString("JMuestraDatos.readTagButton.text")); readTagButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/scan_64.png"))); readTagButton.setHorizontalAlignment(SwingConstants.LEFT); readTagButton.setFont(new Font("Tahoma", Font.BOLD, 16)); readTagButton.setEnabled(false); readTagButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { readTagButtonActionPerformed(e); } }); panel1.add(readTagButton, cc.xywh(3, 5, 3, 1)); //---- countTagsButton ---- countTagsButton.setText(bundle.getString("JMuestraDatos.countTagsButton.text")); countTagsButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/counter_64.png"))); countTagsButton.setHorizontalAlignment(SwingConstants.LEFT); countTagsButton.setFont(new Font("Tahoma", Font.BOLD, 16)); countTagsButton.setEnabled(false); countTagsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { countTagsButtonActionPerformed(e); } }); panel1.add(countTagsButton, cc.xywh(7, 5, 3, 1)); //---- programTagButton ---- programTagButton.setText(bundle.getString("JMuestraDatos.programTagButton.text")); programTagButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/record_64.png"))); programTagButton.setHorizontalAlignment(SwingConstants.LEFT); programTagButton.setFont(new Font("Tahoma", Font.BOLD, 16)); programTagButton.setEnabled(false); programTagButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { programTagButtonActionPerformed(e); } }); panel1.add(programTagButton, cc.xywh(3, 7, 3, 1)); } tabbedPane1.addTab(bundle.getString("JMuestraDatos.panel1.tab.title"), panel1); //======== panel8 ======== { panel8.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(35)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(160)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(160)) }, new RowSpec[] { new RowSpec(Sizes.dluY(15)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- setBoxTimeButton ---- setBoxTimeButton.setText(bundle.getString("JMuestraDatos.setBoxTimeButton.text")); setBoxTimeButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/set_time_64.png"))); setBoxTimeButton.setHorizontalAlignment(SwingConstants.LEFT); setBoxTimeButton.setFont(new Font("Tahoma", Font.BOLD, 16)); setBoxTimeButton.setEnabled(false); setBoxTimeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setBoxTimeButtonActionPerformed(e); } }); panel8.add(setBoxTimeButton, cc.xy(3, 3)); //---- getBoxTimeButton ---- getBoxTimeButton.setText(bundle.getString("JMuestraDatos.getBoxTimeButton.text")); getBoxTimeButton.setIcon( new ImageIcon(getClass().getResource("/com/tiempometa/resources/get_time_64.png"))); getBoxTimeButton.setHorizontalAlignment(SwingConstants.LEFT); getBoxTimeButton.setFont(new Font("Tahoma", Font.BOLD, 16)); getBoxTimeButton.setEnabled(false); getBoxTimeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { getBoxTimeButtonActionPerformed(e); } }); panel8.add(getBoxTimeButton, cc.xy(5, 3)); //---- label20 ---- label20.setText(bundle.getString("JMuestraDatos.label20.text")); label20.setFont(new Font("Tahoma", Font.BOLD, 14)); panel8.add(label20, cc.xy(3, 5)); //---- label19 ---- label19.setText(bundle.getString("JMuestraDatos.label19.text")); label19.setFont(new Font("Tahoma", Font.BOLD, 14)); panel8.add(label19, cc.xy(5, 5)); panel8.add(systemTimeLabel, cc.xy(3, 7)); panel8.add(foxberryTimeLabel, cc.xy(5, 7)); panel8.add(foxberryTimeDiffLabel, cc.xy(5, 9)); } tabbedPane1.addTab(bundle.getString("JMuestraDatos.panel8.tab.title"), panel8); } panel4.add(tabbedPane1, cc.xy(1, 1)); } contentPane.add(panel4, BorderLayout.CENTER); //======== panel6 ======== { panel6.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(17)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(65)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(65)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(199)) }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)) })); //---- label21 ---- label21.setText(bundle.getString("JMuestraDatos.label21.text")); label21.setFont(new Font("Tahoma", Font.BOLD, 16)); panel6.add(label21, cc.xy(3, 1)); //---- label1 ---- label1.setText(bundle.getString("JMuestraDatos.label1.text")); label1.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel6.add(label1, cc.xy(5, 1)); //---- usbStatusLabel ---- usbStatusLabel.setText(bundle.getString("JMuestraDatos.usbStatusLabel.text")); usbStatusLabel.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel6.add(usbStatusLabel, cc.xy(7, 1)); //---- label16 ---- label16.setText(bundle.getString("JMuestraDatos.label16.text")); label16.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel6.add(label16, cc.xy(9, 1)); //---- tcpStatusLabel ---- tcpStatusLabel.setText(bundle.getString("JMuestraDatos.tcpStatusLabel.text")); tcpStatusLabel.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel6.add(tcpStatusLabel, cc.xy(11, 1)); //---- label8 ---- label8.setText(bundle.getString("JMuestraDatos.label8.text")); label8.setFont(new Font("Tahoma", Font.BOLD, 16)); panel6.add(label8, cc.xy(3, 3)); //---- databaseLabel ---- databaseLabel.setText(bundle.getString("JMuestraDatos.databaseLabel.text")); panel6.add(databaseLabel, cc.xywh(3, 5, 11, 1)); } contentPane.add(panel6, BorderLayout.SOUTH); //======== panel7 ======== { panel7.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); } contentPane.add(panel7, BorderLayout.EAST); setSize(740, 620); setLocationRelativeTo(getOwner()); // //GEN-END:initComponents }
From source file:edu.ku.brc.specify.Specify.java
/** * General Method for initializing the class * *///w w w .j a v a 2 s .co m private void initialize(final GraphicsConfiguration gc) { setLayout(new BorderLayout()); // set the preferred size of the demo setPreferredSize(new Dimension(PREFERRED_WIDTH, PREFERRED_HEIGHT)); setPreferredSize(new Dimension(1024, 768)); // For demo topFrame = new JFrame(gc); topFrame.setIconImage(IconManager.getImage(getIconName()).getImage()); //$NON-NLS-1$ //topFrame.setAlwaysOnTop(true); topFrame.setGlassPane(glassPane = GhostGlassPane.getInstance()); topFrame.setLocationRelativeTo(null); Toolkit.getDefaultToolkit().setDynamicLayout(true); UIRegistry.register(UIRegistry.GLASSPANE, glassPane); // Don't check everytime, too annoying //AppPreferences.getLocalPrefs().remove("SYSTEM.HasOpenGL"); // clear prop so it is checked UIHelper.checkForOpenGL(); JPanel top = new JPanel(); top.setLayout(new BorderLayout()); add(top, BorderLayout.NORTH); UIRegistry.setTopWindow(topFrame); menuBar = createMenus(); if (menuBar != null) { topFrame.setJMenuBar(menuBar); } UIRegistry.register(UIRegistry.MENUBAR, menuBar); JToolBar toolBar = createToolBar(); if (toolBar != null) { top.add(toolBar, BorderLayout.CENTER); } UIRegistry.register(UIRegistry.TOOLBAR, toolBar); mainPanel = new MainPanel(); int[] sections = { 5, 5, 5, 1 }; statusField = new JStatusBar(sections); statusField.setErrorIcon(IconManager.getIcon("Error", IconManager.IconSize.Std16)); //$NON-NLS-1$ statusField.setWarningIcon(IconManager.getIcon("Warning", IconManager.IconSize.Std16)); //$NON-NLS-1$ UIRegistry.setStatusBar(statusField); JLabel secLbl = statusField.getSectionLabel(3); if (secLbl != null) { boolean isSecurityOn = AppContextMgr.isSecurityOn(); secLbl.setIcon( IconManager.getImage(isSecurityOn ? "SecurityOn" : "SecurityOff", IconManager.IconSize.Std16)); secLbl.setHorizontalAlignment(SwingConstants.CENTER); secLbl.setHorizontalTextPosition(SwingConstants.LEFT); secLbl.setText(""); secLbl.setToolTipText(getResourceString("Specify.SEC_" + (isSecurityOn ? "ON" : "OFF"))); } add(statusField, BorderLayout.SOUTH); }
From source file:es.emergya.ui.plugins.admin.aux1.SummaryAction.java
private JPanel buildCabecera(final String label_cabecera, final int textfieldSize, final Icon icono, final String titulo, final String icono_seleccionado) { JLabel title = new JLabel(titulo, icono, SwingConstants.LEFT); title.setFont(LogicConstants.deriveBoldFont(12f)); JPanel resultado = new JPanel(new BorderLayout(2, 2)); resultado.setOpaque(false);//from w w w. j av a2 s. c o m resultado.add(title, BorderLayout.NORTH); JPanel cabecera = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); cabecera.setOpaque(false); JLabel nombre = new JLabel(label_cabecera, JLabel.RIGHT); gbc.gridx = 0; gbc.gridy = 0; cabecera.add(nombre, gbc); textfieldCabecera.setColumns(textfieldSize); textfieldCabecera.getDocument().addDocumentListener(changeListener); nombre.setLabelFor(textfieldCabecera); gbc.gridx++; cabecera.add(textfieldCabecera, gbc); if (icono_seleccionado != null) { JLabel nombre2 = new JLabel("Icono:", JLabel.RIGHT); gbc.gridx = 0; gbc.gridy++; cabecera.add(nombre2, gbc); ((DefaultComboBoxModel) iconos.getModel()).removeAllElements(); for (String icon : FlotaConsultas.getAllIcons("/images/" + LogicConstants.DIRECTORIO_ICONOS_FLOTAS)) { ((DefaultComboBoxModel) iconos.getModel()).addElement(icon); } for (ActionListener l : iconos.getActionListeners()) { iconos.removeActionListener(l); } iconos.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cambios = true; if (iconos.getSelectedItem() != null) { i.setIcon(LogicConstants.getIcon(LogicConstants.DIRECTORIO_ICONOS_FLOTAS + iconos.getSelectedItem().toString() + "_flota_preview")); } i.updateUI(); } }); iconos.setSelectedItem(icono_seleccionado); if (iconos.getSelectedIndex() == -1 || i.getIcon() == null) { if (iconos.getModel().getSize() > 0) iconos.setSelectedIndex(0); } cambios = false; nombre2.setLabelFor(iconos); gbc.gridx++; gbc.anchor = GridBagConstraints.WEST; cabecera.add(iconos, gbc); gbc.gridheight = 2; gbc.gridx = 2; gbc.gridy = 0; gbc.insets = new Insets(2, 10, 2, 10); gbc.ipadx = 5; gbc.ipady = 5; i.setBorder(BorderFactory.createLineBorder(Color.black)); cabecera.add(i, gbc); } resultado.add(cabecera, BorderLayout.CENTER); resultado.setBorder(new EmptyBorder(15, 15, 15, 15)); return resultado; }
From source file:ca.uhn.hl7v2.testpanel.ui.conn.Hl7ConnectionPanelBackup.java
/** * Create the panel.//w w w . j a va 2 s .c o m */ public Hl7ConnectionPanelBackup(Controller theController) { myController = theController; setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[] { 150, 0 }; gridBagLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; gridBagLayout.columnWeights = new double[] { 0.0, 1.0 }; gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE }; setLayout(gridBagLayout); mySinglePortRadio = new JRadioButton("Single Port MLLP"); mySinglePortRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updatePortsModel(); updatePortsUi(); } }); myPortButtonGroup.add(mySinglePortRadio); GridBagConstraints gbc_SinglePortRadio = new GridBagConstraints(); gbc_SinglePortRadio.anchor = GridBagConstraints.WEST; gbc_SinglePortRadio.insets = new Insets(0, 0, 5, 5); gbc_SinglePortRadio.gridx = 0; gbc_SinglePortRadio.gridy = 0; add(mySinglePortRadio, gbc_SinglePortRadio); JPanel panel_4 = new JPanel(); panel_4.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel_4 = new GridBagConstraints(); gbc_panel_4.fill = GridBagConstraints.BOTH; gbc_panel_4.insets = new Insets(0, 0, 5, 0); gbc_panel_4.gridx = 1; gbc_panel_4.gridy = 0; add(panel_4, gbc_panel_4); GridBagLayout gbl_panel_4 = new GridBagLayout(); gbl_panel_4.columnWidths = new int[] { 0, 0, 0 }; gbl_panel_4.rowHeights = new int[] { 0, 0 }; gbl_panel_4.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_panel_4.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel_4.setLayout(gbl_panel_4); mySinglePortTextBox = new JTextField(); mySinglePortTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = mySinglePortTextBox.getText(); text = text.replaceAll("[^0-9]+", ""); if (!StringUtils.equals(mySinglePortTextBox.getText(), text)) { final String newVal = text; SwingUtilities.invokeLater(new Runnable() { public void run() { mySinglePortTextBox.setText(newVal); } }); } if (mySinglePortRadio.isSelected()) { if (text.length() > 0) { myConnection.setIncomingOrSinglePort(Integer.parseInt(text)); } else { myConnection.setIncomingOrSinglePort(-1); } } } }); mylabel = new JLabel("Port"); mylabel.setHorizontalAlignment(SwingConstants.CENTER); mylabel.setPreferredSize(new Dimension(60, 16)); mylabel.setMinimumSize(new Dimension(60, 16)); mylabel.setMaximumSize(new Dimension(60, 16)); GridBagConstraints gbc_label = new GridBagConstraints(); gbc_label.anchor = GridBagConstraints.EAST; gbc_label.insets = new Insets(0, 0, 0, 5); gbc_label.gridx = 0; gbc_label.gridy = 0; panel_4.add(mylabel, gbc_label); GridBagConstraints gbc_SinglePortTextBox = new GridBagConstraints(); gbc_SinglePortTextBox.insets = new Insets(0, 5, 0, 0); gbc_SinglePortTextBox.anchor = GridBagConstraints.WEST; gbc_SinglePortTextBox.gridx = 1; gbc_SinglePortTextBox.gridy = 0; panel_4.add(mySinglePortTextBox, gbc_SinglePortTextBox); mySinglePortTextBox.setMinimumSize(new Dimension(100, 28)); mySinglePortTextBox.setMaximumSize(new Dimension(100, 2147483647)); mySinglePortTextBox.setColumns(10); myDualPortRadio = new JRadioButton("Dual Port MLLP"); myDualPortRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updatePortsModel(); updatePortsUi(); } }); myPortButtonGroup.add(myDualPortRadio); GridBagConstraints gbc_DualPortRadio = new GridBagConstraints(); gbc_DualPortRadio.anchor = GridBagConstraints.WEST; gbc_DualPortRadio.insets = new Insets(0, 0, 5, 5); gbc_DualPortRadio.gridx = 0; gbc_DualPortRadio.gridy = 1; add(myDualPortRadio, gbc_DualPortRadio); JPanel panel = new JPanel(); panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_BottomPanel = new GridBagConstraints(); gbc_BottomPanel.insets = new Insets(0, 0, 5, 0); gbc_BottomPanel.fill = GridBagConstraints.BOTH; gbc_BottomPanel.gridx = 1; gbc_BottomPanel.gridy = 1; add(panel, gbc_BottomPanel); GridBagLayout gbl_panel = new GridBagLayout(); gbl_panel.columnWidths = new int[] { 0, 0, 0, 0, 0, 0 }; gbl_panel.rowHeights = new int[] { 0, 0 }; gbl_panel.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE }; gbl_panel.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel.setLayout(gbl_panel); JLabel lblInbound = new JLabel("Inbound"); lblInbound.setHorizontalAlignment(SwingConstants.CENTER); lblInbound.setPreferredSize(new Dimension(60, 16)); lblInbound.setMinimumSize(new Dimension(60, 16)); lblInbound.setMaximumSize(new Dimension(60, 16)); GridBagConstraints gbc_lblInbound = new GridBagConstraints(); gbc_lblInbound.insets = new Insets(0, 5, 0, 5); gbc_lblInbound.anchor = GridBagConstraints.EAST; gbc_lblInbound.gridx = 0; gbc_lblInbound.gridy = 0; panel.add(lblInbound, gbc_lblInbound); myDualIncomingTextBox = new JTextField(); myDualIncomingTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = myDualIncomingTextBox.getText(); text = text.replaceAll("[^0-9]+", ""); if (!StringUtils.equals(myDualIncomingTextBox.getText(), text)) { final String newVal = text; SwingUtilities.invokeLater(new Runnable() { public void run() { myDualIncomingTextBox.setText(newVal); } }); } if (myDualPortRadio.isSelected()) { if (text.length() > 0) { myConnection.setIncomingOrSinglePort(Integer.parseInt(text)); } else { myConnection.setIncomingOrSinglePort(-1); } } } }); myDualIncomingTextBox.setMaximumSize(new Dimension(100, 2147483647)); myDualIncomingTextBox.setMinimumSize(new Dimension(100, 28)); GridBagConstraints gbc_DualIncomingTextBox = new GridBagConstraints(); gbc_DualIncomingTextBox.anchor = GridBagConstraints.WEST; gbc_DualIncomingTextBox.insets = new Insets(0, 0, 0, 5); gbc_DualIncomingTextBox.gridx = 1; gbc_DualIncomingTextBox.gridy = 0; panel.add(myDualIncomingTextBox, gbc_DualIncomingTextBox); myDualIncomingTextBox.setColumns(10); JLabel lblOutbound = new JLabel("Outbound"); GridBagConstraints gbc_lblOutbound = new GridBagConstraints(); gbc_lblOutbound.anchor = GridBagConstraints.EAST; gbc_lblOutbound.insets = new Insets(0, 0, 0, 5); gbc_lblOutbound.gridx = 2; gbc_lblOutbound.gridy = 0; panel.add(lblOutbound, gbc_lblOutbound); myDualOutgoingTextBox = new JTextField(); myDualOutgoingTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = myDualOutgoingTextBox.getText(); text = text.replaceAll("[^0-9]+", ""); if (!StringUtils.equals(myDualOutgoingTextBox.getText(), text)) { final String newVal = text; SwingUtilities.invokeLater(new Runnable() { public void run() { myDualOutgoingTextBox.setText(newVal); } }); } if (myDualPortRadio.isSelected()) { if (text.length() > 0) { myConnection.setOutgoingPort(Integer.parseInt(text)); } else { myConnection.setOutgoingPort(-1); } } } }); myDualOutgoingTextBox.setMinimumSize(new Dimension(100, 28)); myDualOutgoingTextBox.setMaximumSize(new Dimension(100, 2147483647)); GridBagConstraints gbc_DualOutgoingTextBox = new GridBagConstraints(); gbc_DualOutgoingTextBox.insets = new Insets(0, 0, 0, 5); gbc_DualOutgoingTextBox.anchor = GridBagConstraints.WEST; gbc_DualOutgoingTextBox.gridx = 3; gbc_DualOutgoingTextBox.gridy = 0; panel.add(myDualOutgoingTextBox, gbc_DualOutgoingTextBox); myDualOutgoingTextBox.setColumns(10); myHl7OverHttpRadioButton = new JRadioButton("HL7 over HTTP"); myHl7OverHttpRadioButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updatePortsModel(); updatePortsUi(); } }); myPortButtonGroup.add(myHl7OverHttpRadioButton); GridBagConstraints gbc_Hl7OverHttpRadioButton = new GridBagConstraints(); gbc_Hl7OverHttpRadioButton.anchor = GridBagConstraints.WEST; gbc_Hl7OverHttpRadioButton.insets = new Insets(0, 0, 5, 5); gbc_Hl7OverHttpRadioButton.gridx = 0; gbc_Hl7OverHttpRadioButton.gridy = 2; add(myHl7OverHttpRadioButton, gbc_Hl7OverHttpRadioButton); mypanel = new JPanel(); mypanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel = new GridBagConstraints(); gbc_panel.insets = new Insets(0, 0, 5, 0); gbc_panel.fill = GridBagConstraints.BOTH; gbc_panel.gridx = 1; gbc_panel.gridy = 2; add(mypanel, gbc_panel); GridBagLayout gbl_panel2 = new GridBagLayout(); gbl_panel2.columnWidths = new int[] { 0, 0 }; gbl_panel2.rowHeights = new int[] { 0, 0 }; gbl_panel2.columnWeights = new double[] { 0.0, 1.0 }; gbl_panel2.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; mypanel.setLayout(gbl_panel2); mylabel_1 = new JLabel("URL"); mylabel_1.setHorizontalAlignment(SwingConstants.CENTER); mylabel_1.setPreferredSize(new Dimension(60, 16)); mylabel_1.setMinimumSize(new Dimension(60, 16)); mylabel_1.setMaximumSize(new Dimension(60, 16)); GridBagConstraints gbc_label_1 = new GridBagConstraints(); gbc_label_1.anchor = GridBagConstraints.EAST; gbc_label_1.insets = new Insets(0, 0, 0, 5); gbc_label_1.gridx = 0; gbc_label_1.gridy = 0; mypanel.add(mylabel_1, gbc_label_1); myHoHUrlTextField = new JTextField(); myHoHUrlTextField.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { if (myHohUrlTextFieldUpdating) { return; } String value = myHoHUrlTextField.getText(); try { URL url = new URL(value); boolean tls; if (url.getProtocol().equals("http")) { tls = false; } else if (url.getProtocol().equals("https")) { tls = true; } else { ourLog.info("Unknown protocol: {}", url.getProtocol()); myHoHUrlTextField.setBackground(ERROR_BG); return; } myConnection.setTls(tls); myConnection.setHost(url.getHost()); myConnection .setIncomingOrSinglePort(url.getPort() != -1 ? url.getPort() : url.getDefaultPort()); myConnection.setHttpUriPath(url.getPath()); myHohUrlTextFieldUpdating = true; updatePortsUi(); myHohUrlTextFieldUpdating = false; myTlsCheckbox.setSelected(tls); myHohTlsCheckbox.setSelected(tls); myHoHUrlTextField.setBackground(Color.white); } catch (MalformedURLException e) { myHoHUrlTextField.setBackground(ERROR_BG); } } }); GridBagConstraints gbc_HohUsernameTextbox = new GridBagConstraints(); gbc_HohUsernameTextbox.fill = GridBagConstraints.HORIZONTAL; gbc_HohUsernameTextbox.gridx = 1; gbc_HohUsernameTextbox.gridy = 0; mypanel.add(myHoHUrlTextField, gbc_HohUsernameTextbox); myHoHUrlTextField.setColumns(10); JLabel lblEncoding = new JLabel("Encoding"); GridBagConstraints gbc_lblEncoding = new GridBagConstraints(); gbc_lblEncoding.insets = new Insets(0, 0, 5, 5); gbc_lblEncoding.gridx = 0; gbc_lblEncoding.gridy = 3; add(lblEncoding, gbc_lblEncoding); JPanel encodingPanel = new JPanel(); GridBagConstraints gbc_encodingPanel = new GridBagConstraints(); gbc_encodingPanel.fill = GridBagConstraints.HORIZONTAL; gbc_encodingPanel.insets = new Insets(0, 0, 5, 0); gbc_encodingPanel.gridx = 1; gbc_encodingPanel.gridy = 3; add(encodingPanel, gbc_encodingPanel); encodingPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gbl_encodingPanel = new GridBagLayout(); gbl_encodingPanel.columnWidths = new int[] { 144, 58, 0 }; gbl_encodingPanel.rowHeights = new int[] { 23, 0 }; gbl_encodingPanel.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE }; gbl_encodingPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; encodingPanel.setLayout(gbl_encodingPanel); myXmlRadio = new JRadioButton("XML"); myXmlRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent theE) { updateEncodingModel(); } }); myEr7Radio = new JRadioButton("ER7 (Pipe and hat)"); myEr7Radio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateEncodingModel(); } }); encodingButtonGroup.add(myEr7Radio); GridBagConstraints gbc_Er7Radio = new GridBagConstraints(); gbc_Er7Radio.anchor = GridBagConstraints.NORTHWEST; gbc_Er7Radio.insets = new Insets(0, 0, 0, 5); gbc_Er7Radio.gridx = 0; gbc_Er7Radio.gridy = 0; encodingPanel.add(myEr7Radio, gbc_Er7Radio); encodingButtonGroup.add(myXmlRadio); GridBagConstraints gbc_XmlRadio = new GridBagConstraints(); gbc_XmlRadio.anchor = GridBagConstraints.NORTHWEST; gbc_XmlRadio.gridx = 1; gbc_XmlRadio.gridy = 0; encodingPanel.add(myXmlRadio, gbc_XmlRadio); JLabel lblCharset = new JLabel("Charset"); GridBagConstraints gbc_lblCharset = new GridBagConstraints(); gbc_lblCharset.insets = new Insets(0, 0, 5, 5); gbc_lblCharset.gridx = 0; gbc_lblCharset.gridy = 4; add(lblCharset, gbc_lblCharset); JPanel panel_2 = new JPanel(); GridBagConstraints gbc_panel_2 = new GridBagConstraints(); gbc_panel_2.fill = GridBagConstraints.HORIZONTAL; gbc_panel_2.insets = new Insets(0, 0, 5, 0); gbc_panel_2.gridx = 1; gbc_panel_2.gridy = 4; add(panel_2, gbc_panel_2); panel_2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gbl_panel_2 = new GridBagLayout(); gbl_panel_2.columnWidths = new int[] { 28, 198, 0, 0 }; gbl_panel_2.rowHeights = new int[] { 27, 0 }; gbl_panel_2.columnWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; gbl_panel_2.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel_2.setLayout(gbl_panel_2); myCharsetSelectRadio = new JRadioButton(""); myCharsetSelectRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateCharsetModel(); } }); charsetButtonGroup.add(myCharsetSelectRadio); GridBagConstraints gbc_CharsetSelectRadio = new GridBagConstraints(); gbc_CharsetSelectRadio.anchor = GridBagConstraints.WEST; gbc_CharsetSelectRadio.insets = new Insets(0, 0, 0, 5); gbc_CharsetSelectRadio.gridx = 0; gbc_CharsetSelectRadio.gridy = 0; panel_2.add(myCharsetSelectRadio, gbc_CharsetSelectRadio); myCharsetCombo = new JComboBox(); myCharsetCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateCharsetModel(); } }); GridBagConstraints gbc_CharsetCombo = new GridBagConstraints(); gbc_CharsetCombo.anchor = GridBagConstraints.NORTHWEST; gbc_CharsetCombo.insets = new Insets(0, 0, 0, 5); gbc_CharsetCombo.gridx = 1; gbc_CharsetCombo.gridy = 0; panel_2.add(myCharsetCombo, gbc_CharsetCombo); myCharsetDetectRadio = new JRadioButton("Detect in Message (MSH-18)"); myCharsetDetectRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateCharsetModel(); } }); charsetButtonGroup.add(myCharsetDetectRadio); GridBagConstraints gbc_CharsetDetectRadio = new GridBagConstraints(); gbc_CharsetDetectRadio.anchor = GridBagConstraints.NORTH; gbc_CharsetDetectRadio.gridwidth = 2; gbc_CharsetDetectRadio.gridx = 2; gbc_CharsetDetectRadio.gridy = 0; panel_2.add(myCharsetDetectRadio, gbc_CharsetDetectRadio); mylabel_5 = new JLabel("Debug"); GridBagConstraints gbc_label_5 = new GridBagConstraints(); gbc_label_5.insets = new Insets(0, 0, 5, 5); gbc_label_5.gridx = 0; gbc_label_5.gridy = 5; add(mylabel_5, gbc_label_5); mypanel_2 = new JPanel(); mypanel_2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel_75 = new GridBagConstraints(); gbc_panel_75.insets = new Insets(0, 0, 5, 0); gbc_panel_75.fill = GridBagConstraints.BOTH; gbc_panel_75.gridx = 1; gbc_panel_75.gridy = 5; add(mypanel_2, gbc_panel_75); GridBagLayout gbl_panel_74 = new GridBagLayout(); gbl_panel_74.columnWidths = new int[] { 0, 0 }; gbl_panel_74.rowHeights = new int[] { 0, 0 }; gbl_panel_74.columnWeights = new double[] { 0.0, Double.MIN_VALUE }; gbl_panel_74.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; mypanel_2.setLayout(gbl_panel_74); myCaptureByteStreamCheckbox = new JCheckBox("Capture Bytes"); GridBagConstraints gbc_CaptureByteStreamCheckbox = new GridBagConstraints(); gbc_CaptureByteStreamCheckbox.gridx = 0; gbc_CaptureByteStreamCheckbox.gridy = 0; mypanel_2.add(myCaptureByteStreamCheckbox, gbc_CaptureByteStreamCheckbox); myCaptureByteStreamCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myConnection.setCaptureBytes(myCaptureByteStreamCheckbox.isSelected()); } }); myCaptureByteStreamCheckbox.setToolTipText("Check this box to capture the transport level communication"); myInterfaceTypeCardPanel = new JPanel(); myInterfaceTypeCardPanel.setBorder(null); GridBagConstraints gbc_InterfaceTypeCardPanel = new GridBagConstraints(); gbc_InterfaceTypeCardPanel.gridwidth = 2; gbc_InterfaceTypeCardPanel.fill = GridBagConstraints.BOTH; gbc_InterfaceTypeCardPanel.gridx = 0; gbc_InterfaceTypeCardPanel.gridy = 6; add(myInterfaceTypeCardPanel, gbc_InterfaceTypeCardPanel); myInterfaceTypeCardPanel.setLayout(new CardLayout(0, 0)); myMllpCard = new JPanel(); myMllpCard.setBorder(null); myInterfaceTypeCardPanel.add(myMllpCard, IFACE_TYPE_CARD_MLLP); GridBagLayout gbl_MllpCard = new GridBagLayout(); gbl_MllpCard.columnWidths = new int[] { 150, 0, 0 }; gbl_MllpCard.rowHeights = new int[] { 0, 0, 0, 0 }; gbl_MllpCard.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_MllpCard.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; myMllpCard.setLayout(gbl_MllpCard); JLabel lblHost = new JLabel("Host"); GridBagConstraints gbc_lblHost = new GridBagConstraints(); gbc_lblHost.insets = new Insets(0, 0, 5, 5); gbc_lblHost.gridx = 0; gbc_lblHost.gridy = 0; myMllpCard.add(lblHost, gbc_lblHost); mypanel_1 = new JPanel(); mypanel_1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel_1 = new GridBagConstraints(); gbc_panel_1.insets = new Insets(0, 0, 5, 0); gbc_panel_1.fill = GridBagConstraints.BOTH; gbc_panel_1.gridx = 1; gbc_panel_1.gridy = 0; myMllpCard.add(mypanel_1, gbc_panel_1); GridBagLayout gbl_panel_1 = new GridBagLayout(); gbl_panel_1.columnWidths = new int[] { 134, 0 }; gbl_panel_1.rowHeights = new int[] { 28, 0 }; gbl_panel_1.columnWeights = new double[] { 1.0, Double.MIN_VALUE }; gbl_panel_1.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; mypanel_1.setLayout(gbl_panel_1); myHostBox = new JTextField(); GridBagConstraints gbc_HostBox = new GridBagConstraints(); gbc_HostBox.fill = GridBagConstraints.HORIZONTAL; gbc_HostBox.anchor = GridBagConstraints.NORTH; gbc_HostBox.gridx = 0; gbc_HostBox.gridy = 0; mypanel_1.add(myHostBox, gbc_HostBox); myHostBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHost(myHostBox.getText()); } }); myHostBox.setColumns(10); JLabel lblTransport = new JLabel("Transport"); GridBagConstraints gbc_lblTransport = new GridBagConstraints(); gbc_lblTransport.insets = new Insets(0, 0, 5, 5); gbc_lblTransport.gridx = 0; gbc_lblTransport.gridy = 1; myMllpCard.add(lblTransport, gbc_lblTransport); JPanel panel_3 = new JPanel(); GridBagConstraints gbc_hohAuthPanel = new GridBagConstraints(); gbc_hohAuthPanel.fill = GridBagConstraints.HORIZONTAL; gbc_hohAuthPanel.insets = new Insets(0, 0, 5, 0); gbc_hohAuthPanel.gridx = 1; gbc_hohAuthPanel.gridy = 1; myMllpCard.add(panel_3, gbc_hohAuthPanel); panel_3.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gbl_hohAuthPanel = new GridBagLayout(); gbl_hohAuthPanel.columnWidths = new int[] { 0, 0, 0 }; gbl_hohAuthPanel.rowHeights = new int[] { 0, 0 }; gbl_hohAuthPanel.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE }; gbl_hohAuthPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel_3.setLayout(gbl_hohAuthPanel); myTlsCheckbox = new JCheckBox("Use TLS/SSL"); myTlsCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myHohTlsCheckbox.setSelected(myTlsCheckbox.isSelected()); myConnection.setTls(myTlsCheckbox.isSelected()); } }); GridBagConstraints gbc_TlsCheckbox = new GridBagConstraints(); gbc_TlsCheckbox.insets = new Insets(0, 0, 0, 5); gbc_TlsCheckbox.anchor = GridBagConstraints.WEST; gbc_TlsCheckbox.gridx = 0; gbc_TlsCheckbox.gridy = 0; panel_3.add(myTlsCheckbox, gbc_TlsCheckbox); myHoHCard = new JPanel(); myInterfaceTypeCardPanel.add(myHoHCard, IFACE_TYPE_CARD_HOH); GridBagLayout gbl_HoHCard = new GridBagLayout(); gbl_HoHCard.columnWidths = new int[] { 150, 0, 0 }; gbl_HoHCard.rowHeights = new int[] { 0, 0, 0, 0 }; gbl_HoHCard.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_HoHCard.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; myHoHCard.setLayout(gbl_HoHCard); mylabel_6 = new JLabel("Authorization"); GridBagConstraints gbc_label_6 = new GridBagConstraints(); gbc_label_6.insets = new Insets(0, 0, 5, 5); gbc_label_6.gridx = 0; gbc_label_6.gridy = 0; myHoHCard.add(mylabel_6, gbc_label_6); hohAuthPanel = new JPanel(); hohAuthPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_hohAuthPanel2 = new GridBagConstraints(); gbc_hohAuthPanel2.insets = new Insets(0, 0, 5, 0); gbc_hohAuthPanel2.fill = GridBagConstraints.BOTH; gbc_hohAuthPanel2.gridx = 1; gbc_hohAuthPanel2.gridy = 0; myHoHCard.add(hohAuthPanel, gbc_hohAuthPanel2); GridBagLayout gbl_hohAuthPanel3 = new GridBagLayout(); gbl_hohAuthPanel3.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0 }; gbl_hohAuthPanel3.rowHeights = new int[] { 0, 0 }; gbl_hohAuthPanel3.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE }; gbl_hohAuthPanel3.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; hohAuthPanel.setLayout(gbl_hohAuthPanel3); myHohAuthEnabledCheckbox = new JCheckBox("Enabled"); myHohAuthEnabledCheckbox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent theE) { myConnection.setHohAuthenticationEnabled(myHohAuthEnabledCheckbox.isSelected()); } }); GridBagConstraints gbc_HohAuthEnabledCheckbox = new GridBagConstraints(); gbc_HohAuthEnabledCheckbox.insets = new Insets(0, 0, 0, 5); gbc_HohAuthEnabledCheckbox.gridx = 0; gbc_HohAuthEnabledCheckbox.gridy = 0; hohAuthPanel.add(myHohAuthEnabledCheckbox, gbc_HohAuthEnabledCheckbox); mylabel_7 = new JLabel("Username:"); GridBagConstraints gbc_label_7 = new GridBagConstraints(); gbc_label_7.insets = new Insets(0, 0, 0, 5); gbc_label_7.anchor = GridBagConstraints.EAST; gbc_label_7.gridx = 1; gbc_label_7.gridy = 0; hohAuthPanel.add(mylabel_7, gbc_label_7); myHohAuthUsernameTextbox = new JTextField(); myHohAuthUsernameTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohAuthenticationUsername(myHohAuthUsernameTextbox.getText()); } }); myHohAuthUsernameTextbox.setMaximumSize(new Dimension(200, 2147483647)); myHohAuthUsernameTextbox.setMinimumSize(new Dimension(100, 28)); myHohAuthUsernameTextbox.setPreferredSize(new Dimension(100, 28)); GridBagConstraints gbc_HohUsernameTextbox2 = new GridBagConstraints(); gbc_HohUsernameTextbox2.insets = new Insets(0, 0, 0, 5); gbc_HohUsernameTextbox2.fill = GridBagConstraints.HORIZONTAL; gbc_HohUsernameTextbox2.gridx = 2; gbc_HohUsernameTextbox2.gridy = 0; hohAuthPanel.add(myHohAuthUsernameTextbox, gbc_HohUsernameTextbox2); myHohAuthUsernameTextbox.setColumns(10); mylabel_8 = new JLabel("Password:"); GridBagConstraints gbc_label_8 = new GridBagConstraints(); gbc_label_8.insets = new Insets(0, 0, 0, 5); gbc_label_8.anchor = GridBagConstraints.EAST; gbc_label_8.gridx = 3; gbc_label_8.gridy = 0; hohAuthPanel.add(mylabel_8, gbc_label_8); myHohAuthPasswordTextbox = new JTextField(); myHohAuthPasswordTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohAuthenticationPassword(myHohAuthPasswordTextbox.getText()); } }); myHohAuthPasswordTextbox.setPreferredSize(new Dimension(100, 28)); myHohAuthPasswordTextbox.setMaximumSize(new Dimension(200, 2147483647)); myHohAuthPasswordTextbox.setMinimumSize(new Dimension(100, 28)); GridBagConstraints gbc_textField = new GridBagConstraints(); gbc_textField.insets = new Insets(0, 0, 0, 5); gbc_textField.fill = GridBagConstraints.HORIZONTAL; gbc_textField.gridx = 4; gbc_textField.gridy = 0; hohAuthPanel.add(myHohAuthPasswordTextbox, gbc_textField); myHohAuthPasswordTextbox.setColumns(10); mylabel_2 = new JLabel("Security Profile"); GridBagConstraints gbc_label_2 = new GridBagConstraints(); gbc_label_2.insets = new Insets(0, 0, 5, 5); gbc_label_2.gridx = 0; gbc_label_2.gridy = 1; myHoHCard.add(mylabel_2, gbc_label_2); securityProfilePanel = new JPanel(); GridBagConstraints gbc_securityProfilePanel = new GridBagConstraints(); gbc_securityProfilePanel.insets = new Insets(0, 0, 5, 0); gbc_securityProfilePanel.fill = GridBagConstraints.BOTH; gbc_securityProfilePanel.gridx = 1; gbc_securityProfilePanel.gridy = 1; myHoHCard.add(securityProfilePanel, gbc_securityProfilePanel); securityProfilePanel.setLayout(new BorderLayout(0, 0)); myHohTlsCheckbox = new JCheckBox("TLS Enabled"); myHohTlsCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myConnection.setTls(myHohTlsCheckbox.isSelected()); myTlsCheckbox.setSelected(myHohTlsCheckbox.isSelected()); updatePortsUi(); } }); securityProfilePanel.add(myHohTlsCheckbox, BorderLayout.WEST); tlsKeystorePanel = new JPanel(); tlsKeystorePanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); securityProfilePanel.add(tlsKeystorePanel, BorderLayout.CENTER); GridBagLayout gbl_tlsKeystorePanel = new GridBagLayout(); gbl_tlsKeystorePanel.columnWidths = new int[] { 58, 107, 77, 0, 0 }; gbl_tlsKeystorePanel.rowHeights = new int[] { 28, 16, 0 }; gbl_tlsKeystorePanel.columnWeights = new double[] { 0.0, 1.0, 1.0, 0.0, Double.MIN_VALUE }; gbl_tlsKeystorePanel.rowWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE }; tlsKeystorePanel.setLayout(gbl_tlsKeystorePanel); mylabel_3 = new JLabel("Keystore:"); GridBagConstraints gbc_label_3 = new GridBagConstraints(); gbc_label_3.anchor = GridBagConstraints.WEST; gbc_label_3.fill = GridBagConstraints.VERTICAL; gbc_label_3.insets = new Insets(0, 0, 5, 5); gbc_label_3.gridx = 0; gbc_label_3.gridy = 0; tlsKeystorePanel.add(mylabel_3, gbc_label_3); myHohSecurityKeystoreTextbox = new JTextField(); GridBagConstraints gbc_HohKeystoreTextbox = new GridBagConstraints(); gbc_HohKeystoreTextbox.gridwidth = 2; gbc_HohKeystoreTextbox.anchor = GridBagConstraints.NORTH; gbc_HohKeystoreTextbox.fill = GridBagConstraints.HORIZONTAL; gbc_HohKeystoreTextbox.insets = new Insets(0, 0, 5, 5); gbc_HohKeystoreTextbox.gridx = 1; gbc_HohKeystoreTextbox.gridy = 0; tlsKeystorePanel.add(myHohSecurityKeystoreTextbox, gbc_HohKeystoreTextbox); myHohSecurityKeystoreTextbox.setColumns(10); myHohSecurityKeystoreTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = myHohSecurityKeystoreTextbox.getText(); myHohSecurityKeyPwTextBox.setEnabled(isNotBlank(text)); myConnection.setTlsKeystoreLocation(text); scheduleHohSecurityKeystoreCheck(); } }); myHohSecurityKeystoreChooseBtn = new JButton("Choose"); myHohSecurityKeystoreChooseBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String directory = Prefs.getInstance().getInterfaceHohSecurityKeystoreDirectory(); directory = StringUtils.defaultString(directory, "."); JFileChooser chooser = new JFileChooser(directory); chooser.setDialogType(JFileChooser.OPEN_DIALOG); chooser.setDialogTitle("Select a Java Keystore"); int result = chooser.showOpenDialog(Hl7ConnectionPanelBackup.this); if (result == JFileChooser.APPROVE_OPTION) { Prefs.getInstance() .setInterfaceHohSecurityKeystoreDirectory(chooser.getSelectedFile().getParent()); myHohSecurityKeystoreTextbox.setText(chooser.getSelectedFile().getAbsolutePath()); } } }); myHohSecurityKeystoreChooseBtn.setIcon(new ImageIcon( Hl7ConnectionPanelBackup.class.getResource("/ca/uhn/hl7v2/testpanel/images/open.png"))); GridBagConstraints gbc_button = new GridBagConstraints(); gbc_button.insets = new Insets(0, 0, 5, 0); gbc_button.gridx = 3; gbc_button.gridy = 0; tlsKeystorePanel.add(myHohSecurityKeystoreChooseBtn, gbc_button); mylabel_4 = new JLabel("Store Pass:"); GridBagConstraints gbc_label_4 = new GridBagConstraints(); gbc_label_4.insets = new Insets(0, 0, 0, 5); gbc_label_4.anchor = GridBagConstraints.EAST; gbc_label_4.gridx = 0; gbc_label_4.gridy = 1; tlsKeystorePanel.add(mylabel_4, gbc_label_4); myHohSecurityKeyPwTextBox = new JTextField(); myHohSecurityKeyPwTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setTlsKeystorePassword(myHohSecurityKeyPwTextBox.getText()); scheduleHohSecurityKeystoreCheck(); } }); GridBagConstraints gbc_HohSecurityKeyPwTextBox = new GridBagConstraints(); gbc_HohSecurityKeyPwTextBox.insets = new Insets(0, 0, 0, 5); gbc_HohSecurityKeyPwTextBox.fill = GridBagConstraints.HORIZONTAL; gbc_HohSecurityKeyPwTextBox.gridx = 1; gbc_HohSecurityKeyPwTextBox.gridy = 1; tlsKeystorePanel.add(myHohSecurityKeyPwTextBox, gbc_HohSecurityKeyPwTextBox); myHohSecurityKeyPwTextBox.setColumns(10); myHohSecurityProfileKeystoreStatus = new JLabel("Value goes here"); myHohSecurityProfileKeystoreStatus.setHorizontalAlignment(SwingConstants.LEFT); GridBagConstraints gbc_HohSecurityProfileKeystoreStatus = new GridBagConstraints(); gbc_HohSecurityProfileKeystoreStatus.anchor = GridBagConstraints.NORTH; gbc_HohSecurityProfileKeystoreStatus.fill = GridBagConstraints.HORIZONTAL; gbc_HohSecurityProfileKeystoreStatus.gridwidth = 2; gbc_HohSecurityProfileKeystoreStatus.gridx = 2; gbc_HohSecurityProfileKeystoreStatus.gridy = 1; tlsKeystorePanel.add(myHohSecurityProfileKeystoreStatus, gbc_HohSecurityProfileKeystoreStatus); init(); }