List of usage examples for javax.swing JButton setName
public void setName(String name)
From source file:Form.Principal.java
public void PanelUsuarios() { int i = 0;//w ww . j a v a 2 s .c o m int Altura = 0; Color gris = new Color(44, 44, 44); Color azul = new Color(0, 153, 255); Color rojo = new Color(221, 76, 76); try { //Consultamos todos los clientes ResultSet Comandos = Funcion.Select(st, "SELECT * FROM usuarios where Tipo!='Administrador';"); //Ciclo para crear un panel para cada uno while (Comandos.next()) { //Creamos un panel con alineacion a la izquierda JPanel Panel = new JPanel(); Panel.setLayout(null); jPanel12.add(Panel); //Tamao del panel Panel.setSize(500, 200); // La posicion y del panel ira incrementando para que no se encimen Altura = 40 + (i * 220); Panel.setLocation(175, Altura); Panel.setBackground(Color.white); Panel.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); //Creamos label para mostrar los datos del cliente, el codigo html es para que al llegar al final del panel //se pase a la siguiente linea y para el margen izquierdo JLabel Foto = new JLabel(); Foto.setSize(150, 150); File FotoPerfil = new File("Imagenes/Fotos Perfil/" + Comandos.getInt("id") + ".png"); File FotoPerfil2 = new File("Imagenes/Fotos Perfil/" + Comandos.getInt("id") + ".jpg"); if (FotoPerfil.exists()) { ImageIcon Imagen = new ImageIcon("Imagenes/Fotos Perfil/" + Comandos.getInt("id") + ".png"); Image ImagenEscalada = Imagen.getImage().getScaledInstance(Foto.getWidth(), Foto.getHeight(), Image.SCALE_SMOOTH); Icon IconoEscalado = new ImageIcon(ImagenEscalada); Foto.setIcon(IconoEscalado); } else if (FotoPerfil2.exists()) { ImageIcon Imagen = new ImageIcon("Imagenes/Fotos Perfil/" + Comandos.getInt("id") + ".jpg"); Image ImagenEscalada = Imagen.getImage().getScaledInstance(Foto.getWidth(), Foto.getHeight(), Image.SCALE_SMOOTH); Icon IconoEscalado = new ImageIcon(ImagenEscalada); Foto.setIcon(IconoEscalado); } else { ImageIcon Imagen = new ImageIcon(getClass().getResource("/Imagen/Default.png")); Image ImagenEscalada = Imagen.getImage().getScaledInstance(Foto.getWidth(), Foto.getHeight(), Image.SCALE_SMOOTH); Icon IconoEscalado = new ImageIcon(ImagenEscalada); Foto.setIcon(IconoEscalado); } JLabel Nombre = new JLabel(); Nombre.setText("Nombre de Usuario: " + Comandos.getString("Nombre")); JLabel Contrasena = new JLabel(); Contrasena.setText(("Contrasea: " + Comandos.getString("contrasena"))); JButton Editar = new JButton(); Editar.setText("Editar"); Editar.setName(Comandos.getString("id")); Editar.setBackground(azul); JButton Eliminar = new JButton(); Eliminar.setText("Eliminar"); Eliminar.setName(Comandos.getString("id")); Eliminar.setBackground(rojo); MouseListener mlEditar = new MouseListener() { @Override public void mouseReleased(MouseEvent e) { //System.out.println("Released!"); } @Override public void mousePressed(MouseEvent e) { //System.out.println("Pressed!"); } @Override public void mouseExited(MouseEvent e) { //System.out.println("Exited!"); } @Override public void mouseEntered(MouseEvent e) { //System.out.println("Entered!"); } @Override public void mouseClicked(MouseEvent e) { presionadoactual = 24; Color azul = new Color(0, 182, 230); jButton24.setBackground(azul); JButton source = (JButton) e.getSource(); System.out.println(source.getName()); jPanel17.setVisible(false); jButton30.setLocation(470, 480); jButton31.setLocation(270, 480); jLabel2.setToolTipText(null); jTabbedPane2.setSelectedIndex(5); editando = true; PerfilUsuario(Integer.parseInt(source.getName())); Color gris = new Color(44, 44, 44); jButton4.setBackground(gris); } }; MouseListener mlEliminar = new MouseListener() { @Override public void mouseReleased(MouseEvent e) { //System.out.println("Released!"); } @Override public void mousePressed(MouseEvent e) { //System.out.println("Pressed!"); } @Override public void mouseExited(MouseEvent e) { //System.out.println("Exited!"); } @Override public void mouseEntered(MouseEvent e) { //System.out.println("Entered!"); } @Override public void mouseClicked(MouseEvent e) { JButton source = (JButton) e.getSource(); System.out.println(source.getName()); Funcion.Update(st, "DELETE FROM usuarios WHERE id = " + source.getName() + ";"); jPanel12.removeAll(); PanelUsuarios(); jPanel12.repaint(); } }; Editar.addMouseListener(mlEditar); Eliminar.addMouseListener(mlEliminar); //Fuente del texto; Nombre.setFont(new Font("Verdana", Font.PLAIN, 15)); Nombre.setForeground(gris); Contrasena.setFont(new Font("Verdana", Font.PLAIN, 15)); Contrasena.setForeground(gris); Editar.setFont(new Font("Verdana", Font.PLAIN, 15)); Editar.setForeground(Color.white); Eliminar.setFont(new Font("Verdana", Font.PLAIN, 15)); Eliminar.setForeground(Color.white); //Aadimos los label al panel correspondiente del cliente Panel.add(Foto); Panel.add(Nombre); Panel.add(Contrasena); Panel.add(Editar); Panel.add(Eliminar); Foto.setLocation(10, 20); Nombre.setLocation(170, 30); Nombre.setSize(300, 45); Contrasena.setLocation(170, 60); Contrasena.setSize(300, 45); Editar.setLocation(170, 100); Editar.setSize(120, 40); Eliminar.setLocation(315, 100); Eliminar.setSize(120, 40); i++; } } catch (SQLException ex) { Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex); } //Dependiendo de cuantos clientes se agregaron, se ajusta el tamao del panel principal para que el scroll llegue hasta ahi jPanel12.setPreferredSize(new Dimension(jPanel12.getWidth(), Altura + 150)); }
From source file:Form.Principal.java
public void PanelClientes() { int i = 0;//from www .j av a 2s. c o m int Altura = 0; Color gris = new Color(44, 44, 44); Color rojo = new Color(221, 76, 76); Color azul = new Color(0, 153, 255); try { //Consultamos todos los clientes ResultSet Comandos = Funcion.Select(st, "SELECT * FROM cliente;"); //Ciclo para crear un panel para cada uno while (Comandos.next()) { //Creamos un panel con alineacion a la izquierda JPanel Panel = new JPanel(); Panel.setLayout(null); jPanel8.add(Panel); //Tamao del panel Panel.setSize(700, 195); // La posicion y del panel ira incrementando para que no se encimen Altura = 30 + (i * 205); Panel.setLocation(50, Altura); Panel.setBackground(Color.white); Panel.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); //Creamos label para mostrar los datos del cliente, el codigo html es para que al llegar al final del panel //se pase a la siguiente linea y para el margen izquierdo JLabel RFC = new JLabel(); RFC.setText("RFC: " + Comandos.getString("RFC")); JLabel Nombre = new JLabel(); Nombre.setText("Nombre: " + Comandos.getString("NombreCliente")); JTextArea Direccion = new JTextArea(); Direccion.setLineWrap(true); Direccion.setBorder(null); Direccion.setText("Direccin: " + Comandos.getString("Direccion")); JLabel Correo = new JLabel(); Correo.setText("Correo: " + Comandos.getString("correo")); JButton VerMas = new JButton(); VerMas.setText("Ver ms"); VerMas.setName(Comandos.getString("idCliente")); VerMas.setBackground(azul); JButton Eliminar = new JButton(); Eliminar.setText("Eliminar"); Eliminar.setName(Comandos.getString("idCliente")); Eliminar.setBackground(rojo); MouseListener mlVerMas = new MouseListener() { @Override public void mouseReleased(MouseEvent e) { //System.out.println("Released!"); } @Override public void mousePressed(MouseEvent e) { //System.out.println("Pressed!"); } @Override public void mouseExited(MouseEvent e) { //System.out.println("Exited!"); } @Override public void mouseEntered(MouseEvent e) { //System.out.println("Entered!"); e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } @Override public void mouseClicked(MouseEvent e) { JButton source = (JButton) e.getSource(); id = Integer.parseInt(source.getName()); jTabbedPane2.setSelectedIndex(4); jButton16.setVisible(true); jButton17.setVisible(true); jButtonEditar.setVisible(true); jPanel9.setVisible(true); jPanel10.setVisible(true); jPanel14.setVisible(false); LlenarPanel(); } }; VerMas.addMouseListener(mlVerMas); MouseListener mlEliminar = new MouseListener() { @Override public void mouseReleased(MouseEvent e) { //System.out.println("Released!"); } @Override public void mousePressed(MouseEvent e) { //System.out.println("Pressed!"); } @Override public void mouseExited(MouseEvent e) { //System.out.println("Exited!"); } @Override public void mouseEntered(MouseEvent e) { //System.out.println("Entered!"); e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } @Override public void mouseClicked(MouseEvent e) { JButton source = (JButton) e.getSource(); Funcion.Update(st, "DELETE FROM cliente WHERE idCliente = " + source.getName() + ";"); Autocompletar.removeAllItems(); Autocompletar = new TextAutoCompleter(jTextField2); ResultSet Comandos = Funcion.Select(st, "SELECT * FROM cliente;"); try { while (Comandos.next()) { Autocompletar.addItem(Comandos.getString("RFC")); } } catch (SQLException ex) { //Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex); } jPanel8.removeAll(); PanelClientes(); jPanel8.repaint(); } }; Eliminar.addMouseListener(mlEliminar); //Fuente del texto RFC.setFont(new Font("Verdana", Font.PLAIN, 14)); RFC.setForeground(gris); Nombre.setFont(new Font("Verdana", Font.PLAIN, 14)); Nombre.setForeground(gris); Direccion.setFont(new Font("Verdana", Font.PLAIN, 14)); Direccion.setForeground(gris); Correo.setFont(new Font("Verdana", Font.PLAIN, 14)); Correo.setForeground(gris); VerMas.setFont(new Font("Verdana", Font.PLAIN, 14)); VerMas.setForeground(Color.white); Eliminar.setFont(new Font("Verdana", Font.PLAIN, 14)); Eliminar.setForeground(Color.white); /*VERMAS.setFont(new Font("Verdana", Font.PLAIN, 13)); VERMAS.setForeground(azul);*/ //Aadimos los label al panel correspondiente del cliente Panel.add(RFC); Panel.add(Nombre); Panel.add(Direccion); Panel.add(Correo); Panel.add(VerMas); Panel.add(Eliminar); RFC.setLocation(30, 10); RFC.setSize(610, 30); Nombre.setLocation(30, 40); Nombre.setSize(610, 30); Direccion.setLocation(30, 75); Direccion.setSize(610, 40); Correo.setLocation(30, 115); Correo.setSize(610, 30); VerMas.setLocation(210, 150); VerMas.setSize(120, 35); Eliminar.setLocation(390, 150); Eliminar.setSize(120, 35); //Panel.add(VERMAS); i++; } } catch (SQLException ex) { Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex); } //Dependiendo de cuantos clientes se agregaron, se ajusta el tamao del panel principal para que el scroll llegue hasta ahi jPanel8.setPreferredSize(new Dimension(jPanel8.getWidth(), Altura + 205)); }
From source file:Form.Principal.java
public void PanelFacturas() { int i = 0;//from w ww .j a v a 2s.c o m int Altura = 0; Color gris = new Color(44, 44, 44); Color azul = new Color(0, 153, 255); Color rojo = new Color(221, 76, 76); try { //Consultamos todos los clientes ResultSet Comandos = Funcion.Select(st, "SELECT factura_emitida.*, cliente.* FROM cliente,factura_emitida WHERE factura_emitida.idCliente = cliente.idCliente;"); //Ciclo para crear un panel para cada uno while (Comandos.next()) { Variables.Comentario = Comandos.getString("Observaciones"); //Creamos un panel con alineacion a la izquierda JPanel Panel = new JPanel(); Panel.setLayout(null); jPanel11.add(Panel); //Tamao del panel Panel.setSize(680, 200); // La posicion y del panel ira incrementando para que no se encimen Altura = 30 + (i * 250); Panel.setLocation(50, Altura); Panel.setBackground(Color.white); Panel.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); //Creamos label para mostrar los datos del cliente, el codigo html es para que al llegar al final del panel //se pase a la siguiente linea y para el margen izquierdo JLabel FolioFactura = new JLabel(); FolioFactura.setText("Folio de factura: " + Comandos.getString("idFacturaEmitida")); JLabel RFC = new JLabel(); RFC.setText("RFC: " + Comandos.getString("RFC")); JLabel Nombre = new JLabel(); Nombre.setText("Nombre: " + Comandos.getString("NombreCliente")); JLabel Direccion = new JLabel(); Direccion.setText("Direccion: " + Comandos.getString("Direccion")); JLabel Correo = new JLabel(); Correo.setText("Correo: " + Comandos.getString("correo")); JLabel Fecha = new JLabel(); Fecha.setText("Fecha y Hora de emisin: " + Comandos.getString("FechaEmision")); JButton Abre = new JButton(); Abre.setText("Abrir"); Abre.setName(Comandos.getString("idFacturaEmitida")); Abre.setBackground(azul); JButton Cancelar = new JButton(); Cancelar.setText("Cancelar"); Cancelar.setName(Comandos.getString("idFacturaEmitida")); Cancelar.setBackground(rojo); MouseListener mlAbre = new MouseListener() { @Override public void mouseReleased(MouseEvent e) { //System.out.println("Released!"); } @Override public void mousePressed(MouseEvent e) { //System.out.println("Pressed!"); } @Override public void mouseExited(MouseEvent e) { //System.out.println("Exited!"); } @Override public void mouseEntered(MouseEvent e) { //System.out.println("Entered!"); } @Override public void mouseClicked(MouseEvent e) { try { JButton source = (JButton) e.getSource(); idFacClien = Integer.parseInt(source.getName()); ResultSet Comandos = Funcion.Select(st, "SELECT *FROM factura_emitida WHERE idfacturaEmitida=" + idFacClien + ";"); while (Comandos.next()) { Variables.FechaFactura = Comandos.getString("FechaEmision"); Variables.FechaSistema = Comandos.getString("fechasistema"); Variables.idFactura = Comandos.getInt("idFacturaEmitida"); } Consulta(); Variables.guardar = false; NuevoPdf pdf = new NuevoPdf("Factura.pdf"); pdf.main(); File myfile = new File("Factura.pdf"); Desktop.getDesktop().open(myfile); Comandos = Funcion.Select(st, "SELECT * FROM factura_emitida;"); try { if (Comandos.next()) { Comandos.last(); Variables.idFactura = Comandos.getInt("idFacturaEmitida") + 1; } else { Variables.idFactura = 1; } } catch (SQLException ex) { Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex); } } catch (Exception ex) { Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex); } } }; MouseListener mlCancelar = new MouseListener() { @Override public void mouseReleased(MouseEvent e) { //System.out.println("Released!"); } @Override public void mousePressed(MouseEvent e) { //System.out.println("Pressed!"); } @Override public void mouseExited(MouseEvent e) { //System.out.println("Exited!"); } @Override public void mouseEntered(MouseEvent e) { //System.out.println("Entered!"); } @Override public void mouseClicked(MouseEvent e) { JButton source = (JButton) e.getSource(); Variables.Cancelar = Integer.parseInt(source.getName()); String Comando = "UPDATE factura_emitida SET Observaciones='Factura Cancelada' WHERE idFacturaEmitida=" + Variables.Cancelar + ";"; Funcion.Update(st, Comando); jPanel11.removeAll(); PanelFacturas(); jPanel11.repaint(); } }; Abre.addMouseListener(mlAbre); Cancelar.addMouseListener(mlCancelar); //Fuente del texto; FolioFactura.setFont(new Font("Verdana", Font.PLAIN, 13)); FolioFactura.setForeground(gris); RFC.setFont(new Font("Verdana", Font.PLAIN, 13)); RFC.setForeground(gris); Nombre.setFont(new Font("Verdana", Font.PLAIN, 13)); Nombre.setForeground(gris); Direccion.setFont(new Font("Verdana", Font.PLAIN, 13)); Direccion.setForeground(gris); Correo.setFont(new Font("Verdana", Font.PLAIN, 13)); Correo.setForeground(gris); Fecha.setFont(new Font("Verdana", Font.PLAIN, 13)); Fecha.setForeground(gris); /// Botones Abre.setFont(new Font("Verdana", Font.PLAIN, 15)); Abre.setForeground(Color.white); Cancelar.setFont(new Font("Verdana", Font.PLAIN, 15)); Cancelar.setForeground(Color.white); //Aadimos los label al panel correspondiente del cliente Panel.add(FolioFactura); Panel.add(RFC); Panel.add(Nombre); Panel.add(Direccion); Panel.add(Correo); Panel.add(Fecha); Panel.add(Abre); FolioFactura.setLocation(15, 5); FolioFactura.setSize(400, 45); RFC.setLocation(15, 25); RFC.setSize(400, 45); Nombre.setLocation(15, 45); Nombre.setSize(500, 45); Direccion.setLocation(15, 65); Direccion.setSize(650, 45); Correo.setLocation(15, 85); Correo.setSize(500, 45); Fecha.setLocation(15, 105); Fecha.setSize(500, 45); /// Botones Tamao y localizacion if (Variables.Tipo.equalsIgnoreCase("Administrador")) { // Verificamos que sea un Administrador Panel.add(Cancelar); Abre.setLocation(185, 160); Abre.setSize(120, 30); Cancelar.setLocation(350, 160); Cancelar.setSize(120, 30); if (Variables.Comentario.equalsIgnoreCase("Factura Cancelada")) { Cancelar.setVisible(false); Abre.setLocation(290, 160); Abre.setSize(120, 30); } } else { Abre.setLocation(290, 160); Abre.setSize(120, 30); } i++; } } catch (SQLException ex) { Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex); } //Dependiendo de cuantos clientes se agregaron, se ajusta el tamao del panel principal para que el scroll llegue hasta ahi jPanel11.setPreferredSize(new Dimension(jPanel11.getWidth(), Altura + 300)); }
From source file:com.diversityarrays.kdxplore.curate.TrialDataEditor.java
private List<JButton> createVisualisationButtons() { List<JButton> visButtons = new ArrayList<>(); for (final VisualisationTool tool : visualisationTools) { JButton button = new JButton(); button.setBorder(new CompoundBorder(new EmptyBorder(2, 2, 2, 2), BorderFactory.createBevelBorder(BevelBorder.RAISED))); Icon icon = tool.getToolIcon(); if (icon != null) { button.setIcon(icon);/*from ww w .j a v a2 s.c o m*/ } else { button.setName(tool.getToolButtonName()); } boolean onlyForDeveloper = false; VisualisationToolActionListener actionListener = new VisualisationToolActionListener( TrialDataEditor.this, getTitle(), onlyForDeveloper, curationContext, tool); button.addActionListener(actionListener); visButtons.add(button); button.setText(tool.getToolName()); } return visButtons; }
From source file:cfa.vo.sed.science.stacker.SedStackerFrame.java
/** This method is called from within the constructor to * initialize the form.//www . j a v a 2s . com * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); javax.swing.ButtonGroup buttonGroup1 = new javax.swing.ButtonGroup(); javax.swing.ButtonGroup buttonGroup2 = new javax.swing.ButtonGroup(); jPopupMenu1 = new javax.swing.JPopupMenu(); javax.swing.JMenuItem jMenuItem1 = new javax.swing.JMenuItem(); jPopupMenu2 = new javax.swing.JPopupMenu(); javax.swing.JMenuItem jMenuItem2 = new javax.swing.JMenuItem(); jButton1 = new javax.swing.JButton(); javax.swing.JPanel jPanel1 = new javax.swing.JPanel(); stackPanel = new javax.swing.JScrollPane(); jList1 = new javax.swing.JList(); javax.swing.JPanel jPanel5 = new javax.swing.JPanel(); correctFlux = new javax.swing.JCheckBox(); jTextField8 = new javax.swing.JTextField(); javax.swing.JLabel jLabel11 = new javax.swing.JLabel(); redshiftButton = new javax.swing.JButton(); javax.swing.JLabel jLabel6 = new javax.swing.JLabel(); jRadioButton3 = new javax.swing.JRadioButton(); jRadioButton4 = new javax.swing.JRadioButton(); integrationXMaxText = new javax.swing.JTextField(); integrationMinMaxUnit = new WiderJComboBox(); integrationYUnit = new WiderJComboBox(); integrationValueText = new javax.swing.JTextField(); integrationNormType = new javax.swing.JComboBox(); javax.swing.JLabel integrationNormToLabel = new javax.swing.JLabel(); javax.swing.JLabel integrationXMinLabel = new javax.swing.JLabel(); integrationXMinText = new javax.swing.JTextField(); jRadioButton1 = new javax.swing.JRadioButton(); jRadioButton2 = new javax.swing.JRadioButton(); javax.swing.JLabel atPointXLabel = new javax.swing.JLabel(); javax.swing.JLabel atPointYLabel = new javax.swing.JLabel(); atPointXText = new javax.swing.JTextField(); atPointYType = new javax.swing.JComboBox(); atPointXUnit = new javax.swing.JComboBox(); atPointYText = new javax.swing.JTextField(); atPointYUnit = new javax.swing.JComboBox(); normalizeButton = new javax.swing.JButton(); javax.swing.JSeparator jSeparator1 = new javax.swing.JSeparator(); javax.swing.JLabel integrationXMaxLabel = new javax.swing.JLabel(); javax.swing.JCheckBox jCheckBox1 = new javax.swing.JCheckBox(); javax.swing.JCheckBox jCheckBox2 = new javax.swing.JCheckBox(); javax.swing.JPanel jPanel4 = new javax.swing.JPanel(); addButton = new javax.swing.JButton(); removeButton = new javax.swing.JButton(); javax.swing.JScrollPane jScrollPane2 = new javax.swing.JScrollPane(); sedsTable = new javax.swing.JTable(); javax.swing.JPanel jPanel6 = new javax.swing.JPanel(); javax.swing.JLabel jLabel7 = new javax.swing.JLabel(); stackStatisticComboBox = new javax.swing.JComboBox(); smoothCheckBox = new javax.swing.JCheckBox(); javax.swing.JLabel jLabel8 = new javax.swing.JLabel(); jTextField6 = new javax.swing.JTextField(); logBinningCheckBox = new javax.swing.JCheckBox(); javax.swing.JLabel jLabel9 = new javax.swing.JLabel(); binsizeTextField = new javax.swing.JTextField(); stackBinSizeUnitsComboBox = new javax.swing.JComboBox(); javax.swing.JLabel jLabel10 = new javax.swing.JLabel(); stackButton = new javax.swing.JButton(); stackYUnitComboBox = new javax.swing.JComboBox(); javax.swing.JLabel jLabel1 = new javax.swing.JLabel(); javax.swing.JPanel jPanel2 = new javax.swing.JPanel(); resetButton = new javax.swing.JButton(); javax.swing.JButton deleteButton = new javax.swing.JButton(); createSedButton = new javax.swing.JButton(); jPopupMenu1.setName("jPopupMenu1"); // NOI18N jMenuItem1.setText("Rename..."); jMenuItem1.setName("jMenuItem1"); // NOI18N jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jPopupMenu1.add(jMenuItem1); jPopupMenu2.setName("jPopupMenu2"); // NOI18N jMenuItem2.setText("Change redshift..."); jMenuItem2.setName("jMenuItem2"); // NOI18N jMenuItem2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem2ActionPerformed(evt); } }); jPopupMenu2.add(jMenuItem2); setClosable(true); setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE); setIconifiable(true); setResizable(true); setTitle("SED Stacker"); jButton1.setText("Create New Stack"); jButton1.setName("jButton1"); // NOI18N jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newStack(evt); } }); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Open Stacks")); jPanel1.setName("jPanel1"); // NOI18N stackPanel.setName("stackPanel"); // NOI18N jList1.setModel(new javax.swing.AbstractListModel() { String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; public int getSize() { return strings.length; } public Object getElementAt(int i) { return strings[i]; } }); jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); jList1.setName("jList1"); // NOI18N org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${stacks}"); org.jdesktop.swingbinding.JListBinding jListBinding = org.jdesktop.swingbinding.SwingBindings .createJListBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, eLProperty, jList1); jListBinding.setSourceUnreadableValue(null); bindingGroup.addBinding(jListBinding); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedStack}"), jList1, org.jdesktop.beansbinding.BeanProperty.create("selectedElement")); bindingGroup.addBinding(binding); jList1.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jList1MousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { jList1MouseReleased(evt); } }); stackPanel.setViewportView(jList1); org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(stackPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 153, Short.MAX_VALUE)); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, stackPanel)); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Redshift and Normalize")); jPanel5.setName("jPanel5"); // NOI18N correctFlux.setText("Correct flux"); correctFlux.setName("correctFlux"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.redshiftConfiguration.correctFlux}"), correctFlux, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); jTextField8.setName("jTextField8"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.redshiftConfiguration.toRedshift}"), jTextField8, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel11.setText("Move to redshift:"); jLabel11.setName("jLabel11"); // NOI18N redshiftButton.setText("Redshift"); redshiftButton.setName("redshiftButton"); // NOI18N redshiftButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { redshiftButtonActionPerformed(evt); } }); jLabel6.setText("Add or multiply normalization constant:"); jLabel6.setName("jLabel6"); // NOI18N buttonGroup2.add(jRadioButton3); jRadioButton3.setText("Add"); jRadioButton3.setName("jRadioButton3"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.add}"), jRadioButton3, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); buttonGroup2.add(jRadioButton4); jRadioButton4.setText("Multiply"); jRadioButton4.setName("jRadioButton4"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.multiply}"), jRadioButton4, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); integrationXMaxText.setName("integrationXMaxText"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.xmax}"), integrationXMaxText, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1, org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationXMaxText, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); integrationMinMaxUnit.setModel(new DefaultComboBoxModel(loadEnum(XUnit.class))); integrationMinMaxUnit.setToolTipText("null"); integrationMinMaxUnit.setName("integrationMinMaxUnit"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.XUnits}"), integrationMinMaxUnit, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1, org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationMinMaxUnit, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); integrationYUnit.setModel(new javax.swing.DefaultComboBoxModel( new String[] { "erg/s/cm2", "Jy-Hz", "Watt/m2", "erg/s", "Watt" })); integrationYUnit.setName("integrationYUnit"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty .create("${selectedConfig.normConfiguration.integrateValueYUnits}"), integrationYUnit, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1, org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationYUnit, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); integrationValueText.setName("integrationValueText"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.YValue}"), integrationValueText, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty .create("${selectedConfig.normConfiguration.integrateYTextEnabled}"), integrationValueText, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); integrationNormType .setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Value", "Average", "Median" })); integrationNormType.setName("integrationNormType"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.stats}"), integrationNormType, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1, org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationNormType, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); integrationNormToLabel.setText("Normalize to"); integrationNormToLabel.setName("integrationNormToLabel"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1, org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationNormToLabel, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); integrationXMinLabel.setText("X Min:"); integrationXMinLabel.setName("integrationXMinLabel"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1, org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationXMinLabel, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); integrationXMinText.setName("integrationXMinText"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.xmin}"), integrationXMinText, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1, org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationXMinText, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); buttonGroup1.add(jRadioButton1); jRadioButton1.setText("Integration"); jRadioButton1.setName("jRadioButton1"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.integrate}"), jRadioButton1, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); buttonGroup1.add(jRadioButton2); jRadioButton2.setText("At point"); jRadioButton2.setName("jRadioButton2"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPoint}"), jRadioButton2, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); atPointXLabel.setText("X:"); atPointXLabel.setName("atPointXLabel"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2, org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointXLabel, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); atPointYLabel.setText("Y:"); atPointYLabel.setName("atPointYLabel"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2, org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointYLabel, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); atPointXText.setName("atPointXText"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPointXValue}"), atPointXText, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2, org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointXText, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); atPointYType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Value", "Average", "Median" })); atPointYType.setName("atPointYType"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPointStats}"), atPointYType, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2, org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointYType, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); atPointXUnit.setModel(new DefaultComboBoxModel(loadEnum(XUnit.class))); atPointXUnit.setName("atPointXUnit"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPointXUnits}"), atPointXUnit, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2, org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointXUnit, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); atPointYText.setName("atPointYText"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPointYValue}"), atPointYText, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty .create("${selectedConfig.normConfiguration.atPointYTextEnabled}"), atPointYText, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); atPointYUnit.setModel(new DefaultComboBoxModel(loadEnum(SPVYUnit.class))); atPointYUnit.setName("atPointYUnit"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPointYUnits}"), atPointYUnit, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2, org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointYUnit, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); normalizeButton.setText("Normalize"); normalizeButton.setName("normalizeButton"); // NOI18N normalizeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { normalizeButtonActionPerformed(evt); } }); jSeparator1.setName("jSeparator1"); // NOI18N integrationXMaxLabel.setText("X Max:"); integrationXMaxLabel.setName("integrationXMaxLabel"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1, org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationXMaxLabel, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); jCheckBox1.setText("Create SED"); jCheckBox1.setToolTipText("Create and view SED after redshifting"); jCheckBox1.setName("jCheckBox1"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${createSedAfterRedshift}"), jCheckBox1, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); jCheckBox2.setText("Create SED"); jCheckBox2.setToolTipText("Create and view SED after normalizing"); jCheckBox2.setName("jCheckBox2"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${createSedAfterNormalize}"), jCheckBox2, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout .setHorizontalGroup(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup().addContainerGap().add(jPanel5Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(jSeparator1) .add(jPanel5Layout.createSequentialGroup().add(jLabel11) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jTextField8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 76, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(correctFlux) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jCheckBox1).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(redshiftButton)) .add(jPanel5Layout.createSequentialGroup().add(jPanel5Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup().add(jRadioButton2) .add(26, 26, 26) .add(jPanel5Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .add(atPointXLabel) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(atPointXText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 73, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(3, 3, 3).add(atPointXUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel5Layout.createSequentialGroup() .add(atPointYLabel) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(atPointYType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(atPointYText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 78, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(7, 7, 7) .add(atPointYUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(jPanel5Layout.createSequentialGroup().add(jPanel5Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(jPanel5Layout.createSequentialGroup() .add(integrationNormToLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(integrationNormType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)) .add(jPanel5Layout.createSequentialGroup().add(jRadioButton1) .add(8, 8, 8).add(integrationXMinLabel).add(3, 3, 3) .add(integrationXMinText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 73, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(integrationXMaxLabel).add(3, 3, 3))) .add(jPanel5Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.TRAILING, false) .add(jPanel5Layout .createSequentialGroup() .add(integrationXMaxText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 73, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(integrationMinMaxUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel5Layout.createSequentialGroup().add( integrationValueText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 73, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add(integrationYUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(jPanel5Layout.createSequentialGroup().add(jLabel6) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jRadioButton3) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jRadioButton4))) .add(0, 0, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel5Layout.createSequentialGroup().add(0, 0, Short.MAX_VALUE) .add(jCheckBox2) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(normalizeButton))) .addContainerGap())); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createSequentialGroup() .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(correctFlux) .add(jTextField8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel11)) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(redshiftButton).add(jCheckBox1))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel6).add(jRadioButton3).add(jRadioButton4)) .add(18, 18, 18) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jRadioButton1) .add(integrationMinMaxUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(integrationXMaxText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(integrationXMinText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(integrationXMinLabel).add(integrationXMaxLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(integrationYUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(integrationValueText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(integrationNormType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(integrationNormToLabel)) .add(11, 11, 11) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jRadioButton2) .add(jPanel5Layout.createSequentialGroup().add(jPanel5Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel5Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(atPointXText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(atPointXLabel)) .add(atPointXUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel5Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(atPointYLabel) .add(atPointYType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(atPointYText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(atPointYUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(normalizeButton).add(jCheckBox2)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Added SEDs")); jPanel4.setName("jPanel4"); // NOI18N addButton.setText("Add..."); addButton.setName("addButton"); // NOI18N addButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addButtonActionPerformed(evt); } }); removeButton.setText("Remove"); removeButton.setName("removeButton"); // NOI18N removeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { removeButtonActionPerformed(evt); } }); jScrollPane2.setName("jScrollPane2"); // NOI18N sedsTable.setModel(new StackTableModel()); sedsTable.setName("sedsTable"); // NOI18N sedsTable.getTableHeader().setReorderingAllowed(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedSeds}"), sedsTable, org.jdesktop.beansbinding.BeanProperty.create("selectedElements")); bindingGroup.addBinding(binding); sedsTable.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { sedsTableMousePressed(evt); } }); jScrollPane2.setViewportView(sedsTable); org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout .setHorizontalGroup(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup() .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(addButton).add(removeButton)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 653, Short.MAX_VALUE))); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup().add(addButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(removeButton)) .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 160, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)); jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Stacking Options")); jPanel6.setName("jPanel6"); // NOI18N jLabel7.setText("Statistic:"); jLabel7.setName("jLabel7"); // NOI18N stackStatisticComboBox .setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Average", "Weighted Avg", "Sum" })); stackStatisticComboBox.setName("stackStatisticComboBox"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.statistic}"), stackStatisticComboBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); smoothCheckBox.setText("Smooth"); smoothCheckBox.setName("smoothCheckBox"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.smooth}"), smoothCheckBox, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); jLabel8.setText("Box Size:"); jLabel8.setName("jLabel8"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, smoothCheckBox, org.jdesktop.beansbinding.ELProperty.create("${selected}"), jLabel8, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); jTextField6.setName("jTextField6"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.smoothBinsize}"), jTextField6, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, smoothCheckBox, org.jdesktop.beansbinding.ELProperty.create("${selected}"), jTextField6, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); logBinningCheckBox.setText("Logarithmic Binning"); logBinningCheckBox.setToolTipText( "java.lang.String \"Note: If logarithmic binning is on, the Bin Size is also logarithmic (e.g., a bin size of 1.0 with logarithmic binning spans 1 decade).\""); // NOI18N logBinningCheckBox.setName("logBinningCheckBox"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.logbin}"), logBinningCheckBox, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); jLabel9.setText("Bin Size:"); jLabel9.setName("jLabel9"); // NOI18N binsizeTextField.setName("binsizeTextField"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.binsize}"), binsizeTextField, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); stackBinSizeUnitsComboBox.setModel(new DefaultComboBoxModel(loadEnum(XUnit.class))); stackBinSizeUnitsComboBox.setName("stackBinSizeUnitsComboBox"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.binsizeUnit}"), stackBinSizeUnitsComboBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); jLabel10.setText("Bin Size Units:"); jLabel10.setName("jLabel10"); // NOI18N stackButton.setText("Stack!"); stackButton.setName("stackButton"); // NOI18N stackButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { stackButtonActionPerformed(evt); } }); stackYUnitComboBox.setModel(new DefaultComboBoxModel(loadEnum(SPVYUnit.class))); stackYUnitComboBox.setName("stackYUnitComboBox"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.YUnits}"), stackYUnitComboBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); jLabel1.setText("Y Axis:"); jLabel1.setName("jLabel1"); // NOI18N org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel6Layout.createSequentialGroup().addContainerGap().add(jPanel6Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup().add(0, 0, Short.MAX_VALUE).add(stackButton) .addContainerGap()) .add(jPanel6Layout.createSequentialGroup().add(29, 29, 29).add(jLabel8) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jTextField6) .add(17, 17, 17)) .add(jPanel6Layout.createSequentialGroup() .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel6Layout.createSequentialGroup().add(jLabel10) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(stackBinSizeUnitsComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel6Layout.createSequentialGroup().add(jPanel6Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel7).add(jLabel1)) .add(jPanel6Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel6Layout.createSequentialGroup().add(12, 12, 12) .add(stackYUnitComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 143, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(jPanel6Layout.createSequentialGroup() .addPreferredGap( org.jdesktop.layout.LayoutStyle.UNRELATED) .add(stackStatisticComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 143, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(smoothCheckBox).add(logBinningCheckBox) .add(jPanel6Layout.createSequentialGroup().add(jLabel9).add(43, 43, 43).add( binsizeTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 115, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))); jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel6Layout.createSequentialGroup().addContainerGap() .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel7).add(stackStatisticComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(stackYUnitComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel1)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel9).add(binsizeTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel10).add(stackBinSizeUnitsComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(9, 9, 9).add(logBinningCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(smoothCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel8).add(jTextField6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(18, 18, 18).add(stackButton).add(18, 18, 18))); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Managment")); jPanel2.setName("jPanel2"); // NOI18N resetButton.setText("Reset"); resetButton.setToolTipText("Reset SEDs to their original values"); resetButton.setName("resetButton"); // NOI18N resetButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { resetButtonActionPerformed(evt); } }); deleteButton.setText("Delete"); deleteButton.setToolTipText("Delete the currently selected Stack"); deleteButton.setName("deleteButton"); // NOI18N deleteButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteButtonActionPerformed(evt); } }); createSedButton.setText("Create SED"); createSedButton.setToolTipText("Create new SED of the current Stack."); createSedButton.setName("createSedButton"); // NOI18N createSedButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { createSedButtonActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup() .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(resetButton).add(createSedButton).add(deleteButton)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup().addContainerGap().add(resetButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(deleteButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(createSedButton).addContainerGap())); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout .createSequentialGroup().addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jButton1).add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(0, 10, Short.MAX_VALUE))); layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .add(jButton1).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 301, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); bindingGroup.bind(); pack(); }
From source file:org.apache.jmeter.visualizers.StatGraphVisualizer.java
private JButton createColorBarButton(BarGraph barGraph, int index) { // Button/*from ww w . j ava2s. c o m*/ JButton colorBtn = new JButton(); colorBtn.setName(String.valueOf(index)); colorBtn.setFont(FONT_SMALL); colorBtn.addActionListener(this); colorBtn.setBackground(barGraph.getBackColor()); return colorBtn; }
From source file:org.datavyu.controllers.component.MixerController.java
private void initView() { // Set default scale values minStart = 0;/*from ww w.j a v a 2s . c om*/ listenerList = new EventListenerList(); // Set up the root panel tracksPanel = new JPanel(); tracksPanel.setLayout(new MigLayout("ins 0", "[left|left|left|left]rel push[right|right]", "")); tracksPanel.setBackground(Color.WHITE); if (Platform.isMac()) { osxGestureListener.register(tracksPanel); } // Menu buttons lockToggle = new JToggleButton("Lock all"); lockToggle.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { lockToggleHandler(e); } }); lockToggle.setName("lockToggleButton"); bookmarkButton = new JButton("Add Bookmark"); bookmarkButton.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { addBookmarkHandler(); } }); bookmarkButton.setEnabled(false); bookmarkButton.setName("bookmarkButton"); JButton snapRegion = new JButton("Snap Region"); snapRegion.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { snapRegionHandler(e); } }); snapRegion.setName("snapRegionButton"); JButton clearRegion = new JButton("Clear Region"); clearRegion.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { clearRegionHandler(e); } }); clearRegion.setName("clearRegionButton"); zoomSlide = new JSlider(JSlider.HORIZONTAL, 1, 1000, 1); zoomSlide.addChangeListener(new ChangeListener() { public void stateChanged(final ChangeEvent e) { if (!isUpdatingZoomSlide && zoomSlide.getValueIsAdjusting()) { try { isUpdatingZoomSlide = true; zoomSetting = (double) (zoomSlide.getValue() - zoomSlide.getMinimum()) / (zoomSlide.getMaximum() - zoomSlide.getMinimum() + 1); viewportModel.setViewportZoom(zoomSetting, needleController.getNeedleModel().getCurrentTime()); } finally { isUpdatingZoomSlide = false; } } } }); zoomSlide.setName("zoomSlider"); zoomSlide.setBackground(tracksPanel.getBackground()); JButton zoomRegionButton = new JButton("", zoomIcon); zoomRegionButton.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { zoomToRegion(e); } }); zoomRegionButton.setName("zoomRegionButton"); tracksPanel.add(lockToggle); tracksPanel.add(bookmarkButton); tracksPanel.add(snapRegion); tracksPanel.add(clearRegion); tracksPanel.add(zoomRegionButton); tracksPanel.add(zoomSlide, "wrap"); timescaleController = new TimescaleController(mixerModel); timescaleController.addTimescaleEventListener(this); needleController = new NeedleController(this, mixerModel); regionController = new RegionController(mixerModel); tracksEditorController = new TracksEditorController(this, mixerModel); needleController.setTimescaleTransitionHeight( timescaleController.getTimescaleModel().getZoomWindowToTrackTransitionHeight()); needleController .setZoomIndicatorHeight(timescaleController.getTimescaleModel().getZoomWindowIndicatorHeight()); // Set up the layered pane layeredPane = new JLayeredPane(); layeredPane.setLayout(new MigLayout("fillx, ins 0")); final int layeredPaneHeight = 272; final int timescaleViewHeight = timescaleController.getTimescaleModel().getHeight(); final int needleHeadHeight = (int) Math.ceil(NeedleConstants.NEEDLE_HEAD_HEIGHT); final int tracksScrollPaneY = needleHeadHeight + 1; final int timescaleViewY = layeredPaneHeight - MixerConstants.HSCROLL_HEIGHT - timescaleViewHeight; final int tracksScrollPaneHeight = timescaleViewY - tracksScrollPaneY; final int tracksScrollBarY = timescaleViewY + timescaleViewHeight; final int needleAndRegionMarkerHeight = (timescaleViewY + timescaleViewHeight - timescaleController.getTimescaleModel().getZoomWindowIndicatorHeight() - timescaleController.getTimescaleModel().getZoomWindowToTrackTransitionHeight() + 1); // Set up filler component responsible for horizontal resizing of the // layout. { // Null args; let layout manager handle sizes. Box.Filler filler = new Filler(null, null, null); filler.setName("Filler"); filler.addComponentListener(new SizeHandler()); Map<String, String> constraints = Maps.newHashMap(); constraints.put("wmin", Integer.toString(MixerConstants.MIXER_MIN_WIDTH)); // TODO Could probably use this same component to handle vertical // resizing... String template = "id filler, h 0!, grow 100 0, wmin ${wmin}, cell 0 0 "; StrSubstitutor sub = new StrSubstitutor(constraints); layeredPane.setLayer(filler, MixerConstants.FILLER_ZORDER); layeredPane.add(filler, sub.replace(template), MixerConstants.FILLER_ZORDER); } // Set up the timescale layout { JComponent timescaleView = timescaleController.getView(); Map<String, String> constraints = Maps.newHashMap(); constraints.put("x", Integer.toString(TimescaleConstants.XPOS_ABS)); constraints.put("y", Integer.toString(timescaleViewY)); // Calculate padding from the right int rightPad = (int) (RegionConstants.RMARKER_WIDTH + MixerConstants.VSCROLL_WIDTH + MixerConstants.R_EDGE_PAD); constraints.put("x2", "(filler.w-" + rightPad + ")"); constraints.put("y2", "(tscale.y+${height})"); constraints.put("height", Integer.toString(timescaleViewHeight)); String template = "id tscale, pos ${x} ${y} ${x2} ${y2}"; StrSubstitutor sub = new StrSubstitutor(constraints); // Must call setLayer first. layeredPane.setLayer(timescaleView, MixerConstants.TIMESCALE_ZORDER); layeredPane.add(timescaleView, sub.replace(template), MixerConstants.TIMESCALE_ZORDER); } // Set up the scroll pane's layout. { tracksScrollPane = new JScrollPane(tracksEditorController.getView()); tracksScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); tracksScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); tracksScrollPane.setBorder(BorderFactory.createEmptyBorder()); tracksScrollPane.setName("jScrollPane"); Map<String, String> constraints = Maps.newHashMap(); constraints.put("x", "0"); constraints.put("y", Integer.toString(tracksScrollPaneY)); constraints.put("x2", "(filler.w-" + MixerConstants.R_EDGE_PAD + ")"); constraints.put("height", Integer.toString(tracksScrollPaneHeight)); String template = "pos ${x} ${y} ${x2} n, h ${height}!"; StrSubstitutor sub = new StrSubstitutor(constraints); layeredPane.setLayer(tracksScrollPane, MixerConstants.TRACKS_ZORDER); layeredPane.add(tracksScrollPane, sub.replace(template), MixerConstants.TRACKS_ZORDER); } // Create the region markers and set up the layout. { JComponent regionView = regionController.getView(); Map<String, String> constraints = Maps.newHashMap(); int x = (int) (TrackConstants.HEADER_WIDTH - RegionConstants.RMARKER_WIDTH); constraints.put("x", Integer.toString(x)); constraints.put("y", "0"); // Padding from the right int rightPad = MixerConstants.R_EDGE_PAD + MixerConstants.VSCROLL_WIDTH - 2; constraints.put("x2", "(filler.w-" + rightPad + ")"); constraints.put("height", Integer.toString(needleAndRegionMarkerHeight)); String template = "pos ${x} ${y} ${x2} n, h ${height}::"; StrSubstitutor sub = new StrSubstitutor(constraints); layeredPane.setLayer(regionView, MixerConstants.REGION_ZORDER); layeredPane.add(regionView, sub.replace(template), MixerConstants.REGION_ZORDER); } // Set up the timing needle's layout { JComponent needleView = needleController.getView(); Map<String, String> constraints = Maps.newHashMap(); int x = (int) (TrackConstants.HEADER_WIDTH - NeedleConstants.NEEDLE_HEAD_WIDTH + NeedleConstants.NEEDLE_WIDTH); constraints.put("x", Integer.toString(x)); constraints.put("y", "0"); // Padding from the right int rightPad = MixerConstants.R_EDGE_PAD + MixerConstants.VSCROLL_WIDTH - 1; constraints.put("x2", "(filler.w-" + rightPad + ")"); constraints.put("height", Integer.toString(needleAndRegionMarkerHeight + timescaleController.getTimescaleModel().getZoomWindowToTrackTransitionHeight() + timescaleController.getTimescaleModel().getZoomWindowIndicatorHeight() - 1)); String template = "pos ${x} ${y} ${x2} n, h ${height}::"; StrSubstitutor sub = new StrSubstitutor(constraints); layeredPane.setLayer(needleView, MixerConstants.NEEDLE_ZORDER); layeredPane.add(needleView, sub.replace(template), MixerConstants.NEEDLE_ZORDER); } // Set up the snap marker's layout { JComponent markerView = tracksEditorController.getMarkerView(); Map<String, String> constraints = Maps.newHashMap(); constraints.put("x", Integer.toString(TimescaleConstants.XPOS_ABS)); constraints.put("y", Integer.toString(needleHeadHeight + 1)); // Padding from the right int rightPad = MixerConstants.R_EDGE_PAD + MixerConstants.VSCROLL_WIDTH - 1; constraints.put("x2", "(filler.w-" + rightPad + ")"); constraints.put("height", Integer.toString(needleAndRegionMarkerHeight - needleHeadHeight - 1)); String template = "pos ${x} ${y} ${x2} n, h ${height}::"; StrSubstitutor sub = new StrSubstitutor(constraints); layeredPane.setLayer(markerView, MixerConstants.MARKER_ZORDER); layeredPane.add(markerView, sub.replace(template), MixerConstants.MARKER_ZORDER); } // Set up the tracks horizontal scroll bar { tracksScrollBar = new JScrollBar(Adjustable.HORIZONTAL); tracksScrollBar.setValues(0, TRACKS_SCROLL_BAR_RANGE, 0, TRACKS_SCROLL_BAR_RANGE); tracksScrollBar.setUnitIncrement(TRACKS_SCROLL_BAR_RANGE / 20); tracksScrollBar.setBlockIncrement(TRACKS_SCROLL_BAR_RANGE / 2); tracksScrollBar.addAdjustmentListener(this); tracksScrollBar.setValueIsAdjusting(false); tracksScrollBar.setVisible(false); tracksScrollBar.setName("horizontalScrollBar"); Map<String, String> constraints = Maps.newHashMap(); constraints.put("x", Integer.toString(TimescaleConstants.XPOS_ABS)); constraints.put("y", Integer.toString(tracksScrollBarY)); int rightPad = (int) (RegionConstants.RMARKER_WIDTH + MixerConstants.VSCROLL_WIDTH + MixerConstants.R_EDGE_PAD); constraints.put("x2", "(filler.w-" + rightPad + ")"); constraints.put("height", Integer.toString(MixerConstants.HSCROLL_HEIGHT)); String template = "pos ${x} ${y} ${x2} n, h ${height}::"; StrSubstitutor sub = new StrSubstitutor(constraints); layeredPane.setLayer(tracksScrollBar, MixerConstants.TRACKS_SB_ZORDER); layeredPane.add(tracksScrollBar, sub.replace(template), MixerConstants.TRACKS_SB_ZORDER); } { Map<String, String> constraints = Maps.newHashMap(); constraints.put("span", "6"); constraints.put("width", Integer.toString(MixerConstants.MIXER_MIN_WIDTH)); constraints.put("height", Integer.toString(layeredPaneHeight)); String template = "growx, span ${span}, w ${width}::, h ${height}::, wrap"; StrSubstitutor sub = new StrSubstitutor(constraints); tracksPanel.add(layeredPane, sub.replace(template)); } tracksPanel.validate(); }
From source file:org.datavyu.views.DataControllerV.java
/** * Helper method for Building a button for the data controller - sets the * icon, selected icon, action map and name. * * @param rMap The resource map that holds the icons for this button. * @param aMap The action map holding the action that this button invokes. * @param name The prefix to use when looking for actions and buttons. * @param modifier The modifier (if any) to apply to the prefix. Maybe null. * * @return A configured button.//from ww w . j a v a2 s. c o m */ private JButton buildButton(final ResourceMap rMap, final ActionMap aMap, final String name, final String modifier) { JButton result = new JButton(); result.setAction(aMap.get(name + "Action")); if (modifier == null) { result.setIcon(rMap.getIcon(name + "Button.icon")); result.setPressedIcon(rMap.getIcon(name + "SelectedButton.icon")); } else { result.setIcon(rMap.getIcon(modifier + name + "Button.icon")); result.setPressedIcon(rMap.getIcon(modifier + name + "SelectedButton.icon")); } result.setFocusPainted(false); result.setName(name + "Button"); return result; }
From source file:org.jets3t.apps.cockpitlite.ToggleAclDialog.java
/** * Initialises all GUI elements./* w w w. ja v a 2 s . c o m*/ */ private void initGui() { // Initialise skins factory. skinsFactory = SkinsFactory.getInstance(applicationProperties); // Set Skinned Look and Feel. LookAndFeel lookAndFeel = skinsFactory.createSkinnedMetalTheme("SkinnedLookAndFeel"); try { UIManager.setLookAndFeel(lookAndFeel); } catch (UnsupportedLookAndFeelException e) { log.error("Unable to set skinned LookAndFeel", e); } this.setResizable(false); this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); JHtmlLabel messageLabel = skinsFactory.createSkinnedJHtmlLabel("ToggleAclDialogMessage", hyperlinkListener); messageLabel.setText("File privacy setting:"); messageLabel.setHorizontalAlignment(JLabel.CENTER); privateRadioButton = skinsFactory.createSkinnedJRadioButton("ToggleAclDialogPrivateRadioButton"); privateRadioButton.setText("Private file"); publicRadioButton = skinsFactory.createSkinnedJRadioButton("ToggleAclDialogPublicRadioButton"); publicRadioButton.setText("Public file"); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(privateRadioButton); buttonGroup.add(publicRadioButton); publicRadioButton.setSelected(isPublicObject); privateRadioButton.setSelected(!isPublicObject); JButton okButton = skinsFactory.createSkinnedJButton("ToggleAclDialogOkButton"); okButton.setName("OK"); okButton.setText("OK"); okButton.addActionListener(this); this.getRootPane().setDefaultButton(okButton); JPanel buttonsPanel = skinsFactory.createSkinnedJPanel("ToggleAclDialogButtonsPanel"); buttonsPanel.setLayout(new GridBagLayout()); buttonsPanel.add(privateRadioButton, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); buttonsPanel.add(publicRadioButton, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); buttonsPanel.add(okButton, new GridBagConstraints(0, 1, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsZero, 0, 0)); int row = 0; this.getContentPane().setLayout(new GridBagLayout()); this.getContentPane().add(messageLabel, new GridBagConstraints(0, row++, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); this.getContentPane().add(buttonsPanel, new GridBagConstraints(0, row++, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); this.pack(); this.setLocationRelativeTo(this.getOwner()); }
From source file:org.jets3t.gui.ErrorDialog.java
/** * Initialises all GUI elements.//from w w w . ja va 2 s . c o m */ private void initGui(String message, String details) { // Initialise skins factory. skinsFactory = SkinsFactory.getInstance(applicationProperties); // Set Skinned Look and Feel. LookAndFeel lookAndFeel = skinsFactory.createSkinnedMetalTheme("SkinnedLookAndFeel"); try { UIManager.setLookAndFeel(lookAndFeel); } catch (UnsupportedLookAndFeelException e) { log.error("Unable to set skinned LookAndFeel", e); } this.setResizable(false); this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); JHtmlLabel messageLabel = skinsFactory.createSkinnedJHtmlLabel("ErrorMessageLabel", hyperlinkListener); messageLabel.setText(message); messageLabel.setHorizontalAlignment(JLabel.CENTER); JHtmlLabel detailsLabel = skinsFactory.createSkinnedJHtmlLabel("ErrorDetailsLabel", hyperlinkListener); detailsLabel.setText(details); JButton okButton = skinsFactory.createSkinnedJButton("ErrorOkButton"); okButton.setName("OK"); okButton.setText("OK"); okButton.addActionListener(this); this.getRootPane().setDefaultButton(okButton); JPanel dialogPanel = skinsFactory.createSkinnedJPanel("ErrorDialogPanel"); int row = 0; dialogPanel.setLayout(new GridBagLayout()); dialogPanel.add(messageLabel, new GridBagConstraints(0, row++, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(12, 5, 12, 5), 0, 0)); dialogPanel.add(detailsLabel, new GridBagConstraints(0, row++, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); dialogPanel.add(okButton, new GridBagConstraints(0, row++, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsDefault, 0, 0)); this.getContentPane().add(dialogPanel); this.pack(); this.setLocationRelativeTo(this.getOwner()); }