List of usage examples for javax.swing GroupLayout DEFAULT_SIZE
int DEFAULT_SIZE
To view the source code for javax.swing GroupLayout DEFAULT_SIZE.
Click Source Link
From source file:frames.consulta.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./*from w w w .j a v a2s. c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { grupoconsulta = new javax.swing.ButtonGroup(); jPopupMenu1 = new javax.swing.JPopupMenu(); mnModificar = new javax.swing.JMenuItem(); mnVer = new javax.swing.JMenuItem(); jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); txtbuscar = new javax.swing.JTextField(); btnbuscar = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); tblconsulta = new javax.swing.JTable(); cedula = new javax.swing.JRadioButton(); apellido = new javax.swing.JRadioButton(); jButton1 = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); btnModificar = new javax.swing.JButton(); btnver = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); btneliminar = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); mnModificar.setText("Modificar"); mnModificar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { mnModificarActionPerformed(evt); } }); jPopupMenu1.add(mnModificar); mnVer.setText("ver"); mnVer.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { mnVerActionPerformed(evt); } }); jPopupMenu1.add(mnVer); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(30, 51, 125)); jPanel2.setBackground(new java.awt.Color(78, 131, 173)); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Consulta", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(247, 237, 237))); // NOI18N jPanel2.setForeground(new java.awt.Color(245, 231, 231)); jLabel1.setFont(new java.awt.Font("DejaVu Sans", 1, 14)); // NOI18N jLabel1.setForeground(new java.awt.Color(254, 238, 238)); jLabel1.setText("Buscar"); btnbuscar.setForeground(new java.awt.Color(254, 254, 254)); btnbuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Search2.png"))); // NOI18N btnbuscar.setText("Buscar"); btnbuscar.setContentAreaFilled(false); btnbuscar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnbuscar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnbuscar.setIconTextGap(-5); btnbuscar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); btnbuscar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); btnbuscar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnbuscarActionPerformed(evt); } }); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Lista de Pacientes")); tblconsulta .setModel(new javax.swing.table.DefaultTableModel(new Object[][] { {}, {}, {}, {} }, new String[] { })); tblconsulta.setComponentPopupMenu(jPopupMenu1); jScrollPane2.setViewportView(tblconsulta); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel3Layout .createSequentialGroup().addContainerGap().addComponent(jScrollPane2).addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout .createSequentialGroup().addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE) .addContainerGap())); cedula.setBackground(new java.awt.Color(254, 254, 254)); grupoconsulta.add(cedula); cedula.setFont(new java.awt.Font("DejaVu Sans", 1, 14)); // NOI18N cedula.setForeground(new java.awt.Color(244, 236, 236)); cedula.setText("Cdula"); grupoconsulta.add(apellido); apellido.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N apellido.setForeground(new java.awt.Color(248, 236, 236)); apellido.setText("Apellido"); jButton1.setForeground(new java.awt.Color(253, 251, 251)); jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/consulgene.png"))); // NOI18N jButton1.setText("General"); jButton1.setContentAreaFilled(false); jButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton1.setDoubleBuffered(true); jButton1.setFocusCycleRoot(true); jButton1.setFocusable(false); jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton1.setIconTextGap(-5); jButton1.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jLabel3.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jLabel3.setForeground(new java.awt.Color(254, 254, 254)); jLabel3.setText("Tipo de Bsqueda"); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtbuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 437, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(40, 40, 40).addComponent(cedula).addGap(58, 58, 58) .addComponent(apellido).addGap(133, 133, 133))) .addComponent(btnbuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(apellido).addComponent(cedula))) .addGap(37, 37, 37) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtbuscar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(38, 38, 38)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup().addGap(32, 32, 32).addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnbuscar)).addGap(18, 18, 18))) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(62, 62, 62))); jPanel4.setBackground(new java.awt.Color(234, 239, 242)); btnModificar .setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/1466449409_Application.png"))); // NOI18N btnModificar.setText("Modificar "); btnModificar.setContentAreaFilled(false); btnModificar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnModificar.setDoubleBuffered(true); btnModificar.setFocusCycleRoot(true); btnModificar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnModificar.setIconTextGap(-1); btnModificar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); btnModificar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); btnModificar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnModificarActionPerformed(evt); } }); btnver.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/1466449365_PatientData.png"))); // NOI18N btnver.setText("Ver Historia"); btnver.setContentAreaFilled(false); btnver.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnver.setDoubleBuffered(true); btnver.setFocusCycleRoot(true); btnver.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnver.setIconTextGap(-10); btnver.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); btnver.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); btnver.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnverActionPerformed(evt); } }); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/cropped-happy_tooth3.jpg"))); // NOI18N jButton3.setIcon(new javax.swing.ImageIcon( getClass().getResource("/images/1466451542_delete_unapprove_discard_remove_x_red.png"))); // NOI18N jButton3.setText("Salir"); jButton3.setContentAreaFilled(false); jButton3.setDoubleBuffered(true); jButton3.setFocusCycleRoot(true); jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton3.setIconTextGap(5); jButton3.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); btneliminar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/1466454184_free-27.png"))); // NOI18N btneliminar.setText("Eliminar"); btneliminar.setContentAreaFilled(false); btneliminar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btneliminar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btneliminar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); btneliminar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); btneliminar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btneliminarActionPerformed(evt); } }); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btnver, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel4Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(btnModificar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(btneliminar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap())); jPanel4Layout .setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel4Layout.createSequentialGroup() .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(29, 29, 29) .addComponent(btnModificar, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(btnver, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(btneliminar).addGap(18, 18, 18) .addComponent(jButton3).addContainerGap(59, Short.MAX_VALUE))); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(30, 30, 30) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1Layout .setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(24, Short.MAX_VALUE))); jMenu1.setText("Reportes"); jMenuItem1.setText("Reportes de Pacientes"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu1.add(jMenuItem1); jMenuBar1.add(jMenu1); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); pack(); }
From source file:gui.MainGUI.java
private void initComponents() { panelExploration = new javax.swing.JPanel(); scrollPaneImage = new javax.swing.JScrollPane(); labelImageHolder = new javax.swing.JLabel(); buttonStart = new javax.swing.JButton(); toggleHierarchy = new javax.swing.JToggleButton(); toggleEnv = new javax.swing.JToggleButton(); buttonStep = new javax.swing.JButton(); buttonStop = new javax.swing.JButton(); labelCycleUpdate = new javax.swing.JLabel(); labelCycle = new javax.swing.JLabel(); labelExploredUpdate = new javax.swing.JLabel(); labelExplored = new javax.swing.JLabel(); buttonData = new javax.swing.JButton(); labelSpeed = new javax.swing.JLabel(); sliderSpeed = new javax.swing.JSlider(); scrollPaneRobots = new javax.swing.JScrollPane(); panelRobotInfo = new javax.swing.JPanel(); labelAvgCycle = new javax.swing.JLabel(); labelAvgCycleUpdate = new javax.swing.JLabel(); MainMenu1 = new javax.swing.JMenuBar(); menuExploration1 = new javax.swing.JMenu(); menuCommunication1 = new javax.swing.JMenu(); menuEnvironment1 = new javax.swing.JMenu(); menuRobots1 = new javax.swing.JMenu(); menuLogs1 = new javax.swing.JMenu(); setTitle("Multi-robot Exploration Simulator (MRESim) v2.0"); setName("OuterFrame"); // NOI18N setResizable(false);/* w ww . ja v a 2 s. c o m*/ panelExploration.setMaximumSize(new java.awt.Dimension(800, 600)); panelExploration.setMinimumSize(new java.awt.Dimension(800, 600)); panelExploration.setRequestFocusEnabled(false); labelImageHolder.setBackground(new java.awt.Color(255, 255, 102)); labelImageHolder.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); labelImageHolder.setMaximumSize(new java.awt.Dimension(800, 600)); labelImageHolder.setMinimumSize(new java.awt.Dimension(800, 600)); labelImageHolder.setPreferredSize(new java.awt.Dimension(800, 600)); scrollPaneImage.setViewportView(labelImageHolder); javax.swing.GroupLayout panelExplorationLayout = new javax.swing.GroupLayout(panelExploration); panelExploration.setLayout(panelExplorationLayout); panelExplorationLayout.setHorizontalGroup( panelExplorationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( scrollPaneImage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); panelExplorationLayout.setVerticalGroup( panelExplorationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( scrollPaneImage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); buttonStart.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N buttonStart.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/buttonPlay.png"))); // NOI18N buttonStart.setToolTipText("Start simulation"); buttonStart.setBorderPainted(false); buttonStart.setContentAreaFilled(false); buttonStart.setIconTextGap(0); buttonStart.setMaximumSize(new java.awt.Dimension(36, 36)); buttonStart.setMinimumSize(new java.awt.Dimension(36, 36)); buttonStart.setPreferredSize(new java.awt.Dimension(36, 36)); buttonStart.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonStartActionPerformed(evt); } }); toggleHierarchy .setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/buttonHierarchy.png"))); // NOI18N toggleHierarchy.setSelected(true); toggleHierarchy.setToolTipText("Toggle hierarchy"); toggleHierarchy.setBorderPainted(false); toggleHierarchy.setContentAreaFilled(false); toggleHierarchy.setMaximumSize(new java.awt.Dimension(36, 36)); toggleHierarchy.setMinimumSize(new java.awt.Dimension(36, 36)); toggleHierarchy.setPreferredSize(new java.awt.Dimension(36, 36)); toggleHierarchy.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { toggleHierarchyActionPerformed(evt); } }); toggleEnv.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/buttonEnvironment.png"))); // NOI18N toggleEnv.setSelected(true); toggleEnv.setToolTipText("Toggle environment"); toggleEnv.setBorderPainted(false); toggleEnv.setContentAreaFilled(false); toggleEnv.setMaximumSize(new java.awt.Dimension(36, 36)); toggleEnv.setMinimumSize(new java.awt.Dimension(36, 36)); toggleEnv.setPreferredSize(new java.awt.Dimension(36, 36)); toggleEnv.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { toggleEnvActionPerformed(evt); } }); buttonStep.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N buttonStep.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/buttonStep.png"))); // NOI18N buttonStep.setToolTipText("Take one step"); buttonStep.setBorderPainted(false); buttonStep.setContentAreaFilled(false); buttonStep.setMaximumSize(new java.awt.Dimension(36, 36)); buttonStep.setMinimumSize(new java.awt.Dimension(36, 36)); buttonStep.setPreferredSize(new java.awt.Dimension(36, 36)); buttonStep.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonStepActionPerformed(evt); } }); buttonStop.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N buttonStop.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/buttonStop.png"))); // NOI18N buttonStop.setToolTipText("Reset simulation"); buttonStop.setBorderPainted(false); buttonStop.setContentAreaFilled(false); buttonStop.setMaximumSize(new java.awt.Dimension(36, 36)); buttonStop.setMinimumSize(new java.awt.Dimension(36, 36)); buttonStop.setPreferredSize(new java.awt.Dimension(36, 36)); buttonStop.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonStopActionPerformed(evt); } }); labelCycleUpdate.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N labelCycleUpdate.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); labelCycleUpdate.setText("0"); labelCycle.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N labelCycle.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); labelCycle.setText("Cycle:"); labelExploredUpdate.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N labelExploredUpdate.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); labelExploredUpdate.setText("0"); labelExplored.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N labelExplored.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); labelExplored.setText("% Explored:"); buttonData.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/buttonData.png"))); // NOI18N buttonData.setBorderPainted(false); buttonData.setContentAreaFilled(false); buttonData.setMaximumSize(new java.awt.Dimension(36, 36)); buttonData.setMinimumSize(new java.awt.Dimension(36, 36)); buttonData.setPreferredSize(new java.awt.Dimension(36, 36)); buttonData.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonDataActionPerformed(evt); } }); labelSpeed.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N labelSpeed.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); labelSpeed.setText("Speed:"); sliderSpeed.setMajorTickSpacing(1); sliderSpeed.setMaximum(10); sliderSpeed.setSnapToTicks(true); sliderSpeed.setToolTipText("Simulation speed"); sliderSpeed.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { sliderSpeedStateChanged(evt); } }); scrollPaneRobots.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPaneRobots.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPaneRobots.setMinimumSize(new java.awt.Dimension(21, 22)); scrollPaneRobots.setPreferredSize(new java.awt.Dimension(0, 0)); panelRobotInfo.setPreferredSize(new java.awt.Dimension(273, 600)); javax.swing.GroupLayout panelRobotInfoLayout = new javax.swing.GroupLayout(panelRobotInfo); panelRobotInfo.setLayout(panelRobotInfoLayout); panelRobotInfoLayout.setHorizontalGroup(panelRobotInfoLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 273, Short.MAX_VALUE)); panelRobotInfoLayout.setVerticalGroup(panelRobotInfoLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 600, Short.MAX_VALUE)); scrollPaneRobots.setViewportView(panelRobotInfo); labelAvgCycle.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N labelAvgCycle.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); labelAvgCycle.setText("Avg Cycle:"); labelAvgCycleUpdate.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N labelAvgCycleUpdate.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); labelAvgCycleUpdate.setText("0"); MainMenu1.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N menuExploration1.setText("Exploration"); menuExploration1.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N menuExploration1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { menuExplorationMouseClicked(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { menuExplorationMouseReleased(evt); } }); menuExploration1.addMenuDragMouseListener(new javax.swing.event.MenuDragMouseListener() { public void menuDragMouseDragged(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseEntered(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseExited(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseReleased(javax.swing.event.MenuDragMouseEvent evt) { menuExplorationMenuDragMouseReleased(evt); } }); MainMenu1.add(menuExploration1); menuCommunication1.setText("Communication"); menuCommunication1.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N menuCommunication1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { menuCommunicationMouseClicked(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { menuCommunicationMouseReleased(evt); } }); menuCommunication1.addMenuDragMouseListener(new javax.swing.event.MenuDragMouseListener() { public void menuDragMouseDragged(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseEntered(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseExited(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseReleased(javax.swing.event.MenuDragMouseEvent evt) { menuCommunicationMenuDragMouseReleased(evt); } }); MainMenu1.add(menuCommunication1); menuEnvironment1.setText("Environment"); menuEnvironment1.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N menuEnvironment1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { menuEnvironmentMouseClicked(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { menuEnvironmentMouseReleased(evt); } }); menuEnvironment1.addMenuDragMouseListener(new javax.swing.event.MenuDragMouseListener() { public void menuDragMouseDragged(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseEntered(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseExited(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseReleased(javax.swing.event.MenuDragMouseEvent evt) { menuEnvironmentMenuDragMouseReleased(evt); } }); MainMenu1.add(menuEnvironment1); menuRobots1.setText("Robots"); menuRobots1.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N menuRobots1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { menuRobotsMouseClicked(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { menuRobotsMouseReleased(evt); } }); menuRobots1.addMenuDragMouseListener(new javax.swing.event.MenuDragMouseListener() { public void menuDragMouseDragged(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseEntered(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseExited(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseReleased(javax.swing.event.MenuDragMouseEvent evt) { menuRobotsMenuDragMouseReleased(evt); } }); MainMenu1.add(menuRobots1); menuLogs1.setText("Logs"); menuLogs1.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N menuLogs1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { menuLogsMouseClicked(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { menuLogsMouseReleased(evt); } }); menuLogs1.addMenuDragMouseListener(new javax.swing.event.MenuDragMouseListener() { public void menuDragMouseDragged(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseEntered(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseExited(javax.swing.event.MenuDragMouseEvent evt) { } public void menuDragMouseReleased(javax.swing.event.MenuDragMouseEvent evt) { menuLogsMenuDragMouseReleased(evt); } }); MainMenu1.add(menuLogs1); setJMenuBar(MainMenu1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(panelExploration, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(scrollPaneRobots, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(labelSpeed, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(sliderSpeed, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(164, 164, 164) .addComponent(buttonStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(buttonStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(buttonStop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(231, 231, 231) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(labelCycle).addComponent(labelExplored, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(labelExploredUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(labelCycleUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup() .addComponent(labelAvgCycle, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(labelAvgCycleUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(65, 65, 65) .addComponent(toggleEnv, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(toggleHierarchy, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(buttonData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(46, 89, Short.MAX_VALUE))) .addContainerGap())); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout .createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false).addComponent( panelExploration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(scrollPaneRobots, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(labelCycleUpdate).addComponent(labelCycle)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(labelExploredUpdate) .addComponent(labelExplored)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(labelAvgCycleUpdate) .addComponent(labelAvgCycle))) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(buttonStop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( buttonStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(labelSpeed) .addComponent(sliderSpeed, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(toggleHierarchy, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(toggleEnv, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); pack(); }
From source file:de.tor.tribes.ui.views.DSWorkbenchConquersFrame.java
/** * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this * method is always regenerated by the Form Editor. *///from w w w . j av a 2 s .c om @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jConquersPanel = new javax.swing.JPanel(); jConquerTablePanel = new org.jdesktop.swingx.JXPanel(); infoPanel = new org.jdesktop.swingx.JXCollapsiblePane(); jXLabel1 = new org.jdesktop.swingx.JXLabel(); jScrollPane4 = new javax.swing.JScrollPane(); jXPanel2 = new org.jdesktop.swingx.JXPanel(); jSeparator1 = new javax.swing.JSeparator(); jLastUpdateLabel = new javax.swing.JLabel(); jGreyConquersLabel = new javax.swing.JLabel(); jFriendlyConquersLabel = new javax.swing.JLabel(); jSelfConquersLabel = new javax.swing.JLabel(); jxFilterPane = new org.jdesktop.swingx.JXPanel(); jXPanel3 = new org.jdesktop.swingx.JXPanel(); jButton12 = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); jLabel21 = new javax.swing.JLabel(); jFilterRows = new javax.swing.JCheckBox(); jFilterCaseSensitive = new javax.swing.JCheckBox(); jScrollPane1 = new javax.swing.JScrollPane(); jXColumnList = new org.jdesktop.swingx.JXList(); jLabel22 = new javax.swing.JLabel(); jConquersFrameAlwaysOnTop = new javax.swing.JCheckBox(); jConquerPanel = new org.jdesktop.swingx.JXPanel(); capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel(); jConquersPanel.setBackground(new java.awt.Color(239, 235, 223)); jConquersPanel.setLayout(new java.awt.BorderLayout()); jConquerTablePanel.setLayout(new java.awt.BorderLayout()); infoPanel.setCollapsed(true); infoPanel.setInheritAlpha(false); jXLabel1.setText("Keine Meldung"); jXLabel1.setOpaque(true); jXLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { fireHideInfoEvent(evt); } }); infoPanel.add(jXLabel1, java.awt.BorderLayout.CENTER); jConquerTablePanel.add(infoPanel, java.awt.BorderLayout.SOUTH); jConquersTable .setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane4.setViewportView(jConquersTable); jConquerTablePanel.add(jScrollPane4, java.awt.BorderLayout.CENTER); jConquersPanel.add(jConquerTablePanel, java.awt.BorderLayout.CENTER); jXPanel2.setOpaque(false); jXPanel2.setLayout(new java.awt.GridBagLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(10, 0, 10, 0); jXPanel2.add(jSeparator1, gridBagConstraints); jLastUpdateLabel.setText("Letzte Aktualisierung:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); jXPanel2.add(jLastUpdateLabel, gridBagConstraints); jGreyConquersLabel.setBackground(new java.awt.Color(255, 204, 204)); jGreyConquersLabel.setText("Grau-Adelungen:"); jGreyConquersLabel.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); jXPanel2.add(jGreyConquersLabel, gridBagConstraints); jFriendlyConquersLabel.setBackground(new java.awt.Color(0, 255, 255)); jFriendlyConquersLabel.setText("Aufadelungen:"); jFriendlyConquersLabel.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); jXPanel2.add(jFriendlyConquersLabel, gridBagConstraints); jSelfConquersLabel.setBackground(new java.awt.Color(213, 255, 128)); jSelfConquersLabel.setText("Selbstadelungen:"); jSelfConquersLabel.setOpaque(true); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 5); jXPanel2.add(jSelfConquersLabel, gridBagConstraints); jConquersPanel.add(jXPanel2, java.awt.BorderLayout.SOUTH); jxFilterPane.setOpaque(false); jxFilterPane.setLayout(new java.awt.GridBagLayout()); jXPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jXPanel3.setInheritAlpha(false); jButton12.setText("Anwenden"); jButton12.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { jButton12fireHideGlassPaneEvent(evt); } }); jTextField1.addCaretListener(new javax.swing.event.CaretListener() { public void caretUpdate(javax.swing.event.CaretEvent evt) { jTextField1fireHighlightEvent(evt); } }); jLabel21.setText("Suchbegriff"); jFilterRows.setText("Nur gefilterte Zeilen anzeigen"); jFilterRows.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jFilterRowsfireUpdateFilterEvent(evt); } }); jFilterCaseSensitive.setText("Gro-/Kleinschreibung beachten"); jFilterCaseSensitive.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jFilterCaseSensitivefireUpdateFilterEvent(evt); } }); jXColumnList.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]; } }); jXColumnList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); jScrollPane1.setViewportView(jXColumnList); jLabel22.setText("Spalten"); javax.swing.GroupLayout jXPanel3Layout = new javax.swing.GroupLayout(jXPanel3); jXPanel3.setLayout(jXPanel3Layout); jXPanel3Layout .setHorizontalGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jLabel21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel3Layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jXPanel3Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jXPanel3Layout.createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jFilterRows, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jFilterCaseSensitive, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jButton12))) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jXPanel3Layout.setVerticalGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel21) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jXPanel3Layout .createSequentialGroup().addComponent(jFilterCaseSensitive) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jFilterRows) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton12)) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel22)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jxFilterPane.add(jXPanel3, new java.awt.GridBagConstraints()); setTitle("Eroberungen"); getContentPane().setLayout(new java.awt.GridBagLayout()); jConquersFrameAlwaysOnTop.setText("Immer im Vordergrund"); jConquersFrameAlwaysOnTop.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { fireConquersFrameAlwaysOnTopEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(jConquersFrameAlwaysOnTop, gridBagConstraints); jConquerPanel.setBackground(new java.awt.Color(239, 235, 223)); jConquerPanel.setLayout(new java.awt.BorderLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 661; gridBagConstraints.ipady = 354; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(jConquerPanel, gridBagConstraints); capabilityInfoPanel1.setBbSupport(false); capabilityInfoPanel1.setCopyable(false); capabilityInfoPanel1.setDeletable(false); capabilityInfoPanel1.setPastable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(capabilityInfoPanel1, gridBagConstraints); pack(); }
From source file:com.josescalia.tumblr.form.PreferenceForm.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./*from w ww . j a va 2s. c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); rbGroupUseProxy = new ButtonGroup(); folderChooser = new JFileChooser(); jTabbedPane1 = new JTabbedPane(); jPanel1 = new JPanel(); jPanel10 = new JPanel(); jLabel29 = new JLabel(); jLabel26 = new JLabel(); jLabel25 = new JLabel(); jLabel24 = new JLabel(); jLabel28 = new JLabel(); jLabel27 = new JLabel(); jPanel12 = new JPanel(); txtProxyPort = new JTextField(); rbUseProxy = new JRadioButton(); jLabel2 = new JLabel(); rbNoProxy = new JRadioButton(); txtProxyPassword = new JPasswordField(); jLabel3 = new JLabel(); txtProxyUsername = new JTextField(); btnSaveProxyConfig = new JButton(); jLabel1 = new JLabel(); jLabel4 = new JLabel(); txtProxyHost = new JTextField(); checkProxyNeedAuth = new JCheckBox(); jPanel2 = new JPanel(); jPanel11 = new JPanel(); jLabel35 = new JLabel(); jLabel30 = new JLabel(); jLabel33 = new JLabel(); jLabel32 = new JLabel(); jLabel31 = new JLabel(); jLabel34 = new JLabel(); jPanel14 = new JPanel(); txtDefaultFolderPath1 = new JTextField(); jLabel6 = new JLabel(); txtDefaultFolderPath = new JTextField(); jLabel7 = new JLabel(); btnChooseFolder = new JButton(); btnSaveAppConfig = new JButton(); jPanel7 = new JPanel(); jPanel9 = new JPanel(); jLabel18 = new JLabel(); jLabel23 = new JLabel(); jLabel19 = new JLabel(); jLabel21 = new JLabel(); jLabel20 = new JLabel(); jLabel22 = new JLabel(); jPanel13 = new JPanel(); jLabel8 = new JLabel(); btnOpenOtherCacheFolder = new JButton(); btnDeleteCache = new JButton(); jLabel9 = new JLabel(); txtTotalFileSize1 = new JTextField(); txtTotalFileSize = new JTextField(); jPanel3 = new JPanel(); jPanel5 = new JPanel(); txtTotalLogSize = new JTextField(); jLabel11 = new JLabel(); txtTotalLog = new JTextField(); btnCleanLog = new JButton(); jLabel13 = new JLabel(); jPanel6 = new JPanel(); jLabel12 = new JLabel(); jScrollPane1 = new JScrollPane(); txtLogContent = new JTextArea(); jPanel8 = new JPanel(); jLabel17 = new JLabel(); jLabel16 = new JLabel(); jLabel15 = new JLabel(); jLabel14 = new JLabel(); jPanel4 = new JPanel(); jPanel15 = new JPanel(); txtAppLookAndFeel = new JTextField(); jLabel10 = new JLabel(); btnSaveLF = new JButton(); btnSelectLF = new JButton(); jPanel16 = new JPanel(); jLabel41 = new JLabel(); jLabel36 = new JLabel(); jLabel40 = new JLabel(); jLabel37 = new JLabel(); jLabel38 = new JLabel(); jLabel39 = new JLabel(); jLabel5 = new JLabel(); jPanel1.setBorder(BorderFactory.createEtchedBorder()); jPanel10.setBackground(Color.white); jPanel10.setBorder(BorderFactory.createEtchedBorder()); jLabel29.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel29.setText("set up this Proxy Connection."); jLabel26.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel26.setText("if this application need to connect to the internet. The setting of this "); jLabel25.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel25.setText("The Proxy Connection is a set of configuration which will be applied"); jLabel24.setFont(new Font("Liberation Sans", 1, 12)); // NOI18N jLabel24.setText("Info :"); jLabel28.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel28.setText("configuration. Contact Computer Network Administrator to correctly"); jLabel27.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel27.setText("Proxy Connection should be match with the computer network"); GroupLayout jPanel10Layout = new GroupLayout(jPanel10); jPanel10.setLayout(jPanel10Layout); jPanel10Layout.setHorizontalGroup(jPanel10Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel10Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel28).addComponent(jLabel25).addComponent(jLabel24) .addComponent(jLabel26).addComponent(jLabel27).addComponent(jLabel29)) .addContainerGap())); jPanel10Layout.setVerticalGroup(jPanel10Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup().addContainerGap().addComponent(jLabel24) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel25) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel26) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel27) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel28) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel29) .addContainerGap())); jPanel12.setBorder(BorderFactory.createEtchedBorder()); txtProxyPort.setEnabled(false); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${proxyConnection.proxyPort}"), txtProxyPort, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); rbGroupUseProxy.add(rbUseProxy); rbUseProxy.setText("Use Proxy"); rbUseProxy.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbUseProxyActionPerformed(evt); } }); jLabel2.setText("Proxy Port"); rbGroupUseProxy.add(rbNoProxy); rbNoProxy.setText("No Proxy"); rbNoProxy.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbNoProxyActionPerformed(evt); } }); txtProxyPassword.setEnabled(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${proxyConnection.proxyPassword}"), txtProxyPassword, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel3.setText("Username "); txtProxyUsername.setEnabled(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${proxyConnection.proxyUsername}"), txtProxyUsername, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); btnSaveProxyConfig.setIcon(new ImageIcon(getClass().getResource("/icons/edit.png"))); // NOI18N btnSaveProxyConfig.setText("Save"); btnSaveProxyConfig.setHorizontalTextPosition(SwingConstants.CENTER); btnSaveProxyConfig.setVerticalTextPosition(SwingConstants.BOTTOM); btnSaveProxyConfig.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveProxyConfigActionPerformed(evt); } }); jLabel1.setText("Proxy Host"); jLabel4.setText("Password"); txtProxyHost.setEnabled(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${proxyConnection.proxyHost}"), txtProxyHost, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); checkProxyNeedAuth.setText("Proxy Need Authentication"); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${bUseProxyAuth}"), checkProxyNeedAuth, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); checkProxyNeedAuth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkProxyNeedAuthActionPerformed(evt); } }); GroupLayout jPanel12Layout = new GroupLayout(jPanel12); jPanel12.setLayout(jPanel12Layout); jPanel12Layout.setHorizontalGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel12Layout.createSequentialGroup().addContainerGap().addGroup(jPanel12Layout .createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel12Layout.createSequentialGroup().addComponent(rbNoProxy) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(rbUseProxy)) .addGroup(jPanel12Layout.createSequentialGroup().addGroup(jPanel12Layout .createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3).addComponent(jLabel4)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(txtProxyPort, GroupLayout.PREFERRED_SIZE, 105, GroupLayout.PREFERRED_SIZE) .addComponent(txtProxyHost, GroupLayout.PREFERRED_SIZE, 297, GroupLayout.PREFERRED_SIZE) .addGroup(jPanel12Layout .createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addComponent(txtProxyPassword, GroupLayout.Alignment.LEADING) .addComponent(txtProxyUsername, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 227, GroupLayout.PREFERRED_SIZE)))) .addComponent(checkProxyNeedAuth).addComponent(btnSaveProxyConfig, GroupLayout.PREFERRED_SIZE, 89, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jPanel12Layout.setVerticalGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel12Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(rbNoProxy).addComponent(rbUseProxy)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel1).addComponent(txtProxyHost, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel2).addComponent(txtProxyPort, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(4, 4, 4).addComponent(checkProxyNeedAuth) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(txtProxyUsername, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(txtProxyPassword, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(btnSaveProxyConfig) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); GroupLayout jPanel1Layout = new GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout .setHorizontalGroup( jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel12, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(286, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(11, 11, 11) .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jPanel12, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jPanel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addContainerGap(165, Short.MAX_VALUE))); jTabbedPane1.addTab("Proxy Connection", jPanel1); jPanel2.setBorder(BorderFactory.createEtchedBorder()); jPanel11.setBackground(Color.white); jPanel11.setBorder(BorderFactory.createEtchedBorder()); jLabel35.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel35.setText("the application is trigger to open a folder."); jLabel30.setFont(new Font("Liberation Sans", 1, 12)); // NOI18N jLabel30.setText("Info :"); jLabel33.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel33.setText("application downloading stuff from the internet."); jLabel32.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel32.setText("Default Download Path is the default folder location when the "); jLabel31.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel31.setText("This is the set of configuration will be used by this application."); jLabel34.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel34.setText("Default Folder Viewer is the default of computer programs when "); GroupLayout jPanel11Layout = new GroupLayout(jPanel11); jPanel11.setLayout(jPanel11Layout); jPanel11Layout.setHorizontalGroup(jPanel11Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel11Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel30).addComponent(jLabel31).addComponent(jLabel32) .addComponent(jLabel33).addComponent(jLabel34).addComponent(jLabel35)) .addContainerGap())); jPanel11Layout.setVerticalGroup(jPanel11Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup().addContainerGap().addComponent(jLabel30) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel31) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel32) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel33) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel34) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel35) .addContainerGap())); jPanel14.setBorder(BorderFactory.createEtchedBorder()); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${defaultFolderViewer}"), txtDefaultFolderPath1, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel6.setText("Default Download Path"); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${defaultDownloadPath}"), txtDefaultFolderPath, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel7.setText("Default Folder Viewer"); btnChooseFolder.setText("Change"); btnChooseFolder.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnChooseFolderActionPerformed(evt); } }); btnSaveAppConfig.setIcon(new ImageIcon(getClass().getResource("/icons/edit.png"))); // NOI18N btnSaveAppConfig.setText("Save"); btnSaveAppConfig.setHorizontalTextPosition(SwingConstants.CENTER); btnSaveAppConfig.setVerticalTextPosition(SwingConstants.BOTTOM); btnSaveAppConfig.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveAppConfigActionPerformed(evt); } }); GroupLayout jPanel14Layout = new GroupLayout(jPanel14); jPanel14.setLayout(jPanel14Layout); jPanel14Layout.setHorizontalGroup(jPanel14Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createSequentialGroup().addContainerGap().addGroup(jPanel14Layout .createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createSequentialGroup() .addComponent(jLabel7, GroupLayout.PREFERRED_SIZE, 161, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtDefaultFolderPath1, GroupLayout.PREFERRED_SIZE, 258, GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel14Layout.createSequentialGroup() .addComponent(jLabel6, GroupLayout.PREFERRED_SIZE, 161, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtDefaultFolderPath, GroupLayout.PREFERRED_SIZE, 346, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnChooseFolder)) .addComponent(btnSaveAppConfig, GroupLayout.PREFERRED_SIZE, 95, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jPanel14Layout.setVerticalGroup(jPanel14Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel14Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(txtDefaultFolderPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(btnChooseFolder)) .addGap(4, 4, 4) .addGroup(jPanel14Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel7).addComponent(txtDefaultFolderPath1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnSaveAppConfig).addContainerGap())); GroupLayout jPanel2Layout = new GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout .setHorizontalGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel14, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel11, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(jPanel11, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel14, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(285, Short.MAX_VALUE))); jTabbedPane1.addTab("Application Config", jPanel2); jPanel9.setBackground(Color.white); jPanel9.setBorder(BorderFactory.createEtchedBorder()); jLabel18.setFont(new Font("Liberation Sans", 1, 12)); // NOI18N jLabel18.setText("Info :"); jLabel23.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel23.setText("make the application processing faster."); jLabel19.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel19.setText("Cache Info contains a summary of how much space in hard drive"); jLabel21.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel21.setText("hard drive space by this application, but if the application need to"); jLabel20.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel20.setText("used by this application. Deleting cache will reduce the usage of"); jLabel22.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel22.setText("fetch the data from internet, this cache will be used in order to"); GroupLayout jPanel9Layout = new GroupLayout(jPanel9); jPanel9.setLayout(jPanel9Layout); jPanel9Layout.setHorizontalGroup(jPanel9Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel9Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel18).addComponent(jLabel19).addComponent(jLabel20) .addComponent(jLabel21).addComponent(jLabel22).addComponent(jLabel23)) .addContainerGap())); jPanel9Layout.setVerticalGroup(jPanel9Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup().addContainerGap().addComponent(jLabel18) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel19) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel20) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel21) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel22) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel23) .addContainerGap())); jPanel13.setBorder(BorderFactory.createEtchedBorder()); jLabel8.setText("Total Cache File Size"); btnOpenOtherCacheFolder.setIcon(new ImageIcon(getClass().getResource("/icons/folder_open.png"))); // NOI18N btnOpenOtherCacheFolder.setText("Open Dir"); btnOpenOtherCacheFolder.setHorizontalTextPosition(SwingConstants.CENTER); btnOpenOtherCacheFolder.setVerticalTextPosition(SwingConstants.BOTTOM); btnOpenOtherCacheFolder.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnOpenOtherCacheFolderActionPerformed(evt); } }); btnDeleteCache.setIcon(new ImageIcon(getClass().getResource("/icons/cross2.png"))); // NOI18N btnDeleteCache.setText("Delete Cache"); btnDeleteCache.setHorizontalTextPosition(SwingConstants.CENTER); btnDeleteCache.setVerticalTextPosition(SwingConstants.BOTTOM); btnDeleteCache.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDeleteCacheActionPerformed(evt); } }); jLabel9.setText("Total Cache File"); txtTotalFileSize1.setEditable(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${cacheFile.fileListSize}"), txtTotalFileSize1, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); txtTotalFileSize.setEditable(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${cacheFile.totalFolderSize}"), txtTotalFileSize, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); GroupLayout jPanel13Layout = new GroupLayout(jPanel13); jPanel13.setLayout(jPanel13Layout); jPanel13Layout.setHorizontalGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel13Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel8).addComponent(jLabel9).addComponent(btnDeleteCache)) .addGap(18, 18, 18) .addGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addComponent(txtTotalFileSize1, GroupLayout.Alignment.LEADING) .addComponent(btnOpenOtherCacheFolder, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE) .addComponent(txtTotalFileSize)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel13Layout.setVerticalGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel13Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel8).addComponent(txtTotalFileSize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel9).addComponent(txtTotalFileSize1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(btnDeleteCache, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnOpenOtherCacheFolder)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); GroupLayout jPanel7Layout = new GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup(jPanel7Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel13, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel9, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(443, Short.MAX_VALUE))); jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel7Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(jPanel9, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel13, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(289, Short.MAX_VALUE))); jTabbedPane1.addTab("Cache Info", jPanel7); jPanel5.setBorder(BorderFactory.createEtchedBorder()); txtTotalLogSize.setEditable(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${logFile.totalFolderSize}"), txtTotalLogSize, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel11.setText("Total File on Log Folder"); txtTotalLog.setEditable(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${logFile.fileListSize}"), txtTotalLog, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); btnCleanLog.setIcon(new ImageIcon(getClass().getResource("/icons/cross2.png"))); // NOI18N btnCleanLog.setText("Clean Log File"); btnCleanLog.setHorizontalTextPosition(SwingConstants.CENTER); btnCleanLog.setVerticalTextPosition(SwingConstants.BOTTOM); btnCleanLog.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCleanLogActionPerformed(evt); } }); jLabel13.setText("Total Size on Log Folder "); GroupLayout jPanel5Layout = new GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addComponent(btnCleanLog, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel5Layout.createSequentialGroup() .addGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel13).addComponent(jLabel11)) .addGap(18, 18, 18) .addGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(txtTotalLog, GroupLayout.PREFERRED_SIZE, 66, GroupLayout.PREFERRED_SIZE) .addComponent(txtTotalLogSize, GroupLayout.PREFERRED_SIZE, 123, GroupLayout.PREFERRED_SIZE)))) .addContainerGap(22, Short.MAX_VALUE))); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(txtTotalLog, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel11)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel13).addComponent(txtTotalLogSize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnCleanLog, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE) .addContainerGap())); jPanel6.setBorder(BorderFactory.createEtchedBorder()); jLabel12.setText("Log File Data :"); txtLogContent.setEditable(false); txtLogContent.setColumns(20); txtLogContent.setLineWrap(true); txtLogContent.setRows(5); txtLogContent.setWrapStyleWord(true); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${logFileData}"), txtLogContent, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jScrollPane1.setViewportView(txtLogContent); GroupLayout jPanel6Layout = new GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup(jPanel6Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel6Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 724, Short.MAX_VALUE) .addGroup(jPanel6Layout.createSequentialGroup().addComponent(jLabel12).addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); jPanel6Layout .setVerticalGroup(jPanel6Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap().addComponent(jLabel12) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 339, GroupLayout.PREFERRED_SIZE) .addContainerGap())); jPanel8.setBackground(Color.white); jPanel8.setBorder(BorderFactory.createEtchedBorder()); jLabel17.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel17.setText("application use it as a log tracker."); jLabel16.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel16.setText("These 2 log files cannot be delete, because the"); jLabel15.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel15.setText("Minimal log files is 2 files."); jLabel14.setFont(new Font("Liberation Sans", 1, 12)); // NOI18N jLabel14.setText("Info :"); GroupLayout jPanel8Layout = new GroupLayout(jPanel8); jPanel8.setLayout(jPanel8Layout); jPanel8Layout.setHorizontalGroup(jPanel8Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel8Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel14).addComponent(jLabel15).addComponent(jLabel16) .addComponent(jLabel17)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel8Layout.setVerticalGroup(jPanel8Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup().addContainerGap().addComponent(jLabel14) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel15) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel16) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel17) .addContainerGap())); GroupLayout jPanel3Layout = new GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup( GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(jPanel5, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel8, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel6, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addGap(20, 20, 20) .addGroup(jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jPanel6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jPanel5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel8, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addContainerGap(41, Short.MAX_VALUE))); jTabbedPane1.addTab("Log Monitor", jPanel3); jPanel15.setBorder(BorderFactory.createEtchedBorder()); txtAppLookAndFeel.setEditable(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${defaultLookAndFeel}"), txtAppLookAndFeel, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel10.setText("Look And Feel "); btnSaveLF.setIcon(new ImageIcon(getClass().getResource("/icons/edit.png"))); // NOI18N btnSaveLF.setText("Save"); btnSaveLF.setHorizontalTextPosition(SwingConstants.CENTER); btnSaveLF.setVerticalTextPosition(SwingConstants.BOTTOM); btnSaveLF.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveLFActionPerformed(evt); } }); btnSelectLF.setText("Change Look and Feel"); btnSelectLF.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSelectLFActionPerformed(evt); } }); GroupLayout jPanel15Layout = new GroupLayout(jPanel15); jPanel15.setLayout(jPanel15Layout); jPanel15Layout.setHorizontalGroup(jPanel15Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel15Layout.createSequentialGroup().addContainerGap().addComponent(jLabel10) .addGap(4, 4, 4) .addGroup(jPanel15Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(btnSaveLF, GroupLayout.PREFERRED_SIZE, 90, GroupLayout.PREFERRED_SIZE) .addComponent(txtAppLookAndFeel, GroupLayout.PREFERRED_SIZE, 395, GroupLayout.PREFERRED_SIZE) .addComponent(btnSelectLF, GroupLayout.PREFERRED_SIZE, 176, GroupLayout.PREFERRED_SIZE)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel15Layout.setVerticalGroup(jPanel15Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel15Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel15Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel10).addComponent(txtAppLookAndFeel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(btnSelectLF) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(btnSaveLF) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel16.setBackground(Color.white); jPanel16.setBorder(BorderFactory.createEtchedBorder()); jLabel41.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel41.setText("to be restarted."); jLabel36.setFont(new Font("Liberation Sans", 1, 12)); // NOI18N jLabel36.setText("Info :"); jLabel40.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel40.setText("System. Changing Look and Feel requires application"); jLabel37.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel37.setText("Changing the Look and Feel means changing this"); jLabel38.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel38.setText("application theme, the theme provided by it's installed"); jLabel39.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel39.setText("Look and Feel class in the Java Runtime Environment"); GroupLayout jPanel16Layout = new GroupLayout(jPanel16); jPanel16.setLayout(jPanel16Layout); jPanel16Layout.setHorizontalGroup(jPanel16Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel16Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel36).addComponent(jLabel37).addComponent(jLabel38) .addComponent(jLabel39).addComponent(jLabel40).addComponent(jLabel41)) .addContainerGap())); jPanel16Layout.setVerticalGroup(jPanel16Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup().addContainerGap().addComponent(jLabel36) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel37) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel38) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel39) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel40) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel41) .addContainerGap())); GroupLayout jPanel4Layout = new GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout .setHorizontalGroup( jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel15, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel16, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(261, Short.MAX_VALUE))); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(jPanel16, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel15, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(289, Short.MAX_VALUE))); jTabbedPane1.addTab("Look And Feel", jPanel4); jLabel5.setFont(new Font("DejaVu Sans", 1, 18)); // NOI18N jLabel5.setHorizontalAlignment(SwingConstants.CENTER); jLabel5.setText("System Configuration"); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jTabbedPane1).addComponent(jLabel5, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addComponent(jLabel5) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jTabbedPane1))); bindingGroup.bind(); }
From source file:de.dmarcini.submatix.pclogger.gui.ProgramProperetysDialog.java
/** * Initialisiere das Fenster Project: SubmatixBTForPC Package: de.dmarcini.submatix.pclogger.gui * /*from w w w .j ava2 s. c o m*/ * @author Dirk Marciniak (dirk_marciniak@arcor.de) Stand: 03.08.2012 */ private void initDialog() { setResizable(false); setIconImage(Toolkit.getDefaultToolkit().getImage( ProgramProperetysDialog.class.getResource("/de/dmarcini/submatix/pclogger/res/search.png"))); // setVisible( true ); setBounds(100, 100, 750, 417); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.SOUTH); { btnCancel = new JButton(LangStrings.getString("ProgramProperetysDialog.btnCancel.text")); //$NON-NLS-1$ btnCancel.setIcon(new ImageIcon( ProgramProperetysDialog.class.getResource("/de/dmarcini/submatix/pclogger/res/114.png"))); btnCancel.setHorizontalAlignment(SwingConstants.LEFT); btnCancel.setIconTextGap(15); btnCancel.setPreferredSize(new Dimension(180, 40)); btnCancel.setMaximumSize(new Dimension(160, 40)); btnCancel.setMargin(new Insets(6, 30, 6, 30)); btnCancel.setForeground(Color.RED); btnCancel.setBackground(new Color(255, 192, 203)); btnCancel.setActionCommand("cancel"); btnCancel.addActionListener(this); btnCancel.addMouseMotionListener(this); } { btnOk = new JButton(LangStrings.getString("ProgramProperetysDialog.btnOk.text")); //$NON-NLS-1$ btnOk.setIconTextGap(15); btnOk.setHorizontalAlignment(SwingConstants.LEFT); btnOk.setIcon(new ImageIcon( ProgramProperetysDialog.class.getResource("/de/dmarcini/submatix/pclogger/res/31.png"))); btnOk.setPreferredSize(new Dimension(180, 40)); btnOk.setMaximumSize(new Dimension(160, 40)); btnOk.setMargin(new Insets(6, 30, 6, 30)); btnOk.setForeground(new Color(0, 100, 0)); btnOk.setBackground(new Color(152, 251, 152)); btnOk.setActionCommand("set_propertys"); btnOk.addActionListener(this); btnOk.addMouseMotionListener(this); } unitsPanel = new JPanel(); unitsPanel.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), " UNITS ", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pahtsPanel = new JPanel(); pahtsPanel.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), " DIRECTORYS ", TitledBorder.LEADING, TitledBorder.TOP, null, null)); GroupLayout gl_contentPanel = new GroupLayout(contentPanel); gl_contentPanel.setHorizontalGroup(gl_contentPanel.createParallelGroup(Alignment.TRAILING).addGroup( Alignment.LEADING, gl_contentPanel.createSequentialGroup().addContainerGap().addGroup(gl_contentPanel .createParallelGroup(Alignment.LEADING) .addComponent(pahtsPanel, GroupLayout.PREFERRED_SIZE, 714, GroupLayout.PREFERRED_SIZE) .addGroup(gl_contentPanel.createSequentialGroup() .addComponent(btnCancel, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED, 394, Short.MAX_VALUE) .addComponent(btnOk, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE)) .addComponent(unitsPanel, GroupLayout.DEFAULT_SIZE, 714, Short.MAX_VALUE)) .addContainerGap())); gl_contentPanel.setVerticalGroup(gl_contentPanel.createParallelGroup(Alignment.TRAILING) .addGroup(gl_contentPanel.createSequentialGroup() .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pahtsPanel, GroupLayout.PREFERRED_SIZE, 225, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(unitsPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE) .addComponent(btnOk, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE) .addComponent(btnCancel, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)))); databaseDirLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.databaseDirLabel.text")); //$NON-NLS-1$ databaseDirTextField = new JTextField(); databaseDirTextField.setEditable(false); databaseDirTextField.addMouseMotionListener(this); databaseDirTextField.setColumns(10); logfileLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.logFileLabel.text")); //$NON-NLS-1$ logfileNameTextField = new JTextField(); logfileNameTextField.setEditable(false); logfileNameTextField.addMouseMotionListener(this); logfileNameTextField.setColumns(10); moveDataCheckBox = new JCheckBox(LangStrings.getString("ProgramProperetysDialog.moveDataCheckBox.text")); //$NON-NLS-1$ moveDataCheckBox.addMouseMotionListener(this); databaseDirFileButton = new JButton(""); databaseDirFileButton.setIcon(new ImageIcon( ProgramProperetysDialog.class.getResource("/javax/swing/plaf/metal/icons/ocean/directory.gif"))); databaseDirFileButton.addActionListener(this); databaseDirFileButton.setActionCommand("choose_datadir"); databaseDirFileButton.addMouseMotionListener(this); logfileNameButton = new JButton(""); logfileNameButton.setIcon(new ImageIcon( ProgramProperetysDialog.class.getResource("/javax/swing/plaf/metal/icons/ocean/directory.gif"))); logfileNameButton.addActionListener(this); logfileNameButton.setActionCommand("choose_logfile"); logfileNameButton.addMouseMotionListener(this); exportDirLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.exportDirLabel.text")); //$NON-NLS-1$ exportDirTextField = new JTextField(); exportDirTextField.setEditable(false); exportDirTextField.setColumns(10); exportDirButton = new JButton(""); exportDirButton.setIcon(new ImageIcon( ProgramProperetysDialog.class.getResource("/javax/swing/plaf/metal/icons/ocean/directory.gif"))); exportDirButton.setActionCommand("choose_exportdir"); exportDirButton.addActionListener(this); exportDirButton.addMouseMotionListener(this); GroupLayout gl_pahtsPanel = new GroupLayout(pahtsPanel); gl_pahtsPanel.setHorizontalGroup(gl_pahtsPanel.createParallelGroup(Alignment.LEADING).addGroup(gl_pahtsPanel .createSequentialGroup().addContainerGap() .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.LEADING) .addGroup(Alignment.TRAILING, gl_pahtsPanel.createSequentialGroup().addGroup(gl_pahtsPanel .createParallelGroup(Alignment.LEADING) .addGroup(gl_pahtsPanel.createSequentialGroup() .addComponent(databaseDirLabel, GroupLayout.DEFAULT_SIZE, 419, Short.MAX_VALUE) .addGap(193)) .addGroup(gl_pahtsPanel.createSequentialGroup() .addComponent(databaseDirTextField, GroupLayout.DEFAULT_SIZE, 606, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED))) .addComponent(databaseDirFileButton, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)) .addComponent(moveDataCheckBox, Alignment.TRAILING) .addGroup(Alignment.TRAILING, gl_pahtsPanel.createSequentialGroup() .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_pahtsPanel.createSequentialGroup() .addComponent(logfileLabel, GroupLayout.DEFAULT_SIZE, 345, Short.MAX_VALUE) .addGap(267)) .addGroup(Alignment.TRAILING, gl_pahtsPanel.createSequentialGroup() .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.TRAILING) .addComponent(exportDirLabel, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 606, Short.MAX_VALUE) .addComponent(logfileNameTextField, GroupLayout.DEFAULT_SIZE, 606, Short.MAX_VALUE) .addComponent(exportDirTextField, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 606, Short.MAX_VALUE)) .addPreferredGap(ComponentPlacement.RELATED))) .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.LEADING) .addComponent(logfileNameButton, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE) .addComponent(exportDirButton, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)))) .addContainerGap())); gl_pahtsPanel.setVerticalGroup(gl_pahtsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_pahtsPanel.createSequentialGroup() .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.TRAILING) .addComponent(databaseDirFileButton, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE) .addGroup(gl_pahtsPanel.createSequentialGroup().addComponent(databaseDirLabel) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(databaseDirTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED))) .addGap(1).addComponent(moveDataCheckBox).addGap(18) .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.TRAILING) .addComponent(logfileNameButton, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE) .addGroup(gl_pahtsPanel.createSequentialGroup().addComponent(logfileLabel) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(logfileNameTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addGap(18).addComponent(exportDirLabel).addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.BASELINE) .addComponent(exportDirTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(exportDirButton, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)) .addGap(24))); pahtsPanel.setLayout(gl_pahtsPanel); defaultUnitsRadioButton = new JRadioButton( LangStrings.getString("ProgramPropertysDialog.defaultUnitsRadioButton.text")); //$NON-NLS-1$ defaultUnitsRadioButton.setSelected(true); defaultUnitsRadioButton.setActionCommand("rbutton"); defaultUnitsRadioButton.addActionListener(this); metricUnitsRadioButton = new JRadioButton( LangStrings.getString("ProgramPropertysDialog.metricUnitsRadioButton.text")); //$NON-NLS-1$ metricUnitsRadioButton.setActionCommand("rbutton"); metricUnitsRadioButton.addActionListener(this); imperialUnitsRadioButton = new JRadioButton( LangStrings.getString("ProgramPropertysDialog.imperialUnitsRadioButton.text")); //$NON-NLS-1$ imperialUnitsRadioButton.addActionListener(this); imperialUnitsRadioButton.setActionCommand("rbutton"); defaultUnitsLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.defaultUnitsLabel.text")); //$NON-NLS-1$ metricUnitsLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.metricUnitsLabel.text")); //$NON-NLS-1$ imperialUnitsLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.imperialUnitsLabel.text")); //$NON-NLS-1$ GroupLayout gl_untitsPanel = new GroupLayout(unitsPanel); gl_untitsPanel.setHorizontalGroup(gl_untitsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_untitsPanel.createSequentialGroup().addContainerGap() .addGroup(gl_untitsPanel.createParallelGroup(Alignment.LEADING, false) .addComponent(metricUnitsRadioButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(imperialUnitsRadioButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(defaultUnitsRadioButton, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(gl_untitsPanel.createParallelGroup(Alignment.LEADING) .addComponent(metricUnitsLabel, GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE) .addComponent(defaultUnitsLabel, GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE) .addComponent(imperialUnitsLabel, GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)) .addContainerGap())); gl_untitsPanel.setVerticalGroup(gl_untitsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_untitsPanel.createSequentialGroup() .addGroup(gl_untitsPanel.createParallelGroup(Alignment.BASELINE) .addComponent(defaultUnitsRadioButton).addComponent(defaultUnitsLabel)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_untitsPanel.createParallelGroup(Alignment.BASELINE) .addComponent(metricUnitsRadioButton).addComponent(metricUnitsLabel)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_untitsPanel.createParallelGroup(Alignment.BASELINE) .addComponent(imperialUnitsRadioButton).addComponent(imperialUnitsLabel)) .addContainerGap(10, Short.MAX_VALUE))); unitsPanel.setLayout(gl_untitsPanel); contentPanel.setLayout(gl_contentPanel); unitsButtonGroup = new ButtonGroup(); unitsButtonGroup.add(defaultUnitsRadioButton); unitsButtonGroup.add(metricUnitsRadioButton); unitsButtonGroup.add(imperialUnitsRadioButton); }
From source file:com.juanhg.icewalker.IceWalkerApplet.java
private void autogeneratedCode() { JPanel panel_control = new JPanel(); panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null), new BevelBorder(BevelBorder.RAISED, null, null, null, null))); JPanel panelInputs = new JPanel(); panelInputs.setToolTipText(""); panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelTiempo = new JPanel(); panelTiempo.setToolTipText(""); panelTiempo.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelOutputs = new JPanel(); panelOutputs.setToolTipText(""); panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelTitleOutputs = new JPanel(); panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n"); labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitleOutputs.add(labelOutputData); lblPhase = new JLabel("Velocidad:"); lblPhase.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVValue = new JLabel(); lblVValue.setText("0"); lblVValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblPosicion = new JLabel("Posici\u00F3n:"); lblPosicion.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblPositionValue = new JLabel(); lblPositionValue.setText("0"); lblPositionValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs); gl_panelOutputs/*from www .j av a 2 s . c o m*/ .setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(panelTitleOutputs, GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE) .addGroup(gl_panelOutputs.createSequentialGroup().addContainerGap() .addComponent(lblPhase, GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE).addGap(26) .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 147, GroupLayout.PREFERRED_SIZE) .addContainerGap(130, Short.MAX_VALUE)) .addGroup(gl_panelOutputs.createSequentialGroup().addContainerGap() .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addGap(26).addComponent(lblPositionValue, GroupLayout.PREFERRED_SIZE, 147, GroupLayout.PREFERRED_SIZE) .addContainerGap(130, Short.MAX_VALUE))); gl_panelOutputs .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblPhase).addComponent(lblVValue)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblPositionValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGap(63))); panelOutputs.setLayout(gl_panelOutputs); panel_1 = new JPanel(); panel_1.setBorder(new LineBorder(new Color(0, 0, 0))); GroupLayout gl_panel_control = new GroupLayout(panel_control); gl_panel_control.setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap().addGroup(gl_panel_control .createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_control.createSequentialGroup() .addGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING, false) .addComponent(panelOutputs, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelInputs, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) .addGroup(Alignment.TRAILING, gl_panel_control.createSequentialGroup() .addGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING) .addComponent(panel_1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE) .addComponent(panelTiempo, GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE)) .addContainerGap())))); gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap() .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 141, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panelTiempo, GroupLayout.PREFERRED_SIZE, 271, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED, 15, Short.MAX_VALUE).addComponent(panel_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap())); JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE"); panel_1.add(lblNewLabel); btnLaunchSimulation = new JButton("Iniciar"); btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16)); btnLaunchSimulation.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { btnLaunchSimulationEvent(event); } }); panel = new JPanel(); panel.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); label = new JLabel("Datos de la Simulaci\u00F3n"); label.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel.add(label); btnBanana = new JButton(""); btnBanana.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { btnBananaEvent(); } }); bananaImage = loadImage(banana); btnBanana.setIcon(new ImageIcon(bananaImage)); btnBurger = new JButton(""); btnBurger.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnBurgerEvent(); } }); burgerImage = loadImage(burger); btnBurger.setIcon(new ImageIcon(burgerImage)); btnCookie = new JButton(""); btnCookie.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnCookieEvent(); } }); cookieImage = loadImage(cookie); btnCookie.setIcon(new ImageIcon(cookieImage)); btnCarrot = new JButton(""); carrotImage = loadImage(carrot); btnCarrot.setIcon(new ImageIcon(carrotImage)); btnCarrot.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { btnCarrotEvent(); } }); JLabel lblNewLabel_1 = new JLabel("30 cal/100g"); JLabel lblCalg_2 = new JLabel("734 cal/100g"); lblCalg = new JLabel("90 cal/100g"); lblCalg_1 = new JLabel("433 cal/100g"); GroupLayout gl_panelTiempo = new GroupLayout(panelTiempo); gl_panelTiempo.setHorizontalGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING) .addComponent(panel, GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE) .addGroup(gl_panelTiempo.createSequentialGroup().addGap(17).addGroup(gl_panelTiempo .createParallelGroup(Alignment.LEADING, false) .addComponent(btnLaunchSimulation, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(gl_panelTiempo.createSequentialGroup() .addGroup(gl_panelTiempo.createParallelGroup(Alignment.TRAILING) .addComponent(btnCarrot, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addComponent(lblNewLabel_1, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelTiempo.createParallelGroup(Alignment.TRAILING) .addComponent(btnBanana).addComponent(lblCalg, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(gl_panelTiempo.createParallelGroup(Alignment.TRAILING) .addComponent(btnCookie, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addComponent(lblCalg_1, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelTiempo.createSequentialGroup().addGap(6).addComponent( btnBurger, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelTiempo.createSequentialGroup().addGap(18).addComponent( lblCalg_2, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE))))) .addContainerGap(24, Short.MAX_VALUE))); gl_panelTiempo.setVerticalGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelTiempo.createSequentialGroup() .addComponent(panel, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING).addGroup(gl_panelTiempo .createSequentialGroup() .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING) .addComponent(btnCarrot, GroupLayout.PREFERRED_SIZE, 69, GroupLayout.PREFERRED_SIZE) .addComponent(btnCookie, GroupLayout.PREFERRED_SIZE, 69, GroupLayout.PREFERRED_SIZE) .addComponent(btnBurger, GroupLayout.PREFERRED_SIZE, 69, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING, false) .addComponent(lblNewLabel_1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(gl_panelTiempo.createParallelGroup(Alignment.BASELINE) .addComponent(lblCalg_2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblCalg_1, GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE)) .addComponent(lblCalg, GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE))) .addComponent(btnBanana, GroupLayout.PREFERRED_SIZE, 69, GroupLayout.PREFERRED_SIZE)) .addGap(30).addComponent(btnLaunchSimulation, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE) .addContainerGap(33, Short.MAX_VALUE))); panelTiempo.setLayout(gl_panelTiempo); JLabel LabelStrength = new JLabel("Fuerza"); LabelStrength.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelStaticFriction = new JLabel("Roz. Est\u00E1tico"); labelStaticFriction.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelDynamicFriction = new JLabel("Roz. Din\u00E1mico"); labelDynamicFriction.setFont(new Font("Tahoma", Font.PLAIN, 14)); JPanel panelTitle = new JPanel(); panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); lblStaticFrictionValue = new JLabel("0.2"); lblStaticFrictionValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblDynamicFrictionValue = new JLabel("0.1"); lblDynamicFrictionValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblStregthValue = new JLabel("100"); lblStregthValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderStrength = new JSlider(); sliderStrength.setMinorTickSpacing(1); sliderStrength.setMinimum(1); sliderStrength.setMaximum(300); sliderStrength.setValue(100); sliderStrength.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent event) { sliderStrenghtEvent(); } }); sliderStaticFriction = new JSlider(); sliderStaticFriction.setMinimum(15); sliderStaticFriction.setMaximum(80); sliderStaticFriction.setMinorTickSpacing(1); sliderStaticFriction.setValue(20); sliderStaticFriction.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderStaticFrictionEvent(); } }); sliderDynamicFriction = new JSlider(); sliderDynamicFriction.setValue(10); sliderDynamicFriction.setMaximum(15); sliderDynamicFriction.setMinimum(5); sliderDynamicFriction.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderDynamicFrictionEvent(); } }); sliderDynamicFriction.setMinorTickSpacing(1); GroupLayout gl_panelInputs = new GroupLayout(panelInputs); gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panelInputs.createSequentialGroup().addContainerGap() .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING, false) .addComponent(labelDynamicFriction, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(LabelStrength, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelStaticFriction, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 120, Short.MAX_VALUE)) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblStregthValue, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE) .addComponent(lblStaticFrictionValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addComponent(lblDynamicFrictionValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(sliderStaticFriction, GroupLayout.PREFERRED_SIZE, 146, GroupLayout.PREFERRED_SIZE) .addComponent(sliderStrength, GroupLayout.PREFERRED_SIZE, 146, GroupLayout.PREFERRED_SIZE) .addComponent(sliderDynamicFriction, GroupLayout.PREFERRED_SIZE, 146, GroupLayout.PREFERRED_SIZE)) .addGap(26)) .addComponent(panelTitle, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)); gl_panelInputs .setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(8) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(LabelStrength).addComponent(lblStregthValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderStrength, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(labelStaticFriction) .addComponent(lblStaticFrictionValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderStaticFriction, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(11) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(labelDynamicFriction) .addComponent(lblDynamicFrictionValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderDynamicFriction, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(75))); JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada"); lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitle.add(lblDatosDeEntrada); panelInputs.setLayout(gl_panelInputs); panel_control.setLayout(gl_panel_control); JPanel panel_visualizar = new JPanel(); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup().addContainerGap() .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 432, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_visualizar, GroupLayout.DEFAULT_SIZE, 592, Short.MAX_VALUE) .addContainerGap())); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(groupLayout.createSequentialGroup().addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addComponent(panel_visualizar, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 598, Short.MAX_VALUE) .addComponent(panel_control, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 598, Short.MAX_VALUE)) .addContainerGap())); GridBagLayout gbl_panel_visualizar = new GridBagLayout(); gbl_panel_visualizar.columnWidths = new int[] { 0, 0 }; gbl_panel_visualizar.rowHeights = new int[] { 0, 0, 0 }; gbl_panel_visualizar.columnWeights = new double[] { 1.0, Double.MIN_VALUE }; gbl_panel_visualizar.rowWeights = new double[] { 1.0, 1.0, Double.MIN_VALUE }; panel_visualizar.setLayout(gbl_panel_visualizar); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); GridBagConstraints gbc_tabbedPane = new GridBagConstraints(); gbc_tabbedPane.gridheight = 2; gbc_tabbedPane.fill = GridBagConstraints.BOTH; gbc_tabbedPane.gridx = 0; gbc_tabbedPane.gridy = 0; panel_visualizar.add(tabbedPane, gbc_tabbedPane); panelSimulation = new JPanelGrafica(); tabbedPane.addTab("Simulacin", null, panelSimulation, null); panelSimulation.setBackground(Color.WHITE); getContentPane().setLayout(groupLayout); }
From source file:de.tor.tribes.ui.views.DSWorkbenchNotepad.java
/** This method is called from within the constructor to * initialize the form./*ww w . j ava2 s . c o m*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jXNotePanel = new org.jdesktop.swingx.JXPanel(); jNoteTabbedPane = new javax.swing.JTabbedPane(); jNewSetPanel = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); jxSearchPane = new org.jdesktop.swingx.JXPanel(); jXPanel3 = new org.jdesktop.swingx.JXPanel(); jButton16 = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); jLabel21 = new javax.swing.JLabel(); jFilterRows = new javax.swing.JCheckBox(); jFilterCaseSensitive = new javax.swing.JCheckBox(); jExportFormatDialog = new javax.swing.JDialog(); bBPanel1 = new de.tor.tribes.ui.panels.BBPanel(); jComboBox1 = new javax.swing.JComboBox(); jLabel5 = new javax.swing.JLabel(); jScrollPane4 = new javax.swing.JScrollPane(); jTextPane1 = new javax.swing.JTextPane(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jAlwaysOnTopBox = new javax.swing.JCheckBox(); jNotesPanel = new javax.swing.JPanel(); capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel(); jXNotePanel.setPreferredSize(new java.awt.Dimension(500, 400)); jXNotePanel.setLayout(new java.awt.BorderLayout()); jXNotePanel.add(jNoteTabbedPane, java.awt.BorderLayout.CENTER); jNewSetPanel.setOpaque(false); jNewSetPanel.setLayout(new java.awt.BorderLayout()); jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/document_new_24x24.png"))); // NOI18N jLabel4.setToolTipText("Leeres Notizset erstellen"); jLabel4.setMaximumSize(new java.awt.Dimension(40, 40)); jLabel4.setMinimumSize(new java.awt.Dimension(40, 40)); jLabel4.setOpaque(true); jLabel4.setPreferredSize(new java.awt.Dimension(40, 40)); jLabel4.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { fireEnterEvent(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { fireMouseExitEvent(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { fireCreateNoteSetEvent(evt); } }); jNewSetPanel.add(jLabel4, java.awt.BorderLayout.CENTER); jxSearchPane.setOpaque(false); jxSearchPane.setLayout(new java.awt.GridBagLayout()); jXPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jXPanel3.setInheritAlpha(false); jButton16.setText("Anwenden"); jButton16.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { jButton16fireHideGlassPaneEvent(evt); } }); jTextField1.addCaretListener(new javax.swing.event.CaretListener() { public void caretUpdate(javax.swing.event.CaretEvent evt) { jTextField1fireHighlightEvent(evt); } }); jLabel21.setText("Suchbegriff"); jFilterRows.setText("Nur gefilterte Zeilen anzeigen"); jFilterRows.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jFilterRowsfireUpdateFilterEvent(evt); } }); jFilterCaseSensitive.setText("Gro-/Kleinschreibung beachten"); jFilterCaseSensitive.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jFilterCaseSensitivefireUpdateFilterEvent(evt); } }); javax.swing.GroupLayout jXPanel3Layout = new javax.swing.GroupLayout(jXPanel3); jXPanel3.setLayout(jXPanel3Layout); jXPanel3Layout.setHorizontalGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel3Layout.createSequentialGroup() .addContainerGap().addComponent(jLabel21).addGap(18, 18, 18) .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel3Layout.createSequentialGroup().addGap(176, 176, 176) .addGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jXPanel3Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jFilterRows, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jFilterCaseSensitive, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jButton16))) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jXPanel3Layout.setVerticalGroup(jXPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jXPanel3Layout.createSequentialGroup().addContainerGap() .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel21).addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jFilterCaseSensitive) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jFilterRows) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton16) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jxSearchPane.add(jXPanel3, new java.awt.GridBagConstraints()); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel( new String[] { "Nicht gruppieren", "Gruppieren nach Drfern", "Gruppieren nach Notizsymbolen" })); jLabel5.setText("Gruppierung"); jScrollPane4.setBorder(javax.swing.BorderFactory.createTitledBorder("Vorschau")); jTextPane1.setContentType("text/html"); // NOI18N jTextPane1.setEditable(false); jScrollPane4.setViewportView(jTextPane1); jButton4.setText("bernehmen"); jButton5.setText("Abbrechen"); javax.swing.GroupLayout jExportFormatDialogLayout = new javax.swing.GroupLayout( jExportFormatDialog.getContentPane()); jExportFormatDialog.getContentPane().setLayout(jExportFormatDialogLayout); jExportFormatDialogLayout.setHorizontalGroup(jExportFormatDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jExportFormatDialogLayout.createSequentialGroup().addContainerGap() .addGroup(jExportFormatDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jExportFormatDialogLayout.createSequentialGroup() .addGroup(jExportFormatDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(bBPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jExportFormatDialogLayout.createSequentialGroup() .addComponent(jLabel5) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jExportFormatDialogLayout.createSequentialGroup().addComponent(jButton5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton4))) .addContainerGap())); jExportFormatDialogLayout.setVerticalGroup(jExportFormatDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jExportFormatDialogLayout.createSequentialGroup().addContainerGap() .addGroup(jExportFormatDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jExportFormatDialogLayout .createSequentialGroup() .addComponent(bBPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jExportFormatDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5).addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGap(18, 18, 18) .addGroup(jExportFormatDialogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton4).addComponent(jButton5)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); setTitle("Notizen"); setMinimumSize(new java.awt.Dimension(500, 400)); getContentPane().setLayout(new java.awt.GridBagLayout()); jAlwaysOnTopBox.setText("Immer im Vordergrund"); jAlwaysOnTopBox.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireAlwaysOnTopChangedEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(jAlwaysOnTopBox, gridBagConstraints); jNotesPanel.setBackground(new java.awt.Color(239, 235, 223)); jNotesPanel.setPreferredSize(new java.awt.Dimension(500, 400)); jNotesPanel.setLayout(new java.awt.BorderLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 500; gridBagConstraints.ipady = 400; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(jNotesPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(capabilityInfoPanel1, gridBagConstraints); pack(); }
From source file:at.nhmwien.schema_mapping_tool.ProcessMappingWindow.java
/** This method is called from within the constructor to * initialize the form.// w w w . ja v a2 s. co m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { progressPanel = new javax.swing.JPanel(); progressBar = new javax.swing.JProgressBar(); progressBarLabel = new javax.swing.JLabel(); abortButton = new javax.swing.JButton(); processButton = new javax.swing.JButton(); typeSelectTabbedPanel = new javax.swing.JTabbedPane(); optionsPanel = new javax.swing.JPanel(); inputFileFormatLabel = new javax.swing.JLabel(); outputFileFormatLabel = new javax.swing.JLabel(); inputFileFormatComboBox = new javax.swing.JComboBox(); outputFileFormatComboBox = new javax.swing.JComboBox(); ifEncodingLabel = new javax.swing.JLabel(); ifEncodingComboBox = new javax.swing.JComboBox(); ofEncodingLabel = new javax.swing.JLabel(); ofEncodingComboBox = new javax.swing.JComboBox(); cooButton = new javax.swing.JButton(); cioButton = new javax.swing.JButton(); inputIDPrefixLabel = new javax.swing.JLabel(); inputIDPrefixTextField = new javax.swing.JTextField(); countThresholdLabel = new javax.swing.JLabel(); countThresholdTextField = new javax.swing.JFormattedTextField(); menuToolBar = new javax.swing.JToolBar(); loadSettingsButton = new javax.swing.JButton(); saveSettingsButton = new javax.swing.JButton(); setTitle("Process Mapping"); setResizable(false); progressPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Mapping Progress", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 12), new java.awt.Color(1, 1, 1))); // NOI18N progressBarLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); progressBarLabel.setText("Progress"); javax.swing.GroupLayout progressPanelLayout = new javax.swing.GroupLayout(progressPanel); progressPanel.setLayout(progressPanelLayout); progressPanelLayout.setHorizontalGroup( progressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, progressPanelLayout.createSequentialGroup().addContainerGap() .addGroup(progressPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(progressBarLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 657, Short.MAX_VALUE) .addComponent(progressBar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 657, Short.MAX_VALUE)) .addContainerGap())); progressPanelLayout.setVerticalGroup(progressPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, progressPanelLayout.createSequentialGroup() .addComponent(progressBarLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); abortButton.setText("Abort"); abortButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { abortButtonActionPerformed(evt); } }); processButton.setText("Process"); processButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { processButtonActionPerformed(evt); } }); optionsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Process Options", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 12), new java.awt.Color(1, 1, 1))); // NOI18N inputFileFormatLabel.setText("Input Format:"); outputFileFormatLabel.setText("Output Format:"); inputFileFormatComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { inputFileFormatComboBoxActionPerformed(evt); } }); outputFileFormatComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { outputFileFormatComboBoxActionPerformed(evt); } }); ifEncodingLabel.setText("Encoding:"); ofEncodingLabel.setText("Encoding:"); cooButton.setText("Output Order"); cooButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cooButtonActionPerformed(evt); } }); cioButton.setText("Input Order"); cioButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cioButtonActionPerformed(evt); } }); inputIDPrefixLabel.setText("Input ID Prefix:"); countThresholdLabel.setText("New File every X entries:"); countThresholdTextField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory( new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0")))); countThresholdTextField.setText("0"); javax.swing.GroupLayout optionsPanelLayout = new javax.swing.GroupLayout(optionsPanel); optionsPanel.setLayout(optionsPanelLayout); optionsPanelLayout.setHorizontalGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(optionsPanelLayout.createSequentialGroup().addContainerGap().addGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(optionsPanelLayout.createSequentialGroup().addGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(inputFileFormatLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(outputFileFormatLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(optionsPanelLayout.createSequentialGroup() .addComponent(inputFileFormatComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(ifEncodingLabel)) .addGroup(optionsPanelLayout.createSequentialGroup() .addComponent(outputFileFormatComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(ofEncodingLabel))) .addGap(18, 18, 18) .addGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ofEncodingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ifEncodingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(optionsPanelLayout.createSequentialGroup().addComponent(cioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 434, Short.MAX_VALUE) .addComponent(cooButton)) .addGroup(optionsPanelLayout.createSequentialGroup().addComponent(inputIDPrefixLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(inputIDPrefixTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 552, Short.MAX_VALUE)) .addGroup(optionsPanelLayout.createSequentialGroup() .addComponent(countThresholdLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(countThresholdTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap())); optionsPanelLayout.setVerticalGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(optionsPanelLayout.createSequentialGroup().addContainerGap().addGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(inputFileFormatLabel) .addComponent(inputFileFormatComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ifEncodingLabel) .addComponent(ifEncodingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(outputFileFormatLabel) .addComponent(outputFileFormatComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ofEncodingLabel).addComponent(ofEncodingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(inputIDPrefixLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(inputIDPrefixTextField)) .addGap(18, 18, 18) .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(countThresholdLabel).addComponent(countThresholdTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cioButton).addComponent(cooButton)) .addContainerGap())); menuToolBar.setRollover(true); loadSettingsButton.setText("Load"); loadSettingsButton.setFocusable(false); loadSettingsButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); loadSettingsButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); loadSettingsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadSettingsButtonActionPerformed(evt); } }); menuToolBar.add(loadSettingsButton); saveSettingsButton.setText("Save"); saveSettingsButton.setFocusable(false); saveSettingsButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); saveSettingsButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); saveSettingsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveSettingsButtonActionPerformed(evt); } }); menuToolBar.add(saveSettingsButton); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(menuToolBar, javax.swing.GroupLayout.DEFAULT_SIZE, 715, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup().addContainerGap() .addComponent(optionsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addComponent(typeSelectTabbedPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 703, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap() .addComponent(progressPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(abortButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 541, Short.MAX_VALUE) .addComponent(processButton).addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(menuToolBar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(optionsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(typeSelectTabbedPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(progressPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(abortButton).addComponent(processButton)) .addContainerGap())); pack(); }
From source file:SuitaDetails.java
private void showLib() { JScrollPane jScrollPane1 = new JScrollPane(); JList jList1 = new JList(); JPanel libraries = new JPanel(); jScrollPane1.setViewportView(jList1); GroupLayout layout = new GroupLayout(libraries); libraries.setLayout(layout);//from w w w. j a va 2 s . com layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)); try { Object[] s = (Object[]) RunnerRepository.getRPCClient().execute("getLibrariesList", new Object[] { RunnerRepository.user }); String[] libs = new String[s.length]; for (int i = 0; i < s.length; i++) { libs[i] = s[i].toString(); } ArrayList<Integer> ind = new ArrayList<Integer>(); jList1.setModel(new DefaultComboBoxModel(libs)); for (String st : globallib) { for (int i = 0; i < libs.length; i++) { if (libs[i].equals(st)) { ind.add(new Integer(i)); } } } int[] indices = new int[ind.size()]; for (int i = 0; i < ind.size(); i++) { indices[i] = ind.get(i); } jList1.setSelectedIndices(indices); } catch (Exception e) { System.out.println("There was an error on calling getLibrariesList on CE"); e.printStackTrace(); } int resp = (Integer) CustomDialog.showDialog(libraries, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, RunnerRepository.window, "Libraries", null); if (resp == JOptionPane.OK_OPTION) { Object[] val = jList1.getSelectedValues(); globallib = new String[val.length]; for (int s = 0; s < val.length; s++) { globallib[s] = val[s].toString(); } } }
From source file:eu.cassandra.training.gui.MainGUI.java
/** * Constructor of the Training Module GUI. * /* w ww .ja v a 2 s. com*/ * @throws UnsupportedLookAndFeelException * @throws IllegalAccessException * @throws InstantiationException * @throws ClassNotFoundException * @throws FileNotFoundException */ public MainGUI() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException, FileNotFoundException { setForeground(new Color(0, 204, 51)); // Enable the closing of the frame when pressing the x on the upper corner // of the window addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { Utils.cleanFiles(); System.exit(0); } }); // Cleaning temporary files from the temp folder when starting the GUI. // Utils.cleanFiles(); // Change the platforms look and feel to Nimbus LookAndFeel lnf = new javax.swing.plaf.nimbus.NimbusLookAndFeel(); UIManager.put("NimbusLookAndFeel", Color.GREEN); UIManager.setLookAndFeel(lnf); // Setting the basic attributes of the Training Module GUI setTitle("Training Module (BETA)"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 1228, 799); // Creating the menu bar and adding the menu items JMenuBar menuBar = new JMenuBar(); setJMenuBar(menuBar); JMenu mnNewMenu = new JMenu("File"); menuBar.add(mnNewMenu); JMenuItem mntmExit = new JMenuItem("Exit"); mntmExit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Utils.cleanFiles(); System.exit(0); } }); mnNewMenu.add(mntmExit); JMenu mnExit = new JMenu("Help"); menuBar.add(mnExit); JMenuItem mntmManual = new JMenuItem("Manual"); mnExit.add(mntmManual); JMenuItem mntmAbout = new JMenuItem("About"); mnExit.add(mntmAbout); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); // Adding the tabbed pane to the content pane final JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); GroupLayout gl_contentPane = new GroupLayout(contentPane); gl_contentPane.setHorizontalGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) .addComponent(tabbedPane, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 1202, Short.MAX_VALUE)); gl_contentPane.setVerticalGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPane.createSequentialGroup() .addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 736, GroupLayout.PREFERRED_SIZE) .addContainerGap(47, Short.MAX_VALUE))); // TABS // final JPanel importTab = new JPanel(); tabbedPane.addTab("Import Data", null, importTab, null); tabbedPane.setDisplayedMnemonicIndexAt(0, 0); tabbedPane.setEnabledAt(0, true); importTab.setLayout(null); final JPanel trainingTab = new JPanel(); tabbedPane.addTab("Train Activity Models", null, trainingTab, null); tabbedPane.setDisplayedMnemonicIndexAt(1, 1); tabbedPane.setEnabledAt(1, false); trainingTab.setLayout(null); final JPanel createResponseTab = new JPanel(); tabbedPane.addTab("Create Response Models", null, createResponseTab, null); tabbedPane.setEnabledAt(2, false); createResponseTab.setLayout(null); // RESPONSE MODEL TAB // final JPanel responseParametersPanel = new JPanel(); responseParametersPanel.setLayout(null); responseParametersPanel.setBorder( new TitledBorder(null, "Response Parameters", TitledBorder.LEADING, TitledBorder.TOP, null, null)); responseParametersPanel.setBounds(6, 6, 394, 271); createResponseTab.add(responseParametersPanel); final JPanel activityModelSelectionPanel = new JPanel(); activityModelSelectionPanel.setLayout(null); activityModelSelectionPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Activity Model Selection", TitledBorder.LEADING, TitledBorder.TOP, null, null)); activityModelSelectionPanel.setBounds(6, 516, 394, 192); createResponseTab.add(activityModelSelectionPanel); final JPanel responsePanel = new JPanel(); responsePanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Activity Model Change Preview", TitledBorder.LEADING, TitledBorder.TOP, null, null)); responsePanel.setBounds(417, 6, 770, 385); createResponseTab.add(responsePanel); responsePanel.setLayout(new BorderLayout(0, 0)); final JPanel pricingPreviewPanel = new JPanel(); pricingPreviewPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Pricing Scheme Preview", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pricingPreviewPanel.setBounds(417, 438, 770, 259); createResponseTab.add(pricingPreviewPanel); pricingPreviewPanel.setLayout(new BorderLayout(0, 0)); final JPanel pricingSchemePanel = new JPanel(); pricingSchemePanel.setLayout(null); pricingSchemePanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Pricing Scheme Selection", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pricingSchemePanel.setBounds(6, 274, 394, 243); createResponseTab.add(pricingSchemePanel); // ///////////////// // RESPONSE TAB // // //////////////// // RESPONSE PARAMETERS // final JLabel lblSensitivity = new JLabel("Sensitivity"); lblSensitivity.setBounds(10, 28, 78, 16); responseParametersPanel.add(lblSensitivity); final JSlider sensitivitySlider = new JSlider(); sensitivitySlider.setPaintLabels(true); sensitivitySlider.setSnapToTicks(true); sensitivitySlider.setPaintTicks(true); sensitivitySlider.setMinorTickSpacing(10); sensitivitySlider.setMajorTickSpacing(10); sensitivitySlider.setBounds(111, 28, 214, 45); responseParametersPanel.add(sensitivitySlider); final JLabel lblAwareness = new JLabel("Awareness"); lblAwareness.setBounds(10, 79, 78, 16); responseParametersPanel.add(lblAwareness); final JSlider awarenessSlider = new JSlider(); awarenessSlider.setPaintLabels(true); awarenessSlider.setPaintTicks(true); awarenessSlider.setMajorTickSpacing(10); awarenessSlider.setMinorTickSpacing(10); awarenessSlider.setSnapToTicks(true); awarenessSlider.setBounds(111, 79, 214, 45); responseParametersPanel.add(awarenessSlider); final JLabel label_7 = new JLabel("Response Model"); label_7.setBounds(10, 153, 103, 16); responseParametersPanel.add(label_7); final JRadioButton optimalCaseRadioButton = new JRadioButton("Optimal Case Scenario"); responseModelButtonGroup.add(optimalCaseRadioButton); optimalCaseRadioButton.setBounds(111, 131, 170, 18); responseParametersPanel.add(optimalCaseRadioButton); final JRadioButton normalCaseRadioButton = new JRadioButton("Normal Case Scenario"); normalCaseRadioButton.setSelected(true); responseModelButtonGroup.add(normalCaseRadioButton); normalCaseRadioButton.setBounds(111, 152, 170, 18); responseParametersPanel.add(normalCaseRadioButton); final JRadioButton discreteCaseRadioButton = new JRadioButton("Discrete Case Scenario"); discreteCaseRadioButton.setSelected(true); responseModelButtonGroup.add(discreteCaseRadioButton); discreteCaseRadioButton.setBounds(111, 173, 170, 18); responseParametersPanel.add(discreteCaseRadioButton); final JButton previewResponseButton = new JButton("Preview Response Model"); previewResponseButton.setEnabled(false); previewResponseButton.setBounds(24, 198, 157, 28); responseParametersPanel.add(previewResponseButton); final JButton createResponseButton = new JButton("Create Response Model"); createResponseButton.setEnabled(false); createResponseButton.setBounds(191, 198, 162, 28); responseParametersPanel.add(createResponseButton); final JButton createResponseAllButton = new JButton("Create Response All"); createResponseAllButton.setEnabled(false); createResponseAllButton.setBounds(111, 232, 157, 28); responseParametersPanel.add(createResponseAllButton); // SELECT ACTIVITY MODEL // final JLabel lblSelectedActivity = new JLabel("Selected Activity"); lblSelectedActivity.setBounds(10, 21, 130, 16); activityModelSelectionPanel.add(lblSelectedActivity); JScrollPane activityListScrollPane = new JScrollPane(); activityListScrollPane.setBounds(20, 39, 355, 143); activityModelSelectionPanel.add(activityListScrollPane); final JList<String> activitySelectList = new JList<String>(); activityListScrollPane.setViewportView(activitySelectList); activitySelectList.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); final JButton commitButton = new JButton("Commit"); commitButton.setEnabled(false); commitButton.setBounds(151, 209, 89, 23); pricingSchemePanel.add(commitButton); JLabel lblBasicSchema = new JLabel("Basic Schema (Start-End-Value)"); lblBasicSchema.setBounds(10, 18, 182, 14); pricingSchemePanel.add(lblBasicSchema); JLabel lblNewSchemastart = new JLabel("New Schema (Start-End-Value)"); lblNewSchemastart.setBounds(197, 18, 177, 14); pricingSchemePanel.add(lblNewSchemastart); JScrollPane basicPricingSchemeScrollPane = new JScrollPane(); basicPricingSchemeScrollPane.setBounds(10, 43, 177, 161); pricingSchemePanel.add(basicPricingSchemeScrollPane); final JTextPane basicPricingSchemePane = new JTextPane(); basicPricingSchemeScrollPane.setViewportView(basicPricingSchemePane); basicPricingSchemePane.setText("00:00-23:59-0.05"); JScrollPane newPricingScrollPane = new JScrollPane(); newPricingScrollPane.setBounds(197, 43, 177, 161); pricingSchemePanel.add(newPricingScrollPane); final JTextPane newPricingSchemePane = new JTextPane(); newPricingScrollPane.setViewportView(newPricingSchemePane); JPanel buttonPanel = new JPanel(); buttonPanel.setBounds(682, 390, 265, 33); createResponseTab.add(buttonPanel); final JButton dailyResponseButton = new JButton("Daily Times"); dailyResponseButton.setEnabled(false); buttonPanel.add(dailyResponseButton); final JButton startResponseButton = new JButton("Start Time"); startResponseButton.setEnabled(false); buttonPanel.add(startResponseButton); final JPanel exportTab = new JPanel(); tabbedPane.addTab("Export Models", null, exportTab, null); tabbedPane.setEnabledAt(3, false); exportTab.setLayout(null); // PANELS // // DATA IMPORT TAB // final JPanel dataFilePanel = new JPanel(); dataFilePanel .setBorder(new TitledBorder(null, "Data File", TitledBorder.LEADING, TitledBorder.TOP, null, null)); dataFilePanel.setBounds(6, 6, 622, 284); importTab.add(dataFilePanel); dataFilePanel.setLayout(null); final JPanel disaggregationPanel = new JPanel(); disaggregationPanel.setLayout(null); disaggregationPanel.setBorder( new TitledBorder(null, "Disaggregation", TitledBorder.LEADING, TitledBorder.TOP, null, null)); disaggregationPanel.setBounds(629, 6, 567, 284); importTab.add(disaggregationPanel); final JPanel dataReviewPanel = new JPanel(); dataReviewPanel.setBorder( new TitledBorder(null, "Data Preview", TitledBorder.LEADING, TitledBorder.TOP, null, null)); dataReviewPanel.setBounds(6, 293, 622, 407); importTab.add(dataReviewPanel); dataReviewPanel.setLayout(new BorderLayout(0, 0)); final JPanel consumptionModelPanel = new JPanel(); consumptionModelPanel.setBounds(629, 293, 567, 407); importTab.add(consumptionModelPanel); consumptionModelPanel.setBorder( new TitledBorder(null, "Consumption Model", TitledBorder.LEADING, TitledBorder.TOP, null, null)); consumptionModelPanel.setLayout(new BorderLayout(0, 0)); // TRAINING ACTIVITY TAB // final JPanel trainingParametersPanel = new JPanel(); trainingParametersPanel.setLayout(null); trainingParametersPanel.setBorder( new TitledBorder(null, "Training Parameters", TitledBorder.LEADING, TitledBorder.TOP, null, null)); trainingParametersPanel.setBounds(6, 6, 621, 256); trainingTab.add(trainingParametersPanel); final JPanel applianceSelectionPanel = new JPanel(); applianceSelectionPanel.setLayout(null); applianceSelectionPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Appliance/Activity Selection", TitledBorder.LEADING, TitledBorder.TOP, null, null)); applianceSelectionPanel.setBounds(630, 6, 557, 256); trainingTab.add(applianceSelectionPanel); final JPanel expectedPowerPanel = new JPanel(); expectedPowerPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Expected Power Preview", TitledBorder.LEADING, TitledBorder.TOP, null, null)); expectedPowerPanel.setBounds(630, 261, 557, 447); trainingTab.add(expectedPowerPanel); expectedPowerPanel.setLayout(new BorderLayout(0, 0)); contentPane.setLayout(gl_contentPane); // EXPORT TAB // JPanel modelExportPanel = new JPanel(); modelExportPanel.setLayout(null); modelExportPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Model Export Selection", TitledBorder.LEADING, TitledBorder.TOP, null, null)); modelExportPanel.setBounds(10, 11, 596, 267); exportTab.add(modelExportPanel); final JPanel exportPreviewPanel = new JPanel(); exportPreviewPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Export Model Preview", TitledBorder.LEADING, TitledBorder.TOP, null, null)); exportPreviewPanel.setBounds(10, 310, 1187, 387); exportTab.add(exportPreviewPanel); exportPreviewPanel.setLayout(new BorderLayout(0, 0)); JPanel exportButtonsPanel = new JPanel(); exportButtonsPanel.setBounds(322, 279, 536, 33); exportTab.add(exportButtonsPanel); JPanel connectionPanel = new JPanel(); connectionPanel.setLayout(null); connectionPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Connection Properties", TitledBorder.LEADING, TitledBorder.TOP, null, null)); connectionPanel.setBounds(606, 11, 581, 267); exportTab.add(connectionPanel); // COMPONENTS // // IMPORT TAB // // DATA IMPORT // final JLabel lblSource = new JLabel("Data Source:"); lblSource.setBounds(23, 47, 71, 16); dataFilePanel.add(lblSource); final JTextField pathField = new JTextField(); pathField.setEditable(false); pathField.setBounds(99, 41, 405, 28); dataFilePanel.add(pathField); pathField.setColumns(10); final JButton dataBrowseButton = new JButton("Browse"); dataBrowseButton.setBounds(516, 41, 87, 28); dataFilePanel.add(dataBrowseButton); final JButton resetButton = new JButton("Reset"); resetButton.setBounds(516, 81, 87, 28); dataFilePanel.add(resetButton); final JLabel lblDataMeasurementsFrom = new JLabel("Data Measurements From:"); lblDataMeasurementsFrom.setBounds(23, 90, 154, 16); dataFilePanel.add(lblDataMeasurementsFrom); final JRadioButton singleApplianceRadioButton = new JRadioButton("Single Appliance"); singleApplianceRadioButton.setEnabled(false); dataMeasurementsButtonGroup.add(singleApplianceRadioButton); singleApplianceRadioButton.setBounds(242, 110, 115, 18); dataFilePanel.add(singleApplianceRadioButton); final JRadioButton installationRadioButton = new JRadioButton("Installation"); installationRadioButton.setSelected(true); installationRadioButton.setEnabled(false); dataMeasurementsButtonGroup.add(installationRadioButton); installationRadioButton.setBounds(242, 89, 115, 18); dataFilePanel.add(installationRadioButton); final JLabel labelConsumptionModel = new JLabel("Consumption Model:"); labelConsumptionModel.setBounds(23, 179, 120, 16); dataFilePanel.add(labelConsumptionModel); final JButton importDataButton = new JButton("Import Data"); importDataButton.setEnabled(false); importDataButton.setBounds(23, 237, 126, 28); dataFilePanel.add(importDataButton); final JButton disaggregateButton = new JButton("Disaggregate"); disaggregateButton.setEnabled(false); disaggregateButton.setBounds(216, 237, 147, 28); dataFilePanel.add(disaggregateButton); final JButton createEventsButton = new JButton("Create Events Dataset"); createEventsButton.setEnabled(false); createEventsButton.setBounds(422, 237, 181, 28); dataFilePanel.add(createEventsButton); final JTextField consumptionPathField = new JTextField(); consumptionPathField.setEnabled(false); consumptionPathField.setEditable(false); consumptionPathField.setColumns(10); consumptionPathField.setBounds(99, 197, 405, 28); dataFilePanel.add(consumptionPathField); final JButton consumptionBrowseButton = new JButton("Browse"); consumptionBrowseButton.setEnabled(false); consumptionBrowseButton.setBounds(516, 197, 87, 28); dataFilePanel.add(consumptionBrowseButton); JLabel lblTypeOfMeasurements = new JLabel("Type of Measurements"); lblTypeOfMeasurements.setBounds(23, 141, 154, 16); dataFilePanel.add(lblTypeOfMeasurements); final JRadioButton activePowerRadioButton = new JRadioButton("Active Power (P)"); powerButtonGroup.add(activePowerRadioButton); activePowerRadioButton.setEnabled(false); activePowerRadioButton.setBounds(242, 140, 115, 18); dataFilePanel.add(activePowerRadioButton); final JRadioButton activeAndReactivePowerRadioButton = new JRadioButton("Active and Reactive Power (P, Q)"); activeAndReactivePowerRadioButton.setSelected(true); powerButtonGroup.add(activeAndReactivePowerRadioButton); activeAndReactivePowerRadioButton.setEnabled(false); activeAndReactivePowerRadioButton.setBounds(242, 161, 262, 18); dataFilePanel.add(activeAndReactivePowerRadioButton); // ////////////////// // DISAGGREGATION // // ///////////////// final JLabel lblAppliancesDetected = new JLabel("Detected Appliances "); lblAppliancesDetected.setBounds(18, 33, 130, 16); disaggregationPanel.add(lblAppliancesDetected); JScrollPane scrollPane_2 = new JScrollPane(); scrollPane_2.setBounds(145, 31, 396, 231); disaggregationPanel.add(scrollPane_2); final JList<String> detectedApplianceList = new JList<String>(); scrollPane_2.setViewportView(detectedApplianceList); detectedApplianceList.setEnabled(false); detectedApplianceList.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); // //////////////// // TRAINING TAB // // //////////////// // TRAINING PARAMETERS // final JLabel label_1 = new JLabel("Times Per Day"); label_1.setBounds(19, 40, 103, 16); trainingParametersPanel.add(label_1); final JRadioButton timesHistogramRadioButton = new JRadioButton("Histogram"); timesHistogramRadioButton.setSelected(true); timesDailyButtonGroup.add(timesHistogramRadioButton); timesHistogramRadioButton.setBounds(160, 38, 87, 18); trainingParametersPanel.add(timesHistogramRadioButton); final JRadioButton timesNormalRadioButton = new JRadioButton("Normal Distribution"); timesNormalRadioButton.setEnabled(false); timesDailyButtonGroup.add(timesNormalRadioButton); timesNormalRadioButton.setBounds(304, 40, 137, 18); trainingParametersPanel.add(timesNormalRadioButton); JRadioButton timesGaussianRadioButton = new JRadioButton("Gaussian Mixture"); timesGaussianRadioButton.setEnabled(false); timesDailyButtonGroup.add(timesGaussianRadioButton); timesGaussianRadioButton.setBounds(478, 38, 137, 18); trainingParametersPanel.add(timesGaussianRadioButton); final JLabel label_2 = new JLabel("Start Time"); label_2.setBounds(19, 133, 103, 16); trainingParametersPanel.add(label_2); final JRadioButton startHistogramRadioButton = new JRadioButton("Histogram"); startHistogramRadioButton.setSelected(true); startTimeButtonGroup.add(startHistogramRadioButton); startHistogramRadioButton.setBounds(160, 131, 87, 18); trainingParametersPanel.add(startHistogramRadioButton); final JRadioButton startNormalRadioButton = new JRadioButton("Normal Distribution"); // startNormalRadioButton.setEnabled(false); startTimeButtonGroup.add(startNormalRadioButton); startNormalRadioButton.setBounds(304, 133, 137, 18); trainingParametersPanel.add(startNormalRadioButton); final JRadioButton startGaussianRadioButton = new JRadioButton("Gaussian Mixture"); startGaussianRadioButton.setSelected(true); startTimeButtonGroup.add(startGaussianRadioButton); startGaussianRadioButton.setBounds(478, 131, 137, 18); trainingParametersPanel.add(startGaussianRadioButton); final JLabel label_3 = new JLabel("Duration"); label_3.setBounds(19, 86, 103, 16); trainingParametersPanel.add(label_3); final JRadioButton durationHistogramRadioButton = new JRadioButton("Histogram"); durationHistogramRadioButton.setSelected(true); durationButtonGroup.add(durationHistogramRadioButton); durationHistogramRadioButton.setBounds(160, 84, 87, 18); trainingParametersPanel.add(durationHistogramRadioButton); final JRadioButton durationNormalRadioButton = new JRadioButton("Normal Distribution"); durationNormalRadioButton.setSelected(true); durationButtonGroup.add(durationNormalRadioButton); durationNormalRadioButton.setBounds(304, 86, 137, 18); trainingParametersPanel.add(durationNormalRadioButton); final JRadioButton durationGaussianRadioButton = new JRadioButton("Gaussian Mixture"); durationButtonGroup.add(durationGaussianRadioButton); durationGaussianRadioButton.setBounds(478, 84, 137, 18); trainingParametersPanel.add(durationGaussianRadioButton); final JButton trainingButton = new JButton("Train"); trainingButton.setBounds(125, 194, 115, 28); trainingParametersPanel.add(trainingButton); final JButton trainAllButton = new JButton("Train All"); trainAllButton.setBounds(366, 194, 115, 28); trainingParametersPanel.add(trainAllButton); // APPLIANCE SELECTION // final JLabel label_4 = new JLabel("Selected Appliance"); label_4.setBounds(18, 33, 130, 16); applianceSelectionPanel.add(label_4); JScrollPane scrollPane_1 = new JScrollPane(); scrollPane_1.setBounds(128, 29, 419, 216); applianceSelectionPanel.add(scrollPane_1); final JList<String> selectedApplianceList = new JList<String>(); scrollPane_1.setViewportView(selectedApplianceList); selectedApplianceList.setEnabled(false); selectedApplianceList.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); // DISTRIBUTION SELECTION // JPanel distributionSelectionPanel = new JPanel(); distributionSelectionPanel.setBounds(80, 261, 482, 33); trainingTab.add(distributionSelectionPanel); final JButton dailyTimesButton = new JButton("Daily Times"); dailyTimesButton.setEnabled(false); distributionSelectionPanel.add(dailyTimesButton); final JButton durationButton = new JButton("Duration"); durationButton.setEnabled(false); distributionSelectionPanel.add(durationButton); final JButton startTimeButton = new JButton("Start Time"); startTimeButton.setEnabled(false); distributionSelectionPanel.add(startTimeButton); final JButton startTimeBinnedButton = new JButton("Start Time Binned"); startTimeBinnedButton.setEnabled(false); distributionSelectionPanel.add(startTimeBinnedButton); final JPanel distributionPreviewPanel = new JPanel(); distributionPreviewPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Distribution Preview", TitledBorder.LEADING, TitledBorder.TOP, null, null)); distributionPreviewPanel.setBounds(6, 299, 621, 409); trainingTab.add(distributionPreviewPanel); distributionPreviewPanel.setLayout(new BorderLayout(0, 0)); // ////////////////// // EXPORT TAB /////// // ///////////////// JLabel exportModelLabel = new JLabel("Select Model"); exportModelLabel.setBounds(10, 34, 151, 16); modelExportPanel.add(exportModelLabel); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(83, 32, 503, 212); modelExportPanel.add(scrollPane); final JList<String> exportModelList = new JList<String>(); scrollPane.setViewportView(exportModelList); exportModelList.setEnabled(false); exportModelList.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); // EXPORT TAB // final JButton exportDailyButton = new JButton("Daily Times"); exportDailyButton.setEnabled(false); exportButtonsPanel.add(exportDailyButton); final JButton exportDurationButton = new JButton("Duration"); exportDurationButton.setEnabled(false); exportButtonsPanel.add(exportDurationButton); final JButton exportStartButton = new JButton("Start Time"); exportStartButton.setEnabled(false); exportButtonsPanel.add(exportStartButton); final JButton exportStartBinnedButton = new JButton("Start Time Binned"); exportStartBinnedButton.setEnabled(false); exportButtonsPanel.add(exportStartBinnedButton); final JButton exportExpectedPowerButton = new JButton("Expected Power"); exportExpectedPowerButton.setEnabled(false); exportButtonsPanel.add(exportExpectedPowerButton); JLabel usernameLabel = new JLabel("Username:"); usernameLabel.setBounds(46, 27, 71, 16); connectionPanel.add(usernameLabel); final JTextField usernameTextField; usernameTextField = new JTextField(); usernameTextField.setText("user"); usernameTextField.setColumns(10); usernameTextField.setBounds(122, 21, 405, 28); connectionPanel.add(usernameTextField); final JButton exportButton = new JButton("Export Entity"); exportButton.setEnabled(false); exportButton.setBounds(46, 178, 147, 28); connectionPanel.add(exportButton); final JButton exportAllBaseButton = new JButton("Export All Base"); exportAllBaseButton.setEnabled(false); exportAllBaseButton.setBounds(203, 178, 177, 28); connectionPanel.add(exportAllBaseButton); final JButton exportAllResponseButton = new JButton("Export All Response"); exportAllResponseButton.setEnabled(false); exportAllResponseButton.setBounds(390, 178, 181, 28); connectionPanel.add(exportAllResponseButton); JLabel passwordLabel = new JLabel("Password:"); passwordLabel.setBounds(46, 62, 71, 16); connectionPanel.add(passwordLabel); JLabel UrlLabel = new JLabel("URL:"); UrlLabel.setBounds(46, 105, 71, 16); connectionPanel.add(UrlLabel); final JTextField urlTextField; urlTextField = new JTextField(); urlTextField.setText("https://160.40.50.233:8443/cassandra/api"); urlTextField.setColumns(10); urlTextField.setBounds(122, 99, 405, 28); connectionPanel.add(urlTextField); final JButton connectButton = new JButton("Connect"); connectButton.setEnabled(false); connectButton.setBounds(217, 138, 147, 28); connectionPanel.add(connectButton); final JPasswordField passwordField; passwordField = new JPasswordField(); passwordField.setBounds(122, 60, 405, 28); connectionPanel.add(passwordField); final JTextField householdNameTextField; householdNameTextField = new JTextField(); householdNameTextField.setEnabled(false); householdNameTextField.setBounds(166, 225, 405, 31); connectionPanel.add(householdNameTextField); householdNameTextField.setColumns(10); final JLabel householdNameLabel = new JLabel("Export Household Name:"); householdNameLabel.setBounds(24, 233, 147, 14); connectionPanel.add(householdNameLabel); JButton btnOpenPlatform = new JButton("Open Platform"); btnOpenPlatform.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { Desktop.getDesktop() .browse(new URL("https://cassandra.iti.gr:8443/cassandra/app.html").toURI()); } catch (Exception e) { e.printStackTrace(); } } }); btnOpenPlatform.setBounds(401, 138, 147, 28); connectionPanel.add(btnOpenPlatform); // ////////////////// // ACTIONS /////// // ///////////////// // IMPORT TAB // // DATA IMPORT //// dataBrowseButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the browse button to * input the data file on the Data File panel of the Import Data tab. * */ @Override public void actionPerformed(ActionEvent e) { // Opens the browse panel to find the data set file JFileChooser fc = new JFileChooser("./"); // Adds a filter to the type of files acceptable for selection fc.setFileSelectionMode(JFileChooser.FILES_ONLY); fc.setFileFilter(new MyFilter2()); int returnVal = fc.showOpenDialog(contentPane); // After choosing the file some of the options in the Data File panel // are unlocked if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); pathField.setText(file.getAbsolutePath()); importDataButton.setEnabled(true); activePowerRadioButton.setEnabled(true); activeAndReactivePowerRadioButton.setEnabled(true); installationRadioButton.setEnabled(true); singleApplianceRadioButton.setEnabled(true); } } }); consumptionBrowseButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the browse button to * input the consumption model file on the Data File panel of the Import * Data tab. * */ @Override public void actionPerformed(ActionEvent e) { // Opens the browse panel to find the consumption model file JFileChooser fc = new JFileChooser("./"); // Adds a filter to the type of files acceptable for selection fc.setFileSelectionMode(JFileChooser.FILES_ONLY); fc.setFileFilter(new MyFilter()); int returnVal = fc.showOpenDialog(contentPane); // After choosing the file some of the options in the Data File panel // are unlocked if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); consumptionPathField.setText(file.getAbsolutePath()); createEventsButton.setEnabled(true); } } }); resetButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the reset button * on the Data File panel of the Import Data tab. All the imported and * created entities are removed and the Training Module goes back to its * initial state. * */ @Override public void actionPerformed(ActionEvent e) { // Cleaning the Import Data tab components pathField.setText(""); consumptionPathField.setText(""); importDataButton.setEnabled(false); disaggregateButton.setEnabled(false); createEventsButton.setEnabled(false); installation = new Installation(); dataBrowseButton.setEnabled(true); consumptionBrowseButton.setEnabled(false); installationRadioButton.setEnabled(false); installationRadioButton.setSelected(true); singleApplianceRadioButton.setEnabled(false); activePowerRadioButton.setEnabled(false); activeAndReactivePowerRadioButton.setEnabled(false); activeAndReactivePowerRadioButton.setSelected(true); dataReviewPanel.removeAll(); dataReviewPanel.updateUI(); consumptionModelPanel.removeAll(); consumptionModelPanel.updateUI(); detectedApplianceList.setSelectedIndex(-1); detectedAppliances.clear(); detectedApplianceList.setListData(new String[0]); detectedApplianceList.repaint(); // Cleaning the Training Activity Models tab components distributionPreviewPanel.removeAll(); distributionPreviewPanel.updateUI(); expectedPowerPanel.removeAll(); expectedPowerPanel.updateUI(); selectedApplianceList.setSelectedIndex(-1); selectedAppliances.clear(); selectedApplianceList.setListData(new String[0]); selectedApplianceList.repaint(); timesHistogramRadioButton.setSelected(true); durationNormalRadioButton.setSelected(true); startGaussianRadioButton.setSelected(true); // Cleaning the Create Response Models tab components sensitivitySlider.setValue(50); awarenessSlider.setValue(50); normalCaseRadioButton.setSelected(true); previewResponseButton.setEnabled(false); createResponseButton.setEnabled(false); createResponseAllButton.setEnabled(false); pricingPreviewPanel.removeAll(); pricingPreviewPanel.updateUI(); responsePanel.removeAll(); responsePanel.updateUI(); activitySelectList.setSelectedIndex(-1); activityModels.clear(); activitySelectList.setListData(new String[0]); activitySelectList.repaint(); basicPricingSchemePane.setText("00:00-23:59-0.05"); newPricingSchemePane.setText(""); commitButton.setEnabled(false); dailyResponseButton.setEnabled(false); startResponseButton.setEnabled(false); // Cleaning the Export Models tab components exportModelList.setSelectedIndex(-1); exportModels.clear(); exportModelList.setListData(new String[0]); exportModelList.repaint(); exportPreviewPanel.removeAll(); exportPreviewPanel.updateUI(); exportDailyButton.setEnabled(false); exportDurationButton.setEnabled(false); exportStartButton.setEnabled(false); exportStartBinnedButton.setEnabled(false); exportExpectedPowerButton.setEnabled(false); exportButton.setEnabled(false); exportAllBaseButton.setEnabled(false); exportAllResponseButton.setEnabled(false); householdNameTextField.setEnabled(false); // Disabling the necessary tabs tabbedPane.setEnabledAt(1, false); tabbedPane.setEnabledAt(2, false); tabbedPane.setEnabledAt(3, false); // Clearing the arrayList in need tempAppliances.clear(); tempActivities.clear(); // Removing temporary files Utils.cleanFiles(); trained = false; } }); singleApplianceRadioButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Single Appliance * radio button on the Data File panel of the Import Data tab. */ @Override public void actionPerformed(ActionEvent e) { consumptionPathField.setEnabled(false); consumptionBrowseButton.setEnabled(false); consumptionPathField.setText(""); } }); installationRadioButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Installation * radio button on the Data File panel of the Import Data tab. */ @Override public void actionPerformed(ActionEvent e) { consumptionPathField.setEnabled(false); consumptionBrowseButton.setEnabled(false); consumptionPathField.setText(""); } }); importDataButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Import Data * button on the Data File panel of the Import Data tab. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); // Change the state of some components installationRadioButton.setEnabled(false); singleApplianceRadioButton.setEnabled(false); importDataButton.setEnabled(false); dataBrowseButton.setEnabled(false); activePowerRadioButton.setEnabled(false); activeAndReactivePowerRadioButton.setEnabled(false); // Check if both active and reactive activeOnly data set are available boolean power = activePowerRadioButton.isSelected(); int parse = -1; // Parsing the measurements file try { parse = Utils.parseMeasurementsFile(pathField.getText(), power); } catch (IOException e2) { e2.printStackTrace(); } // If everything is OK if (parse == -1) { try { // Creating new installation installation = new Installation(pathField.getText(), power); } catch (IOException e2) { e2.printStackTrace(); } // Show the measurements in the preview chart ChartPanel chartPanel = null; try { chartPanel = installation.measurementsChart(); } catch (IOException e1) { e1.printStackTrace(); } dataReviewPanel.add(chartPanel, BorderLayout.CENTER); dataReviewPanel.validate(); disaggregateButton.setEnabled(false); createEventsButton.setEnabled(false); // Enable the appropriate buttons given source of measurements if (installationRadioButton.isSelected()) { disaggregateButton.setEnabled(true); } else if (singleApplianceRadioButton.isSelected()) { consumptionPathField.setEnabled(true); consumptionBrowseButton.setEnabled(true); } // Add installation to the export models list exportModels.addElement(installation.toString()); exportModels.addElement(installation.getPerson().getName()); householdNameTextField.setText(installation.getName()); // Enable Export Models tab exportModelList.setEnabled(true); exportModelList.setModel(exportModels); tabbedPane.setEnabledAt(3, true); } // In case of an error during the measurement parsing show the line of // error and reset settings. else { JFrame error = new JFrame(); JOptionPane.showMessageDialog(error, "Parsing measurements file failed. The problem seems to be in line " + parse + ".Check the selected buttons and the file provided and try again.", "Inane error", JOptionPane.ERROR_MESSAGE); resetButton.doClick(); } } finally { root.setCursor(Cursor.getDefaultCursor()); } } }); disaggregateButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Disaggregate * button on the Data File panel of the Import Data tab in order to * automatically analyse the data set and extract the appliances and * activities within. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); // Get auxiliary files containing appliances and activities which are // the output of the disaggregation process. String filename = pathField.getText(); File file = new File(filename); String folder = file.getParent() + "/"; String fileNameWithExtension = file.getName(); String fileName = file.getName().substring(0, file.getName().length() - 4); filename = pathField.getText().substring(0, pathField.getText().length() - 4); File appliancesFile = new File(Constants.resultFolder + fileName + "ApplianceList.csv"); File activitiesFile = new File(Constants.resultFolder + fileName + "ActivityList.csv"); if ((Constants.USE_FILES == false) || (!appliancesFile.exists() && !activitiesFile.exists())) { try { System.out.println("IN!!!"); Disaggregate dis = new Disaggregate(folder, fileNameWithExtension); appliancesFile = new File(Constants.resultFolder + fileName + "ApplianceList.csv"); activitiesFile = new File(Constants.resultFolder + fileName + "ActivityList.csv"); } catch (Exception e2) { System.out.println("Missing File"); e2.printStackTrace(); } } // If these exist, disaggregation was successful and the procedure can // continue if (appliancesFile.exists() && activitiesFile.exists()) { // Read appliance file and start appliance parsing Scanner input = null; try { input = new Scanner(appliancesFile); } catch (FileNotFoundException e1) { e1.printStackTrace(); } String nextLine; String[] line; while (input.hasNext()) { nextLine = input.nextLine(); line = nextLine.split(","); String name = line[1] + " " + line[0]; // String activity = line[1]; String activity = name; String[] temp = line[0].split(" "); String type = ""; if (temp.length == 1) type = temp[0]; else { for (int i = 0; i < temp.length - 1; i++) type += temp[i] + " "; type = type.trim(); } boolean refFlag = activity.contains("Refrigeration"); boolean wmFlag = name.contains("Washing"); double p = 0, q = 0; int distance = 0, duration = 0; if (refFlag) { p = Double.parseDouble(line[2]); q = Double.parseDouble(line[3]); duration = Integer.parseInt(line[4]); distance = Integer.parseInt(line[5]); // For each appliance found in the file, an temporary Appliance // Entity is created. tempAppliances.add(new ApplianceTemp(name, installation.getName(), type, activity, p, q, duration, distance)); } else if (wmFlag) { double[] pValues = new double[line.length / 2 - 1]; double[] qValues = new double[line.length / 2 - 1]; // For each appliance found in the file, an temporary Appliance // Entity is created. for (int i = 0; i < pValues.length; i++) { pValues[i] = Double.parseDouble(line[2 + 2 * i]); qValues[i] = Double.parseDouble(line[3 + 2 * i]); } tempAppliances.add(new ApplianceTemp(name, installation.getName(), type, activity, pValues, qValues)); } else { p = Double.parseDouble(line[2]); q = Double.parseDouble(line[3]); // For each appliance found in the file, an temporary Appliance // Entity is created. tempAppliances .add(new ApplianceTemp(name, installation.getName(), type, activity, p, q)); } } System.out.println("Appliances:" + tempAppliances.size()); input.close(); // Read activity file and start activity parsing try { input = new Scanner(activitiesFile); } catch (FileNotFoundException e1) { System.out.println("Problem with activity file."); e1.printStackTrace(); } while (input.hasNext()) { nextLine = input.nextLine(); line = nextLine.split(","); // System.out.println(Arrays.toString(line)); // String name = line[0]; // String activity = line[1]; String activity = line[1] + " " + line[0]; String type = line[1]; int start = Integer.parseInt(line[2]); int end = Integer.parseInt(line[3]); // Search for existing activity int activityIndex = findActivity(activity); // if not found, create a new one if (activityIndex == -1) { // System.out.println("In!"); ActivityTemp newActivity = new ActivityTemp(activity, type); newActivity.addEvent(start, end); tempActivities.add(newActivity); // System.out.println(tempActivities.toString()); } // else add data to the found activity else tempActivities.get(activityIndex).addEvent(start, end); } // This is hard copied for now ArrayList<ActivityTemp> activities = findAllActivity("Refrigeration"); for (ActivityTemp activityTemp : activities) { tempActivities.remove(activityTemp); System.out.println("Refrigeration Removed"); } int index = findActivity("Standby"); if (index != -1) { tempActivities.remove(index); System.out.println("Standby Consumption Removed"); } // TODO Add these lines in case we want to remove activities with // small sampling number // System.out.println(tempActivities.size()); // for (int i = tempActivities.size() - 1; i >= 0; i--) // if (tempActivities.get(i).getEvents().size() < threshold) // tempActivities.remove(i); // Create an event file for each activity, in order to be able to // use // it for training the behaviour models if asked from the user for (int i = 0; i < tempActivities.size(); i++) { // tempActivities.get(i).status(); try { tempActivities.get(i).createEventFile(); } catch (IOException e1) { System.out.println("Problem with creating events file."); e1.printStackTrace(); } } input.close(); // Add each found appliance (after converting temporary appliance to // normal appliance) in the installation Entity, to the detected // appliance and export models list for (ApplianceTemp temp : tempAppliances) { Appliance tempAppliance = temp.toAppliance(); installation.addAppliance(tempAppliance); detectedAppliances.addElement(tempAppliance.toString()); exportModels.addElement(tempAppliance.toString()); } // Add appliances corresponding to each activity, remove activities // without appliances and add activities to the selected activities // list. for (int i = tempActivities.size() - 1; i >= 0; i--) { tempActivities.get(i).setAppliances(findAppliances(tempActivities.get(i))); if (tempActivities.get(i).getAppliances().size() == 0) { tempActivities.remove(i); } else selectedAppliances.addElement(tempActivities.get(i).toString()); } } // In case of an error. else { int temp = 8 + ((int) (Math.random() * 2)); for (int i = 0; i < temp; i++) { String name = "Appliance " + i; String powerModel = ""; String reactiveModel = ""; int tempIndex = i % 5; switch (tempIndex) { case 0: powerModel = "{\"n\":1,\"params\":[{\"n\":1,\"values\":[{\"p\":1900,\"d\":1,\"s\":0}]},{\"n\":0,\"values\":[{\"p\":300,\"d\":1,\"s\":0}]}]}"; reactiveModel = "{\"n\":1,\"params\":[{\"n\":1,\"values\":[{\"q\":-40,\"d\":1,\"s\":0}]},{\"n\":0,\"values\":[{\"q\":-10,\"d\":1,\"s\":0}]}]}"; break; case 1: powerModel = "{ \"n\" : 0, \"params\" : [{ \"n\" : 1, \"values\" : [ {\"p\" : 140.0, \"d\" : 20, \"s\": 0.0}]}]}"; reactiveModel = "{ \"n\" : 0, \"params\" : [{ \"n\" : 1, \"values\" : [ {\"q\" : 120.0, \"d\" : 20, \"s\": 0.0}]}]}"; break; case 2: powerModel = "{ \"n\" : 0, \"params\" : [{ \"n\" : 1, \"values\" : [ {\"p\" : 95.0, \"d\" : 20, \"s\": 0.0}, {\"p\" :80.0, \"d\" : 18, \"s\": 0.0}, {\"p\" : 0.0, \"d\" : 73, \"s\": 0.0}]}]}]}"; reactiveModel = "{ \"n\" : 0, \"params\" : [{ \"n\" : 1, \"values\" : [ {\"q\" : 0.0, \"d\" : 20, \"s\": 0.0}, {\"q\" : 0.0, \"d\" : 18, \"s\": 0.0}, {\"q\" : 0.0, \"d\" : 73, \"s\": 0.0}]}]}]}"; break; case 3: powerModel = "{ \"n\" : 0, \"params\" : [{ \"n\" : 1, \"values\" : [ {\"p\" : 30.0, \"d\" : 20, \"s\": 0.0}]}]}"; reactiveModel = "{ \"n\" : 0, \"params\" : [{ \"n\" : 1, \"values\" : [ {\"q\" : -5.0, \"d\" : 20, \"s\": 0.0}]}]}"; break; case 4: powerModel = "{\"n\":1,\"params\":[{\"n\":1,\"values\":[{\"p\":150,\"d\":25,\"s\":0},{\"p\":2000,\"d\":13,\"s\":0},{\"p\":100,\"d\":62,\"s\":0}]}]}"; reactiveModel = "{\"n\":1,\"params\":[{\"n\":1,\"values\":[{\"q\":400,\"d\":25,\"s\":0},{\"q\":200,\"d\":13,\"s\":0},{\"q\":300,\"d\":62,\"s\":0}]}]}"; break; } Appliance tempAppliance = new Appliance(name, installation.getName(), powerModel, reactiveModel, "Demo/eventsAll" + tempIndex + ".csv"); installation.addAppliance(tempAppliance); detectedAppliances.addElement(tempAppliance.toString()); selectedAppliances.addElement(tempAppliance.toString()); exportModels.addElement(tempAppliance.toString()); } } // Enable all appliance/activity lists detectedApplianceList.setEnabled(true); detectedApplianceList.setModel(detectedAppliances); detectedApplianceList.setSelectedIndex(0); tabbedPane.setEnabledAt(1, true); selectedApplianceList.setEnabled(true); selectedApplianceList.setModel(selectedAppliances); // exportModelList.setEnabled(true); // exportModelList.setModel(exportModels); // tabbedPane.setEnabledAt(3, true); // Disable unnecessary buttons. disaggregateButton.setEnabled(false); createEventsButton.setEnabled(false); } finally { root.setCursor(Cursor.getDefaultCursor()); } } }); createEventsButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Create Events * button on the Data File panel of the Import Data tab. This button is * used when there is a single appliance with an known consumption model * so that the events can be extracted automatically from the data set. * Used for presentation purposes only since is depricated by the * disaggregation function. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); // Parse the consumption model file File file = new File(consumptionPathField.getText()); String temp = file.getName(); temp = temp.replace(".", " "); String name = temp.split(" ")[0]; Appliance appliance = null; try { int rand = (int) (Math.random() * 5); appliance = new Appliance(name, consumptionPathField.getText(), consumptionPathField.getText(), "Demo/eventsAll" + rand + ".csv", installation, activePowerRadioButton.isSelected()); } catch (IOException e1) { e1.printStackTrace(); } // Add appliance to the installation entity installation.addAppliance(appliance); // Enable all appliance/activity lists detectedAppliances.addElement(appliance.toString()); selectedAppliances.addElement(appliance.toString()); exportModels.addElement(appliance.toString()); detectedApplianceList.setEnabled(true); detectedApplianceList.setModel(detectedAppliances); detectedApplianceList.setSelectedIndex(0); tabbedPane.setEnabledAt(1, true); selectedApplianceList.setEnabled(true); selectedApplianceList.setModel(selectedAppliances); // exportModelList.setEnabled(true); // exportModelList.setModel(exportModels); // tabbedPane.setEnabledAt(3, true); // Disable unnecessary buttons. disaggregateButton.setEnabled(false); createEventsButton.setEnabled(false); } finally { root.setCursor(Cursor.getDefaultCursor()); } } }); // APPLIANCE DETECTION // detectedApplianceList.addListSelectionListener(new ListSelectionListener() { /** * This function is called when the user selects an appliance from the * list of Detected Appliances on the Disaggregation panel of the Import * Data tab. Then the corresponding consumption model is presented in the * Consumption Model Preview panel. */ @Override public void valueChanged(ListSelectionEvent e) { consumptionModelPanel.removeAll(); consumptionModelPanel.updateUI(); if (detectedAppliances.size() >= 1) { String selection = detectedApplianceList.getSelectedValue(); Appliance current = installation.findAppliance(selection); ChartPanel chartPanel = current.consumptionGraph(); consumptionModelPanel.add(chartPanel, BorderLayout.CENTER); consumptionModelPanel.validate(); } } }); // // TRAINING TAB // trainingTab.addComponentListener(new ComponentAdapter() { @Override public void componentShown(ComponentEvent arg0) { selectedApplianceList.setSelectedIndex(0); } }); trainingButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Train button on * the Training Parameters panel of the Train Activity Models tab. It * contains the procedure needed to create an activity model based on the * event set of the appliance or activity. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); responsePanel.removeAll(); responsePanel.validate(); pricingPreviewPanel.removeAll(); pricingPreviewPanel.validate(); previewResponseButton.setEnabled(false); createResponseButton.setEnabled(false); createResponseAllButton.setEnabled(false); dailyResponseButton.setEnabled(false); startResponseButton.setEnabled(false); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); // Searching for existing activity or appliance. String selection = selectedApplianceList.getSelectedValue(); ActivityTemp activity = null; if (tempActivities.size() > 0) activity = tempActivities.get(findActivity(selection)); Appliance current = installation.findAppliance(selection); String startTime, duration, dailyTimes; // Check for the selected distribution methods for training. if (timesHistogramRadioButton.isSelected()) dailyTimes = "Histogram"; else if (timesNormalRadioButton.isSelected()) dailyTimes = "Normal"; else dailyTimes = "GMM"; if (durationHistogramRadioButton.isSelected()) duration = "Histogram"; else if (durationNormalRadioButton.isSelected()) duration = "Normal"; else duration = "GMM"; if (startHistogramRadioButton.isSelected()) startTime = "Histogram"; else if (startNormalRadioButton.isSelected()) startTime = "Normal"; else startTime = "GMM"; String[] distributions = { dailyTimes, duration, startTime, "Histogram" }; // If the selected object from the list is an appliance the training // procedure for the appliance begins. if (activity == null) { try { installation.getPerson().train(current, distributions); } catch (IOException e1) { e1.printStackTrace(); } } // If the selected object from the list is an activity the training // procedure for the activity begins. else { try { installation.getPerson().train(activity, distributions); } catch (IOException e1) { e1.printStackTrace(); } } // System.out.println("Training OK!"); distributionPreviewPanel.removeAll(); distributionPreviewPanel.updateUI(); expectedPowerPanel.removeAll(); expectedPowerPanel.updateUI(); // Show the distribution created on the Distribution Preview Panel ActivityModel activityModel = installation.getPerson().findActivity(selection, true); if (activityModel == null) activityModel = installation.getPerson().findActivity(current); ChartPanel chartPanel = activityModel.createDailyTimesDistributionChart(); distributionPreviewPanel.add(chartPanel, BorderLayout.CENTER); distributionPreviewPanel.validate(); chartPanel = activityModel.createExpectedPowerChart(); expectedPowerPanel.add(chartPanel, BorderLayout.CENTER); expectedPowerPanel.validate(); // Add the Activity model to the list of trained Activity models of // the Create Response Models tab int size = activitySelectList.getModel().getSize(); if (size > 0) { activityModels = (DefaultListModel<String>) activitySelectList.getModel(); if (activityModels.contains(activityModel.getName()) == false) activityModels.addElement(activityModel.getName()); } else { activityModels = new DefaultListModel<String>(); activityModels.addElement(activityModel.getName()); activitySelectList.setEnabled(true); } activitySelectList.setModel(activityModels); // Add the trained model to the export list also. size = exportModelList.getModel().getSize(); if (size > 0) { exportModels = (DefaultListModel<String>) exportModelList.getModel(); if (exportModels.contains(activityModel.getName()) == false) exportModels.addElement(activityModel.getName()); } else { exportModels = new DefaultListModel<String>(); exportModels.addElement(activityModel.getName()); exportModelList.setEnabled(true); } // Enable some buttons necessary to show the results. dailyTimesButton.setEnabled(true); durationButton.setEnabled(true); startTimeButton.setEnabled(true); startTimeBinnedButton.setEnabled(true); exportModelList.setModel(exportModels); exportDailyButton.setEnabled(true); exportDurationButton.setEnabled(true); exportStartButton.setEnabled(true); exportStartBinnedButton.setEnabled(true); tabbedPane.setEnabledAt(2, true); } finally { root.setCursor(Cursor.getDefaultCursor()); trained = true; } } }); trainAllButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Train All button on * the Training Parameters panel of the Train Activity Models tab. It * is iterating the aforementioned training procedure to each of the * objects on the list. */ @Override public void actionPerformed(ActionEvent e) { responsePanel.removeAll(); responsePanel.validate(); pricingPreviewPanel.removeAll(); pricingPreviewPanel.validate(); previewResponseButton.setEnabled(false); createResponseButton.setEnabled(false); createResponseAllButton.setEnabled(false); dailyResponseButton.setEnabled(false); startResponseButton.setEnabled(false); for (int i = 0; i < selectedApplianceList.getModel().getSize(); i++) { selectedApplianceList.setSelectedIndex(i); trainingButton.doClick(); } } }); dailyTimesButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Daily Times button on * the Distribution Preview panel of the Train Activity Models tab. It * shows the Daily Times Distribution for the selected object from the * list if available. */ @Override public void actionPerformed(ActionEvent arg0) { distributionPreviewPanel.removeAll(); distributionPreviewPanel.updateUI(); String selection = selectedApplianceList.getSelectedValue(); Appliance current = installation.findAppliance(selection); ActivityModel activityModel = installation.getPerson().findActivity(selection, true); if (activityModel == null) activityModel = installation.getPerson().findActivity(current); ChartPanel chartPanel = activityModel.createDailyTimesDistributionChart(); distributionPreviewPanel.add(chartPanel, BorderLayout.CENTER); distributionPreviewPanel.validate(); } }); startTimeBinnedButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Start Time Binned * button on the Distribution Preview panel of the Train Activity * Models tab. It shows the Start Time Binned Distribution for the * selected object from the list if available. */ @Override public void actionPerformed(ActionEvent arg0) { distributionPreviewPanel.removeAll(); distributionPreviewPanel.updateUI(); String selection = selectedApplianceList.getSelectedValue(); Appliance current = installation.findAppliance(selection); ActivityModel activityModel = installation.getPerson().findActivity(selection, true); if (activityModel == null) activityModel = installation.getPerson().findActivity(current); ChartPanel chartPanel = activityModel.createStartTimeBinnedDistributionChart(); distributionPreviewPanel.add(chartPanel, BorderLayout.CENTER); distributionPreviewPanel.validate(); } }); startTimeButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Start Time * button on the Distribution Preview panel of the Train Activity * Models tab. It shows the Start Time Distribution for the selected * object from the list if available. */ @Override public void actionPerformed(ActionEvent arg0) { distributionPreviewPanel.removeAll(); distributionPreviewPanel.updateUI(); String selection = selectedApplianceList.getSelectedValue(); Appliance current = installation.findAppliance(selection); ActivityModel activityModel = installation.getPerson().findActivity(selection, true); if (activityModel == null) activityModel = installation.getPerson().findActivity(current); ChartPanel chartPanel = activityModel.createStartTimeDistributionChart(); distributionPreviewPanel.add(chartPanel, BorderLayout.CENTER); distributionPreviewPanel.validate(); } }); durationButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Duration * button on the Distribution Preview panel of the Train Activity * Models tab. It shows the Duration Distribution for the selected * object from the list if available. */ @Override public void actionPerformed(ActionEvent arg0) { distributionPreviewPanel.removeAll(); distributionPreviewPanel.updateUI(); String selection = selectedApplianceList.getSelectedValue(); Appliance current = installation.findAppliance(selection); ActivityModel activityModel = installation.getPerson().findActivity(selection, true); if (activityModel == null) activityModel = installation.getPerson().findActivity(current); ChartPanel chartPanel = activityModel.createDurationDistributionChart(); distributionPreviewPanel.add(chartPanel, BorderLayout.CENTER); distributionPreviewPanel.validate(); } }); selectedApplianceList.addListSelectionListener(new ListSelectionListener() { /** * This function is called when the user selects an appliance or activity * from the list of Selected Appliances on the Appliance / Activity * Selection panel of the Train Activity Models tab. Then an example * corresponding consumption model is presented in the Consumption Model * Preview panel. */ @Override public void valueChanged(ListSelectionEvent arg0) { ChartPanel chartPanel = null, chartPanel2 = null, chartPanel3 = null; expectedPowerPanel.removeAll(); expectedPowerPanel.updateUI(); distributionPreviewPanel.removeAll(); distributionPreviewPanel.updateUI(); // If there are any appliances / activities on the list if (selectedAppliances.size() >= 1) { // Find the corresponding appliance / activity and show its // consumption model String selection = selectedApplianceList.getSelectedValue(); Appliance currentAppliance = installation.findAppliance(selection); ActivityModel activityModel = installation.getPerson().findActivity(selection, true); // If there is also an Activity model trained, show the corresponding // distribution charts on the Distribution Preview panel if (currentAppliance != null) activityModel = installation.getPerson().findActivity(currentAppliance); if (activityModel == null) activityModel = installation.getPerson().findActivity(selection, true); if (activityModel != null) { dailyTimesButton.setEnabled(true); durationButton.setEnabled(true); startTimeButton.setEnabled(true); startTimeBinnedButton.setEnabled(true); chartPanel2 = activityModel.createDailyTimesDistributionChart(); distributionPreviewPanel.add(chartPanel2, BorderLayout.CENTER); distributionPreviewPanel.validate(); distributionPreviewPanel.updateUI(); chartPanel3 = activityModel.createExpectedPowerChart(); expectedPowerPanel.add(chartPanel3, BorderLayout.CENTER); expectedPowerPanel.validate(); expectedPowerPanel.updateUI(); } else { dailyTimesButton.setEnabled(false); durationButton.setEnabled(false); startTimeButton.setEnabled(false); startTimeBinnedButton.setEnabled(false); } } } }); // RESPONSE TAB // createResponseTab.addComponentListener(new ComponentAdapter() { @Override public void componentHidden(ComponentEvent arg0) { activitySelectList.setSelectedIndex(0); } @Override public void componentShown(ComponentEvent arg0) { activitySelectList.setSelectedIndex(0); } }); previewResponseButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Preview Response * button on the Response Parameters panel of the Create Response Models * tab. This button is enabled after selecting activity model, response * type and pricing for testing and presents a preview of the response * model that may be extracted. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); responsePanel.removeAll(); // Find the selected activity ActivityModel activity = installation.getPerson() .findActivity(activitySelectList.getSelectedValue(), false); int response = -1; // Check for the selected response type if (optimalCaseRadioButton.isSelected()) response = 0; else if (normalCaseRadioButton.isSelected()) response = 1; else response = 2; // Parse the pricing schemes double[] basicScheme = Utils.parseScheme(basicPricingSchemePane.getText()); double[] newScheme = Utils.parseScheme(newPricingSchemePane.getText()); float awareness = (float) (awarenessSlider.getValue()) / 100; float sensitivity = (float) (sensitivitySlider.getValue()) / 100; System.out.println("Awareness: " + awareness + " Sensitivity: " + sensitivity); // Create a preview chart of the response model ChartPanel chartPanel = installation.getPerson().previewResponse(activity, response, basicScheme, newScheme, awareness, sensitivity); responsePanel.add(chartPanel, BorderLayout.CENTER); responsePanel.validate(); createResponseButton.setEnabled(true); createResponseAllButton.setEnabled(true); dailyResponseButton.setEnabled(true); startResponseButton.setEnabled(true); } finally { root.setCursor(Cursor.getDefaultCursor()); } } }); createResponseButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Create Response Model * button on the Response Parameters panel of the Create Response Models * tab. This button is enabled after preview results of the selected * activity model, response type and pricing for testing and creates the * response model for the user. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); exportPreviewPanel.removeAll(); exportPreviewPanel.updateUI(); int responseType = -1; String responseString = ""; // Check for the selected response type if (optimalCaseRadioButton.isSelected()) { responseType = 0; responseString = "Optimal"; } else if (normalCaseRadioButton.isSelected()) { responseType = 1; responseString = "Normal"; } else if (discreteCaseRadioButton.isSelected()) { responseType = 2; responseString = "Discrete"; } // Parse the pricing schemes double[] basicScheme = Utils.parseScheme(basicPricingSchemePane.getText()); double[] newScheme = Utils.parseScheme(newPricingSchemePane.getText()); // Create the response model ActivityModel activity = installation.getPerson() .findActivity(activitySelectList.getSelectedValue(), false); String response = ""; float awareness = (float) (awarenessSlider.getValue()) / 100; float sensitivity = (float) (sensitivitySlider.getValue()) / 100; System.out.println("Awareness: " + awareness + " Sensitivity: " + sensitivity); try { response = installation.getPerson().createResponse(activity, responseType, basicScheme, newScheme, awareness, sensitivity); } catch (IOException exc) { exc.printStackTrace(); } // Add the response model extracted to the export model list. int size = exportModelList.getModel().getSize(); // System.out.println(size); if (size > 0) { exportModels = (DefaultListModel<String>) exportModelList.getModel(); String response2 = "", response3 = ""; if (responseString.equalsIgnoreCase("Optimal")) { response2 = response.replace(responseString, "Normal"); response3 = response.replace(responseString, "Discrete"); } else if (responseString.equalsIgnoreCase("Normal")) { response2 = response.replace(responseString, "Optimal"); response3 = response.replace(responseString, "Discrete"); } else { response2 = response.replace(responseString, "Optimal"); response3 = response.replace(responseString, "Normal"); } if (exportModels.contains(response2)) exportModels.removeElement(response2); if (exportModels.contains(response3)) exportModels.removeElement(response3); if (exportModels.contains(response) == false) exportModels.addElement(response); } else { exportModels = new DefaultListModel<String>(); exportModels.addElement(response); exportModelList.setEnabled(true); } exportModelList.setModel(exportModels); if (manyFlag == false) { JFrame success = new JFrame(); JOptionPane.showMessageDialog(success, "The response model " + response + " was created successfully", "Response Model Created", JOptionPane.INFORMATION_MESSAGE); } } finally { root.setCursor(Cursor.getDefaultCursor()); } } }); createResponseAllButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Create Response All * button on the Response Parameters panel of the Create Response Models * tab. This is achieved by iterating the procedure above for all the * available activity models in the list. */ @Override public void actionPerformed(ActionEvent arg0) { manyFlag = true; for (int i = 0; i < activitySelectList.getModel().getSize(); i++) { activitySelectList.setSelectedIndex(i); createResponseButton.doClick(); } JFrame success = new JFrame(); JOptionPane.showMessageDialog(success, "The response models were created successfully", "Response Models Created", JOptionPane.INFORMATION_MESSAGE); manyFlag = false; } }); newPricingSchemePane.addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent arg0) { commitButton.setEnabled(true); } }); basicPricingSchemePane.addCaretListener(new CaretListener() { @Override public void caretUpdate(CaretEvent arg0) { commitButton.setEnabled(true); } }); commitButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Commit button on the * Pricing Scheme panel of the Create Response Models tab. This button is * enabled after adding the two pricing schemes that are prerequisites for * the creation of a response model. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); boolean basicScheme = false; boolean newScheme = false; int parseBasic = 0; int parseNew = 0; pricingPreviewPanel.removeAll(); // Check if both pricing schemes are entered if (basicPricingSchemePane.getText().equalsIgnoreCase("") == false) basicScheme = true; if (newPricingSchemePane.getText().equalsIgnoreCase("") == false) newScheme = true; // Parse the pricing schemes for errors if (basicScheme) parseBasic = Utils.parsePricingScheme(basicPricingSchemePane.getText()); if (newScheme) parseNew = Utils.parsePricingScheme(newPricingSchemePane.getText()); // If errors are found then present the line the error may be at if (parseBasic != -1) { JFrame error = new JFrame(); JOptionPane.showMessageDialog(error, "Basic Pricing Scheme is not defined correctly. Please check your input in line " + parseBasic + " and try again.", "Inane error", JOptionPane.ERROR_MESSAGE); } else if (parseNew != -1) { JFrame error = new JFrame(); JOptionPane.showMessageDialog(error, "New Pricing Scheme is not defined correctly. Please check your input in line " + parseNew + " and try again.", "Inane error", JOptionPane.ERROR_MESSAGE); } // If no errors are found make a preview chart of the two pricing // schemes else { if (basicScheme && newScheme) { ChartPanel chartPanel = ChartUtils.parsePricingScheme(basicPricingSchemePane.getText(), newPricingSchemePane.getText()); pricingPreviewPanel.add(chartPanel, BorderLayout.CENTER); pricingPreviewPanel.validate(); previewResponseButton.setEnabled(true); } else { JFrame error = new JFrame(); JOptionPane.showMessageDialog(error, "You have not defined both pricing schemes.Please check your input and try again.", "Inane error", JOptionPane.ERROR_MESSAGE); previewResponseButton.setEnabled(false); } } responsePanel.removeAll(); responsePanel.validate(); createResponseButton.setEnabled(false); createResponseAllButton.setEnabled(false); dailyResponseButton.setEnabled(false); startResponseButton.setEnabled(false); } finally { root.setCursor(Cursor.getDefaultCursor()); } } }); startResponseButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the start time button on * the Preview Response panel of the Create Response Models tab. This * button is enabled after the user has pressed the Response Preview * button in order to see the results of his pricing scheme on a activity * model. It shows the changes in the start time distribution. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); responsePanel.removeAll(); // Find the selected activity ActivityModel activity = installation.getPerson() .findActivity(activitySelectList.getSelectedValue(), false); int response = -1; // Check for the selected response type if (optimalCaseRadioButton.isSelected()) response = 0; else if (normalCaseRadioButton.isSelected()) response = 1; else response = 2; // Parse the pricing schemes double[] basicScheme = Utils.parseScheme(basicPricingSchemePane.getText()); double[] newScheme = Utils.parseScheme(newPricingSchemePane.getText()); float awareness = (float) (awarenessSlider.getValue()) / 100; float sensitivity = (float) (sensitivitySlider.getValue()) / 100; System.out.println("Awareness: " + awareness + " Sensitivity: " + sensitivity); // Create a preview chart of the response model ChartPanel chartPanel = installation.getPerson().previewResponse(activity, response, basicScheme, newScheme, awareness, sensitivity); responsePanel.add(chartPanel, BorderLayout.CENTER); responsePanel.validate(); createResponseButton.setEnabled(true); createResponseAllButton.setEnabled(true); dailyResponseButton.setEnabled(true); startResponseButton.setEnabled(true); } finally { root.setCursor(Cursor.getDefaultCursor()); } } }); dailyResponseButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the start time button on * the Preview Response panel of the Create Response Models tab. This * button is enabled after the user has pressed the Response Preview * button in order to see the results of his pricing scheme on a activity * model. It shows the changes in the daily times distribution. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); responsePanel.removeAll(); // Find the selected activity ActivityModel activity = installation.getPerson() .findActivity(activitySelectList.getSelectedValue(), false); // Parse the pricing schemes double[] basicScheme = Utils.parseScheme(basicPricingSchemePane.getText()); double[] newScheme = Utils.parseScheme(newPricingSchemePane.getText()); float awareness = (float) (awarenessSlider.getValue()) / 100; float sensitivity = (float) (sensitivitySlider.getValue()) / 100; System.out.println("Awareness: " + awareness + " Sensitivity: " + sensitivity); // Create a preview chart of the response model ChartPanel chartPanel = installation.getPerson().previewDailyResponse(activity, basicScheme, newScheme, awareness, sensitivity); responsePanel.add(chartPanel, BorderLayout.CENTER); responsePanel.validate(); createResponseButton.setEnabled(true); createResponseAllButton.setEnabled(true); dailyResponseButton.setEnabled(true); startResponseButton.setEnabled(true); } finally { root.setCursor(Cursor.getDefaultCursor()); } } }); // EXPORT TAB // exportTab.addComponentListener(new ComponentAdapter() { @Override public void componentShown(ComponentEvent arg0) { exportModelList.setSelectedIndex(0); } }); exportModelList.addListSelectionListener(new ListSelectionListener() { /** * This function is called when the user selects an entity from the * list of models on the Model Export Selection panel of the Export Models * tab. Then the corresponding preview of the entity model is presented in * the * Export Model Preview panel. */ @Override public void valueChanged(ListSelectionEvent arg0) { if (tabbedPane.getSelectedIndex() == 3) { exportPreviewPanel.removeAll(); exportPreviewPanel.updateUI(); // Checking if the list has any object if (exportModels.size() > 1) { String selection = exportModelList.getSelectedValue(); // Check to see what type of entity is selected (Installation, // Person, Appliance, Activity, Response) Appliance appliance = installation.findAppliance(selection); ActivityModel activity = installation.getPerson().findActivity(selection, false); ResponseModel response = installation.getPerson().findResponse(selection); // Create the appropriate chart for the selected entity and show it. ChartPanel chartPanel = null; if (selection.equalsIgnoreCase(installation.getName())) { try { chartPanel = installation.measurementsChart(); exportDailyButton.setEnabled(false); exportDurationButton.setEnabled(false); exportStartButton.setEnabled(false); exportStartBinnedButton.setEnabled(false); if (trained) exportExpectedPowerButton.setEnabled(true); else exportExpectedPowerButton.setEnabled(false); } catch (IOException e1) { e1.printStackTrace(); } } else if (selection.equalsIgnoreCase(installation.getPerson().getName())) { chartPanel = installation.getPerson().statisticGraphs(); exportDailyButton.setEnabled(false); exportDurationButton.setEnabled(false); exportStartButton.setEnabled(false); exportStartBinnedButton.setEnabled(false); exportExpectedPowerButton.setEnabled(false); } else if (appliance != null) { chartPanel = appliance.consumptionGraph(); exportDailyButton.setEnabled(false); exportDurationButton.setEnabled(false); exportStartButton.setEnabled(false); exportStartBinnedButton.setEnabled(false); exportExpectedPowerButton.setEnabled(false); } else if (activity != null) { chartPanel = activity.createDailyTimesDistributionChart(); activity.status(); exportDailyButton.setEnabled(true); exportDurationButton.setEnabled(true); exportStartButton.setEnabled(true); exportStartBinnedButton.setEnabled(true); exportExpectedPowerButton.setEnabled(true); } else if (response != null) { chartPanel = response.createDailyTimesDistributionChart(); exportDailyButton.setEnabled(true); exportDurationButton.setEnabled(true); exportStartButton.setEnabled(true); exportStartBinnedButton.setEnabled(true); exportExpectedPowerButton.setEnabled(true); } exportPreviewPanel.add(chartPanel, BorderLayout.CENTER); exportPreviewPanel.validate(); } } } }); exportDailyButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Daily Times * button on the Entity Preview panel of the Export Models tab. It shows * the Daily Times Distribution for the selected object from the list. */ @Override public void actionPerformed(ActionEvent arg0) { exportPreviewPanel.removeAll(); exportPreviewPanel.updateUI(); String selection = exportModelList.getSelectedValue(); ActivityModel activity = installation.getPerson().findActivity(selection, false); ResponseModel response = installation.getPerson().findResponse(selection); ChartPanel chartPanel = null; if (activity != null) chartPanel = activity.createDailyTimesDistributionChart(); else chartPanel = response.createDailyTimesDistributionChart(); exportPreviewPanel.add(chartPanel, BorderLayout.CENTER); exportPreviewPanel.validate(); } }); exportStartBinnedButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Start Time Binned * button on the Entity Preview panel of the Export Models tab. It shows * the Start Time Binned Distribution for the selected object from the * list. */ @Override public void actionPerformed(ActionEvent arg0) { exportPreviewPanel.removeAll(); exportPreviewPanel.updateUI(); String selection = exportModelList.getSelectedValue(); ActivityModel activity = installation.getPerson().findActivity(selection, false); ResponseModel response = installation.getPerson().findResponse(selection); ChartPanel chartPanel = null; if (activity != null) chartPanel = activity.createStartTimeBinnedDistributionChart(); else chartPanel = response.createStartTimeBinnedDistributionChart(); exportPreviewPanel.add(chartPanel, BorderLayout.CENTER); exportPreviewPanel.validate(); } }); exportStartButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Start Time * button on the Entity Preview panel of the Export Models tab. It shows * the Start Time Distribution for the selected object from the list. */ @Override public void actionPerformed(ActionEvent arg0) { exportPreviewPanel.removeAll(); exportPreviewPanel.updateUI(); String selection = exportModelList.getSelectedValue(); ActivityModel activity = installation.getPerson().findActivity(selection, false); ResponseModel response = installation.getPerson().findResponse(selection); ChartPanel chartPanel = null; if (activity != null) chartPanel = activity.createStartTimeDistributionChart(); else chartPanel = response.createStartTimeDistributionChart(); exportPreviewPanel.add(chartPanel, BorderLayout.CENTER); exportPreviewPanel.validate(); } }); exportDurationButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Duration * button on the Entity Preview panel of the Export Models tab. It shows * the Duration Distribution for the selected object from the list. */ @Override public void actionPerformed(ActionEvent arg0) { exportPreviewPanel.removeAll(); exportPreviewPanel.updateUI(); String selection = exportModelList.getSelectedValue(); ActivityModel activity = installation.getPerson().findActivity(selection, false); ResponseModel response = installation.getPerson().findResponse(selection); ChartPanel chartPanel = null; if (activity != null) chartPanel = activity.createDurationDistributionChart(); else chartPanel = response.createDurationDistributionChart(); exportPreviewPanel.add(chartPanel, BorderLayout.CENTER); exportPreviewPanel.validate(); } }); exportExpectedPowerButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { exportPreviewPanel.removeAll(); exportPreviewPanel.updateUI(); String selection = exportModelList.getSelectedValue(); ActivityModel activity = installation.getPerson().findActivity(selection, false); ResponseModel response = installation.getPerson().findResponse(selection); ChartPanel chartPanel = null; if (selection.equalsIgnoreCase(installation.getName())) chartPanel = installation.createExpectedPowerChart(); else if (activity != null) chartPanel = activity.createExpectedPowerChart(); else chartPanel = response.createExpectedPowerChart(); exportPreviewPanel.add(chartPanel, BorderLayout.CENTER); exportPreviewPanel.validate(); } }); connectButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Connect button on the * Connection Properties panel of the Export Models tab. It helps the user * to connect to his Cassandra Library and export the models he created * there. */ @Override public void actionPerformed(ActionEvent e) { boolean result = false; // Reads the user credentials and the server to connect to. try { APIUtilities.setUrl(urlTextField.getText()); result = APIUtilities.sendUserCredentials(usernameTextField.getText(), passwordField.getPassword()); } catch (Exception e1) { e1.printStackTrace(); } // If the use credentials are correct if (result) { exportButton.setEnabled(true); exportAllBaseButton.setEnabled(true); exportAllResponseButton.setEnabled(true); householdNameTextField.setEnabled(true); } // Else a error message appears. else { JFrame error = new JFrame(); JOptionPane.showMessageDialog(error, "User Credentials are not correct! Please try again.", "Inane error", JOptionPane.ERROR_MESSAGE); passwordField.setText(""); } } }); passwordField.addCaretListener(new CaretListener() { @Override public void caretUpdate(CaretEvent e) { String pass = String.valueOf(passwordField.getPassword()); if (pass.equals("")) { connectButton.setEnabled(false); } else connectButton.setEnabled(true); } }); exportButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Export button on the * Connection Properties panel of the Export Models tab. The entity model * selected from the list is then exported to the User Library in * Cassandra Platform. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); // Parsing the selected entity and find out what type of entity it is. String selection = exportModelList.getSelectedValue(); Appliance appliance = installation.findAppliance(selection); ActivityModel activity = installation.getPerson().findActivity(selection, false); ResponseModel response = installation.getPerson().findResponse(selection); // If it is installation if (selection.equalsIgnoreCase(installation.getName())) { String oldName = installation.getName(); installation.setName(householdNameTextField.getText()); try { installation.setInstallationID(APIUtilities .sendEntity(installation.toJSON(APIUtilities.getUserID()).toString(), "/inst")); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } installation.setName(oldName); JFrame success = new JFrame(); JOptionPane.showMessageDialog(success, "The installation model " + installation.getName() + " was exported successfully", "Installation Model Exported", JOptionPane.INFORMATION_MESSAGE); } // If it is person else if (selection.equalsIgnoreCase(installation.getPerson().getName())) { try { installation.getPerson().setPersonID(APIUtilities.sendEntity( installation.getPerson().toJSON(APIUtilities.getUserID()).toString(), "/pers")); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } JFrame success = new JFrame(); JOptionPane.showMessageDialog(success, "The person model " + installation.getPerson().getName() + " was exported successfully", "Person Model Exported", JOptionPane.INFORMATION_MESSAGE); } // If it is appliance else if (appliance != null) { try { appliance.setApplianceID(APIUtilities .sendEntity(appliance.toJSON(APIUtilities.getUserID()).toString(), "/app")); APIUtilities.sendEntity(appliance.powerConsumptionModelToJSON().toString(), "/consmod"); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } JFrame success = new JFrame(); JOptionPane.showMessageDialog(success, "The appliance model " + appliance.getName() + " was exported successfully", "Appliance Model Exported", JOptionPane.INFORMATION_MESSAGE); } // If it is activity else if (activity != null) { String[] applianceTemp = new String[activity.getAppliancesOf().length]; String activityTemp = ""; String durationTemp = ""; String dailyTemp = ""; String startTemp = ""; // For each appliance that participates in the activity for (int i = 0; i < activity.getAppliancesOf().length; i++) { Appliance activityAppliance = activity.getAppliancesOf()[i]; try { // In case the appliances contained in the Activity model are // not // in the database, we create the object there before sending // the // activity model if (activityAppliance.getApplianceID().equalsIgnoreCase("")) { activityAppliance.setApplianceID(APIUtilities.sendEntity( activityAppliance.toJSON(APIUtilities.getUserID()).toString(), "/app")); APIUtilities.sendEntity( activityAppliance.powerConsumptionModelToJSON().toString(), "/consmod"); } applianceTemp[i] = activityAppliance.getApplianceID(); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } } try { String[] appliancesID = applianceTemp; // Creating the JSON of the activity model activity.setActivityModelID(APIUtilities.sendEntity( activity.toJSON(appliancesID, APIUtilities.getUserID()).toString(), "/actmod")); activityTemp = activity.getActivityModelID(); // Creating the JSON of the distributions activity.getDailyTimes().setDistributionID(APIUtilities.sendEntity( activity.getDailyTimes().toJSON(activityTemp).toString(), "/distr")); activity.setDailyID(activity.getDailyTimes().getDistributionID()); dailyTemp = activity.getDailyID(); activity.getDuration().setDistributionID(APIUtilities .sendEntity(activity.getDuration().toJSON(activityTemp).toString(), "/distr")); activity.setDurationID(activity.getDuration().getDistributionID()); durationTemp = activity.getDurationID(); activity.getStartTime().setDistributionID(APIUtilities .sendEntity(activity.getStartTime().toJSON(activityTemp).toString(), "/distr")); activity.setStartID(activity.getStartTime().getDistributionID()); startTemp = activity.getStartID(); // Adding the JSON of the distributions to the activity model APIUtilities.updateEntity( activity.toJSON(appliancesID, APIUtilities.getUserID()).toString(), "/actmod", activityTemp); } catch (AuthenticationException | NoSuchAlgorithmException | IOException e1) { e1.printStackTrace(); } JFrame success = new JFrame(); JOptionPane.showMessageDialog(success, "The activity model " + activity.getName() + " was exported successfully", "Activity Model Exported", JOptionPane.INFORMATION_MESSAGE); } // If it is response else if (response != null) { String[] applianceTemp = new String[response.getAppliancesOf().length]; String responseTemp = ""; String durationTemp = ""; String dailyTemp = ""; String startTemp = ""; // For each appliance that participates in the activity for (int i = 0; i < response.getAppliancesOf().length; i++) { Appliance responseAppliance = response.getAppliancesOf()[i]; try { // In case the appliances contained in the Activity model are // not // in the database, we create the object there before sending // the // activity model if (responseAppliance.getApplianceID().equalsIgnoreCase("")) { responseAppliance.setApplianceID(APIUtilities.sendEntity( responseAppliance.toJSON(APIUtilities.getUserID()).toString(), "/app")); APIUtilities.sendEntity( responseAppliance.powerConsumptionModelToJSON().toString(), "/consmod"); } applianceTemp[i] = responseAppliance.getApplianceID(); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } } try { String[] appliancesID = applianceTemp; // Creating the JSON of the response response.setActivityModelID(APIUtilities.sendEntity( response.toJSON(appliancesID, APIUtilities.getUserID()).toString(), "/actmod")); responseTemp = response.getActivityModelID(); // Creating the JSON of the distributions response.getDailyTimes().setDistributionID(APIUtilities.sendEntity( response.getDailyTimes().toJSON(responseTemp).toString(), "/distr")); response.setDailyID(response.getDailyTimes().getDistributionID()); dailyTemp = response.getDailyID(); response.getDuration().setDistributionID(APIUtilities .sendEntity(response.getDuration().toJSON(responseTemp).toString(), "/distr")); response.setDurationID(response.getDuration().getDistributionID()); durationTemp = response.getDurationID(); response.getStartTime().setDistributionID(APIUtilities .sendEntity(response.getStartTime().toJSON(responseTemp).toString(), "/distr")); response.setStartID(response.getStartTime().getDistributionID()); startTemp = response.getStartID(); // Adding the JSON of the distributions to the activity model APIUtilities.updateEntity( response.toJSON(appliancesID, APIUtilities.getUserID()).toString(), "/actmod", responseTemp); } catch (AuthenticationException | NoSuchAlgorithmException | IOException e1) { e1.printStackTrace(); } JFrame success = new JFrame(); JOptionPane.showMessageDialog(success, "The response model " + response.getName() + " was exported successfully", "Response Model Exported", JOptionPane.INFORMATION_MESSAGE); } } finally { root.setCursor(Cursor.getDefaultCursor()); } } }); exportAllBaseButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Export All Base * button on the Connection Properties panel of the Export Models tab. The * export procedure above is iterated through all the entities available * on the list except for the response models. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); for (int i = 0; i < exportModelList.getModel().getSize(); i++) { exportModelList.setSelectedIndex(i); String selection = exportModelList.getSelectedValue(); Appliance appliance = installation.findAppliance(selection); ActivityModel activity = installation.getPerson().findActivity(selection, false); ResponseModel response = installation.getPerson().findResponse(selection); if (selection.equalsIgnoreCase(installation.getName())) { String oldName = installation.getName(); try { installation.setName(householdNameTextField.getText() + " Base"); installation.setInstallationID(APIUtilities.sendEntity( installation.toJSON(APIUtilities.getUserID()).toString(), "/inst")); installation.setName(oldName); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } } else if (selection.equalsIgnoreCase(installation.getPerson().getName())) { try { installation.getPerson().setPersonID(APIUtilities.sendEntity(installation .getPerson().toJSON(installation.getInstallationID()).toString(), "/pers")); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } } else if (appliance != null) { try { appliance.setApplianceID(APIUtilities.sendEntity( appliance.toJSON(installation.getInstallationID().toString()).toString(), "/app")); APIUtilities.sendEntity(appliance.powerConsumptionModelToJSON().toString(), "/consmod"); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } } else if (activity != null) { String[] applianceTemp = new String[activity.getAppliancesOf().length]; String personTemp = ""; String activityTemp = ""; String durationTemp = ""; String dailyTemp = ""; String startTemp = ""; // For each appliance that participates in the activity for (int j = 0; j < activity.getAppliancesOf().length; j++) { Appliance activityAppliance = activity.getAppliancesOf()[j]; applianceTemp[j] = activityAppliance.getApplianceID(); } personTemp = installation.getPerson().getPersonID(); try { activity.setActivityID(APIUtilities .sendEntity(activity.activityToJSON(personTemp).toString(), "/act")); String[] appliancesID = applianceTemp; activity.setActivityModelID(APIUtilities .sendEntity(activity.toJSON(appliancesID).toString(), "/actmod")); activityTemp = activity.getActivityModelID(); activity.getDailyTimes().setDistributionID(APIUtilities.sendEntity( activity.getDailyTimes().toJSON(activityTemp).toString(), "/distr")); activity.setDailyID(activity.getDailyTimes().getDistributionID()); dailyTemp = activity.getDailyID(); activity.getDuration().setDistributionID(APIUtilities.sendEntity( activity.getDuration().toJSON(activityTemp).toString(), "/distr")); activity.setDurationID(activity.getDuration().getDistributionID()); durationTemp = activity.getDurationID(); activity.getStartTime().setDistributionID(APIUtilities.sendEntity( activity.getStartTime().toJSON(activityTemp).toString(), "/distr")); activity.setStartID(activity.getStartTime().getDistributionID()); startTemp = activity.getStartID(); APIUtilities.updateEntity(activity.toJSON(appliancesID).toString(), "/actmod", activityTemp); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } } else if (response != null) { } } } finally { root.setCursor(Cursor.getDefaultCursor()); } JFrame success = new JFrame(); JOptionPane.showMessageDialog(success, "The installation model " + installation.getName() + " for the base pricing scheme and all the entities contained within were exported successfully", "Installation Model Exported", JOptionPane.INFORMATION_MESSAGE); } }); exportAllResponseButton.addActionListener(new ActionListener() { /** * This function is called when the user presses the Export All Base * button on the Connection Properties panel of the Export Models tab. The * export procedure above is iterated through all the entities available * on the list except for the activity models. */ @Override public void actionPerformed(ActionEvent e) { Component root = SwingUtilities.getRoot((JButton) e.getSource()); try { root.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); for (int i = 0; i < exportModelList.getModel().getSize(); i++) { exportModelList.setSelectedIndex(i); String selection = exportModelList.getSelectedValue(); Appliance appliance = installation.findAppliance(selection); ActivityModel activity = installation.getPerson().findActivity(selection, false); ResponseModel response = installation.getPerson().findResponse(selection); if (selection.equalsIgnoreCase(installation.getName())) { String oldName = installation.getName(); try { installation.setName(householdNameTextField.getText() + " Response"); installation.setInstallationID(APIUtilities.sendEntity( installation.toJSON(APIUtilities.getUserID()).toString(), "/inst")); installation.setName(oldName); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } } else if (selection.equalsIgnoreCase(installation.getPerson().getName())) { try { installation.getPerson().setPersonID(APIUtilities.sendEntity(installation .getPerson().toJSON(installation.getInstallationID()).toString(), "/pers")); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } } else if (appliance != null) { try { appliance.setApplianceID(APIUtilities.sendEntity( appliance.toJSON(installation.getInstallationID().toString()).toString(), "/app")); APIUtilities.sendEntity(appliance.powerConsumptionModelToJSON().toString(), "/consmod"); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } } else if (activity != null) { } else if (response != null) { String[] applianceTemp = new String[response.getAppliancesOf().length]; String personTemp = ""; String responseTemp = ""; String durationTemp = ""; String dailyTemp = ""; String startTemp = ""; // For each appliance that participates in the activity for (int j = 0; j < response.getAppliancesOf().length; j++) { Appliance responseAppliance = response.getAppliancesOf()[j]; applianceTemp[j] = responseAppliance.getApplianceID(); } personTemp = installation.getPerson().getPersonID(); try { response.setActivityID(APIUtilities .sendEntity(response.activityToJSON(personTemp).toString(), "/act")); String[] appliancesID = applianceTemp; response.setActivityModelID(APIUtilities .sendEntity(response.toJSON(appliancesID).toString(), "/actmod")); responseTemp = response.getActivityModelID(); response.getDailyTimes().setDistributionID(APIUtilities.sendEntity( response.getDailyTimes().toJSON(responseTemp).toString(), "/distr")); response.setDailyID(response.getDailyTimes().getDistributionID()); dailyTemp = response.getDailyID(); response.getDuration().setDistributionID(APIUtilities.sendEntity( response.getDuration().toJSON(responseTemp).toString(), "/distr")); response.setDurationID(response.getDuration().getDistributionID()); durationTemp = response.getDurationID(); response.getStartTime().setDistributionID(APIUtilities.sendEntity( response.getStartTime().toJSON(responseTemp).toString(), "/distr")); response.setStartID(response.getStartTime().getDistributionID()); startTemp = response.getStartID(); APIUtilities.updateEntity(response.toJSON(appliancesID).toString(), "/actmod", responseTemp); } catch (IOException | AuthenticationException | NoSuchAlgorithmException e1) { e1.printStackTrace(); } } } } finally { root.setCursor(Cursor.getDefaultCursor()); } JFrame success = new JFrame(); JOptionPane.showMessageDialog(success, "The installation model " + installation.getName() + " for the new pricing scheme and all the entities contained within were exported successfully", "Installation Model Exported", JOptionPane.INFORMATION_MESSAGE); } }); }