List of usage examples for java.awt GridBagConstraints HORIZONTAL
int HORIZONTAL
To view the source code for java.awt GridBagConstraints HORIZONTAL.
Click Source Link
From source file:simMPLS.ui.simulator.JVentanaHija.java
/** Este mtodo es llamado desde el constructor para actualizar la mayor parte de * los atributos de la clase que tienen que ver con la interfaz de usuario. Es un * mtodo creado por NetBeans automaticamente. * @since 1.0//from www. j a v a 2s. co m */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; diseElementoPopUp = new javax.swing.JPopupMenu(); dEliminarMenuItem = new javax.swing.JMenuItem(); dVerNombreMenuItem = new javax.swing.JCheckBoxMenuItem(); jSeparator1 = new javax.swing.JSeparator(); dPropiedadesMenuItem = new javax.swing.JMenuItem(); diseFondoPopUp = new javax.swing.JPopupMenu(); dVerNombresNodosMenuItem = new javax.swing.JMenuItem(); dOcultarNombresNodosMenuItem = new javax.swing.JMenuItem(); dVerNombresEnlacesMenuItem = new javax.swing.JMenuItem(); dOcultarNombresEnlacesMenuItem = new javax.swing.JMenuItem(); jSeparator2 = new javax.swing.JSeparator(); dEliminarTodoMenuItem = new javax.swing.JMenuItem(); jTabbedPane1 = new javax.swing.JTabbedPane(); panelDisenioSuperior = new javax.swing.JPanel(); panelBotonesDisenio = new javax.swing.JPanel(); iconoEmisor = new javax.swing.JLabel(); iconoReceptor = new javax.swing.JLabel(); iconoLER = new javax.swing.JLabel(); iconoLERA = new javax.swing.JLabel(); iconoLSR = new javax.swing.JLabel(); iconoLSRA = new javax.swing.JLabel(); iconoEnlace = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); panelDisenio = new simMPLS.ui.simulator.JPanelDisenio(); panelSimulacionSuperior = new javax.swing.JPanel(); panelBotonesSimulacion = new javax.swing.JPanel(); iconoComenzar = new javax.swing.JLabel(); iconoFinalizar = new javax.swing.JLabel(); iconoReanudar = new javax.swing.JLabel(); iconoPausar = new javax.swing.JLabel(); barraDeProgreso = new javax.swing.JProgressBar(); mlsPorTic = new javax.swing.JSlider(); etiquetaMlsPorTic = new javax.swing.JLabel(); crearTraza = new javax.swing.JCheckBox(); jScrollPane2 = new javax.swing.JScrollPane(); panelSimulacion = new simMPLS.ui.simulator.JSimulationPanel(); panelAnalisisSuperior = new javax.swing.JPanel(); panelSeleccionElemento = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); selectorElementoEstadisticas = new javax.swing.JComboBox(); jScrollPane4 = new javax.swing.JScrollPane(); panelAnalisis = new javax.swing.JPanel(); panelFijo = new javax.swing.JPanel(); etiquetaEstadisticasTituloEscenario = new javax.swing.JLabel(); etiquetaEstadisticasNombreAutor = new javax.swing.JLabel(); areaEstadisticasDescripcion = new javax.swing.JTextArea(); etiquetaNombreElementoEstadistica = new javax.swing.JLabel(); panelOpcionesSuperior = new javax.swing.JPanel(); jScrollPane3 = new javax.swing.JScrollPane(); panelOpciones = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); nombreEscenario = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); nombreAutor = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel(); descripcionEscenario = new javax.swing.JTextField(); jPanel2 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); duracionMs = new javax.swing.JSlider(); etiquetaDuracionMs = new javax.swing.JLabel(); duracionNs = new javax.swing.JSlider(); etiquetaDuracionNs = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); pasoNs = new javax.swing.JSlider(); etiquetaPasoNs = new javax.swing.JLabel(); diseElementoPopUp.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dEliminarMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dEliminarMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("VentanaHija.PopUpDisenio.mne.Delete").charAt(0)); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes"); // NOI18N dEliminarMenuItem.setText(bundle.getString("VentanaHija.PopUpDisenio.Delete")); // NOI18N dEliminarMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioEliminar(evt); } }); diseElementoPopUp.add(dEliminarMenuItem); dVerNombreMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dVerNombreMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("VentanaHija.PopUpDisenio.mne.verNombre").charAt(0)); dVerNombreMenuItem.setText(bundle.getString("VentanaHija.PopUpDisenio.verNombre")); // NOI18N dVerNombreMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioVerNombre(evt); } }); diseElementoPopUp.add(dVerNombreMenuItem); diseElementoPopUp.add(jSeparator1); dPropiedadesMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dPropiedadesMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("VentanaHija.PopUpDisenio.mne.Propiedades").charAt(0)); dPropiedadesMenuItem.setText(bundle.getString("VentanaHija.PopUpDisenio.Propiedades")); // NOI18N dPropiedadesMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPropiedadesPopUpDisenioElemento(evt); } }); diseElementoPopUp.add(dPropiedadesMenuItem); diseFondoPopUp.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dVerNombresNodosMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dVerNombresNodosMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("popUpDisenioFondo.mne.verTodosNodos").charAt(0)); dVerNombresNodosMenuItem.setText(bundle.getString("popUpDisenioFondo.verTodosNodos")); // NOI18N dVerNombresNodosMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioFondoVerNombreNodos(evt); } }); diseFondoPopUp.add(dVerNombresNodosMenuItem); dOcultarNombresNodosMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dOcultarNombresNodosMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("popUpDisenioFondo.mne.ocultarTodosNodos").charAt(0)); dOcultarNombresNodosMenuItem.setText(bundle.getString("popUpDisenioFondo.ocultarTodosNodos")); // NOI18N dOcultarNombresNodosMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioFondoOcultarNombreNodos(evt); } }); diseFondoPopUp.add(dOcultarNombresNodosMenuItem); dVerNombresEnlacesMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dVerNombresEnlacesMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("popUpDisenioFondo.mne.verTodosEnlaces").charAt(0)); dVerNombresEnlacesMenuItem.setText(bundle.getString("popUpDisenioFondo.verTodosEnlaces")); // NOI18N dVerNombresEnlacesMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioFondoVerNombreEnlaces(evt); } }); diseFondoPopUp.add(dVerNombresEnlacesMenuItem); dOcultarNombresEnlacesMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dOcultarNombresEnlacesMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("popUpDisenioFondo.mne.ocultarTodosEnlaces").charAt(0)); dOcultarNombresEnlacesMenuItem.setText(bundle.getString("popUpDisenioFondo.ocultarTodosEnlaces")); // NOI18N dOcultarNombresEnlacesMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioFondoOcultarNombreEnlaces(evt); } }); diseFondoPopUp.add(dOcultarNombresEnlacesMenuItem); diseFondoPopUp.add(jSeparator2); dEliminarTodoMenuItem.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N dEliminarTodoMenuItem.setMnemonic(java.util.ResourceBundle.getBundle("simMPLS/lenguajes/lenguajes") .getString("popUpDisenioFondo.mne.eliminarTodo").charAt(0)); dEliminarTodoMenuItem.setText(bundle.getString("popUpDisenioFondo.borrarTodo")); // NOI18N dEliminarTodoMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnPopUpDisenioFondoEliminar(evt); } }); diseFondoPopUp.add(dEliminarTodoMenuItem); setIconifiable(true); setMaximizable(true); setResizable(true); setTitle(bundle.getString("VentanaHija.Titulo")); // NOI18N setAutoscrolls(true); setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N setFrameIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.ICONO_VENTANA_INTERNA_MENU)); setNormalBounds(new java.awt.Rectangle(10, 10, 100, 100)); setPreferredSize(new java.awt.Dimension(100, 100)); setVisible(true); jTabbedPane1.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT); jTabbedPane1.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N panelDisenioSuperior.setLayout(new java.awt.BorderLayout()); panelBotonesDisenio.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelBotonesDisenio.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT)); iconoEmisor.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.EMISOR_MENU)); iconoEmisor.setToolTipText(bundle.getString("VentanaHija.Topic.Emisor")); // NOI18N iconoEmisor.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoEmisor(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoEmisor(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirEmisorDeTrafico(evt); } }); panelBotonesDisenio.add(iconoEmisor); iconoReceptor.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.RECEPTOR_MENU)); iconoReceptor.setToolTipText(bundle.getString("VentanaHija.Topic.Receptor")); // NOI18N iconoReceptor.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoReceptor(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoReceptor(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirReceptor(evt); } }); panelBotonesDisenio.add(iconoReceptor); iconoLER.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.LER_MENU)); iconoLER.setToolTipText(bundle.getString("VentanaHija.Topic.LER")); // NOI18N iconoLER.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoLER(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoLER(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirLER(evt); } }); panelBotonesDisenio.add(iconoLER); iconoLERA.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.LERA_MENU)); iconoLERA.setToolTipText(bundle.getString("VentanaHija.Topic.LERActivo")); // NOI18N iconoLERA.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoLERA(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoLERA(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirLERA(evt); } }); panelBotonesDisenio.add(iconoLERA); iconoLSR.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.LSR_MENU)); iconoLSR.setToolTipText(bundle.getString("VentanaHija.Topic.LSR")); // NOI18N iconoLSR.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoLSR(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoLSR(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirLSR(evt); } }); panelBotonesDisenio.add(iconoLSR); iconoLSRA.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.LSRA_MENU)); iconoLSRA.setToolTipText(bundle.getString("VentanaHija.Topic.LSRActivo")); // NOI18N iconoLSRA.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoLSRA(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoLSRA(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnAniadirLSRA(evt); } }); panelBotonesDisenio.add(iconoLSRA); iconoEnlace.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.ENLACE_MENU)); iconoEnlace.setToolTipText(bundle.getString("VentanaHija.Topic.Enlace")); // NOI18N iconoEnlace.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { clicEnAniadirEnlace(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoEnlace(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDeIconoEnlace(evt); } }); panelBotonesDisenio.add(iconoEnlace); panelDisenioSuperior.add(panelBotonesDisenio, java.awt.BorderLayout.NORTH); jScrollPane1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); panelDisenio.setBackground(java.awt.Color.white); panelDisenio.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelDisenio.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { clicDerechoEnPanelDisenio(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnPanelDisenio(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { clicSoltadoEnPanelDisenio(evt); } }); panelDisenio.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { arrastrandoEnPanelDisenio(evt); } public void mouseMoved(java.awt.event.MouseEvent evt) { ratonSobrePanelDisenio(evt); } }); panelDisenio.setLayout(null); jScrollPane1.setViewportView(panelDisenio); panelDisenioSuperior.add(jScrollPane1, java.awt.BorderLayout.CENTER); jTabbedPane1.addTab(bundle.getString("VentanaHija.Tab.Disenio"), dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.DISENIO), panelDisenioSuperior, bundle.getString("VentanaHija.A_panel_to_design_network_topology")); // NOI18N panelSimulacionSuperior.setLayout(new java.awt.BorderLayout()); panelBotonesSimulacion.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelBotonesSimulacion.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT)); iconoComenzar.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.BOTON_GENERAR)); iconoComenzar.setToolTipText(bundle.getString("VentanaHija.Topic.Generar")); // NOI18N iconoComenzar.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoComenzar(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDelIconoComenzar(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnComenzar(evt); } }); panelBotonesSimulacion.add(iconoComenzar); iconoFinalizar.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.BOTON_PARAR)); iconoFinalizar.setToolTipText(bundle.getString("VentanaHija.Topic.Finalizar")); // NOI18N iconoFinalizar.setEnabled(false); iconoFinalizar.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoFinalizar(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDelIconoFinalizar(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnFinalizar(evt); } }); panelBotonesSimulacion.add(iconoFinalizar); iconoReanudar.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.BOTON_COMENZAR)); iconoReanudar.setToolTipText(bundle.getString("VentanaHija.Topic.Simulacion")); // NOI18N iconoReanudar.setEnabled(false); iconoReanudar.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoReanudar(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDelIconoReanudar(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnReanudar(evt); } }); panelBotonesSimulacion.add(iconoReanudar); iconoPausar.setIcon(dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.BOTON_PAUSA)); iconoPausar.setToolTipText(bundle.getString("VentanaHija.Topic.Detener")); // NOI18N iconoPausar.setEnabled(false); iconoPausar.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { ratonEntraEnIconoPausar(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { ratonSaleDelIconoPausar(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicAlPausar(evt); } }); panelBotonesSimulacion.add(iconoPausar); barraDeProgreso.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N barraDeProgreso.setToolTipText(bundle.getString("VentanaHija.BarraProgreso.tooltip")); // NOI18N barraDeProgreso.setStringPainted(true); panelBotonesSimulacion.add(barraDeProgreso); mlsPorTic.setMajorTickSpacing(10); mlsPorTic.setMaximum(500); mlsPorTic.setMinimum(1); mlsPorTic.setMinorTickSpacing(1); mlsPorTic.setSnapToTicks(true); mlsPorTic.setToolTipText(bundle.getString("VentanaHija.Simulacion.SelectorDeVelocidad.tooltip")); // NOI18N mlsPorTic.setPreferredSize(new java.awt.Dimension(100, 20)); mlsPorTic.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { mlsPorTicCambiado(evt); } }); panelBotonesSimulacion.add(mlsPorTic); etiquetaMlsPorTic.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N etiquetaMlsPorTic.setForeground(new java.awt.Color(102, 102, 102)); panelBotonesSimulacion.add(etiquetaMlsPorTic); crearTraza.setText(bundle.getString("JVentanaHija.Create_trace_file")); // NOI18N panelBotonesSimulacion.add(crearTraza); panelSimulacionSuperior.add(panelBotonesSimulacion, java.awt.BorderLayout.NORTH); jScrollPane2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); panelSimulacion.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelSimulacion.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { ratonPulsadoYSoltadoEnPanelSimulacion(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { clicEnPanelSimulacion(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { ratonSoltadoEnPanelSimulacion(evt); } }); panelSimulacion.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { ratonArrastradoEnPanelSimulacion(evt); } public void mouseMoved(java.awt.event.MouseEvent evt) { ratonSobrePanelSimulacion(evt); } }); jScrollPane2.setViewportView(panelSimulacion); panelSimulacionSuperior.add(jScrollPane2, java.awt.BorderLayout.CENTER); jTabbedPane1.addTab(bundle.getString("VentanaHija.Tab.Simulacion"), dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.SIMULACION), panelSimulacionSuperior, bundle.getString("VentanaHija.A_panel_to_generate_and_play_simulation.")); // NOI18N panelAnalisisSuperior.setLayout(new java.awt.BorderLayout()); panelSeleccionElemento.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelSeleccionElemento.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT)); jLabel1.setText(bundle.getString("JVentanaHija.SelcUnElemParaVerDatos")); // NOI18N panelSeleccionElemento.add(jLabel1); selectorElementoEstadisticas.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "" })); selectorElementoEstadisticas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clicEnSeleccionalElementoEstadistica(evt); } }); panelSeleccionElemento.add(selectorElementoEstadisticas); panelAnalisisSuperior.add(panelSeleccionElemento, java.awt.BorderLayout.NORTH); jScrollPane4.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); panelAnalisis.setBackground(new java.awt.Color(252, 246, 226)); panelAnalisis.setLayout(new java.awt.GridBagLayout()); panelFijo.setBackground(new java.awt.Color(252, 246, 226)); panelFijo.setLayout(new java.awt.GridBagLayout()); etiquetaEstadisticasTituloEscenario.setBackground(new java.awt.Color(252, 246, 226)); etiquetaEstadisticasTituloEscenario.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N etiquetaEstadisticasTituloEscenario.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); etiquetaEstadisticasTituloEscenario.setText(bundle.getString("JVentanaHija.TituloDelEscenario")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; panelFijo.add(etiquetaEstadisticasTituloEscenario, gridBagConstraints); etiquetaEstadisticasNombreAutor.setBackground(new java.awt.Color(252, 246, 226)); etiquetaEstadisticasNombreAutor.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N etiquetaEstadisticasNombreAutor.setForeground(new java.awt.Color(102, 0, 51)); etiquetaEstadisticasNombreAutor.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); etiquetaEstadisticasNombreAutor.setText(bundle.getString("JVentanaHija.AutorDelEscenario")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; panelFijo.add(etiquetaEstadisticasNombreAutor, gridBagConstraints); areaEstadisticasDescripcion.setBackground(new java.awt.Color(252, 246, 226)); areaEstadisticasDescripcion.setEditable(false); areaEstadisticasDescripcion.setFont(new java.awt.Font("MonoSpaced", 0, 11)); // NOI18N areaEstadisticasDescripcion.setLineWrap(true); areaEstadisticasDescripcion.setRows(3); areaEstadisticasDescripcion.setText(bundle.getString("JVentanaHija.DescripcionDelEscenario")); // NOI18N areaEstadisticasDescripcion.setWrapStyleWord(true); areaEstadisticasDescripcion.setMinimumSize(new java.awt.Dimension(500, 16)); areaEstadisticasDescripcion.setPreferredSize(new java.awt.Dimension(500, 48)); areaEstadisticasDescripcion.setAutoscrolls(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; panelFijo.add(areaEstadisticasDescripcion, gridBagConstraints); etiquetaNombreElementoEstadistica.setBackground(new java.awt.Color(252, 246, 226)); etiquetaNombreElementoEstadistica.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N etiquetaNombreElementoEstadistica.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); etiquetaNombreElementoEstadistica.setText(bundle.getString("JVentanaHija.SeleccioneNodoAInspeccionar")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; panelFijo.add(etiquetaNombreElementoEstadistica, gridBagConstraints); panelAnalisis.add(panelFijo, new java.awt.GridBagConstraints()); jScrollPane4.setViewportView(panelAnalisis); panelAnalisisSuperior.add(jScrollPane4, java.awt.BorderLayout.CENTER); jTabbedPane1.addTab(bundle.getString("JVentanaHija.Analisis"), dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.ANALISIS), panelAnalisisSuperior, bundle.getString("JVentanaHija.Analisis.Tooltip")); // NOI18N panelOpcionesSuperior.setLayout(new java.awt.BorderLayout()); jScrollPane3.setBorder(null); panelOpciones.setPreferredSize(new java.awt.Dimension(380, 230)); panelOpciones.setLayout(new java.awt.GridBagLayout()); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, bundle.getString("VentanaHija.GParameters"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 12))); // NOI18N jPanel3.setLayout(new java.awt.GridBagLayout()); jLabel5.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel5.setText(bundle.getString("VentanaHija.Scene_title")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(jLabel5, gridBagConstraints); nombreEscenario.setToolTipText(bundle.getString("VentanaHija.Type_a__title_of_the_scene")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 200.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(nombreEscenario, gridBagConstraints); jLabel6.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel6.setText(bundle.getString("VentanaHija.Scene_author")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(jLabel6, gridBagConstraints); nombreAutor.setToolTipText(bundle.getString("VentanaHija.Type_de_name_of_the_author")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 200.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(nombreAutor, gridBagConstraints); jLabel7.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel7.setText(bundle.getString("VentanaHija.Description")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(jLabel7, gridBagConstraints); descripcionEscenario.setToolTipText(bundle.getString("VentanaHija.Enter_a_short_description.")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 200.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel3.add(descripcionEscenario, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 350.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); panelOpciones.add(jPanel3, gridBagConstraints); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, bundle.getString("VentanaHija.TParameters"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 12))); // NOI18N jPanel2.setLayout(new java.awt.GridBagLayout()); jLabel3.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel3.setText(bundle.getString("VentanaHija.Duration")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 100.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(jLabel3, gridBagConstraints); duracionMs.setMajorTickSpacing(10); duracionMs.setMaximum(10); duracionMs.setMinorTickSpacing(1); duracionMs.setToolTipText( bundle.getString("VentanaHija.Slide_it_to_change_the_ms._component_of_simulation_duration.")); // NOI18N duracionMs.setValue(0); duracionMs.setMaximumSize(new java.awt.Dimension(30, 20)); duracionMs.setMinimumSize(new java.awt.Dimension(30, 24)); duracionMs.setPreferredSize(new java.awt.Dimension(30, 20)); duracionMs.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { clicEnDuracionMs(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 150.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(duracionMs, gridBagConstraints); etiquetaDuracionMs.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N etiquetaDuracionMs.setForeground(new java.awt.Color(102, 102, 102)); etiquetaDuracionMs.setText(bundle.getString("VentanaHija.ms.")); // NOI18N etiquetaDuracionMs.setMaximumSize(new java.awt.Dimension(30, 14)); etiquetaDuracionMs.setMinimumSize(new java.awt.Dimension(30, 14)); etiquetaDuracionMs.setPreferredSize(new java.awt.Dimension(30, 14)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 40.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(etiquetaDuracionMs, gridBagConstraints); duracionNs.setMajorTickSpacing(1000); duracionNs.setMaximum(999999); duracionNs.setMinorTickSpacing(100); duracionNs.setToolTipText( bundle.getString("VentanaHija.Slide_it_to_change_the_ns._component_of_simulation_duration.")); // NOI18N duracionNs.setValue(100000); duracionNs.setMaximumSize(new java.awt.Dimension(32767, 20)); duracionNs.setMinimumSize(new java.awt.Dimension(36, 20)); duracionNs.setPreferredSize(new java.awt.Dimension(200, 20)); duracionNs.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { clicEnDuracionNs(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 150.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(duracionNs, gridBagConstraints); etiquetaDuracionNs.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N etiquetaDuracionNs.setForeground(new java.awt.Color(102, 102, 102)); etiquetaDuracionNs.setText(bundle.getString("VentanaHija.ns.")); // NOI18N etiquetaDuracionNs.setMaximumSize(new java.awt.Dimension(40, 14)); etiquetaDuracionNs.setMinimumSize(new java.awt.Dimension(40, 14)); etiquetaDuracionNs.setPreferredSize(new java.awt.Dimension(40, 14)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 100.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(etiquetaDuracionNs, gridBagConstraints); jLabel4.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel4.setText(bundle.getString("VentanaHija.Step")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 100.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(jLabel4, gridBagConstraints); pasoNs.setMajorTickSpacing(1000); pasoNs.setMaximum(999999); pasoNs.setMinimum(1); pasoNs.setMinorTickSpacing(100); pasoNs.setToolTipText(bundle.getString("VentanaHija.Slide_it_to_change_the_step_duration_(ns)..")); // NOI18N pasoNs.setValue(10000); pasoNs.setMaximumSize(new java.awt.Dimension(32767, 20)); pasoNs.setPreferredSize(new java.awt.Dimension(100, 20)); pasoNs.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { clicEnPasoNs(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(pasoNs, gridBagConstraints); etiquetaPasoNs.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N etiquetaPasoNs.setForeground(new java.awt.Color(102, 102, 102)); etiquetaPasoNs.setText(bundle.getString("VentanaHija.ns.")); // NOI18N etiquetaPasoNs.setMaximumSize(new java.awt.Dimension(40, 14)); etiquetaPasoNs.setMinimumSize(new java.awt.Dimension(40, 14)); etiquetaPasoNs.setPreferredSize(new java.awt.Dimension(40, 14)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 100.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); jPanel2.add(etiquetaPasoNs, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 350.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); panelOpciones.add(jPanel2, gridBagConstraints); jScrollPane3.setViewportView(panelOpciones); panelOpcionesSuperior.add(jScrollPane3, java.awt.BorderLayout.NORTH); jTabbedPane1.addTab(bundle.getString("VentanaHija.Options"), dispensadorDeImagenes.obtenerIcono(simMPLS.ui.utils.TImagesBroker.OPCIONES), panelOpcionesSuperior, bundle.getString("VentanaHija.Options_about_the_scene")); // NOI18N getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER); pack(); }
From source file:com.rapidminer.gui.new_plotter.gui.ColorSchemeDialog.java
/** * @return/*w w w . j a v a2 s . c om*/ */ private JPanel createSchemeComboBoxPanel() { JPanel schemeListPanel = new JPanel(new GridBagLayout()); // create categories configuration panel { GridBagConstraints itemConstraint = new GridBagConstraints(); // Add active scheme label JLabel actviceSchemeLabel = new ResourceLabel( "plotter.configuration_dialog.color_scheme_dialog.active_scheme"); { itemConstraint.fill = GridBagConstraints.HORIZONTAL; itemConstraint.anchor = GridBagConstraints.WEST; itemConstraint.gridwidth = GridBagConstraints.RELATIVE; itemConstraint.insets = new Insets(0, 5, 5, 5); itemConstraint.weightx = 1.0; actviceSchemeLabel.setBackground(Color.red); schemeListPanel.add(actviceSchemeLabel, itemConstraint); } // add button panel { JPanel buttonPanel = new JPanel(new GridBagLayout()); // rename scheme button { renameSchemeButton = new JButton(new ResourceAction(true, "plotter.configuration_dialog.color_scheme_dialog.rename_scheme_button") { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { String newName = createNameDialog(currentActiveColorSchemeName); if (newName != null && !newName.equals(currentActiveColorSchemeName)) { renameColorSchemeAction(newName); } } }); itemConstraint = new GridBagConstraints(); itemConstraint.gridwidth = GridBagConstraints.RELATIVE; itemConstraint.fill = GridBagConstraints.NONE; buttonPanel.add(renameSchemeButton, itemConstraint); } // remove scheme button { removeSchemeButton = new JButton(new ResourceAction(true, "plotter.configuration_dialog.color_scheme_dialog.remove_scheme_button") { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { ConfirmDialog dialog = new ConfirmDialog( SwingUtilities.getWindowAncestor((Component) e.getSource()), "plotter.configuration_dialog.confirm_color_scheme_delete", ConfirmDialog.YES_NO_OPTION, false); dialog.setLocationRelativeTo((Component) e.getSource()); dialog.setVisible(true); if (dialog.getReturnOption() == ConfirmDialog.YES_OPTION) { removeColorSchemeAction((ColorScheme) colorSchemeComboBox.getSelectedItem()); } } }); itemConstraint = new GridBagConstraints(); itemConstraint.gridwidth = GridBagConstraints.REMAINDER; itemConstraint.fill = GridBagConstraints.NONE; buttonPanel.add(removeSchemeButton, itemConstraint); } itemConstraint = new GridBagConstraints(); itemConstraint.gridwidth = GridBagConstraints.REMAINDER; itemConstraint.fill = GridBagConstraints.NONE; itemConstraint.anchor = GridBagConstraints.EAST; itemConstraint.insets = new Insets(0, 5, 5, 5); schemeListPanel.add(buttonPanel, itemConstraint); } { colorSchemeComboBox = new JComboBox(colorSchemeComboBoxModel); actviceSchemeLabel.setLabelFor(colorSchemeComboBox); colorSchemeComboBox.setRenderer(new ColorSchemeComboBoxRenderer()); colorSchemeComboBox.addPopupMenuListener(new PopupMenuListener() { @Override public void popupMenuWillBecomeVisible(PopupMenuEvent e) { return; } @Override public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { Object selectedValue = colorSchemeComboBox.getSelectedItem(); if (selectedValue instanceof ColorScheme) { ColorScheme selection = (ColorScheme) selectedValue; if (selection != null) { if (!currentActiveColorSchemeName.equals(selection.getName())) { currentActiveColorSchemeName = selection.getName(); adaptModels(); } } } else { String newName = I18N.getGUILabel("plotter.new_color_scheme_name.label"); String suffix = ""; int counter = 1; while (currentColorSchemes.get(newName + suffix) != null) { suffix = "_" + counter; counter++; } newName += suffix; String userSelectedName = createNameDialog(newName); if (userSelectedName == null) { colorSchemeComboBox.setSelectedItem(getCurrentActiveColorScheme()); return; } addNewColorSchemeAction(userSelectedName); } } @Override public void popupMenuCanceled(PopupMenuEvent e) { return; } }); itemConstraint = new GridBagConstraints(); itemConstraint.fill = GridBagConstraints.BOTH; itemConstraint.weightx = 0.0; itemConstraint.weighty = 0.0; itemConstraint.gridwidth = GridBagConstraints.REMAINDER; schemeListPanel.add(colorSchemeComboBox, itemConstraint); } } return schemeListPanel; }
From source file:org.jets3t.apps.cockpitlite.CockpitLite.java
protected void startProgressPanel(Object operationId, String statusMessage, int maxCount, CancelEventTrigger cancelEventTrigger) { // Create new progress panel. final ProgressPanel progressPanel = new ProgressPanel(cockpitLiteProperties.getProperties(), cancelEventTrigger);//w w w. j a v a2s . co m progressPanel.startProgress(statusMessage, 0, maxCount); // Store this panel against the operation ID it tracks. progressPanelMap.put(operationId, progressPanel); // Display panel in progress notification area. SwingUtilities.invokeLater(new Runnable() { public void run() { progressNotificationPanel.add(progressPanel, new GridBagConstraints(0, progressNotificationPanel.getComponents().length, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); progressNotificationPanel.revalidate(); } }); }
From source file:lejos.pc.charting.LogChartFrame.java
/** All the setup of components, etc. What's scary is Swing is a "lightweight" GUI framework... * @throws Exception/*from www . j a v a 2 s . co m*/ */ private void jbInit() throws Exception { this.setJMenuBar(menuBar); this.setSize(new Dimension(819, 613)); this.setMinimumSize(new Dimension(819, 613)); this.setTitle("NXT Charting Logger"); this.setEnabled(true); // enforce minimum window size this.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { JFrame theFrame = (JFrame) e.getSource(); Dimension d1 = theFrame.getMinimumSize(); Dimension d2 = theFrame.getSize(); boolean enforce = false; if (theFrame.getWidth() < d1.getWidth()) { d2.setSize(d1.getWidth(), d2.getHeight()); enforce = true; } if (theFrame.getHeight() < d1.getHeight()) { d2.setSize(d2.getWidth(), d1.getHeight()); enforce = true; } if (enforce) theFrame.setSize(d2); } }); this.getContentPane().setLayout(gridBagLayout1); MenuActionListener menuItemActionListener = new MenuActionListener(); MenuEventListener menuListener = new MenuEventListener(); menu = new JMenu("Edit"); menu.setMnemonic(KeyEvent.VK_E); menuBar.add(menu); menuItem = new JMenuItem("Copy Chart Image", KeyEvent.VK_I); menuItem.addActionListener(menuItemActionListener); menu.add(menuItem); menuItem = new JMenuItem("Copy Data Log", KeyEvent.VK_D); menuItem.addActionListener(menuItemActionListener); menu.add(menuItem); menu = new JMenu("View"); menu.setMnemonic(KeyEvent.VK_V); menu.setActionCommand("VIEW_MENU"); menu.addMenuListener(menuListener); menuBar.add(menu); menuItem = new JMenuItem("Expand Chart", KeyEvent.VK_F); menuItem.addActionListener(menuItemActionListener); menu.add(menuItem); menuItem = new JMenuItem("Chart in New Window", KeyEvent.VK_N); menuItem.addActionListener(menuItemActionListener); menu.add(menuItem); menu = new JMenu("Help"); menu.setMnemonic(KeyEvent.VK_H); menuBar.add(menu); menuItem = new JMenuItem("Chart controls", KeyEvent.VK_C); menuItem.addActionListener(menuItemActionListener); menu.add(menuItem); menuItem = new JMenuItem("Generate sample data", KeyEvent.VK_G); menuItem.addActionListener(menuItemActionListener); menu.add(menuItem); menuItem = new JMenuItem("About", KeyEvent.VK_A); menuItem.addActionListener(menuItemActionListener); jTabbedPane1.setPreferredSize(new Dimension(621, 199)); jTabbedPane1.setMinimumSize(new Dimension(621, 199)); menu.add(menuItem); jButtonConnect.setText("Connect"); jButtonConnect.setBounds(new Rectangle(25, 65, 115, 25)); jButtonConnect.setToolTipText("Connect/disconnect toggle"); jButtonConnect.setMnemonic('C'); jButtonConnect.setSelected(true); jButtonConnect.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButtonConnect_actionPerformed(e); } }); UIPanel.setSize(new Dimension(820, 200)); UIPanel.setLayout(null); UIPanel.setPreferredSize(new Dimension(300, 200)); UIPanel.setMinimumSize(new Dimension(300, 200)); UIPanel.setBounds(new Rectangle(0, 350, 820, 200)); UIPanel.setMaximumSize(new Dimension(300, 32767)); connectionPanel.setBounds(new Rectangle(10, 10, 175, 100)); connectionPanel.setBorder(BorderFactory.createTitledBorder("Connection")); connectionPanel.setLayout(null); connectionPanel.setFont(new Font("Tahoma", 0, 11)); jLabel1logfilename.setText("Log File:"); jLabel1logfilename.setBounds(new Rectangle(10, 125, 165, 20)); jLabel1logfilename.setHorizontalTextPosition(SwingConstants.RIGHT); jLabel1logfilename.setHorizontalAlignment(SwingConstants.LEFT); jLabel1logfilename.setToolTipText("Specify the name of your log file here"); jTextFieldNXTName.setBounds(new Rectangle(5, 40, 165, 20)); jTextFieldNXTName.setToolTipText( "The name or Address of the NXT. Leave empty and the first one found will be used."); jTextFieldNXTName.requestFocus(); jTextAreaStatus.setLineWrap(true); jTextAreaStatus.setFont(new Font("Tahoma", 0, 11)); jTextAreaStatus.setWrapStyleWord(true); jTextAreaStatus.setBackground(SystemColor.window); dataLogTextArea.setLineWrap(false); dataLogTextArea.setFont(new Font("Tahoma", 0, 11)); dataLogTextArea.setBackground(SystemColor.window); FQPathTextArea.setBounds(new Rectangle(5, 170, 185, 40)); FQPathTextArea.setLineWrap(true); FQPathTextArea.setText(getCanonicalName(new File(".", ""))); FQPathTextArea.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); FQPathTextArea.setRows(2); FQPathTextArea.setFont(new Font("Tahoma", 0, 9)); FQPathTextArea.setOpaque(false); FQPathTextArea.setEditable(false); selectFolderButton.setText("Folder..."); selectFolderButton.setBounds(new Rectangle(120, 125, 70, 20)); selectFolderButton.setMargin(new Insets(1, 1, 1, 1)); selectFolderButton.setFocusable(false); selectFolderButton.setMnemonic('F'); selectFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { selectFolderButton_actionPerformed(e); } }); // domain display limits GUI chartOptionsPanel.setLayout(null); chartDomLimitsPanel.setBounds(new Rectangle(5, 35, 180, 135)); chartDomLimitsPanel.setLayout(gridLayout1); chartDomLimitsPanel.setBorder(BorderFactory.createTitledBorder("Domain Display Limiting")); domainDisplayLimitSlider.setEnabled(false); domainDisplayLimitSlider.setMaximum(MAXDOMAIN_DATAPOINT_LIMIT); domainDisplayLimitSlider.setMinimum(MINDOMAIN_LIMIT); domainDisplayLimitSlider.setValue(MAXDOMAIN_DATAPOINT_LIMIT); domainDisplayLimitSlider.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { domainDisplayLimitSlider_stateChanged(e); } }); useTimeRadioButton.setText("By Time"); useTimeRadioButton.setEnabled(false); useTimeRadioButton.setMnemonic('I'); useTimeRadioButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { domainDisplayLimitRadioButton_actionPerformed(e); } }); useDataPointsRadioButton.setText("By Data Points"); ButtonGroup bg1 = new ButtonGroup(); bg1.add(useTimeRadioButton); bg1.add(useDataPointsRadioButton); useDataPointsRadioButton.setSelected(true); useDataPointsRadioButton.setEnabled(false); useDataPointsRadioButton.setMnemonic('P'); useDataPointsRadioButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { domainDisplayLimitRadioButton_actionPerformed(e); } }); datasetLimitEnableCheckBox.setText("Enable"); datasetLimitEnableCheckBox.setRolloverEnabled(true); datasetLimitEnableCheckBox.setMnemonic('A'); datasetLimitEnableCheckBox.setToolTipText("Enable Domain Clipping"); datasetLimitEnableCheckBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { datasetLimitEnableCheckBox_actionPerformed(e); } }); domainLimitLabel.setText(String.format("%1$,d datapoints", MAXDOMAIN_DATAPOINT_LIMIT).toString()); domainLimitLabel.setEnabled(false); gridLayout1.setRows(5); gridLayout1.setColumns(1); jLabel1.setText("Chart Title:"); jLabel1.setBounds(new Rectangle(200, 10, 85, 20)); jLabel1.setPreferredSize(new Dimension(115, 14)); jLabel2.setText("Range Axis 1 Label:"); jLabel2.setBounds(new Rectangle(200, 35, 115, 20)); jLabel2.setSize(new Dimension(115, 20)); jLabel3.setText("Range Axis 2 Label:"); jLabel3.setBounds(new Rectangle(200, 60, 115, 20)); jLabel3.setSize(new Dimension(115, 20)); jLabel4.setText("Range Axis 3 Label:"); jLabel4.setBounds(new Rectangle(200, 85, 115, 20)); jLabel4.setSize(new Dimension(115, 20)); jLabel6.setText("Range Axis 4 Label:"); jLabel6.setBounds(new Rectangle(200, 110, 115, 20)); jLabel6.setSize(new Dimension(115, 20)); titleLabelChangeNotifier notifier = new titleLabelChangeNotifier(); chartTitleTextField.setBounds(new Rectangle(315, 10, 290, 20)); chartTitleTextField.getDocument().addDocumentListener(notifier); axis1LabelTextField.setBounds(new Rectangle(315, 35, 290, 20)); axis1LabelTextField.getDocument().addDocumentListener(notifier); axis2LabelTextField.setBounds(new Rectangle(315, 60, 290, 20)); axis2LabelTextField.getDocument().addDocumentListener(notifier); axis3LabelTextField.setBounds(new Rectangle(315, 85, 290, 20)); axis3LabelTextField.getDocument().addDocumentListener(notifier); axis4LabelTextField.setBounds(new Rectangle(315, 110, 290, 20)); showCommentsCheckBox.setText("Show Comment Markers"); showCommentsCheckBox.setBounds(new Rectangle(200, 140, 185, 25)); showCommentsCheckBox.setToolTipText("Show/Hide any comment markers on the chart"); showCommentsCheckBox.setRolloverEnabled(true); showCommentsCheckBox.setSelected(true); showCommentsCheckBox.setMnemonic('M'); showCommentsCheckBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { customChartPanel.setCommentsVisible(e.getStateChange() == ItemEvent.SELECTED); } }); scrollDomainCheckBox.setText("Scroll Domain"); scrollDomainCheckBox.setBounds(new Rectangle(10, 5, 175, 20)); scrollDomainCheckBox.setSize(new Dimension(175, 25)); scrollDomainCheckBox.setSelected(true); scrollDomainCheckBox.setMnemonic('O'); scrollDomainCheckBox.setToolTipText("Checked to scroll domain as new data is received"); scrollDomainCheckBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scrollDomainCheckBox_actionPerformed(e); } }); axis4LabelTextField.getDocument().addDocumentListener(notifier); logFileTextField.setBounds(new Rectangle(10, 145, 180, 20)); logFileTextField.setText("NXTData.txt"); logFileTextField.setPreferredSize(new Dimension(180, 20)); logFileTextField.setToolTipText("File name. Leave empty to not log to file."); statusScrollPane.setOpaque(false); dataLogScrollPane.setOpaque(false); customChartPanel.setMinimumSize(new Dimension(400, 300)); customChartPanel.setPreferredSize(new Dimension(812, 400)); jLabel5.setText("NXT Name/Address:"); jLabel5.setBounds(new Rectangle(5, 20, 160, 20)); jLabel5.setToolTipText(jTextFieldNXTName.getToolTipText()); jLabel5.setHorizontalTextPosition(SwingConstants.RIGHT); jLabel5.setHorizontalAlignment(SwingConstants.LEFT); connectionPanel.add(jTextFieldNXTName, null); connectionPanel.add(jButtonConnect, null); connectionPanel.add(jLabel5, null); dataLogScrollPane.setViewportView(dataLogTextArea); jTabbedPane1.addTab("Data Log", dataLogScrollPane); statusScrollPane.setViewportView(jTextAreaStatus); jTabbedPane1.addTab("Status", statusScrollPane); jTabbedPane1.addTab("Chart", chartOptionsPanel); chartDomLimitsPanel.add(datasetLimitEnableCheckBox, null); chartDomLimitsPanel.add(useDataPointsRadioButton, null); chartDomLimitsPanel.add(useTimeRadioButton, null); chartDomLimitsPanel.add(domainDisplayLimitSlider, null); chartDomLimitsPanel.add(domainLimitLabel, null); chartOptionsPanel.add(scrollDomainCheckBox, null); chartOptionsPanel.add(showCommentsCheckBox, null); chartOptionsPanel.add(axis4LabelTextField, null); chartOptionsPanel.add(axis3LabelTextField, null); chartOptionsPanel.add(axis2LabelTextField, null); chartOptionsPanel.add(axis1LabelTextField, null); chartOptionsPanel.add(chartTitleTextField, null); chartOptionsPanel.add(jLabel6, null); chartOptionsPanel.add(jLabel4, null); chartOptionsPanel.add(jLabel3, null); chartOptionsPanel.add(jLabel2, null); chartOptionsPanel.add(jLabel1, null); chartOptionsPanel.add(chartDomLimitsPanel, null); tglbtnpauseplay = new JToggleButton(""); tglbtnpauseplay.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if (lpm == null) return; boolean doPause = false; if (e.getStateChange() == ItemEvent.SELECTED) { doPause = true; } lpm.setReaderPaused(doPause); } }); // tglbtnpauseplay.addChangeListener(new ChangeListener() { // public void stateChanged(ChangeEvent e) { // System.out.println(e.toString()); // //lpm.setReaderPaused(doPause) // } // }); tglbtnpauseplay .setSelectedIcon(new ImageIcon(LogChartFrame.class.getResource("/lejos/pc/charting/play.png"))); tglbtnpauseplay.setIcon(new ImageIcon(LogChartFrame.class.getResource("/lejos/pc/charting/pause.png"))); tglbtnpauseplay.setBounds(571, 135, 30, 30); chartOptionsPanel.add(tglbtnpauseplay); jTabbedPane1.setToolTipTextAt(0, "The tab-delimited log of the data sent from the NXT"); jTabbedPane1.setToolTipTextAt(1, "Status output"); jTabbedPane1.setToolTipTextAt(2, "Chart options"); jTabbedPane1.setMnemonicAt(0, KeyEvent.VK_D); jTabbedPane1.setMnemonicAt(1, KeyEvent.VK_S); jTabbedPane1.setMnemonicAt(2, KeyEvent.VK_T); this.getContentPane().add(customChartPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); this.getContentPane().add(UIPanel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), -107, 0)); this.getContentPane().add(jTabbedPane1, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); UIPanel.add(connectionPanel, null); UIPanel.add(selectFolderButton, null); UIPanel.add(logFileTextField, null); UIPanel.add(jLabel1logfilename, null); UIPanel.add(FQPathTextArea, null); ActionListener taskPerformer = new ActionListener() { public void actionPerformed(ActionEvent evt) { String theData = null; for (;;) { theData = LogChartFrame.this.logDataQueue.poll(); if (theData == null) break; try { dataLogTextArea.getDocument().insertString(dataLogTextArea.getDocument().getLength(), theData, null); } catch (BadLocationException e) { System.out.print( "BadLocationException in datalog textarea updater thread:" + e.toString() + "\n"); } } } }; this.updateLogTextAreaTimer = new Timer(1000, taskPerformer); this.updateLogTextAreaTimer.start(); }
From source file:net.jradius.client.gui.JRadiusSimulator.java
private JPanel getRunStatsPanel() { if (runStatsPanel == null) { runStatsPanel = new JPanel(); runStatsPanel.setLayout(new FlowLayout()); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints1.weightx = 1.0; JPanel runStatsPanel1 = new JPanel(); runStatsPanel1.setLayout(new GridBagLayout()); runStatsPanel1.add(new JLabel("Threads:"), gridBagConstraints); runStatsPanel1.add(runStatsThreads = new JLabel(), gridBagConstraints1); runStatsPanel1.add(new JLabel("Sent:"), gridBagConstraints); runStatsPanel1.add(runStatsSent = new JLabel(), gridBagConstraints1); runStatsPanel1.add(new JLabel("Received:"), gridBagConstraints); runStatsPanel1.add(runStatsRecv = new JLabel(), gridBagConstraints1); runStatsPanel1.add(new JLabel("Time:"), gridBagConstraints); runStatsPanel1.add(runStatsTime = new JLabel(), gridBagConstraints1); runStatsPanel1.add(new JLabel("Throughput:"), gridBagConstraints); runStatsPanel1.add(runStatsRPS = new JLabel(), gridBagConstraints1); JPanel runStatsPanel3 = new JPanel(); runStatsPanel3.setLayout(new GridBagLayout()); runStatsPanel3.add(new JLabel("Pkts Received"), gridBagConstraints1); runStatsPanel3.add(new JLabel("Accept:"), gridBagConstraints); runStatsPanel3.add(runStatsPktAccept = new JLabel(), gridBagConstraints1); runStatsPanel3.add(new JLabel("Reject:"), gridBagConstraints); runStatsPanel3.add(runStatsPktReject = new JLabel(), gridBagConstraints1); runStatsPanel3.add(new JLabel("Challenge:"), gridBagConstraints); runStatsPanel3.add(runStatsPktChallenge = new JLabel(), gridBagConstraints1); runStatsPanel3.add(new JLabel("Acct Resp:"), gridBagConstraints); runStatsPanel3.add(runStatsPktAcctResp = new JLabel(), gridBagConstraints1); JPanel runStatsPanel2 = new JPanel(); runStatsPanel2.setLayout(new GridBagLayout()); runStatsPanel2.add(new JLabel("1 ms or less:"), gridBagConstraints); runStatsPanel2.add(runStatsTime1 = new JLabel(), gridBagConstraints1); runStatsPanel2.add(new JLabel("10 ms or less:"), gridBagConstraints); runStatsPanel2.add(runStatsTime2 = new JLabel(), gridBagConstraints1); runStatsPanel2.add(new JLabel("100 ms or less:"), gridBagConstraints); runStatsPanel2.add(runStatsTime3 = new JLabel(), gridBagConstraints1); runStatsPanel2.add(new JLabel("1000 ms or less:"), gridBagConstraints); runStatsPanel2.add(runStatsTime4 = new JLabel(), gridBagConstraints1); runStatsPanel2.add(new JLabel("10000 ms or less:"), gridBagConstraints); runStatsPanel2.add(runStatsTime5 = new JLabel(), gridBagConstraints1); clearStats();/* w w w .j a v a 2s . c o m*/ runStatsPanel.add(runStatsPanel1); runStatsPanel.add(runStatsPanel3); runStatsPanel.add(runStatsPanel2); } return runStatsPanel; }
From source file:org.multibit.viewsystem.swing.view.panels.ShowPreferencesPanel.java
private JPanel createTickerPanel(int stentWidth) { // Load up the original values. originalShowTicker = !Boolean.FALSE.toString() .equals(controller.getModel().getUserPreference(ExchangeModel.TICKER_SHOW)); originalExchange1 = controller.getModel().getUserPreference(ExchangeModel.TICKER_FIRST_ROW_EXCHANGE); originalCurrency1 = controller.getModel().getUserPreference(ExchangeModel.TICKER_FIRST_ROW_CURRENCY); // Map MtGox to Bitstamp + USD if (ExchangeData.MT_GOX_EXCHANGE_NAME.equalsIgnoreCase(originalExchange1)) { originalExchange1 = ExchangeData.BITSTAMP_EXCHANGE_NAME; controller.getModel().setUserPreference(ExchangeModel.TICKER_FIRST_ROW_EXCHANGE, ExchangeData.BITSTAMP_EXCHANGE_NAME); originalCurrency1 = "USD"; controller.getModel().setUserPreference(ExchangeModel.TICKER_FIRST_ROW_CURRENCY, "USD"); }/* w w w .j ava 2 s .c o m*/ originalShowSecondRow = Boolean.TRUE.toString() .equals(controller.getModel().getUserPreference(ExchangeModel.TICKER_SHOW_SECOND_ROW)); originalExchange2 = controller.getModel().getUserPreference(ExchangeModel.TICKER_SECOND_ROW_EXCHANGE); originalCurrency2 = controller.getModel().getUserPreference(ExchangeModel.TICKER_SECOND_ROW_CURRENCY); // Map MtGox to Bitstamp if (ExchangeData.MT_GOX_EXCHANGE_NAME.equalsIgnoreCase(originalExchange2)) { originalExchange2 = ExchangeData.BITSTAMP_EXCHANGE_NAME; controller.getModel().setUserPreference(ExchangeModel.TICKER_SECOND_ROW_EXCHANGE, ExchangeData.BITSTAMP_EXCHANGE_NAME); originalCurrency2 = "USD"; controller.getModel().setUserPreference(ExchangeModel.TICKER_SECOND_ROW_CURRENCY, "USD"); } MultiBitTitledPanel tickerPanel = new MultiBitTitledPanel( controller.getLocaliser().getString("showPreferencesPanel.ticker.title2"), ComponentOrientation.getOrientation(controller.getLocaliser().getLocale())); GridBagConstraints constraints = new GridBagConstraints(); constraints.fill = GridBagConstraints.BOTH; constraints.gridx = 3; constraints.gridy = 3; constraints.weightx = 0.05; constraints.weighty = 0.3; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.CENTER; tickerPanel.add(MultiBitTitledPanel.createStent(MultiBitTitledPanel.SEPARATION_BETWEEN_NAME_VALUE_PAIRS), constraints); String showTickerText = controller.getLocaliser().getString("multiBitFrame.ticker.show.text"); if (showTickerText != null && showTickerText.length() >= 1) { // Capitalise text (this is to save adding a new I18n term. showTickerText = Character.toUpperCase(showTickerText.charAt(0)) + showTickerText.toLowerCase().substring(1); } showTicker = new JCheckBox(showTickerText); showTicker.setOpaque(false); showTicker.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); showTicker.setSelected(originalShowTicker); exchangeInformationLabel = new MultiBitLabel( controller.getLocaliser().getString("showPreferencesPanel.ticker.exchangeInformation")); exchangeInformationLabel.setVisible(originalShowBitcoinConvertedToFiat); showBitcoinConvertedToFiat = new JCheckBox( controller.getLocaliser().getString("showPreferencesPanel.ticker.showBitcoinConvertedToFiat")); showBitcoinConvertedToFiat.setOpaque(false); showBitcoinConvertedToFiat.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); showBitcoinConvertedToFiat.setSelected(originalShowBitcoinConvertedToFiat); showBitcoinConvertedToFiat.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { boolean selectedChange = (e.getStateChange() == ItemEvent.SELECTED); boolean unSelectedChange = (e.getStateChange() == ItemEvent.DESELECTED); if (exchangeInformationLabel != null) { if (selectedChange) { exchangeInformationLabel.setVisible(true); } if (unSelectedChange) { exchangeInformationLabel.setVisible(false); } } } }); showExchange = new JCheckBox(controller.getLocaliser().getString("tickerTableModel.exchange")); showExchange.setOpaque(false); showExchange.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); showCurrency = new JCheckBox(controller.getLocaliser().getString("tickerTableModel.currency")); showCurrency.setOpaque(false); showCurrency.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); showLastPrice = new JCheckBox(controller.getLocaliser().getString("tickerTableModel.lastPrice")); showLastPrice.setOpaque(false); showLastPrice.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); showBid = new JCheckBox(controller.getLocaliser().getString("tickerTableModel.bid")); showBid.setOpaque(false); showBid.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); showAsk = new JCheckBox(controller.getLocaliser().getString("tickerTableModel.ask")); showAsk.setOpaque(false); showAsk.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); String tickerColumnsToShow = controller.getModel().getUserPreference(ExchangeModel.TICKER_COLUMNS_TO_SHOW); if (tickerColumnsToShow == null || tickerColumnsToShow.equals("")) { tickerColumnsToShow = TickerTableModel.DEFAULT_COLUMNS_TO_SHOW; } originalShowCurrency = tickerColumnsToShow.contains(TickerTableModel.TICKER_COLUMN_CURRENCY); showCurrency.setSelected(originalShowCurrency); originalShowRate = tickerColumnsToShow.contains(TickerTableModel.TICKER_COLUMN_LAST_PRICE); showLastPrice.setSelected(originalShowRate); originalShowBid = tickerColumnsToShow.contains(TickerTableModel.TICKER_COLUMN_BID); showBid.setSelected(originalShowBid); originalShowAsk = tickerColumnsToShow.contains(TickerTableModel.TICKER_COLUMN_ASK); showAsk.setSelected(originalShowAsk); originalShowExchange = tickerColumnsToShow.contains(TickerTableModel.TICKER_COLUMN_EXCHANGE); showExchange.setSelected(originalShowExchange); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridx = 1; constraints.gridy = 4; constraints.weightx = 0.2; constraints.weighty = 0.3; constraints.gridwidth = 4; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(showTicker, constraints); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridx = 1; constraints.gridy = 5; constraints.weightx = 0.2; constraints.weighty = 0.3; constraints.gridwidth = 4; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(showBitcoinConvertedToFiat, constraints); constraints.fill = GridBagConstraints.VERTICAL; constraints.gridx = 0; constraints.gridy = 6; constraints.weightx = 0.2; constraints.weighty = 0.3; constraints.gridwidth = 3; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(MultiBitTitledPanel.createStent(1, 12), constraints); MultiBitTitledPanel.addLeftJustifiedTextAtIndent( controller.getLocaliser().getString("showPreferencesPanel.ticker.columnsToShow"), 7, tickerPanel); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 1; constraints.gridy = 8; constraints.weightx = 0.2; constraints.weighty = 0.3; constraints.gridwidth = 3; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(showExchange, constraints); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridx = 1; constraints.gridy = 9; constraints.weightx = 0.2; constraints.weighty = 0.3; constraints.gridwidth = 3; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(showCurrency, constraints); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 1; constraints.gridy = 10; constraints.weightx = 0.2; constraints.weighty = 0.3; constraints.gridwidth = 3; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(showLastPrice, constraints); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 1; constraints.gridy = 11; constraints.weightx = 0.2; constraints.weighty = 0.3; constraints.gridwidth = 3; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(showBid, constraints); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 1; constraints.gridy = 12; constraints.weightx = 0.2; constraints.weighty = 0.3; constraints.gridwidth = 3; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(showAsk, constraints); constraints.fill = GridBagConstraints.VERTICAL; constraints.gridx = 1; constraints.gridy = 13; constraints.weightx = 0.3; constraints.weighty = 0.3; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(MultiBitTitledPanel.createStent(1, 13), constraints); MultiBitTitledPanel.addLeftJustifiedTextAtIndent( controller.getLocaliser().getString("showPreferencesPanel.ticker.firstRow"), 14, tickerPanel); MultiBitLabel exchangeLabel1 = new MultiBitLabel( controller.getLocaliser().getString("showPreferencesPanel.ticker.exchange")); exchangeLabel1.setHorizontalAlignment(JLabel.TRAILING); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridx = 1; constraints.gridy = 15; constraints.weightx = 0.3; constraints.weighty = 1; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_END; tickerPanel.add(exchangeLabel1, constraints); String exchangeToUse1; if (originalExchange1 == null | "".equals(originalExchange1)) { exchangeToUse1 = ExchangeData.DEFAULT_EXCHANGE; } else { exchangeToUse1 = originalExchange1; } String exchangeToUse2; if (originalExchange2 == null | "".equals(originalExchange2)) { exchangeToUse2 = ExchangeData.DEFAULT_EXCHANGE; } else { exchangeToUse2 = originalExchange2; } exchangeComboBox1 = new JComboBox(ExchangeData.getAvailableExchanges()); exchangeComboBox1.setSelectedItem(exchangeToUse1); exchangeComboBox1.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); exchangeComboBox1.setOpaque(false); FontMetrics fontMetrics = getFontMetrics(FontSizer.INSTANCE.getAdjustedDefaultFont()); int textWidth = Math.max(fontMetrics.stringWidth(ExchangeData.OPEN_EXCHANGE_RATES_EXCHANGE_NAME), fontMetrics.stringWidth("USD")) + COMBO_WIDTH_DELTA; Dimension preferredSize = new Dimension(textWidth + TICKER_COMBO_WIDTH_DELTA, fontMetrics.getHeight() + EXCHANGE_COMBO_HEIGHT_DELTA); exchangeComboBox1.setPreferredSize(preferredSize); constraints.fill = GridBagConstraints.BOTH; constraints.gridx = 1; constraints.gridy = 15; constraints.weightx = 0.3; constraints.weighty = 0.3; constraints.gridwidth = 2; constraints.anchor = GridBagConstraints.LINE_START; JPanel stent = MultiBitTitledPanel.createStent(stentWidth); tickerPanel.add(stent, constraints); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 4; constraints.gridy = 15; constraints.weightx = 0.8; constraints.weighty = 0.6; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(exchangeComboBox1, constraints); oerMessageLabel1 = new MultiBitLabel( " " + controller.getLocaliser().getString("showPreferencesPanel.getAppId.label")); oerMessageLabel1.setForeground(Color.GREEN.darker().darker()); boolean showMessageLabel1 = isBrowserSupported() && ExchangeData.OPEN_EXCHANGE_RATES_EXCHANGE_NAME.equalsIgnoreCase(exchangeToUse1) && (originalOERApiCode == null || originalOERApiCode.trim().length() == 0); oerMessageLabel1.setVisible(showMessageLabel1); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 5; constraints.gridy = 15; constraints.weightx = 0.8; constraints.weighty = 0.6; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(oerMessageLabel1, constraints); MultiBitLabel currencyLabel1 = new MultiBitLabel( controller.getLocaliser().getString("showPreferencesPanel.ticker.currency")); currencyLabel1.setHorizontalAlignment(JLabel.TRAILING); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridx = 1; constraints.gridy = 16; constraints.weightx = 0.3; constraints.weighty = 1; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_END; tickerPanel.add(currencyLabel1, constraints); // Make sure the exchange1 has been created and initialised the list of // currencies. if (mainFrame != null && mainFrame.getTickerTimerTask1() != null) { TickerTimerTask tickerTimerTask = mainFrame.getTickerTimerTask1(); synchronized (tickerTimerTask) { if (tickerTimerTask.getExchange() == null) { tickerTimerTask.createExchangeObjects(exchangeToUse1); } } } currencyComboBox1 = new JComboBox(); Collection<String> currenciesToUse = ExchangeData.getAvailableCurrenciesForExchange(exchangeToUse1); if (currenciesToUse != null) { for (String currency : currenciesToUse) { String item = currency; String description = CurrencyConverter.INSTANCE.getCurrencyCodeToDescriptionMap().get(currency); if (description != null && description.trim().length() > 0) { item = item + " (" + description + ")"; } currencyComboBox1.addItem(item); if (currency.equals(originalCurrency1)) { currencyComboBox1.setSelectedItem(item); } } } currencyComboBox1.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); currencyComboBox1.setOpaque(false); currencyComboBox1.setPreferredSize(preferredSize); exchangeComboBox1.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent event) { if (event.getStateChange() == ItemEvent.SELECTED) { Object item = event.getItem(); String exchangeShortName = item.toString(); // Make sure the exchange1 has been created and initialised // the list of currencies. if (mainFrame != null && mainFrame.getTickerTimerTask1() != null) { TickerTimerTask tickerTimerTask = mainFrame.getTickerTimerTask1(); synchronized (tickerTimerTask) { tickerTimerTask.createExchangeObjects(exchangeShortName); currencyComboBox1.removeAllItems(); Collection<String> currenciesToUse = ExchangeData .getAvailableCurrenciesForExchange(exchangeShortName); if (currenciesToUse != null) { for (String currency : currenciesToUse) { String loopItem = currency; String description = CurrencyConverter.INSTANCE .getCurrencyCodeToDescriptionMap().get(currency); if (description != null && description.trim().length() > 0) { loopItem = loopItem + " (" + description + ")"; } currencyComboBox1.addItem(loopItem); } } } } // Enable the OpenExchangeRates App ID if required. boolean showOER = ExchangeData.OPEN_EXCHANGE_RATES_EXCHANGE_NAME .equalsIgnoreCase(exchangeShortName) || ExchangeData.OPEN_EXCHANGE_RATES_EXCHANGE_NAME .equalsIgnoreCase((String) exchangeComboBox2.getSelectedItem()); oerStent.setVisible(showOER); oerApiCodeLabel.setVisible(showOER); oerApiCodeTextField.setVisible(showOER); getOerAppIdButton.setVisible(showOER); boolean showMessageLabel = isBrowserSupported() && ExchangeData.OPEN_EXCHANGE_RATES_EXCHANGE_NAME.equalsIgnoreCase(exchangeShortName) && (oerApiCodeTextField.getText() == null || oerApiCodeTextField.getText().trim().length() == 0); oerMessageLabel1.setVisible(showMessageLabel); } } }); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 4; constraints.gridy = 16; constraints.weightx = 0.8; constraints.weighty = 0.6; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(currencyComboBox1, constraints); constraints.fill = GridBagConstraints.BOTH; constraints.gridx = 1; constraints.gridy = 17; constraints.weightx = 0.3; constraints.weighty = 0.3; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(MultiBitTitledPanel.createStent(12, 12), constraints); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 4; constraints.gridy = 18; constraints.weightx = 0.8; constraints.weighty = 0.6; constraints.gridwidth = 2; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(MultiBitTitledPanel.createStent(fontMetrics.stringWidth(exchangeInformationLabel.getText()), fontMetrics.getHeight()), constraints); tickerPanel.add(exchangeInformationLabel, constraints); constraints.fill = GridBagConstraints.BOTH; constraints.gridx = 1; constraints.gridy = 19; constraints.weightx = 0.3; constraints.weighty = 0.3; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(MultiBitTitledPanel.createStent(12, 12), constraints); MultiBitTitledPanel.addLeftJustifiedTextAtIndent( controller.getLocaliser().getString("showPreferencesPanel.ticker.secondRow"), 20, tickerPanel); showSecondRowCheckBox = new JCheckBox( controller.getLocaliser().getString("showPreferencesPanel.ticker.showSecondRow")); showSecondRowCheckBox.setOpaque(false); showSecondRowCheckBox.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); showSecondRowCheckBox.addItemListener(new ChangeTickerShowSecondRowListener()); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridx = 1; constraints.gridy = 21; constraints.weightx = 0.3; constraints.weighty = 1; constraints.gridwidth = 3; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(showSecondRowCheckBox, constraints); exchangeLabel2 = new MultiBitLabel( controller.getLocaliser().getString("showPreferencesPanel.ticker.exchange")); exchangeLabel2.setHorizontalAlignment(JLabel.TRAILING); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridx = 1; constraints.gridy = 22; constraints.weightx = 0.3; constraints.weighty = 1; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_END; tickerPanel.add(exchangeLabel2, constraints); exchangeComboBox2 = new JComboBox(ExchangeData.getAvailableExchanges()); exchangeComboBox2.setSelectedItem(exchangeToUse2); exchangeComboBox2.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); exchangeComboBox2.setOpaque(false); exchangeComboBox2.setPreferredSize(preferredSize); exchangeComboBox2.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent event) { if (event.getStateChange() == ItemEvent.SELECTED) { Object item = event.getItem(); String exchangeShortName = item.toString(); // Make sure the exchange2 has been created and initialised // the list of currencies. if (mainFrame != null && mainFrame.getTickerTimerTask2() != null) { TickerTimerTask tickerTimerTask = mainFrame.getTickerTimerTask2(); synchronized (tickerTimerTask) { tickerTimerTask.createExchangeObjects(exchangeShortName); currencyComboBox2.removeAllItems(); Collection<String> currenciesToUse = ExchangeData .getAvailableCurrenciesForExchange(exchangeShortName); if (currenciesToUse != null) { for (String currency : currenciesToUse) { String loopItem = currency; String description = CurrencyConverter.INSTANCE .getCurrencyCodeToDescriptionMap().get(currency); if (description != null && description.trim().length() > 0) { loopItem = loopItem + " (" + description + ")"; } currencyComboBox2.addItem(loopItem); } } } } // Enable the OpenExchangeRates App ID if required. boolean showOER = ExchangeData.OPEN_EXCHANGE_RATES_EXCHANGE_NAME .equalsIgnoreCase(exchangeShortName) || ExchangeData.OPEN_EXCHANGE_RATES_EXCHANGE_NAME .equalsIgnoreCase((String) exchangeComboBox1.getSelectedItem()); oerStent.setVisible(showOER); oerApiCodeLabel.setVisible(showOER); oerApiCodeTextField.setVisible(showOER); getOerAppIdButton.setVisible(showOER); boolean showMessageLabel = isBrowserSupported() && ExchangeData.OPEN_EXCHANGE_RATES_EXCHANGE_NAME.equalsIgnoreCase(exchangeShortName) && (oerApiCodeTextField.getText() == null || oerApiCodeTextField.getText().trim().length() == 0); oerMessageLabel2.setVisible(showMessageLabel); } } }); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 4; constraints.gridy = 22; constraints.weightx = 0.8; constraints.weighty = 0.6; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(exchangeComboBox2, constraints); oerMessageLabel2 = new MultiBitLabel( " " + controller.getLocaliser().getString("showPreferencesPanel.getAppId.label")); oerMessageLabel2.setForeground(Color.GREEN.darker().darker()); boolean showMessageLabel2 = isBrowserSupported() && ExchangeData.OPEN_EXCHANGE_RATES_EXCHANGE_NAME.equalsIgnoreCase(exchangeToUse2) && (originalOERApiCode == null || originalOERApiCode.trim().length() == 0); oerMessageLabel2.setVisible(showMessageLabel2); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 5; constraints.gridy = 22; constraints.weightx = 0.8; constraints.weighty = 0.6; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(oerMessageLabel2, constraints); currencyLabel2 = new MultiBitLabel( controller.getLocaliser().getString("showPreferencesPanel.ticker.currency")); currencyLabel2.setHorizontalAlignment(JLabel.TRAILING); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridx = 1; constraints.gridy = 23; constraints.weightx = 0.3; constraints.weighty = 1; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_END; tickerPanel.add(currencyLabel2, constraints); // Make sure the exchange2 has been created and initialised the list of // currencies. if (mainFrame != null && mainFrame.getTickerTimerTask2() != null) { TickerTimerTask tickerTimerTask = mainFrame.getTickerTimerTask2(); synchronized (tickerTimerTask) { if (tickerTimerTask.getExchange() == null) { tickerTimerTask.createExchangeObjects(exchangeToUse2); } } } currencyComboBox2 = new JComboBox(); currenciesToUse = ExchangeData.getAvailableCurrenciesForExchange(exchangeToUse2); if (currenciesToUse != null) { for (String currency : currenciesToUse) { String loopItem = currency; String description = CurrencyConverter.INSTANCE.getCurrencyCodeToDescriptionMap().get(currency); if (description != null && description.trim().length() > 0) { loopItem = loopItem + " (" + description + ")"; } currencyComboBox2.addItem(loopItem); if (currency.equals(originalCurrency2)) { currencyComboBox2.setSelectedItem(loopItem); } } } currencyComboBox2.setFont(FontSizer.INSTANCE.getAdjustedDefaultFont()); currencyComboBox2.setOpaque(false); currencyComboBox2.setPreferredSize(preferredSize); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 4; constraints.gridy = 23; constraints.weightx = 0.8; constraints.weighty = 0.6; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(currencyComboBox2, constraints); showSecondRowCheckBox.setSelected(originalShowSecondRow); enableTickerSecondRow(originalShowSecondRow); constraints.fill = GridBagConstraints.BOTH; constraints.gridx = 1; constraints.gridy = 24; constraints.weightx = 0.3; constraints.weighty = 0.3; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(MultiBitTitledPanel.createStent(12, 12), constraints); JPanel fill1 = new JPanel(); fill1.setOpaque(false); constraints.fill = GridBagConstraints.BOTH; constraints.gridx = 5; constraints.gridy = 25; constraints.weightx = 20; constraints.weighty = 1; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_END; tickerPanel.add(fill1, constraints); boolean showOerSignup = ExchangeData.OPEN_EXCHANGE_RATES_EXCHANGE_NAME.equalsIgnoreCase(exchangeToUse1) || ExchangeData.OPEN_EXCHANGE_RATES_EXCHANGE_NAME.equalsIgnoreCase(exchangeToUse2); oerStent = MultiBitTitledPanel.createStent(12, 12); constraints.fill = GridBagConstraints.BOTH; constraints.gridx = 1; constraints.gridy = 26; constraints.weightx = 0.3; constraints.weighty = 0.3; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; oerStent.setVisible(showOerSignup); tickerPanel.add(oerStent, constraints); oerApiCodeLabel = new MultiBitLabel( controller.getLocaliser().getString("showPreferencesPanel.oerLabel.text")); oerApiCodeLabel.setToolTipText(HelpContentsPanel .createTooltipText(controller.getLocaliser().getString("showPreferencesPanel.oerLabel.tooltip"))); oerApiCodeLabel.setVisible(showOerSignup); oerApiCodeTextField = new MultiBitTextField("", 25, controller); oerApiCodeTextField.setHorizontalAlignment(JLabel.LEADING); oerApiCodeTextField.setMinimumSize(new Dimension(API_CODE_FIELD_WIDTH, API_CODE_FIELD_HEIGHT)); oerApiCodeTextField.setPreferredSize(new Dimension(API_CODE_FIELD_WIDTH, API_CODE_FIELD_HEIGHT)); oerApiCodeTextField.setMaximumSize(new Dimension(API_CODE_FIELD_WIDTH, API_CODE_FIELD_HEIGHT)); oerApiCodeTextField.setVisible(showOerSignup); oerApiCodeTextField.setText(originalOERApiCode); oerApiCodeTextField.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent arg0) { } @Override public void focusLost(FocusEvent arg0) { String apiCode = oerApiCodeTextField.getText(); if (apiCode != null && !(WhitespaceTrimmer.trim(apiCode).length() == 0) && !apiCode.equals( controller.getModel().getUserPreference(ExchangeModel.OPEN_EXCHANGE_RATES_API_CODE))) { // New API code. // Check its length if (!(apiCode.trim().length() == LENGTH_OF_OPEN_EXCHANGE_RATE_APP_ID) && !apiCode.equals(haveShownErrorMessageForApiCode)) { haveShownErrorMessageForApiCode = apiCode; // Give user a message that App ID is not in the correct format. JOptionPane.showMessageDialog(null, new String[] { controller .getLocaliser().getString("showPreferencesPanel.oerValidationError.text1"), " ", controller.getLocaliser() .getString("showPreferencesPanel.oerValidationError.text2"), controller.getLocaliser() .getString("showPreferencesPanel.oerValidationError.text3") }, controller.getLocaliser().getString( "showPreferencesPanel.oerValidationError.title"), JOptionPane.ERROR_MESSAGE, ImageLoader.createImageIcon(ImageLoader.EXCLAMATION_MARK_ICON_FILE)); return; } } updateApiCode(); } }); oerApiCodeTextField.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { String apiCode = oerApiCodeTextField.getText(); if (apiCode != null && !(WhitespaceTrimmer.trim(apiCode).length() == 0) && !apiCode.equals( controller.getModel().getUserPreference(ExchangeModel.OPEN_EXCHANGE_RATES_API_CODE))) { // New API code. // Check its length if (!(apiCode.trim().length() == LENGTH_OF_OPEN_EXCHANGE_RATE_APP_ID) && !apiCode.equals(haveShownErrorMessageForApiCode)) { haveShownErrorMessageForApiCode = apiCode; // Give user a message that App ID is not in the correct format. JOptionPane.showMessageDialog(null, new String[] { controller.getLocaliser() .getString("showPreferencesPanel.oerValidationError.text1"), controller.getLocaliser() .getString("showPreferencesPanel.oerValidationError.text2"), controller.getLocaliser() .getString("showPreferencesPanel.oerValidationError.text3") }, controller.getLocaliser().getString( "showPreferencesPanel.oerValidationError.title"), JOptionPane.ERROR_MESSAGE, ImageLoader.createImageIcon(ImageLoader.EXCLAMATION_MARK_ICON_FILE)); return; } } updateApiCode(); } }); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 1; constraints.gridy = 27; constraints.weightx = 0.3; constraints.weighty = 0.3; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_END; tickerPanel.add(oerApiCodeLabel, constraints); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 4; constraints.gridy = 27; constraints.weightx = 0.3; constraints.weighty = 0.3; constraints.gridwidth = 2; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(oerApiCodeTextField, constraints); if (isBrowserSupported()) { getOerAppIdButton = new MultiBitButton( controller.getLocaliser().getString("showPreferencesPanel.getAppId.text")); getOerAppIdButton .setToolTipText(controller.getLocaliser().getString("showPreferencesPanel.getAppId.tooltip")); getOerAppIdButton.setVisible(showOerSignup); getOerAppIdButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { try { openURI(new URI(OPEN_EXCHANGE_RATES_SIGN_UP_URI)); } catch (URISyntaxException e) { log.debug(e.getMessage()); } } }); constraints.fill = GridBagConstraints.NONE; constraints.gridx = 4; constraints.gridy = 28; constraints.weightx = 1; constraints.weighty = 1; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.LINE_START; tickerPanel.add(getOerAppIdButton, constraints); } return tickerPanel; }
From source file:edu.harvard.mcz.imagecapture.PositionTemplateEditor.java
/** * This method initializes jPanel1 //from w w w . j a v a 2 s. c o m * * @return javax.swing.JPanel */ private JPanel getJPanel1() { if (jPanel1 == null) { GridBagConstraints gridBagConstraints19 = new GridBagConstraints(); gridBagConstraints19.fill = GridBagConstraints.BOTH; gridBagConstraints19.weighty = 1.0; gridBagConstraints19.gridx = 2; gridBagConstraints19.gridy = 1; gridBagConstraints19.weightx = 1.0; jPanel1 = new JPanel(); jPanel1.setLayout(new GridBagLayout()); GridBagConstraints g1 = new GridBagConstraints(); g1.gridx = 1; g1.anchor = GridBagConstraints.NORTHEAST; g1.weightx = 0.1; g1.weighty = 0.75; g1.fill = GridBagConstraints.HORIZONTAL; g1.gridy = 1; GridBagConstraints g2 = new GridBagConstraints(); g2.gridx = 1; g2.anchor = GridBagConstraints.NORTH; g2.fill = GridBagConstraints.BOTH; g2.gridwidth = 2; g2.weighty = 0.2; g2.weightx = 0.0; g2.gridy = 0; jPanel1.add(getJPanel(), g1); jPanel1.add(getJPanel2(), g2); jPanel1.add(getJScrollPane1(), gridBagConstraints19); } return jPanel1; }
From source file:net.jradius.client.gui.JRadiusSimulator.java
/** * This method initializes sendOptionsPanel * //from ww w. j a v a 2s .c o m * @return javax.swing.JPanel */ private JPanel getSendOptionsPanel() { if (sendOptionsPanel == null) { GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints1.weightx = 1.0; GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints2.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); gridBagConstraints3.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints3.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints3.weightx = 1.0; GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints4.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); gridBagConstraints5.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints5.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints5.weightx = 1.0; GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); gridBagConstraints6.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints6.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); gridBagConstraints7.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints7.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints7.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints7.weightx = 1.0; GridBagConstraints gridBagConstraints8 = new GridBagConstraints(); gridBagConstraints8.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints8.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); gridBagConstraints9.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints9.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints9.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints9.weightx = 1.0; GridBagConstraints gridBagConstraints10 = new GridBagConstraints(); gridBagConstraints10.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints10.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); gridBagConstraints11.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints11.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints11.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints11.weightx = 1.0; GridBagConstraints gridBagConstraints12 = new GridBagConstraints(); gridBagConstraints12.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints12.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints13 = new GridBagConstraints(); gridBagConstraints13.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints13.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints13.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints13.weightx = 1.0; GridBagConstraints gridBagConstraints14 = new GridBagConstraints(); gridBagConstraints14.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints14.insets = new java.awt.Insets(0, 10, 0, 5); GridBagConstraints gridBagConstraints15 = new GridBagConstraints(); gridBagConstraints15.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints15.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints15.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints15.weightx = 1.0; GridBagConstraints gridBagConstraints16 = new GridBagConstraints(); gridBagConstraints16.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints16.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints16.insets = new java.awt.Insets(0, 0, 0, 10); gridBagConstraints16.weightx = 1.0; gridBagConstraints16.gridx = 1; JLabel authenticationProtocolLabel = new JLabel(); authenticationProtocolLabel.setText("Authentication Protocol:"); JLabel sharedSecretLabel = new JLabel(); sharedSecretLabel.setText("Shared Secret:"); radiusServerLabel = new JLabel(); radiusServerLabel.setText("RADIUS Server:"); JLabel simulationTypeLabel = new JLabel(); simulationTypeLabel.setText("Simulation Type:"); JLabel checkStandardLabel = new JLabel(); checkStandardLabel.setText("Verify Standard:"); JLabel radiusAuthPortLabel = new JLabel(); radiusAuthPortLabel.setText("Auth Port:"); JLabel radiusAcctPortLabel = new JLabel(); radiusAcctPortLabel.setText("Acct Port:"); JLabel radiusRetriesLabel = new JLabel(); radiusRetriesLabel.setText("Send Retries:"); JLabel radiusTimeoutLabel = new JLabel(); radiusTimeoutLabel.setText("Send Timeout (sec):"); JLabel radiusInterimIntervalLabel = new JLabel(); radiusInterimIntervalLabel.setText("Interim Interval (sec):"); JLabel sessionTimeLabel = new JLabel(); sessionTimeLabel.setText("Session Duration (sec):"); JLabel requestersLabel = new JLabel(); requestersLabel.setText("Requester Threads:"); JLabel requestsLabel = new JLabel(); requestsLabel.setText("Requests per Thread:"); GridBagLayout gridBagLayout = new GridBagLayout(); sendOptionsPanel = new JPanel(); sendOptionsPanel.setLayout(gridBagLayout); sendOptionsPanel.add(new JLabel("Transport"), gridBagConstraints); sendOptionsPanel.add(getTransportTypeComboBox(), gridBagConstraints1); sendOptionsPanel.add(radiusServerLabel, gridBagConstraints); sendOptionsPanel.add(getRadiusServerTextField(), gridBagConstraints1); sendOptionsPanel.add(sharedSecretLabel, gridBagConstraints2); sendOptionsPanel.add(getSharedSecretTextField(), gridBagConstraints3); sendOptionsPanel.add(radiusAuthPortLabel, gridBagConstraints8); sendOptionsPanel.add(getRadiusAuthPortTextField(), gridBagConstraints9); sendOptionsPanel.add(radiusAcctPortLabel, gridBagConstraints10); sendOptionsPanel.add(getRadiusAcctPortTextField(), gridBagConstraints11); sendOptionsPanel.add(radiusTimeoutLabel, gridBagConstraints12); sendOptionsPanel.add(getRadiusTimeoutTextField(), gridBagConstraints13); sendOptionsPanel.add(radiusRetriesLabel, gridBagConstraints12); sendOptionsPanel.add(getRadiusRetriesTextField(), gridBagConstraints13); sendOptionsPanel.add(requestersLabel, gridBagConstraints12); sendOptionsPanel.add(getRequestersTextField(), gridBagConstraints13); sendOptionsPanel.add(requestsLabel, gridBagConstraints12); sendOptionsPanel.add(getRequestsTextField(), gridBagConstraints13); sendOptionsPanel.add(simulationTypeLabel, gridBagConstraints4); sendOptionsPanel.add(getSimulationTypeComboBox(), gridBagConstraints5); sendOptionsPanel.add(authenticationProtocolLabel, gridBagConstraints6); sendOptionsPanel.add(getAuthTypeComboBox(), gridBagConstraints7); sendOptionsPanel.add(checkStandardLabel, gridBagConstraints6); sendOptionsPanel.add(getCheckStandardComboBox(), gridBagConstraints7); //sendOptionsPanel.add(sessionTimeLabel, gridBagConstraints12); //sendOptionsPanel.add(getSessionTimeTextField(), gridBagConstraints13); //sendOptionsPanel.add(radiusInterimIntervalLabel, gridBagConstraints12); //sendOptionsPanel.add(getRadiusInterimIntervalTextField(), gridBagConstraints13); sendOptionsPanel.add(getOptionsLabel(), gridBagConstraints14); sendOptionsPanel.add(getGenerateAcctSessionIdCheckBox(), gridBagConstraints15); sendOptionsPanel.add(getNotStopOnRejectCheckBox(), gridBagConstraints16); sendOptionsPanel.add(getSendClassAttributeCheckBox(), gridBagConstraints16); sendOptionsPanel.add(getDoLogCheckBox(), gridBagConstraints16); sendOptionsPanel.add(getFloodCheckBox(), gridBagConstraints16); } return sendOptionsPanel; }
From source file:edu.harvard.mcz.imagecapture.SpecimenDetailsViewPane.java
/** * This method initializes jPanel, laying out the UI components. * //ww w . j a va2 s . co m * @return javax.swing.JPanel */ private JPanel getJPanel() { if (jPanel == null) { GridBagConstraints gridBagConstraintsImgCount = new GridBagConstraints(); gridBagConstraintsImgCount.fill = GridBagConstraints.BOTH; gridBagConstraintsImgCount.gridy = 6; gridBagConstraintsImgCount.weightx = 1.0; gridBagConstraintsImgCount.anchor = GridBagConstraints.WEST; gridBagConstraintsImgCount.gridwidth = 4; gridBagConstraintsImgCount.insets = new Insets(0, 3, 5, 0); gridBagConstraintsImgCount.ipadx = 3; gridBagConstraintsImgCount.gridx = 4; GridBagConstraints gridBagConstraints124 = new GridBagConstraints(); gridBagConstraints124.insets = new Insets(0, 0, 0, 5); gridBagConstraints124.gridx = 0; gridBagConstraints124.anchor = GridBagConstraints.EAST; gridBagConstraints124.gridy = 20; GridBagConstraints gridBagConstraints38 = new GridBagConstraints(); gridBagConstraints38.insets = new Insets(0, 0, 0, 5); gridBagConstraints38.gridx = 0; gridBagConstraints38.anchor = GridBagConstraints.EAST; gridBagConstraints38.gridy = 27; GridBagConstraints gridBagConstraints215 = new GridBagConstraints(); gridBagConstraints215.insets = new Insets(0, 0, 0, 5); gridBagConstraints215.gridx = 0; gridBagConstraints215.anchor = GridBagConstraints.EAST; gridBagConstraints215.gridy = 26; GridBagConstraints gridBagConstraints120 = new GridBagConstraints(); gridBagConstraints120.insets = new Insets(0, 0, 0, 5); gridBagConstraints120.gridx = 3; gridBagConstraints120.weightx = 1.0; gridBagConstraints120.gridy = 25; jLabel44 = new JLabel(); jLabel44.setText("yyyy/mm/dd"); GridBagConstraints gridBagConstraints49 = new GridBagConstraints(); gridBagConstraints49.insets = new Insets(0, 0, 0, 0); gridBagConstraints49.fill = GridBagConstraints.BOTH; gridBagConstraints49.weighty = 1.0; gridBagConstraints49.weightx = 1.0; gridBagConstraints49.gridx = 1; gridBagConstraints49.gridwidth = 7; gridBagConstraints49.gridy = 35; GridBagConstraints gridBagConstraints214 = new GridBagConstraints(); gridBagConstraints214.gridwidth = 3; gridBagConstraints214.insets = new Insets(0, 0, 0, 5); gridBagConstraints214.anchor = GridBagConstraints.EAST; gridBagConstraints214.gridx = 4; gridBagConstraints214.gridy = 42; gridBagConstraints214.weightx = 0.0; gridBagConstraints214.weighty = 0.0; gridBagConstraints214.fill = GridBagConstraints.NONE; GridBagConstraints gridBagConstraints119 = new GridBagConstraints(); gridBagConstraints119.insets = new Insets(0, 0, 0, 0); gridBagConstraints119.anchor = GridBagConstraints.WEST; gridBagConstraints119.gridx = 7; gridBagConstraints119.gridy = 42; gridBagConstraints119.weightx = 0.0; gridBagConstraints119.weighty = 0.0; gridBagConstraints119.fill = GridBagConstraints.NONE; GridBagConstraints gridBagConstraints213 = new GridBagConstraints(); gridBagConstraints213.insets = new Insets(0, 0, 0, 0); gridBagConstraints213.fill = GridBagConstraints.BOTH; gridBagConstraints213.gridy = 31; gridBagConstraints213.weightx = 0.0; gridBagConstraints213.gridwidth = 7; gridBagConstraints213.anchor = GridBagConstraints.WEST; gridBagConstraints213.gridx = 1; GridBagConstraints gridBagConstraints118 = new GridBagConstraints(); gridBagConstraints118.insets = new Insets(0, 0, 0, 5); gridBagConstraints118.gridx = 0; gridBagConstraints118.anchor = GridBagConstraints.EAST; gridBagConstraints118.gridwidth = 1; gridBagConstraints118.gridy = 31; jLabel31 = new JLabel(); jLabel31.setText("Publications"); GridBagConstraints gridBagConstraints212 = new GridBagConstraints(); gridBagConstraints212.insets = new Insets(0, 0, 0, 5); gridBagConstraints212.gridx = 3; gridBagConstraints212.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints212.gridwidth = 4; gridBagConstraints212.gridy = 15; GridBagConstraints gridBagConstraints117 = new GridBagConstraints(); gridBagConstraints117.insets = new Insets(0, 0, 0, 0); gridBagConstraints117.fill = GridBagConstraints.BOTH; gridBagConstraints117.gridy = 25; gridBagConstraints117.weightx = 0.0; gridBagConstraints117.gridwidth = 4; gridBagConstraints117.anchor = GridBagConstraints.WEST; gridBagConstraints117.gridx = 4; GridBagConstraints gridBagConstraints211 = new GridBagConstraints(); gridBagConstraints211.insets = new Insets(0, 0, 0, 5); gridBagConstraints211.gridx = 3; gridBagConstraints211.gridwidth = 4; gridBagConstraints211.weighty = 1.0; gridBagConstraints211.gridy = 44; GridBagConstraints gridBagConstraintsMS = new GridBagConstraints(); gridBagConstraintsMS.fill = GridBagConstraints.BOTH; gridBagConstraintsMS.gridx = 0; gridBagConstraintsMS.gridwidth = 8; gridBagConstraintsMS.weighty = 1.0; gridBagConstraintsMS.gridy = 45; gridBagConstraintsMS.gridx = 0; GridBagConstraints gridBagConstraints116 = new GridBagConstraints(); gridBagConstraints116.gridwidth = 3; gridBagConstraints116.insets = new Insets(0, 0, 0, 5); gridBagConstraints116.gridx = 4; gridBagConstraints116.anchor = GridBagConstraints.EAST; gridBagConstraints116.gridy = 41; GridBagConstraints gridBagConstraintsInfer = new GridBagConstraints(); gridBagConstraintsInfer.insets = new Insets(0, 0, 0, 0); gridBagConstraintsInfer.fill = GridBagConstraints.BOTH; gridBagConstraintsInfer.gridy = 36; gridBagConstraintsInfer.weightx = 1.0; gridBagConstraintsInfer.anchor = GridBagConstraints.WEST; gridBagConstraintsInfer.gridwidth = 7; gridBagConstraintsInfer.gridx = 1; GridBagConstraints gridBagConstraints56 = new GridBagConstraints(); gridBagConstraints56.insets = new Insets(0, 0, 0, 5); gridBagConstraints56.gridx = 0; gridBagConstraints56.anchor = GridBagConstraints.EAST; gridBagConstraints56.gridy = 36; jLabel43 = new JLabel(); jLabel43.setText("Inferences"); GridBagConstraints gridBagConstraints48 = new GridBagConstraints(); gridBagConstraints48.insets = new Insets(0, 0, 0, 0); gridBagConstraints48.fill = GridBagConstraints.VERTICAL; gridBagConstraints48.gridy = 0; gridBagConstraints48.weightx = 1.0; gridBagConstraints48.anchor = GridBagConstraints.WEST; gridBagConstraints48.gridwidth = 4; gridBagConstraints48.gridx = 4; GridBagConstraints gridBagConstraints37 = new GridBagConstraints(); gridBagConstraints37.insets = new Insets(0, 0, 0, 5); gridBagConstraints37.fill = GridBagConstraints.VERTICAL; gridBagConstraints37.gridx = 3; gridBagConstraints37.anchor = GridBagConstraints.EAST; gridBagConstraints37.gridy = 0; jLabel42 = new JLabel(); jLabel42.setText("Collection"); GridBagConstraints gridBagConstraints29 = new GridBagConstraints(); gridBagConstraints29.insets = new Insets(0, 0, 0, 5); gridBagConstraints29.fill = GridBagConstraints.BOTH; gridBagConstraints29.gridy = 41; gridBagConstraints29.weightx = 1.0; gridBagConstraints29.anchor = GridBagConstraints.WEST; gridBagConstraints29.gridwidth = 3; gridBagConstraints29.gridx = 1; GridBagConstraints gridBagConstraints115 = new GridBagConstraints(); gridBagConstraints115.insets = new Insets(0, 0, 0, 5); gridBagConstraints115.gridx = 0; gridBagConstraints115.gridy = 41; jLabel41 = new JLabel(); jLabel41.setText("Workflow Status"); GridBagConstraints gridBagConstraints172 = new GridBagConstraints(); gridBagConstraints172.insets = new Insets(0, 0, 0, 0); gridBagConstraints172.fill = GridBagConstraints.BOTH; gridBagConstraints172.gridy = 33; gridBagConstraints172.weightx = 1.0; gridBagConstraints172.anchor = GridBagConstraints.WEST; gridBagConstraints172.gridwidth = 4; gridBagConstraints172.gridx = 4; GridBagConstraints gridBagConstraints162 = new GridBagConstraints(); gridBagConstraints162.insets = new Insets(0, 0, 0, 5); gridBagConstraints162.fill = GridBagConstraints.BOTH; gridBagConstraints162.gridy = 33; gridBagConstraints162.weightx = 1.0; gridBagConstraints162.anchor = GridBagConstraints.WEST; gridBagConstraints162.gridwidth = 2; gridBagConstraints162.gridx = 1; GridBagConstraints gridBagConstraints142 = new GridBagConstraints(); gridBagConstraints142.insets = new Insets(0, 0, 0, 5); gridBagConstraints142.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints142.gridy = 42; gridBagConstraints142.weightx = 1.0; gridBagConstraints142.anchor = GridBagConstraints.NORTHWEST; gridBagConstraints142.gridwidth = 3; gridBagConstraints142.ipady = 2; gridBagConstraints142.gridx = 1; GridBagConstraints gridBagConstraints133 = new GridBagConstraints(); gridBagConstraints133.insets = new Insets(0, 0, 0, 5); gridBagConstraints133.gridx = 0; gridBagConstraints133.anchor = GridBagConstraints.NORTHEAST; gridBagConstraints133.gridy = 42; jLabel40 = new JLabel(); jLabel40.setText("Questions"); GridBagConstraints gridBagConstraints123 = new GridBagConstraints(); gridBagConstraints123.insets = new Insets(0, 0, 0, 5); gridBagConstraints123.gridx = 3; gridBagConstraints123.anchor = GridBagConstraints.EAST; gridBagConstraints123.gridy = 33; jLabel39 = new JLabel(); jLabel39.setText("Habitat"); GridBagConstraints gridBagConstraints114 = new GridBagConstraints(); gridBagConstraints114.insets = new Insets(0, 0, 0, 5); gridBagConstraints114.gridx = 0; gridBagConstraints114.anchor = GridBagConstraints.EAST; gridBagConstraints114.gridy = 33; jLabel38 = new JLabel(); jLabel38.setText("Associated Taxon"); GridBagConstraints gridBagConstraints94 = new GridBagConstraints(); gridBagConstraints94.gridwidth = 3; gridBagConstraints94.insets = new Insets(0, 0, 0, 5); gridBagConstraints94.gridx = 4; gridBagConstraints94.anchor = GridBagConstraints.WEST; gridBagConstraints94.gridy = 18; jLabel36 = new JLabel(); jLabel36.setText("Valid Dist."); GridBagConstraints gridBagConstraints83 = new GridBagConstraints(); gridBagConstraints83.gridx = 3; gridBagConstraints83.anchor = GridBagConstraints.EAST; gridBagConstraints83.insets = new Insets(0, 0, 0, 5); gridBagConstraints83.weightx = 1.0; gridBagConstraints83.gridy = 18; GridBagConstraints gridBagConstraints65 = new GridBagConstraints(); gridBagConstraints65.insets = new Insets(0, 0, 0, 5); gridBagConstraints65.gridx = 0; gridBagConstraints65.anchor = GridBagConstraints.NORTHEAST; gridBagConstraints65.gridy = 35; jLabel35 = new JLabel(); jLabel35.setText("Specimen Notes"); GridBagConstraints gridBagConstraints47 = new GridBagConstraints(); gridBagConstraints47.insets = new Insets(0, 0, 0, 5); gridBagConstraints47.gridx = 0; gridBagConstraints47.fill = GridBagConstraints.VERTICAL; gridBagConstraints47.ipady = 12; gridBagConstraints47.gridy = 5; jLabel34 = new JLabel(); jLabel34.setText(" "); GridBagConstraints gridBagConstraints19 = new GridBagConstraints(); gridBagConstraints19.insets = new Insets(0, 0, 0, 0); gridBagConstraints19.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints19.gridy = 23; gridBagConstraints19.weightx = 1.0; gridBagConstraints19.anchor = GridBagConstraints.NORTH; gridBagConstraints19.gridwidth = 5; gridBagConstraints19.gridx = 3; GridBagConstraints gridBagConstraints18 = new GridBagConstraints(); gridBagConstraints18.insets = new Insets(0, 0, 0, 5); gridBagConstraints18.fill = GridBagConstraints.BOTH; gridBagConstraints18.gridy = 19; gridBagConstraints18.weightx = 1.0; gridBagConstraints18.anchor = GridBagConstraints.WEST; gridBagConstraints18.gridx = 4; GridBagConstraints gbc_jLabelElevation = new GridBagConstraints(); gbc_jLabelElevation.insets = new Insets(0, 0, 0, 5); gbc_jLabelElevation.gridx = 3; gbc_jLabelElevation.anchor = GridBagConstraints.EAST; gbc_jLabelElevation.gridy = 19; jLabelElevation = new JLabel(); jLabelElevation.setText("Elevation"); jLabel25 = new JLabel(); jLabel25.setText("Text"); jLabel26 = new JLabel(); jLabel26.setText("Text"); jLabel28 = new JLabel(); jLabel28.setText("Rank"); GridBagConstraints gridBagConstraints161 = new GridBagConstraints(); gridBagConstraints161.gridx = 0; GridBagConstraints gridBagConstraints151 = new GridBagConstraints(); gridBagConstraints151.insets = new Insets(0, 0, 0, 5); gridBagConstraints151.fill = GridBagConstraints.BOTH; gridBagConstraints151.gridy = 27; gridBagConstraints151.weightx = 1.0; gridBagConstraints151.gridx = 1; GridBagConstraints gridBagConstraints141 = new GridBagConstraints(); gridBagConstraints141.insets = new Insets(0, 0, 0, 5); gridBagConstraints141.fill = GridBagConstraints.BOTH; gridBagConstraints141.gridy = 26; gridBagConstraints141.weightx = 1.0; gridBagConstraints141.gridx = 1; GridBagConstraints gridBagConstraints132 = new GridBagConstraints(); gridBagConstraints132.gridwidth = 3; gridBagConstraints132.insets = new Insets(0, 0, 0, 5); gridBagConstraints132.fill = GridBagConstraints.BOTH; gridBagConstraints132.gridy = 27; gridBagConstraints132.weightx = 1.0; gridBagConstraints132.gridx = 4; GridBagConstraints gridBagConstraints122 = new GridBagConstraints(); gridBagConstraints122.gridwidth = 3; gridBagConstraints122.insets = new Insets(0, 0, 0, 5); gridBagConstraints122.fill = GridBagConstraints.BOTH; gridBagConstraints122.gridy = 26; gridBagConstraints122.weightx = 1.0; gridBagConstraints122.gridx = 4; GridBagConstraints gridBagConstraints113 = new GridBagConstraints(); gridBagConstraints113.insets = new Insets(0, 0, 0, 5); gridBagConstraints113.gridx = 3; gridBagConstraints113.anchor = GridBagConstraints.EAST; gridBagConstraints113.gridy = 27; GridBagConstraints gridBagConstraints103 = new GridBagConstraints(); gridBagConstraints103.insets = new Insets(0, 0, 0, 5); gridBagConstraints103.gridx = 3; gridBagConstraints103.anchor = GridBagConstraints.EAST; gridBagConstraints103.gridy = 26; GridBagConstraints gridBagConstraints93 = new GridBagConstraints(); gridBagConstraints93.insets = new Insets(0, 0, 0, 5); gridBagConstraints93.fill = GridBagConstraints.BOTH; gridBagConstraints93.gridy = 12; gridBagConstraints93.weightx = 1.0; gridBagConstraints93.gridx = 1; GridBagConstraints gridBagConstraints84 = new GridBagConstraints(); gridBagConstraints84.gridwidth = 3; gridBagConstraints84.fill = GridBagConstraints.BOTH; gridBagConstraints84.gridy = 12; gridBagConstraints84.weightx = 1.0; gridBagConstraints84.anchor = GridBagConstraints.WEST; gridBagConstraints84.insets = new Insets(0, 0, 0, 5); gridBagConstraints84.gridx = 4; GridBagConstraints gridBagConstraints74 = new GridBagConstraints(); gridBagConstraints74.insets = new Insets(0, 0, 0, 5); gridBagConstraints74.gridx = 3; gridBagConstraints74.anchor = GridBagConstraints.EAST; gridBagConstraints74.weightx = 0.0; gridBagConstraints74.gridy = 12; // GridBagConstraints gridBagConstraints64 = new GridBagConstraints(); // gridBagConstraints64.fill = GridBagConstraints.BOTH; // gridBagConstraints64.gridy = 14; // gridBagConstraints64.weightx = 1.0; // gridBagConstraints64.gridx = 3; GridBagConstraints gridBagConstraints55 = new GridBagConstraints(); gridBagConstraints55.gridx = 2; gridBagConstraints55.gridy = 14; //jLabel31 = new JLabel(); //jLabel31.setText("Qual."); GridBagConstraints gridBagConstraints46 = new GridBagConstraints(); gridBagConstraints46.insets = new Insets(0, 0, 0, 5); gridBagConstraints46.fill = GridBagConstraints.BOTH; gridBagConstraints46.gridy = 14; gridBagConstraints46.weightx = 1.0; gridBagConstraints46.anchor = GridBagConstraints.WEST; gridBagConstraints46.gridx = 1; gridBagConstraints46.gridwidth = 2; GridBagConstraints gridBagConstraints36 = new GridBagConstraints(); gridBagConstraints36.insets = new Insets(0, 0, 0, 5); gridBagConstraints36.gridx = 0; gridBagConstraints36.anchor = GridBagConstraints.EAST; gridBagConstraints36.gridy = 14; jLabel30 = new JLabel(); jLabel30.setText("Unnamed Form"); GridBagConstraints gridBagConstraints210 = new GridBagConstraints(); gridBagConstraints210.insets = new Insets(0, 0, 0, 5); gridBagConstraints210.fill = GridBagConstraints.BOTH; gridBagConstraints210.gridy = 13; gridBagConstraints210.weightx = 1.0; gridBagConstraints210.anchor = GridBagConstraints.WEST; gridBagConstraints210.gridwidth = 2; gridBagConstraints210.gridx = 1; GridBagConstraints gridBagConstraints112 = new GridBagConstraints(); gridBagConstraints112.insets = new Insets(0, 0, 0, 5); gridBagConstraints112.gridx = 0; gridBagConstraints112.anchor = GridBagConstraints.EAST; gridBagConstraints112.gridy = 13; jLabel29 = new JLabel(); jLabel29.setText("Author"); GridBagConstraints gridBagConstraints110 = new GridBagConstraints(); gridBagConstraints110.insets = new Insets(0, 0, 0, 5); gridBagConstraints110.gridx = 0; gridBagConstraints110.gridy = 12; jLabel27 = new JLabel(); jLabel27.setText("Infrasubspecifc Name"); GridBagConstraints gridBagConstraints63 = new GridBagConstraints(); gridBagConstraints63.insets = new Insets(0, 0, 0, 5); gridBagConstraints63.fill = GridBagConstraints.BOTH; gridBagConstraints63.gridy = 25; gridBagConstraints63.weightx = 1.0; gridBagConstraints63.anchor = GridBagConstraints.WEST; gridBagConstraints63.gridx = 1; GridBagConstraints gridBagConstraints35 = new GridBagConstraints(); gridBagConstraints35.insets = new Insets(0, 0, 0, 5); gridBagConstraints35.gridx = 0; gridBagConstraints35.anchor = GridBagConstraints.EAST; gridBagConstraints35.gridy = 25; jLabel22 = new JLabel(); jLabel22.setText("Verbatim Date"); GridBagConstraints gridBagConstraints27 = new GridBagConstraints(); gridBagConstraints27.insets = new Insets(0, 0, 0, 5); gridBagConstraints27.fill = GridBagConstraints.BOTH; gridBagConstraints27.gridy = 30; gridBagConstraints27.weightx = 1.0; gridBagConstraints27.anchor = GridBagConstraints.WEST; gridBagConstraints27.gridx = 1; GridBagConstraints gridBagConstraints102 = new GridBagConstraints(); gridBagConstraints102.insets = new Insets(0, 0, 0, 0); gridBagConstraints102.fill = GridBagConstraints.VERTICAL; gridBagConstraints102.gridy = 30; gridBagConstraints102.weightx = 1.0; gridBagConstraints102.anchor = GridBagConstraints.WEST; gridBagConstraints102.gridwidth = 4; gridBagConstraints102.gridx = 4; GridBagConstraints gridBagConstraints92 = new GridBagConstraints(); gridBagConstraints92.insets = new Insets(0, 0, 0, 5); gridBagConstraints92.gridx = 3; gridBagConstraints92.anchor = GridBagConstraints.EAST; gridBagConstraints92.gridy = 30; jLabel21 = new JLabel(); jLabel21.setText("Sex"); GridBagConstraints gridBagConstraints82 = new GridBagConstraints(); gridBagConstraints82.insets = new Insets(0, 0, 0, 5); gridBagConstraints82.gridx = 0; gridBagConstraints82.anchor = GridBagConstraints.EAST; gridBagConstraints82.gridy = 30; jLabel20 = new JLabel(); jLabel20.setText("LifeStage"); GridBagConstraints gridBagConstraints62 = new GridBagConstraints(); gridBagConstraints62.insets = new Insets(0, 0, 0, 0); gridBagConstraints62.fill = GridBagConstraints.BOTH; gridBagConstraints62.gridy = 7; gridBagConstraints62.weightx = 1.0; gridBagConstraints62.anchor = GridBagConstraints.WEST; gridBagConstraints62.gridwidth = 4; gridBagConstraints62.gridx = 4; GridBagConstraints gridBagConstraints53 = new GridBagConstraints(); gridBagConstraints53.insets = new Insets(0, 0, 0, 5); gridBagConstraints53.fill = GridBagConstraints.BOTH; gridBagConstraints53.gridy = 7; gridBagConstraints53.weightx = 1.0; gridBagConstraints53.anchor = GridBagConstraints.WEST; gridBagConstraints53.gridwidth = 1; gridBagConstraints53.gridx = 1; GridBagConstraints gridBagConstraints44 = new GridBagConstraints(); gridBagConstraints44.insets = new Insets(0, 0, 0, 5); gridBagConstraints44.fill = GridBagConstraints.BOTH; gridBagConstraints44.gridy = 6; gridBagConstraints44.weightx = 1.0; gridBagConstraints44.anchor = GridBagConstraints.WEST; gridBagConstraints44.gridwidth = 3; gridBagConstraints44.gridx = 1; GridBagConstraints gbc_jLabelTribe = new GridBagConstraints(); gbc_jLabelTribe.insets = new Insets(0, 0, 0, 5); gbc_jLabelTribe.gridx = 3; gbc_jLabelTribe.anchor = GridBagConstraints.EAST; gbc_jLabelTribe.gridy = 7; jLabelTribe = new JLabel(); jLabelTribe.setText("Tribe"); GridBagConstraints gridBagConstraints26 = new GridBagConstraints(); gridBagConstraints26.insets = new Insets(0, 0, 0, 5); gridBagConstraints26.gridx = 0; gridBagConstraints26.anchor = GridBagConstraints.EAST; gridBagConstraints26.gridy = 7; jLabel17 = new JLabel(); jLabel17.setText("Subfamily"); GridBagConstraints gridBagConstraints16 = new GridBagConstraints(); gridBagConstraints16.insets = new Insets(0, 0, 0, 5); gridBagConstraints16.gridx = 0; gridBagConstraints16.anchor = GridBagConstraints.EAST; gridBagConstraints16.gridy = 6; jLabel16 = new JLabel(); jLabel16.setText("Family"); GridBagConstraints gridBagConstraints131 = new GridBagConstraints(); gridBagConstraints131.insets = new Insets(0, 0, 0, 5); gridBagConstraints131.fill = GridBagConstraints.BOTH; gridBagConstraints131.gridy = 19; gridBagConstraints131.weightx = 1.0; gridBagConstraints131.anchor = GridBagConstraints.WEST; gridBagConstraints131.gridwidth = 2; gridBagConstraints131.gridx = 1; GridBagConstraints gridBagConstraints121 = new GridBagConstraints(); gridBagConstraints121.insets = new Insets(0, 0, 0, 5); gridBagConstraints121.fill = GridBagConstraints.BOTH; gridBagConstraints121.gridy = 18; gridBagConstraints121.weightx = 1.0; gridBagConstraints121.anchor = GridBagConstraints.WEST; gridBagConstraints121.gridwidth = 1; gridBagConstraints121.gridx = 1; GridBagConstraints gridBagConstraints111 = new GridBagConstraints(); gridBagConstraints111.insets = new Insets(0, 0, 0, 0); gridBagConstraints111.fill = GridBagConstraints.BOTH; gridBagConstraints111.gridy = 16; gridBagConstraints111.weightx = 1.0; gridBagConstraints111.anchor = GridBagConstraints.WEST; gridBagConstraints111.gridwidth = 7; gridBagConstraints111.gridx = 1; GridBagConstraints gridBagConstraints101 = new GridBagConstraints(); gridBagConstraints101.insets = new Insets(0, 0, 0, 5); gridBagConstraints101.gridx = 0; gridBagConstraints101.anchor = GridBagConstraints.EAST; gridBagConstraints101.gridy = 19; jLabel15 = new JLabel(); jLabel15.setText("State/Province"); GridBagConstraints gridBagConstraints91 = new GridBagConstraints(); gridBagConstraints91.insets = new Insets(0, 0, 0, 5); gridBagConstraints91.gridx = 0; gridBagConstraints91.anchor = GridBagConstraints.EAST; gridBagConstraints91.gridy = 18; jLabel14 = new JLabel(); jLabel14.setText("Country"); GridBagConstraints gridBagConstraints81 = new GridBagConstraints(); gridBagConstraints81.insets = new Insets(0, 0, 0, 5); gridBagConstraints81.gridx = 0; gridBagConstraints81.anchor = GridBagConstraints.EAST; gridBagConstraints81.gridy = 16; jLabel13 = new JLabel(); jLabel13.setText("Verbatim Locality"); GridBagConstraints gridBagConstraints71 = new GridBagConstraints(); gridBagConstraints71.insets = new Insets(0, 0, 0, 5); gridBagConstraints71.fill = GridBagConstraints.BOTH; gridBagConstraints71.gridy = 15; gridBagConstraints71.weightx = 1.0; gridBagConstraints71.anchor = GridBagConstraints.WEST; gridBagConstraints71.gridx = 1; GridBagConstraints gridBagConstraints61 = new GridBagConstraints(); gridBagConstraints61.insets = new Insets(0, 0, 0, 5); gridBagConstraints61.gridx = 0; gridBagConstraints61.anchor = GridBagConstraints.EAST; gridBagConstraints61.gridy = 15; jLabel12 = new JLabel(); jLabel12.setText("DrawerNumber"); GridBagConstraints gridBagConstraints52 = new GridBagConstraints(); gridBagConstraints52.insets = new Insets(0, 0, 0, 0); gridBagConstraints52.fill = GridBagConstraints.BOTH; gridBagConstraints52.gridy = 43; gridBagConstraints52.weightx = 1.0; gridBagConstraints52.weighty = 1.0; gridBagConstraints52.gridwidth = 8; gridBagConstraints52.gridx = 0; GridBagConstraints gridBagConstraints43 = new GridBagConstraints(); gridBagConstraints43.gridheight = 2; gridBagConstraints43.gridx = 0; gridBagConstraints43.anchor = GridBagConstraints.NORTHEAST; gridBagConstraints43.ipady = 0; gridBagConstraints43.insets = new Insets(0, 0, 0, 5); gridBagConstraints43.gridy = 23; GridBagConstraints gridBagConstraints33 = new GridBagConstraints(); gridBagConstraints33.insets = new Insets(0, 0, 0, 5); gridBagConstraints33.gridx = 0; gridBagConstraints33.anchor = GridBagConstraints.NORTHEAST; gridBagConstraints33.gridy = 4; GridBagConstraints gridBagConstraints25 = new GridBagConstraints(); gridBagConstraints25.insets = new Insets(0, 0, 0, 5); gridBagConstraints25.fill = GridBagConstraints.BOTH; gridBagConstraints25.gridy = 3; gridBagConstraints25.weightx = 1.0; gridBagConstraints25.weighty = 0.0; gridBagConstraints25.gridheight = 3; gridBagConstraints25.gridwidth = 6; gridBagConstraints25.gridx = 1; GridBagConstraints gridBagConstraints15 = new GridBagConstraints(); gridBagConstraints15.insets = new Insets(0, 0, 0, 5); gridBagConstraints15.gridx = 0; gridBagConstraints15.anchor = GridBagConstraints.NORTHEAST; gridBagConstraints15.gridy = 3; jLabel11 = new JLabel(); jLabel11.setText("Numbers"); GridBagConstraints gridBagConstraints42 = new GridBagConstraints(); gridBagConstraints42.insets = new Insets(0, 0, 0, 5); gridBagConstraints42.gridx = 3; gridBagConstraints42.anchor = GridBagConstraints.EAST; gridBagConstraints42.gridy = 37; jLabel10 = new JLabel(); jLabel10.setText("Date Created"); GridBagConstraints gridBagConstraints32 = new GridBagConstraints(); gridBagConstraints32.insets = new Insets(0, 0, 0, 0); gridBagConstraints32.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints32.gridy = 37; gridBagConstraints32.weightx = 1.0; gridBagConstraints32.anchor = GridBagConstraints.WEST; gridBagConstraints32.gridwidth = 4; gridBagConstraints32.gridx = 4; GridBagConstraints gridBagConstraints24 = new GridBagConstraints(); gridBagConstraints24.insets = new Insets(0, 0, 0, 5); gridBagConstraints24.gridx = 0; gridBagConstraints24.anchor = GridBagConstraints.EAST; gridBagConstraints24.gridy = 37; jLabel9 = new JLabel(); jLabel9.setText("CreatedBy"); GridBagConstraints gridBagConstraints14 = new GridBagConstraints(); gridBagConstraints14.insets = new Insets(0, 0, 0, 5); gridBagConstraints14.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints14.gridy = 37; gridBagConstraints14.weightx = 1.0; gridBagConstraints14.anchor = GridBagConstraints.WEST; gridBagConstraints14.gridx = 1; GridBagConstraints gridBagConstraints23 = new GridBagConstraints(); gridBagConstraints23.insets = new Insets(0, 0, 0, 0); gridBagConstraints23.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints23.gridy = 39; gridBagConstraints23.weightx = 1.0; gridBagConstraints23.anchor = GridBagConstraints.WEST; gridBagConstraints23.gridwidth = 4; gridBagConstraints23.gridx = 4; GridBagConstraints gridBagConstraints13 = new GridBagConstraints(); gridBagConstraints13.insets = new Insets(0, 0, 0, 5); gridBagConstraints13.gridx = 3; gridBagConstraints13.anchor = GridBagConstraints.EAST; gridBagConstraints13.gridy = 39; jLabel8 = new JLabel(); jLabel8.setText("Last Updated"); GridBagConstraints gridBagConstraints22 = new GridBagConstraints(); gridBagConstraints22.insets = new Insets(0, 0, 0, 5); gridBagConstraints22.gridx = 0; gridBagConstraints22.anchor = GridBagConstraints.NORTHEAST; gridBagConstraints22.gridy = 22; jLabel7 = new JLabel(); jLabel7.setText("Collectors"); GridBagConstraints gridBagConstraints12 = new GridBagConstraints(); gridBagConstraints12.insets = new Insets(0, 0, 0, 5); gridBagConstraints12.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints12.gridy = 39; gridBagConstraints12.weightx = 1.0; gridBagConstraints12.anchor = GridBagConstraints.NORTHWEST; gridBagConstraints12.gridx = 1; GridBagConstraints gridBagConstraints51 = new GridBagConstraints(); gridBagConstraints51.insets = new Insets(0, 0, 0, 5); gridBagConstraints51.fill = GridBagConstraints.BOTH; gridBagConstraints51.gridy = 22; gridBagConstraints51.weightx = 1.0; gridBagConstraints51.anchor = GridBagConstraints.WEST; gridBagConstraints51.gridheight = 3; gridBagConstraints51.gridwidth = 2; gridBagConstraints51.gridx = 1; GridBagConstraints gridBagConstraints41 = new GridBagConstraints(); gridBagConstraints41.insets = new Insets(0, 0, 0, 5); gridBagConstraints41.gridx = 0; gridBagConstraints41.fill = GridBagConstraints.NONE; gridBagConstraints41.anchor = GridBagConstraints.NORTHEAST; gridBagConstraints41.gridy = 39; jLabel6 = new JLabel(); jLabel6.setText("LastUpdatedBy"); GridBagConstraints gridBagConstraints31 = new GridBagConstraints(); gridBagConstraints31.insets = new Insets(0, 0, 0, 5); gridBagConstraints31.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints31.gridy = 21; gridBagConstraints31.weightx = 1.0; gridBagConstraints31.anchor = GridBagConstraints.WEST; gridBagConstraints31.gridwidth = 6; gridBagConstraints31.gridx = 1; GridBagConstraints gridBagConstraints21 = new GridBagConstraints(); gridBagConstraints21.insets = new Insets(0, 0, 0, 5); gridBagConstraints21.gridx = 0; gridBagConstraints21.anchor = GridBagConstraints.SOUTHEAST; gridBagConstraints21.gridy = 21; jLabel5 = new JLabel(); jLabel5.setText("Collection"); GridBagConstraints gridBagConstraints10 = new GridBagConstraints(); gridBagConstraints10.insets = new Insets(0, 0, 0, 0); gridBagConstraints10.gridx = 7; gridBagConstraints10.anchor = GridBagConstraints.NORTHWEST; gridBagConstraints10.gridy = 41; gridBagConstraints10.weighty = 0.0; GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); gridBagConstraints9.insets = new Insets(0, 0, 0, 5); gridBagConstraints9.gridx = 0; gridBagConstraints9.anchor = GridBagConstraints.EAST; gridBagConstraints9.gridy = 11; jLabel4 = new JLabel(); jLabel4.setText("Subspecies"); GridBagConstraints gridBagConstraints8 = new GridBagConstraints(); gridBagConstraints8.insets = new Insets(0, 0, 0, 5); gridBagConstraints8.gridx = 0; gridBagConstraints8.anchor = GridBagConstraints.EAST; gridBagConstraints8.gridy = 10; jLabel3 = new JLabel(); jLabel3.setText("Species"); GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); gridBagConstraints7.insets = new Insets(0, 0, 0, 0); gridBagConstraints7.fill = GridBagConstraints.BOTH; gridBagConstraints7.gridy = 20; gridBagConstraints7.weightx = 1.0; gridBagConstraints7.anchor = GridBagConstraints.WEST; gridBagConstraints7.gridwidth = 7; gridBagConstraints7.gridx = 1; GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); gridBagConstraints5.insets = new Insets(0, 0, 0, 5); gridBagConstraints5.fill = GridBagConstraints.BOTH; gridBagConstraints5.gridy = 11; gridBagConstraints5.weightx = 1.0; gridBagConstraints5.anchor = GridBagConstraints.WEST; gridBagConstraints5.gridwidth = 2; gridBagConstraints5.gridx = 1; GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.insets = new Insets(0, 0, 0, 5); gridBagConstraints4.fill = GridBagConstraints.BOTH; gridBagConstraints4.gridy = 10; gridBagConstraints4.weightx = 1.0; gridBagConstraints4.anchor = GridBagConstraints.WEST; gridBagConstraints4.gridwidth = 2; gridBagConstraints4.gridx = 1; GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); gridBagConstraints3.insets = new Insets(0, 0, 0, 5); gridBagConstraints3.fill = GridBagConstraints.BOTH; gridBagConstraints3.gridy = 9; gridBagConstraints3.weightx = 1.0; gridBagConstraints3.anchor = GridBagConstraints.WEST; gridBagConstraints3.gridwidth = 2; gridBagConstraints3.gridx = 1; GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.insets = new Insets(0, 0, 0, 5); gridBagConstraints2.gridx = 0; gridBagConstraints2.anchor = GridBagConstraints.EAST; gridBagConstraints2.gridy = 9; jLabel2 = new JLabel(); jLabel2.setText("Genus"); GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); gridBagConstraints11.gridx = 0; gridBagConstraints11.gridy = 1; GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.insets = new Insets(0, 0, 0, 5); gridBagConstraints1.fill = GridBagConstraints.BOTH; gridBagConstraints1.gridy = 0; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.anchor = GridBagConstraints.WEST; gridBagConstraints1.gridx = 1; GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.insets = new Insets(0, 0, 0, 5); gridBagConstraints.gridx = 0; gridBagConstraints.anchor = GridBagConstraints.EAST; gridBagConstraints.gridy = 0; jLabel = new JLabel(); jLabel.setText("Barcode"); jPanel = new JPanel(); GridBagLayout gbl_jPanel = new GridBagLayout(); gbl_jPanel.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; gbl_jPanel.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; gbl_jPanel.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; gbl_jPanel.columnWeights = new double[] { 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0 }; jPanel.setLayout(gbl_jPanel); jPanel.add(jLabel, gridBagConstraints); jPanel.add(getJTextFieldBarcode(), gridBagConstraints1); jPanel.add(jLabel2, gridBagConstraints2); jPanel.add(getJTextField1(), gridBagConstraints3); GridBagConstraints gbc_lblNatureofid = new GridBagConstraints(); gbc_lblNatureofid.anchor = GridBagConstraints.EAST; gbc_lblNatureofid.insets = new Insets(0, 0, 0, 5); gbc_lblNatureofid.gridx = 3; gbc_lblNatureofid.gridy = 9; jPanel.add(getLblNatureofid(), gbc_lblNatureofid); jComboBoxNatureOfId = getJComboBoxNatureOfId(); GridBagConstraints gbc_jTextFieldNatureOfID = new GridBagConstraints(); gbc_jTextFieldNatureOfID.gridwidth = 4; gbc_jTextFieldNatureOfID.insets = new Insets(0, 0, 0, 0); gbc_jTextFieldNatureOfID.fill = GridBagConstraints.HORIZONTAL; gbc_jTextFieldNatureOfID.gridx = 4; gbc_jTextFieldNatureOfID.gridy = 9; jPanel.add(jComboBoxNatureOfId, gbc_jTextFieldNatureOfID); jPanel.add(getJTextField12(), gridBagConstraints4); GridBagConstraints gbc_lblIdDate = new GridBagConstraints(); gbc_lblIdDate.anchor = GridBagConstraints.EAST; gbc_lblIdDate.insets = new Insets(0, 0, 0, 5); gbc_lblIdDate.gridx = 3; gbc_lblIdDate.gridy = 10; jPanel.add(getLblIdDate(), gbc_lblIdDate); jTextFieldDateDetermined = getJTextFieldDateDetermined(); GridBagConstraints gbc_jTextFieldDateDetermined = new GridBagConstraints(); gbc_jTextFieldDateDetermined.gridwidth = 4; gbc_jTextFieldDateDetermined.insets = new Insets(0, 0, 0, 0); gbc_jTextFieldDateDetermined.fill = GridBagConstraints.HORIZONTAL; gbc_jTextFieldDateDetermined.gridx = 4; gbc_jTextFieldDateDetermined.gridy = 10; jPanel.add(jTextFieldDateDetermined, gbc_jTextFieldDateDetermined); jTextFieldDateDetermined.setColumns(10); jPanel.add(getJTextField2(), gridBagConstraints5); JLabel lblIdBy = new JLabel("Id By"); GridBagConstraints gbc_lblIdBy = new GridBagConstraints(); gbc_lblIdBy.anchor = GridBagConstraints.EAST; gbc_lblIdBy.insets = new Insets(0, 0, 0, 5); gbc_lblIdBy.gridx = 3; gbc_lblIdBy.gridy = 11; jPanel.add(lblIdBy, gbc_lblIdBy); jCBDeterminer = getJCBDeterminer(); GridBagConstraints gbc_jTextFieldDeterminer = new GridBagConstraints(); gbc_jTextFieldDeterminer.gridwidth = 4; gbc_jTextFieldDeterminer.insets = new Insets(0, 0, 0, 0); gbc_jTextFieldDeterminer.fill = GridBagConstraints.HORIZONTAL; gbc_jTextFieldDeterminer.gridx = 4; gbc_jTextFieldDeterminer.gridy = 11; jPanel.add(jCBDeterminer, gbc_jTextFieldDeterminer); GridBagConstraints gbc_lblIdRemarks = new GridBagConstraints(); gbc_lblIdRemarks.anchor = GridBagConstraints.EAST; gbc_lblIdRemarks.insets = new Insets(0, 0, 0, 5); gbc_lblIdRemarks.gridx = 3; gbc_lblIdRemarks.gridy = 13; jPanel.add(getLblIdRemarks(), gbc_lblIdRemarks); jTextFieldIdRemarks = getJTextFieldIdRemarks(); GridBagConstraints gbc_jTextFieldIdRemarks = new GridBagConstraints(); gbc_jTextFieldIdRemarks.insets = new Insets(0, 0, 0, 0); gbc_jTextFieldIdRemarks.fill = GridBagConstraints.HORIZONTAL; gbc_jTextFieldIdRemarks.gridx = 4; gbc_jTextFieldIdRemarks.gridy = 13; gbc_jTextFieldIdRemarks.gridwidth = 4; jPanel.add(jTextFieldIdRemarks, gbc_jTextFieldIdRemarks); jTextFieldIdRemarks.setColumns(10); GridBagConstraints gbc_lblTypestatus = new GridBagConstraints(); gbc_lblTypestatus.anchor = GridBagConstraints.EAST; gbc_lblTypestatus.insets = new Insets(0, 0, 0, 5); gbc_lblTypestatus.gridx = 3; gbc_lblTypestatus.gridy = 14; jPanel.add(getLblTypestatus(), gbc_lblTypestatus); cbTypeStatus = getCbTypeStatus(); GridBagConstraints gbc_cbTypeStatus = new GridBagConstraints(); gbc_cbTypeStatus.gridwidth = 4; gbc_cbTypeStatus.insets = new Insets(0, 0, 0, 5); gbc_cbTypeStatus.fill = GridBagConstraints.HORIZONTAL; gbc_cbTypeStatus.gridx = 4; gbc_cbTypeStatus.gridy = 14; jPanel.add(cbTypeStatus, gbc_cbTypeStatus); GridBagConstraints gbc_lblHigherGeography = new GridBagConstraints(); gbc_lblHigherGeography.anchor = GridBagConstraints.EAST; gbc_lblHigherGeography.insets = new Insets(0, 0, 0, 5); gbc_lblHigherGeography.gridx = 0; gbc_lblHigherGeography.gridy = 17; jPanel.add(getLblHigherGeography(), gbc_lblHigherGeography); GridBagConstraints gbc_comboBoxElevUnits = new GridBagConstraints(); gbc_comboBoxElevUnits.insets = new Insets(0, 0, 0, 0); gbc_comboBoxElevUnits.gridwidth = 7; gbc_comboBoxElevUnits.fill = GridBagConstraints.HORIZONTAL; gbc_comboBoxElevUnits.gridx = 1; gbc_comboBoxElevUnits.gridy = 17; jPanel.add(getComboBoxHighGeog(), gbc_comboBoxElevUnits); GridBagConstraints gbc_lblTo = new GridBagConstraints(); gbc_lblTo.insets = new Insets(0, 0, 0, 5); gbc_lblTo.anchor = GridBagConstraints.EAST; gbc_lblTo.gridx = 5; gbc_lblTo.gridy = 19; jPanel.add(getLblTo(), gbc_lblTo); GridBagConstraints gbc_textFieldMaxElev = new GridBagConstraints(); gbc_textFieldMaxElev.insets = new Insets(0, 0, 0, 5); gbc_textFieldMaxElev.fill = GridBagConstraints.BOTH; gbc_textFieldMaxElev.gridx = 6; gbc_textFieldMaxElev.gridy = 19; jPanel.add(getTextFieldMaxElev(), gbc_textFieldMaxElev); GridBagConstraints gbc_comboBoxMaxElev = new GridBagConstraints(); gbc_comboBoxMaxElev.insets = new Insets(0, 0, 0, 0); gbc_comboBoxMaxElev.fill = GridBagConstraints.HORIZONTAL; gbc_comboBoxMaxElev.gridx = 7; gbc_comboBoxMaxElev.gridy = 19; jPanel.add(getComboBoxElevUnits(), gbc_comboBoxMaxElev); jPanel.add(getJTextField3(), gridBagConstraints7); jPanel.add(jLabel3, gridBagConstraints8); jPanel.add(jLabel4, gridBagConstraints9); GridBagConstraints gridBagConstraints28 = new GridBagConstraints(); gridBagConstraints28.gridwidth = 4; gridBagConstraints28.insets = new Insets(0, 0, 0, 5); gridBagConstraints28.gridx = 3; gridBagConstraints28.anchor = GridBagConstraints.WEST; gridBagConstraints28.fill = GridBagConstraints.NONE; gridBagConstraints28.gridy = 22; jLabel33 = new JLabel(); jLabel33.setText("Collecting Method"); jPanel.add(jLabel33, gridBagConstraints28); GridBagConstraints gbc_georef = new GridBagConstraints(); gbc_georef.insets = new Insets(0, 0, 0, 0); gbc_georef.gridwidth = 5; gbc_georef.fill = GridBagConstraints.HORIZONTAL; gbc_georef.gridx = 3; gbc_georef.gridy = 24; GridBagConstraints gridBagConstraints72 = new GridBagConstraints(); gridBagConstraints72.insets = new Insets(0, 0, 0, 5); gridBagConstraints72.gridx = 0; gridBagConstraints72.anchor = GridBagConstraints.EAST; gridBagConstraints72.gridy = 28; jLabel19 = new JLabel(); jLabel19.setText("Features"); jPanel.add(jLabel19, gridBagConstraints72); GridBagConstraints gridBagConstraints17 = new GridBagConstraints(); gridBagConstraints17.insets = new Insets(0, 0, 0, 5); gridBagConstraints17.fill = GridBagConstraints.VERTICAL; gridBagConstraints17.gridy = 28; gridBagConstraints17.weightx = 1.0; gridBagConstraints17.anchor = GridBagConstraints.WEST; gridBagConstraints17.gridx = 1; jPanel.add(getJComboBoxFeatures(), gridBagConstraints17); GridBagConstraints gridBagConstraints104 = new GridBagConstraints(); gridBagConstraints104.insets = new Insets(0, 0, 0, 5); gridBagConstraints104.gridx = 3; gridBagConstraints104.anchor = GridBagConstraints.EAST; gridBagConstraints104.gridy = 28; jLabel37 = new JLabel(); jLabel37.setText("Prep Type"); jPanel.add(jLabel37, gridBagConstraints104); GridBagConstraints gridBagConstraints152 = new GridBagConstraints(); gridBagConstraints152.insets = new Insets(0, 0, 0, 0); gridBagConstraints152.fill = GridBagConstraints.BOTH; gridBagConstraints152.gridy = 28; gridBagConstraints152.weightx = 1.0; gridBagConstraints152.anchor = GridBagConstraints.WEST; gridBagConstraints152.gridwidth = 4; gridBagConstraints152.gridx = 4; jPanel.add(getJTextFieldPrepType(), gridBagConstraints152); GridBagConstraints gridBagConstraintsPR = new GridBagConstraints(); gridBagConstraintsPR.insets = new Insets(0, 0, 0, 0); gridBagConstraintsPR.gridx = 0; gridBagConstraintsPR.fill = GridBagConstraints.BOTH; gridBagConstraintsPR.gridwidth = 8; gridBagConstraintsPR.weighty = 1.0; gridBagConstraintsPR.gridy = 29; jPanel.add(getJScrollPaneSpecimenParts(), gridBagConstraintsPR); GridBagConstraints gbc_lblMicrohabitat = new GridBagConstraints(); gbc_lblMicrohabitat.anchor = GridBagConstraints.EAST; gbc_lblMicrohabitat.insets = new Insets(0, 0, 0, 5); gbc_lblMicrohabitat.gridx = 0; gbc_lblMicrohabitat.gridy = 34; jPanel.add(getLblMicrohabitat(), gbc_lblMicrohabitat); GridBagConstraints gbc_textField = new GridBagConstraints(); gbc_textField.insets = new Insets(0, 0, 0, 5); gbc_textField.fill = GridBagConstraints.HORIZONTAL; gbc_textField.gridx = 1; gbc_textField.gridy = 34; jPanel.add(getTextField(), gbc_textField); jPanel.add(getJButton(), gridBagConstraints10); jPanel.add(jLabel5, gridBagConstraints21); jPanel.add(getJTextFieldCollection(), gridBagConstraints31); jPanel.add(jLabel6, gridBagConstraints41); jPanel.add(getJTextField14(), gridBagConstraints12); jPanel.add(getJScrollPaneCollectors(), gridBagConstraints51); jPanel.add(jLabel7, gridBagConstraints22); jPanel.add(jLabel8, gridBagConstraints13); jPanel.add(getJTextFieldDateUpdated(), gridBagConstraints23); jPanel.add(getJTextField22(), gridBagConstraints14); jPanel.add(jLabel9, gridBagConstraints24); jPanel.add(getJTextField32(), gridBagConstraints32); jPanel.add(jLabel10, gridBagConstraints42); jPanel.add(jLabel11, gridBagConstraints15); jPanel.add(getJScrollPaneNumbers(), gridBagConstraints25); jPanel.add(getJButtonNumbersAdd(), gridBagConstraints33); jPanel.add(getJButtonCollsAdd(), gridBagConstraints43); jPanel.add(getJScrollPaneWarn(), gridBagConstraints52); jPanel.add(jLabel12, gridBagConstraints61); jPanel.add(getJTextField(), gridBagConstraints71); jPanel.add(jLabel13, gridBagConstraints81); jPanel.add(jLabel14, gridBagConstraints91); jPanel.add(jLabel15, gridBagConstraints101); jPanel.add(getJTextField4(), gridBagConstraints111); jPanel.add(getJTextField13(), gridBagConstraints121); jPanel.add(getJTextField23(), gridBagConstraints131); jPanel.add(jLabel16, gridBagConstraints16); jPanel.add(jLabel17, gridBagConstraints26); jPanel.add(jLabelTribe, gbc_jLabelTribe); jPanel.add(getJTextField5(), gridBagConstraints44); jPanel.add(getJTextFieldSubfamily(), gridBagConstraints53); jPanel.add(getJTextFieldTribe(), gridBagConstraints62); jPanel.add(jLabel20, gridBagConstraints82); jPanel.add(jLabel21, gridBagConstraints92); jPanel.add(getJComboBoxSex(), gridBagConstraints102); jPanel.add(getJComboBoxLifeStage(), gridBagConstraints27); jPanel.add(jLabel22, gridBagConstraints35); jPanel.add(getJTextFieldVerbatimDate(), gridBagConstraints63); jPanel.add(jLabel27, gridBagConstraints110); jPanel.add(jLabel29, gridBagConstraints112); jPanel.add(getJTextFieldAuthorship(), gridBagConstraints210); jPanel.add(jLabel30, gridBagConstraints36); jPanel.add(getJTextFieldUnnamedForm(), gridBagConstraints46); jPanel.add(jLabel28, gridBagConstraints74); jPanel.add(getJTextFieldInfraspecificRank(), gridBagConstraints84); jPanel.add(getJTextFieldInfraspecificName(), gridBagConstraints93); jPanel.add(jLabel25, gridBagConstraints103); jPanel.add(jLabel26, gridBagConstraints113); jPanel.add(getJTextFieldDateEmergedIndicator(), gridBagConstraints122); jPanel.add(getJTextFieldDateCollectedIndicator(), gridBagConstraints132); jPanel.add(getJTextFieldDateEmerged(), gridBagConstraints141); jPanel.add(getJTextFieldDateCollected(), gridBagConstraints151); jPanel.add(jLabelElevation, gbc_jLabelElevation); jPanel.add(getJTextField11(), gridBagConstraints18); jPanel.add(getJTextFieldCollectingMethod(), gridBagConstraints19); jPanel.add(getJButtonGeoreference(), gbc_georef); jPanel.add(jLabel34, gridBagConstraints47); jPanel.add(jLabel35, gridBagConstraints65); jPanel.add(getJCheckBox(), gridBagConstraints83); jPanel.add(jLabel36, gridBagConstraints94); jPanel.add(jLabel38, gridBagConstraints114); jPanel.add(jLabel39, gridBagConstraints123); jPanel.add(jLabel40, gridBagConstraints133); jPanel.add(getJTextField20(), gridBagConstraints142); jPanel.add(getJTextField26(), gridBagConstraints162); jPanel.add(getJTextFieldHabitat(), gridBagConstraints172); jPanel.add(jLabel41, gridBagConstraints115); jPanel.add(getJComboBoxWorkflowStatus(), gridBagConstraints29); jPanel.add(jLabel42, gridBagConstraints37); jPanel.add(getJComboBox2(), gridBagConstraints48); jPanel.add(jLabel43, gridBagConstraints56); jPanel.add(getJTextFieldInferences(), gridBagConstraintsInfer); jPanel.add(getJButton1(), gridBagConstraints116); jPanel.add(getJPanel1(), gridBagConstraints211); jPanel.add(getJTextFieldISODate(), gridBagConstraints117); jPanel.add(getJButtonDets(), gridBagConstraints212); jPanel.add(jLabel31, gridBagConstraints118); jPanel.add(getJTextField9(), gridBagConstraints213); jPanel.add(getJButtonNext(), gridBagConstraints119); jPanel.add(getJButtonPrevious(), gridBagConstraints214); jPanel.add(getJScrollPaneNotes(), gridBagConstraints49); jPanel.add(jLabel44, gridBagConstraints120); jPanel.add(getJButton13(), gridBagConstraints215); jPanel.add(getJButton2(), gridBagConstraints38); jPanel.add(getJButtonSpecificLocality(), gridBagConstraints124); jPanel.add(getJTextFieldImgCount(), gridBagConstraintsImgCount); jPanel.add(getJLabelMigrationStatus(), gridBagConstraintsMS); } return jPanel; }
From source file:net.sf.jabref.gui.JabRefFrame.java
private void initLayout() { tabbedPane.putClientProperty(Options.NO_CONTENT_BORDER_KEY, Boolean.TRUE); setProgressBarVisible(false);/* w w w . jav a2 s.c o m*/ pushExternalButton = new PushToApplicationButton(this, PushToApplications.getApplications()); fillMenu(); createToolBar(); getContentPane().setLayout(gbl); splitPane.setDividerSize(2); splitPane.setBorder(null); //getContentPane().setBackground(GUIGlobals.lightGray); con.fill = GridBagConstraints.HORIZONTAL; con.anchor = GridBagConstraints.WEST; con.weightx = 1; con.weighty = 0; con.gridwidth = GridBagConstraints.REMAINDER; //gbl.setConstraints(mb, con); //getContentPane().add(mb); setJMenuBar(mb); con.anchor = GridBagConstraints.NORTH; //con.gridwidth = 1;//GridBagConstraints.REMAINDER;; gbl.setConstraints(tlb, con); getContentPane().add(tlb); Component lim = Box.createGlue(); gbl.setConstraints(lim, con); //getContentPane().add(lim); /* JPanel empt = new JPanel(); empt.setBackground(GUIGlobals.lightGray); gbl.setConstraints(empt, con); getContentPane().add(empt); con.insets = new Insets(1,0,1,1); con.anchor = GridBagConstraints.EAST; con.weightx = 0; gbl.setConstraints(searchManager, con); getContentPane().add(searchManager);*/ con.gridwidth = GridBagConstraints.REMAINDER; con.weightx = 1; con.weighty = 0; con.fill = GridBagConstraints.BOTH; con.anchor = GridBagConstraints.WEST; con.insets = new Insets(0, 0, 0, 0); lim = Box.createGlue(); gbl.setConstraints(lim, con); getContentPane().add(lim); //tabbedPane.setVisible(false); //tabbedPane.setForeground(GUIGlobals.lightGray); con.weighty = 1; gbl.setConstraints(splitPane, con); getContentPane().add(splitPane); UIManager.put("TabbedPane.contentBorderInsets", new Insets(0, 0, 0, 0)); splitPane.setRightComponent(tabbedPane); splitPane.setLeftComponent(sidePaneManager.getPanel()); sidePaneManager.updateView(); JPanel status = new JPanel(); status.setLayout(gbl); con.weighty = 0; con.weightx = 0; con.gridwidth = 1; con.insets = new Insets(0, 2, 0, 0); gbl.setConstraints(statusLabel, con); status.add(statusLabel); con.weightx = 1; con.insets = new Insets(0, 4, 0, 0); con.gridwidth = 1; gbl.setConstraints(statusLine, con); status.add(statusLine); con.weightx = 0; con.gridwidth = GridBagConstraints.REMAINDER; con.insets = new Insets(2, 4, 2, 2); gbl.setConstraints(progressBar, con); status.add(progressBar); con.weightx = 1; con.gridwidth = GridBagConstraints.REMAINDER; statusLabel.setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR.darker()); con.insets = new Insets(0, 0, 0, 0); gbl.setConstraints(status, con); getContentPane().add(status); // Drag and drop for tabbedPane: TransferHandler xfer = new EntryTableTransferHandler(null, this, null); tabbedPane.setTransferHandler(xfer); tlb.setTransferHandler(xfer); mb.setTransferHandler(xfer); sidePaneManager.getPanel().setTransferHandler(xfer); }