List of usage examples for javax.swing.text DefaultCaret setUpdatePolicy
public void setUpdatePolicy(int policy)
From source file:client.InterfaceJeu.java
/** * Creates new form InterfaceJeu// ww w . java 2 s.c o m * @param cl */ public InterfaceJeu(Client cl) { initComponents(); this.c = cl; this.infosJoueurs = new JSONArray(); this.cartes = new JSONArray(); this.cartesJouables = new JSONArray(); parser = new JSONParser(); this.imgCartes = new ArrayList(); this.imgCartesPosees = new ArrayList(); this.cartesSelectionnees = new ArrayList(); this.cartesJouablesString = new ArrayList(); this.jButton1.setVisible(false); this.jButton2.setVisible(false); tourName = ""; interSession = false; DefaultCaret caret = (DefaultCaret) this.txtAreaChatLect.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); }
From source file:view.App.java
private void initGUI() { try {/*ww w . java 2s . c om*/ { jPanel1 = new JPanel(); BorderLayout jPanel1Layout = new BorderLayout(); jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.CENTER); jPanel1.setPreferredSize(new java.awt.Dimension(901, 398)); { jPanel2 = new JPanel(); BoxLayout jPanel2Layout = new BoxLayout(jPanel2, javax.swing.BoxLayout.Y_AXIS); jPanel2.setLayout(jPanel2Layout); jPanel1.add(jPanel2, BorderLayout.WEST); jPanel2.setPreferredSize(new java.awt.Dimension(292, 446)); { jPanel5 = new JPanel(); jPanel2.add(jPanel5); jPanel5.setPreferredSize(new java.awt.Dimension(292, 109)); { { jTextArea1 = new JTextArea(); jTextArea1.setWrapStyleWord(true); jTextArea1.setLineWrap(true); DefaultCaret caret = (DefaultCaret) jTextArea1.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); jTextArea1.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent evt) { if (jTable1.getModel().getRowCount() == 0 && !jButton1.isEnabled()) { jButton1.setEnabled(true); jTextArea1.setText(""); } } }); JScrollPane sp = new JScrollPane(); sp.setPreferredSize(new java.awt.Dimension(281, 97)); sp.setViewportView(jTextArea1); jPanel5.add(sp, BorderLayout.CENTER); } } } { jPanel4 = new JPanel(); jPanel2.add(jPanel4); FlowLayout jPanel4Layout = new FlowLayout(); jPanel4Layout.setAlignment(FlowLayout.RIGHT); jPanel4.setPreferredSize(new java.awt.Dimension(292, 45)); jPanel4.setSize(102, 51); jPanel4.setLayout(jPanel4Layout); { jButton1 = new JButton(); jPanel4.add(jButton1); jButton1.setText("Get Quotes"); jButton1.setSize(100, 50); jButton1.setPreferredSize(new java.awt.Dimension(100, 26)); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { // String tickerStr = jTextArea1.getText(); if (tickerStr.equals("") || tickerStr.equals(null) || tickerStr.equals(" ")) { jTextArea1.setText(" "); return; } StringTokenizer tokenizer = new StringTokenizer(tickerStr, " "); String[] tickers = new String[tokenizer.countTokens()]; int i = 0; while (tokenizer.hasMoreTokens()) { tickers[i] = tokenizer.nextToken(); i++; } try { Controller.getQuotes(tickers); } catch (CloneNotSupportedException e) { JOptionPane.showMessageDialog(jPanel1, " "); } jButton1.setEnabled(false); } }); } } { jPanel6 = new JPanel(); BorderLayout jPanel6Layout = new BorderLayout(); jPanel6.setLayout(jPanel6Layout); jPanel2.add(jPanel6); { jScrollPane1 = new JScrollPane(); jPanel6.add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(292, 341)); { TableModel jTable1Model = new DefaultTableModel(null, new String[] { "", "MA Value", "", "MA Value" }); jTable1 = new JTable(); jScrollPane1.setViewportView(jTable1); jTable1.setModel(jTable1Model); jTable1.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); } } } } { jPanel3 = new JPanel(); BorderLayout jPanel3Layout = new BorderLayout(); jPanel3.setLayout(jPanel3Layout); jPanel1.add(jPanel3, BorderLayout.CENTER); { // chart = ChartFactory.createLineChart(" ", "dates", "correlation ratio", null, // PlotOrientation.VERTICAL, true, true, false); // ChartPanel chartPanel = new ChartPanel(chart); // chartPanel.setPreferredSize( new java.awt.Dimension( 560 , 367 ) ); // jPanel3.add(chartPanel); } { } } } this.setSize(966, 531); { jMenuBar1 = new JMenuBar(); setJMenuBar(jMenuBar1); { jMenu3 = new JMenu(); jMenuBar1.add(jMenu3); jMenu3.setText("File"); { // newFileMenuItem = new JMenuItem(); // jMenu3.add(newFileMenuItem); // newFileMenuItem.setText("New"); // newFileMenuItem.addActionListener(new ActionListener() { // public void actionPerformed(ActionEvent evt) { //// jTextArea1.setText(""); //// DefaultTableModel model = (DefaultTableModel)jTable1.getModel(); //// model.setRowCount(0); //// Controller.clearPortfolio(); // } // }); } { jSeparator2 = new JSeparator(); jMenu3.add(jSeparator2); } { exitMenuItem = new JMenuItem(); jMenu3.add(exitMenuItem); exitMenuItem.setText("Exit"); exitMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { int action = JOptionPane.showConfirmDialog(jPanel1, " ?", "Confirm Exit", JOptionPane.OK_CANCEL_OPTION); if (action == JOptionPane.OK_OPTION) System.exit(0); } }); } } { jMenu4 = new JMenu(); jMenuBar1.add(jMenu4); jMenu4.setText("Edit"); { cutMenuItem = new JMenuItem(); jMenu4.add(cutMenuItem); cutMenuItem.setText("Cut"); cutMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String txt = jTextArea1.getText(); StringSelection selection = new StringSelection(txt); Clipboard clp = Toolkit.getDefaultToolkit().getSystemClipboard(); clp.setContents(selection, null); jTextArea1.setText(""); } }); } { copyMenuItem = new JMenuItem(); jMenu4.add(copyMenuItem); copyMenuItem.setText("Copy"); copyMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { String txt = jTextArea1.getText(); StringSelection selection = new StringSelection(txt); Clipboard clp = Toolkit.getDefaultToolkit().getSystemClipboard(); clp.setContents(selection, null); } }); } { pasteMenuItem = new JMenuItem(); jMenu4.add(pasteMenuItem); pasteMenuItem.setText("Paste"); pasteMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Clipboard clp = Toolkit.getDefaultToolkit().getSystemClipboard(); try { String data = (String) clp.getData(DataFlavor.stringFlavor); jTextArea1.setText(data); } catch (UnsupportedFlavorException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } }); } } { jMenu5 = new JMenu(); jMenuBar1.add(jMenu5); jMenu5.setText("Help"); { helpMenuItem = new JMenuItem(); jMenu5.add(helpMenuItem); helpMenuItem.setText("About"); helpMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { JOptionPane.showMessageDialog(jPanel1, " . r.zhumagulov@gmail.com", "About", JOptionPane.PLAIN_MESSAGE); } }); } } } } catch (Exception e) { e.printStackTrace(); } }
From source file:com.xmage.launcher.XMageLauncher.java
private XMageLauncher() { locale = Locale.getDefault(); //locale = new Locale("it", "IT"); messages = ResourceBundle.getBundle("MessagesBundle", locale); localize();/*w ww . j av a 2 s . c o m*/ serverConsole = new XMageConsole("XMage Server console"); clientConsole = new XMageConsole("XMage Client console"); frame = new JFrame(messages.getString("frameTitle") + " " + Config.getVersion()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setPreferredSize(new Dimension(800, 500)); frame.setResizable(false); createToolbar(); ImageIcon icon = new ImageIcon(XMageLauncher.class.getResource("/icon-mage-flashed.png")); frame.setIconImage(icon.getImage()); Random r = new Random(); int imageNum = 1 + r.nextInt(17); ImageIcon background = new ImageIcon(new ImageIcon( XMageLauncher.class.getResource("/backgrounds/" + Integer.toString(imageNum) + ".jpg")).getImage() .getScaledInstance(800, 480, Image.SCALE_SMOOTH)); mainPanel = new JLabel(background) { @Override public Dimension getPreferredSize() { Dimension size = super.getPreferredSize(); Dimension lmPrefSize = getLayout().preferredLayoutSize(this); size.width = Math.max(size.width, lmPrefSize.width); size.height = Math.max(size.height, lmPrefSize.height); return size; } }; mainPanel.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { grabPoint = e.getPoint(); mainPanel.getComponentAt(grabPoint); } }); mainPanel.addMouseMotionListener(new MouseMotionAdapter() { @Override public void mouseDragged(MouseEvent e) { // get location of Window int thisX = frame.getLocation().x; int thisY = frame.getLocation().y; // Determine how much the mouse moved since the initial click int xMoved = (thisX + e.getX()) - (thisX + grabPoint.x); int yMoved = (thisY + e.getY()) - (thisY + grabPoint.y); // Move window to this position int X = thisX + xMoved; int Y = thisY + yMoved; frame.setLocation(X, Y); } }); mainPanel.setLayout(new GridBagLayout()); GridBagConstraints constraints = new GridBagConstraints(); constraints.insets = new Insets(10, 10, 10, 10); Font font16 = new Font("Arial", Font.BOLD, 16); Font font12 = new Font("Arial", Font.PLAIN, 12); Font font12b = new Font("Arial", Font.BOLD, 12); mainPanel.add(Box.createRigidArea(new Dimension(250, 50))); ImageIcon logo = new ImageIcon(new ImageIcon(XMageLauncher.class.getResource("/label-xmage.png")).getImage() .getScaledInstance(150, 75, Image.SCALE_SMOOTH)); xmageLogo = new JLabel(logo); constraints.gridx = 3; constraints.gridy = 0; constraints.gridheight = 1; constraints.gridwidth = GridBagConstraints.REMAINDER; constraints.anchor = GridBagConstraints.EAST; mainPanel.add(xmageLogo, constraints); textArea = new JTextArea(5, 40); textArea.setEditable(false); textArea.setForeground(Color.WHITE); textArea.setBackground(Color.BLACK); DefaultCaret caret = (DefaultCaret) textArea.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); scrollPane = new JScrollPane(textArea); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); constraints.gridx = 2; constraints.gridy = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.BOTH; mainPanel.add(scrollPane, constraints); labelProgress = new JLabel(messages.getString("progress")); labelProgress.setFont(font12); labelProgress.setForeground(Color.WHITE); constraints.gridy = 2; constraints.weightx = 0.0; constraints.weighty = 0.0; constraints.gridwidth = 1; constraints.anchor = GridBagConstraints.WEST; mainPanel.add(labelProgress, constraints); progressBar = new JProgressBar(0, 100); constraints.gridx = 3; constraints.weightx = 1.0; constraints.gridwidth = GridBagConstraints.REMAINDER; constraints.fill = GridBagConstraints.HORIZONTAL; mainPanel.add(progressBar, constraints); JPanel pnlButtons = new JPanel(); pnlButtons.setLayout(new GridBagLayout()); pnlButtons.setOpaque(false); constraints.gridx = 0; constraints.gridy = 3; constraints.gridheight = GridBagConstraints.REMAINDER; constraints.fill = GridBagConstraints.BOTH; mainPanel.add(pnlButtons, constraints); btnLaunchClient = new JButton(messages.getString("launchClient")); btnLaunchClient.setToolTipText(messages.getString("launchClient.tooltip")); btnLaunchClient.setFont(font16); btnLaunchClient.setForeground(Color.GRAY); btnLaunchClient.setEnabled(false); btnLaunchClient.setPreferredSize(new Dimension(180, 60)); btnLaunchClient.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handleClient(); } }); constraints.gridx = GridBagConstraints.RELATIVE; constraints.gridy = 0; constraints.gridwidth = 1; constraints.fill = GridBagConstraints.BOTH; pnlButtons.add(btnLaunchClient, constraints); btnLaunchClientServer = new JButton(messages.getString("launchClientServer")); btnLaunchClientServer.setToolTipText(messages.getString("launchClientServer.tooltip")); btnLaunchClientServer.setFont(font12b); btnLaunchClientServer.setEnabled(false); btnLaunchClientServer.setForeground(Color.GRAY); btnLaunchClientServer.setPreferredSize(new Dimension(80, 40)); btnLaunchClientServer.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handleServer(); handleClient(); } }); constraints.fill = GridBagConstraints.HORIZONTAL; pnlButtons.add(btnLaunchClientServer, constraints); btnLaunchServer = new JButton(messages.getString("launchServer")); btnLaunchServer.setToolTipText(messages.getString("launchServer.tooltip")); btnLaunchServer.setFont(font12b); btnLaunchServer.setEnabled(false); btnLaunchServer.setForeground(Color.GRAY); btnLaunchServer.setPreferredSize(new Dimension(80, 40)); btnLaunchServer.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handleServer(); } }); pnlButtons.add(btnLaunchServer, constraints); btnUpdate = new JButton(messages.getString("update.xmage")); btnUpdate.setToolTipText(messages.getString("update.xmage.tooltip")); btnUpdate.setFont(font12b); btnUpdate.setForeground(Color.BLACK); btnUpdate.setPreferredSize(new Dimension(80, 40)); btnUpdate.setEnabled(true); btnUpdate.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handleUpdate(); } }); pnlButtons.add(btnUpdate, constraints); btnCheck = new JButton(messages.getString("check.xmage")); btnCheck.setToolTipText(messages.getString("check.xmage.tooltip")); btnCheck.setFont(font12b); btnCheck.setForeground(Color.BLACK); btnCheck.setPreferredSize(new Dimension(80, 40)); btnCheck.setEnabled(true); btnCheck.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handleCheckUpdates(); } }); pnlButtons.add(btnCheck, constraints); frame.add(mainPanel); frame.pack(); Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); frame.setLocation(dim.width / 2 - frame.getSize().width / 2, dim.height / 2 - frame.getSize().height / 2); }
From source file:gui.TheGui.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 www. j ava 2 s .c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonGroup1 = new javax.swing.ButtonGroup(); buttonGroup2 = new javax.swing.ButtonGroup(); buttonGroup3 = new javax.swing.ButtonGroup(); buttonGroup4 = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jRadioButton1 = new javax.swing.JRadioButton(); jRadioButton2 = new javax.swing.JRadioButton(); jRadioButton3 = new javax.swing.JRadioButton(); jRadioButton4 = new javax.swing.JRadioButton(); jPanel3 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); jRadioButton5 = new javax.swing.JRadioButton(); jRadioButton6 = new javax.swing.JRadioButton(); jPanel6 = new javax.swing.JPanel(); jRadioButton7 = new javax.swing.JRadioButton(); jRadioButton8 = new javax.swing.JRadioButton(); jPanel5 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jProgressBar1 = new javax.swing.JProgressBar(); jLabel1 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenu3 = new javax.swing.JMenu(); jMenuItem2 = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setResizable(false); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "EradioParser v2.0", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.ABOVE_TOP)); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Main Options", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP)); buttonGroup1.add(jRadioButton1); jRadioButton1.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton1.setText("<html><b>Get</b> a playlist for all the stations at <b>e-radio.gr</b>.</html>"); jRadioButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton1ActionPerformed(evt); } }); buttonGroup1.add(jRadioButton2); jRadioButton2.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton2 .setText("<html><b>View</b> the available <b>station Categories</b> and get a playlist.</html>"); buttonGroup1.add(jRadioButton3); jRadioButton3.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton3 .setText("<html><b>View</b> the available <b>station Locations</b> and get a playlist.</html>"); buttonGroup1.add(jRadioButton4); jRadioButton4.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton4.setText( "<html><b>View</b> the station<b> Locations & Categories</b> and create a custom playlist.</html>"); jRadioButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton4ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGap(15, 15, 15).addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jRadioButton4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButton2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButton3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(56, Short.MAX_VALUE))); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGap(18, 18, 18) .addComponent(jRadioButton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jRadioButton2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jRadioButton3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jRadioButton4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(15, Short.MAX_VALUE))); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Run control", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.ABOVE_TOP)); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Playlist type", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.BELOW_TOP)); buttonGroup3.add(jRadioButton5); jRadioButton5.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton5.setText(".m3u playlist"); jRadioButton5.setToolTipText("Select to create .m3u Playlist"); jRadioButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton5ActionPerformed(evt); } }); buttonGroup3.add(jRadioButton6); jRadioButton6.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton6.setSelected(true); jRadioButton6.setText(".xspf playlist"); jRadioButton6.setToolTipText("Select to create .xspf Playlist"); jRadioButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton6ActionPerformed(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().addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jRadioButton5).addComponent(jRadioButton6)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addGap(17, 17, 17).addComponent(jRadioButton5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jRadioButton6).addContainerGap(19, Short.MAX_VALUE))); jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Run Messges")); buttonGroup4.add(jRadioButton7); jRadioButton7.setText("Disable Run Messages"); jRadioButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton7ActionPerformed(evt); } }); buttonGroup4.add(jRadioButton8); jRadioButton8.setSelected(true); jRadioButton8.setText("Enable Run Messages"); jRadioButton8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton8ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout .setHorizontalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap(17, Short.MAX_VALUE) .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jRadioButton7).addComponent(jRadioButton8)))); jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap().addComponent(jRadioButton7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jRadioButton8))); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 3, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Progress Monitor", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP)); jScrollPane1.setAutoscrolls(true); jScrollPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jScrollPane1.setVerifyInputWhenFocusTarget(false); jTextArea1.setColumns(20); jTextArea1.setEditable(false); jTextArea1.setFont(new java.awt.Font("Monospaced", 0, 11)); // NOI18N jTextArea1.setRows(5); jTextArea1.setBorder(javax.swing.BorderFactory.createTitledBorder("")); jTextArea1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); DefaultCaret caret = (DefaultCaret) jTextArea1.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); jScrollPane1.setViewportView(jTextArea1); jProgressBar1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Current Progress", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP)); jLabel1.setText("Program Run Messages"); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1) .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel5Layout.createSequentialGroup().addGap(204, 204, 204).addComponent(jLabel1) .addContainerGap())); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() .addContainerGap() .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE) .addComponent(jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE))); jButton1.setFont(new java.awt.Font("Times New Roman", 1, 21)); // NOI18N jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/runIcon2.png"))); // NOI18N jButton1.setText("Run"); jButton1.setToolTipText("Click to run"); jButton1.setIconTextGap(10); jButton1.setMaximumSize(new java.awt.Dimension(65, 30)); jButton1.setMinimumSize(new java.awt.Dimension(65, 30)); jButton1.setPreferredSize(new java.awt.Dimension(65, 30)); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout .createSequentialGroup().addGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(10, 10, 10)) .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup().addGap(39, 39, 39).addComponent( jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 128, 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) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(42, 42, 42) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())))); jMenuBar1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); jMenu1.setText("File"); jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/exitIcon.png"))); // NOI18N jMenuItem1.setText("Exit"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu1.add(jMenuItem1); jMenuBar1.add(jMenu1); jMenu3.setText("About"); jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/InfoIcon.png"))); // NOI18N jMenuItem2.setText("Info"); jMenuItem2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem2ActionPerformed(evt); } }); jMenu3.add(jMenuItem2); jMenuBar1.add(jMenu3); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))); 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.TheGui.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 va2 s . c om */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { buttonGroup1 = new javax.swing.ButtonGroup(); buttonGroup2 = new javax.swing.ButtonGroup(); buttonGroup3 = new javax.swing.ButtonGroup(); buttonGroup4 = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jRadioButton1 = new javax.swing.JRadioButton(); jRadioButton2 = new javax.swing.JRadioButton(); jRadioButton3 = new javax.swing.JRadioButton(); jRadioButton4 = new javax.swing.JRadioButton(); jPanel3 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); jRadioButton5 = new javax.swing.JRadioButton(); jRadioButton6 = new javax.swing.JRadioButton(); jPanel6 = new javax.swing.JPanel(); jRadioButton7 = new javax.swing.JRadioButton(); jRadioButton8 = new javax.swing.JRadioButton(); jPanel5 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jProgressBar1 = new javax.swing.JProgressBar(); jButton1 = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenu3 = new javax.swing.JMenu(); jMenuItem2 = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setResizable(false); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "EradioParser v2.0", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.ABOVE_TOP)); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Main Options", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP)); buttonGroup1.add(jRadioButton1); jRadioButton1.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton1.setText("<html><b>Get</b> a playlist for all the stations at <b>e-radio.gr</b>.</html>"); jRadioButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton1ActionPerformed(evt); } }); buttonGroup1.add(jRadioButton2); jRadioButton2.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton2 .setText("<html><b>View</b> the available <b>station Categories</b> and get a playlist.</html>"); buttonGroup1.add(jRadioButton3); jRadioButton3.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton3 .setText("<html><b>View</b> the available <b>station Locations</b> and get a playlist.</html>"); buttonGroup1.add(jRadioButton4); jRadioButton4.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton4.setText( "<html><b>View</b> the station<b> Locations & Categories</b> and create a custom playlist.</html>"); jRadioButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton4ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGap(15, 15, 15).addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jRadioButton4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButton2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jRadioButton3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(56, Short.MAX_VALUE))); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGap(18, 18, 18) .addComponent(jRadioButton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jRadioButton2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jRadioButton3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jRadioButton4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(15, Short.MAX_VALUE))); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Run control", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.ABOVE_TOP)); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Playlist type", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.BELOW_TOP)); buttonGroup3.add(jRadioButton5); jRadioButton5.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton5.setText(".m3u playlist"); jRadioButton5.setToolTipText("Select to create .m3u Playlist"); jRadioButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton5ActionPerformed(evt); } }); buttonGroup3.add(jRadioButton6); jRadioButton6.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jRadioButton6.setSelected(true); jRadioButton6.setText(".xspf playlist"); jRadioButton6.setToolTipText("Select to create .xspf Playlist"); jRadioButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton6ActionPerformed(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().addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jRadioButton5).addComponent(jRadioButton6)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addGap(17, 17, 17).addComponent(jRadioButton5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jRadioButton6).addContainerGap(19, Short.MAX_VALUE))); jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Run Messges")); buttonGroup4.add(jRadioButton7); jRadioButton7.setText("Disable Run Messages"); jRadioButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton7ActionPerformed(evt); } }); buttonGroup4.add(jRadioButton8); jRadioButton8.setSelected(true); jRadioButton8.setText("Enable Run Messages"); jRadioButton8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton8ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout .setHorizontalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap(17, Short.MAX_VALUE) .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jRadioButton7).addComponent(jRadioButton8)))); jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap().addComponent(jRadioButton7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jRadioButton8))); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 3, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Program Run messages", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.ABOVE_TOP)); jScrollPane1.setAutoscrolls(true); jScrollPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jScrollPane1.setVerifyInputWhenFocusTarget(false); jTextArea1.setColumns(20); jTextArea1.setEditable(false); jTextArea1.setFont(new java.awt.Font("Monospaced", 0, 11)); // NOI18N jTextArea1.setRows(5); jTextArea1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); DefaultCaret caret = (DefaultCaret) jTextArea1.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); jScrollPane1.setViewportView(jTextArea1); jProgressBar1.setToolTipText(""); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout .setHorizontalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE) .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup().addGap(20, 20, 20) .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(34, 34, 34).addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE))); jButton1.setFont(new java.awt.Font("Times New Roman", 1, 21)); // NOI18N jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/runIcon2.png"))); // NOI18N jButton1.setText("Run"); jButton1.setToolTipText("Click to run"); jButton1.setIconTextGap(10); jButton1.setMaximumSize(new java.awt.Dimension(65, 30)); jButton1.setMinimumSize(new java.awt.Dimension(65, 30)); jButton1.setPreferredSize(new java.awt.Dimension(65, 30)); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(10, 10, 10)) .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup().addGap(39, 39, 39).addComponent( jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 128, 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() .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(42, 42, 42) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(58, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup().addGap(13, 13, 13) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jMenuBar1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); jMenu1.setText("File"); jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/exitIcon.png"))); // NOI18N jMenuItem1.setText("Exit"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu1.add(jMenuItem1); jMenuBar1.add(jMenu1); jMenu3.setText("About"); jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/InfoIcon.png"))); // NOI18N jMenuItem2.setText("Info"); jMenuItem2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem2ActionPerformed(evt); } }); jMenu3.add(jMenuItem2); jMenuBar1.add(jMenu3); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))); 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:com.marginallyclever.makelangelo.MainGUI.java
public Container CreateContentPane() { //Create the content-pane-to-be. JPanel contentPane = new JPanel(new BorderLayout()); contentPane.setOpaque(true);/*w w w .j a va2 s . c o m*/ // the log panel log = new JTextPane(); log.setEditable(false); log.setBackground(Color.BLACK); logPane = new JScrollPane(log); kit = new HTMLEditorKit(); doc = new HTMLDocument(); log.setEditorKit(kit); log.setDocument(doc); DefaultCaret c = (DefaultCaret) log.getCaret(); c.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); ClearLog(); settingsPane = SettingsPanel(); previewPane = new DrawPanel(machineConfiguration); preparePane = ProcessImages(); driveControls = new MakelangeloDriveControls(); driveControls.createPanel(this, translator, machineConfiguration); driveControls.updateButtonAccess(false, false); statusBar = new StatusBar(translator); contextMenu = new JTabbedPane(); contextMenu.addTab(translator.get("MenuSettings"), null, settingsPane, null); contextMenu.addTab(translator.get("MenuGCODE"), null, preparePane, null); contextMenu.addTab(translator.get("MenuDraw"), null, driveControls, null); contextMenu.addTab("Log", null, logPane, null); // major layout split_left_right = new Splitter(JSplitPane.HORIZONTAL_SPLIT); split_left_right.add(previewPane); split_left_right.add(contextMenu); contentPane.add(statusBar, BorderLayout.SOUTH); contentPane.add(split_left_right, BorderLayout.CENTER); return contentPane; }
From source file:com.willwinder.universalgcodesender.MainWindow.java
private void checkScrollWindow() { // Console output. DefaultCaret caret = (DefaultCaret) consoleTextArea.getCaret(); if (scrollWindowCheckBox.isSelected()) { caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); consoleTextArea.setCaretPosition(consoleTextArea.getDocument().getLength()); } else {//from w w w . j ava2s. c o m caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE); } // Command table. this.commandTable.setAutoWindowScroll(scrollWindowCheckBox.isSelected()); }
From source file:search2go.UIFrame.java
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { tabbedPane = new javax.swing.JTabbedPane(); pnlFullProcess = new javax.swing.JPanel(); lblQueriesFP = new javax.swing.JLabel(); lblDatabaseFP = new javax.swing.JLabel(); lblThreadsFP = new javax.swing.JLabel(); lblNXPFP = new javax.swing.JLabel(); btnProcessFP = new javax.swing.JButton(); prgFullProcess = new javax.swing.JProgressBar(); jScrollPane5 = new javax.swing.JScrollPane(); txtFullOutput = new javax.swing.JTextArea(); cbxNXPFP = new javax.swing.JComboBox<>(); txtThreadsFP = new javax.swing.JFormattedTextField(); txtDatabaseFP = new javax.swing.JTextField(); txtQueryFP = new javax.swing.JTextField(); btnChooseQueriesFP = new javax.swing.JButton(); btnChooseDBFP = new javax.swing.JButton(); lblDBIDFP = new javax.swing.JLabel(); cbxDBIDFP = new javax.swing.JComboBox<>(); lblBitScoreFP = new javax.swing.JLabel(); txtBitScoreFP = new javax.swing.JFormattedTextField(); jLabel3 = new javax.swing.JLabel(); txtEFP = new javax.swing.JFormattedTextField(); blastPane = new javax.swing.JPanel(); txtQuery = new javax.swing.JTextField(); lblQuery = new javax.swing.JLabel(); lblDatabase = new javax.swing.JLabel(); txtDatabase = new javax.swing.JTextField(); lblThreads = new javax.swing.JLabel(); lblNXP = new javax.swing.JLabel(); cbxNXP = new javax.swing.JComboBox<>(); jScrollPane1 = new javax.swing.JScrollPane(); txtBlastOutput = new javax.swing.JTextArea(); btnBlast = new javax.swing.JButton(); btnChooseDB = new javax.swing.JButton(); prgBlast = new javax.swing.JProgressBar(); btnChooseQueries = new javax.swing.JButton(); txtThreads = new javax.swing.JFormattedTextField(); jLabel1 = new javax.swing.JLabel(); txtBlastE = new javax.swing.JFormattedTextField(); mapPane = new javax.swing.JPanel(); lblBitScore = new javax.swing.JLabel(); lblDBID = new javax.swing.JLabel(); cbxDBID = new javax.swing.JComboBox<>(); btnMapIDs = new javax.swing.JButton(); jScrollPane2 = new javax.swing.JScrollPane(); txtMapOutput = new javax.swing.JTextArea(); prgMapping = new javax.swing.JProgressBar(); txtBitScore = new javax.swing.JFormattedTextField(); jLabel2 = new javax.swing.JLabel(); txtMapE = new javax.swing.JFormattedTextField(); identPane = new javax.swing.JPanel(); btnGTermIdent = new javax.swing.JButton(); jScrollPane6 = new javax.swing.JScrollPane(); lstQueries = new javax.swing.JList<>(); jScrollPane4 = new javax.swing.JScrollPane(); txtTermInfo = new javax.swing.JTextArea(); txtTermInfo.setFont(new Font("monospaced", Font.PLAIN, 12)); txtSearchTerms = new javax.swing.JTextField(); lblMinFreqFilter = new javax.swing.JLabel(); prgIdentification = new javax.swing.JProgressBar(); lblMaxFreqFilter = new javax.swing.JLabel(); jScrollPane8 = new javax.swing.JScrollPane(); tblGOFreq = new javax.swing.JTable(); txtMinFreqFilter = new javax.swing.JFormattedTextField(); txtMaxFreqFilter = new javax.swing.JFormattedTextField(); analysisPane = new javax.swing.JPanel(); btnFrequencyGraph = new javax.swing.JButton(); pnlChartHolder = new javax.swing.JPanel(); btnWeb = new javax.swing.JToggleButton(); lblMinHits = new javax.swing.JLabel(); lblMaxHits = new javax.swing.JLabel(); txtMinHits = new javax.swing.JFormattedTextField(); txtMaxHits = new javax.swing.JFormattedTextField(); prgChart = new javax.swing.JProgressBar(); txtFilterGOID = new javax.swing.JTextField(); lblFilterGOFamily = new javax.swing.JLabel(); jScrollPane7 = new javax.swing.JScrollPane(); txtGTermInfo = new javax.swing.JTextArea(); mnuMenu = new javax.swing.JMenuBar(); mnuFile = new javax.swing.JMenu(); itmNewProject = new javax.swing.JMenuItem(); itmLoadProject = new javax.swing.JMenuItem(); chkDoCCs = new javax.swing.JCheckBoxMenuItem(); chkDoMFs = new javax.swing.JCheckBoxMenuItem(); chkDoBPs = new javax.swing.JCheckBoxMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setName("mainFrame"); // NOI18N tabbedPane.setPreferredSize(new java.awt.Dimension(670, 500)); lblQueriesFP.setText("Queries:"); lblDatabaseFP.setText("Database:"); lblThreadsFP.setText("Number of Threads:"); lblNXPFP.setText("BLAST Type:"); btnProcessFP.setText("Perform Search"); btnProcessFP.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnProcessFPActionPerformed(evt); }/* w ww. j av a 2 s .c om*/ }); ((DefaultCaret) txtFullOutput.getCaret()).setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); txtFullOutput.setEditable(false); txtFullOutput.setColumns(20); txtFullOutput.setRows(5); jScrollPane5.setViewportView(txtFullOutput); cbxNXPFP.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "BLASTn", "BLASTp", "BLASTx" })); txtThreadsFP.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory( new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0")))); btnChooseQueriesFP.setText("..."); btnChooseQueriesFP.setMargin(new java.awt.Insets(-2, 14, -2, 14)); btnChooseQueriesFP.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnChooseQueriesFPActionPerformed(evt); } }); btnChooseDBFP.setText("..."); btnChooseDBFP.setMargin(new java.awt.Insets(-2, 14, -2, 14)); btnChooseDBFP.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnChooseDBFPActionPerformed(evt); } }); lblDBIDFP.setText("Database ID Type:"); cbxDBIDFP.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Affy ID", "Agilent ID", "Allergome Code", "ApiDB_CryptoDB ID", "Biocarta Pathway Name", "BioCyc ID", "CCDS ID", "Chromosomal Location", "CleanEx ID", "CodeLink ID", "COSMIC ID", "CPDB Protein Interactor", "CTD Disease Info", "CTD Disease name", "CYGD ID", "dictyBase ID", "DIP ID", "DisProt ID", "DrugBank Drug ID", "DrugBank Drug Info", "DrugBank Drug Name", "EC Number", "EchoBASE ID", "EcoGene ID", "Ensembl Biotype", "Ensembl Gene Info", "Ensembl Protein ID", "Ensembl Transcript ID", "FlyBase Gene ID", "FlyBase Transcript ID", "GAD Disease Info", "GAD Disease Name", "GenBank Nucleotide Accession", "GenBank Nucleotid GI", "GenBank Protein Accession", "GenBank Protein GI", "Gene Info", "Gene Symbol", "Gene Symbol and Synonyms", "Gene Synonyms", "GeneFarm ID", "GSEA Standard Name", "H-Inv Locus ID", "HAMAP ID", "HGNC ID", "HMDB Metabolite", "Homolog - All Ens Gene ID", "Homolog - All Ens Protein ID", "Homolog - All Gene ID", "Homolog - Human Ens Gene ID", "Homolog - Human Ens Protein ID", "Homolog - Human Gene ID", "Homolog - Mouse Ens Gene ID", "Homolog - Mouse Ens Protein ID", "Homolog - Mouse Gene ID", "Homolog - Rat Ens Gene ID", "Homolog - Rat Ens Protein ID", "Homolog - Rat Gene ID", "HomoloGene ID", "HPA ID", "HPRD ID", "HPRD Protein Complex", "HPRD Protein Interactor", "Illumina ID", "IMGT/GENE-DB ID", "InterPro ID", "IPI ID", "KEGG Disease ID", "KEGG Gene ID", "KEGG Pathway ID", "KEGG Pathway Info", "KEGG Pathway Title", "LegioList ID", "Leproma ID", "Locus Tag", "MaizeGDB ID", "MGC(ZGC/XGC) ID", "MGC(ZGC/XGC) Image ID", "MGC(ZGC/XGC) Info", "MGI ID", "MIM ID", "MIM Info", "miRBase ID", "NCIPID Pathway Name", "NCIPID Protein Complex", "NCIPID Protein Interactor", "NCIPID PTM", "Orphanet ID", "PANTHER ID", "Paralog - Ens Gene ID", "PBR ID", "PDB ID", "PeroxiBase ID", "Pfam ID", "PharmGKB Drug Info", "PharmGKB Gene ID", "PIR ID", "PIRSF ID", "PptaseDB ID", "PRINTS ID", "ProDom ID", "PROSITE ID", "PseudoCAP ID", "PubMed ID", "Reactome Pathway Name", "REBASE ID", "RefSeq Genomic Accession", "RefSeq Genomic GI", "RefSeq mRNA Accession", "RefSeq ncRNA Accession", "RefSeq Nucleotide GI", "RefSeq Protein Accession", "RefSeq Protein GI", "Rfam ID", "RGD ID", "SGD ID", "SMART ID", "STRING Protein Interactor", "TAIR ID", "Taxon ID", "TCDB ID", "TIGRFAMs ID", "TubercuList ID", "UCSC ID", "UniGene ID", "UniProt Accession", "UniProt Enty Name", "UniProt Info", "UniProt Protein Name", "UniSTS ID", "VectorBase Gene ID", "VEGA Gene ID", "VEGA Protein ID", "VEGA Transcript ID", "WormBase Gene ID", "WormPep Protein ID", "XenBase Gene ID", "ZFIN ID" })); lblBitScoreFP.setText("Hit Bit Score Threshold:"); txtBitScoreFP.setText("0"); jLabel3.setText("Hit E-Value Threshold:"); txtEFP.setText("10"); javax.swing.GroupLayout pnlFullProcessLayout = new javax.swing.GroupLayout(pnlFullProcess); pnlFullProcess.setLayout(pnlFullProcessLayout); pnlFullProcessLayout.setHorizontalGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(prgFullProcess, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane5) .addGroup(pnlFullProcessLayout.createSequentialGroup().addGap(20, 20, 20) .addGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btnProcessFP) .addGroup(pnlFullProcessLayout.createSequentialGroup().addGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lblThreadsFP).addComponent(lblDatabaseFP) .addComponent(lblQueriesFP).addComponent(lblDBIDFP)) .addGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(pnlFullProcessLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(pnlFullProcessLayout.createSequentialGroup() .addGap(31, 31, 31) .addComponent(txtQueryFP, javax.swing.GroupLayout.PREFERRED_SIZE, 381, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnChooseQueriesFP, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pnlFullProcessLayout.createSequentialGroup() .addGap(32, 32, 32) .addComponent(txtDatabaseFP, javax.swing.GroupLayout.PREFERRED_SIZE, 381, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnChooseDBFP, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(pnlFullProcessLayout.createSequentialGroup() .addGap(32, 32, 32) .addGroup(pnlFullProcessLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnlFullProcessLayout .createSequentialGroup() .addComponent(cbxDBIDFP, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblNXPFP) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cbxNXPFP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(txtThreadsFP, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 430, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addGroup(pnlFullProcessLayout.createSequentialGroup().addGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblBitScoreFP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txtBitScoreFP, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE) .addComponent(txtEFP)))) .addContainerGap(183, Short.MAX_VALUE))); pnlFullProcessLayout.setVerticalGroup( pnlFullProcessLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnlFullProcessLayout.createSequentialGroup().addContainerGap() .addGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtQueryFP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblQueriesFP).addComponent(btnChooseQueriesFP)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblDatabaseFP) .addComponent(txtDatabaseFP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnChooseDBFP)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblThreadsFP).addComponent(txtThreadsFP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cbxNXPFP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cbxDBIDFP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblDBIDFP).addComponent(lblNXPFP)) .addGap(8, 8, 8) .addGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblBitScoreFP).addComponent(txtBitScoreFP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pnlFullProcessLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3).addComponent(txtEFP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnProcessFP) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(prgFullProcess, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent( jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE))); tabbedPane.addTab("Full Process", pnlFullProcess); txtQuery.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtQueryActionPerformed(evt); } }); lblQuery.setText("Queries:"); lblDatabase.setText("Database:"); lblThreads.setText("Number of Threads:"); lblNXP.setText("BLAST Type:"); cbxNXP.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "BLASTn", "BLASTp", "BLASTx" })); txtBlastOutput.setEditable(false); txtBlastOutput.setColumns(20); txtBlastOutput.setRows(5); jScrollPane1.setViewportView(txtBlastOutput); btnBlast.setText("Perform Search"); btnBlast.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnBlastActionPerformed(evt); } }); btnChooseDB.setText("..."); btnChooseDB.setMargin(new java.awt.Insets(-2, 14, -2, 14)); btnChooseDB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnChooseDBActionPerformed(evt); } }); btnChooseQueries.setText("..."); btnChooseQueries.setMargin(new java.awt.Insets(-2, 14, -2, 14)); btnChooseQueries.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnChooseQueriesActionPerformed(evt); } }); txtThreads.setText("1"); txtThreads.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtThreadsActionPerformed(evt); } }); jLabel1.setText("E-value Threshold:"); txtBlastE.setText("10"); javax.swing.GroupLayout blastPaneLayout = new javax.swing.GroupLayout(blastPane); blastPane.setLayout(blastPaneLayout); blastPaneLayout.setHorizontalGroup(blastPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(prgBlast, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(blastPaneLayout.createSequentialGroup().addGap(20, 20, 20).addGroup(blastPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(btnBlast) .addGroup(blastPaneLayout.createSequentialGroup().addGroup(blastPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lblThreads).addComponent(lblQuery).addComponent(lblNXP) .addGroup(blastPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblDatabase, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(blastPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(blastPaneLayout.createSequentialGroup() .addComponent(txtQuery, javax.swing.GroupLayout.PREFERRED_SIZE, 381, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnChooseQueries, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)) .addGroup(blastPaneLayout.createSequentialGroup().addGroup(blastPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(cbxNXP, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(txtBlastE, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtDatabase, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 381, Short.MAX_VALUE) .addComponent(txtThreads, javax.swing.GroupLayout.Alignment.LEADING)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnChooseDB, javax.swing.GroupLayout.PREFERRED_SIZE, 40, Short.MAX_VALUE))))) .addContainerGap(200, Short.MAX_VALUE)) .addComponent(jScrollPane1)); blastPaneLayout.setVerticalGroup(blastPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(blastPaneLayout.createSequentialGroup().addContainerGap().addGroup(blastPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtQuery, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblQuery).addComponent(btnChooseQueries)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(blastPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblDatabase) .addComponent(txtDatabase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnChooseDB)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(blastPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(txtBlastE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(blastPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblThreads).addComponent(txtThreads, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(blastPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblNXP).addComponent(cbxNXP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(btnBlast) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(prgBlast, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 228, Short.MAX_VALUE))); tabbedPane.addTab("BLAST", blastPane); lblBitScore.setText("Hit Bit Score Threshold:"); lblDBID.setText("Database ID Type:"); cbxDBID.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Affy ID", "Agilent ID", "Allergome Code", "ApiDB_CryptoDB ID", "Biocarta Pathway Name", "BioCyc ID", "CCDS ID", "Chromosomal Location", "CleanEx ID", "CodeLink ID", "COSMIC ID", "CPDB Protein Interactor", "CTD Disease Info", "CTD Disease name", "CYGD ID", "dictyBase ID", "DIP ID", "DisProt ID", "DrugBank Drug ID", "DrugBank Drug Info", "DrugBank Drug Name", "EC Number", "EchoBASE ID", "EcoGene ID", "Ensembl Biotype", "Ensembl Gene Info", "Ensembl Protein ID", "Ensembl Transcript ID", "FlyBase Gene ID", "FlyBase Transcript ID", "GAD Disease Info", "GAD Disease Name", "GenBank Nucleotide Accession", "GenBank Nucleotid GI", "GenBank Protein Accession", "GenBank Protein GI", "Gene Info", "Gene Symbol", "Gene Symbol and Synonyms", "Gene Synonyms", "GeneFarm ID", "GSEA Standard Name", "H-Inv Locus ID", "HAMAP ID", "HGNC ID", "HMDB Metabolite", "Homolog - All Ens Gene ID", "Homolog - All Ens Protein ID", "Homolog - All Gene ID", "Homolog - Human Ens Gene ID", "Homolog - Human Ens Protein ID", "Homolog - Human Gene ID", "Homolog - Mouse Ens Gene ID", "Homolog - Mouse Ens Protein ID", "Homolog - Mouse Gene ID", "Homolog - Rat Ens Gene ID", "Homolog - Rat Ens Protein ID", "Homolog - Rat Gene ID", "HomoloGene ID", "HPA ID", "HPRD ID", "HPRD Protein Complex", "HPRD Protein Interactor", "Illumina ID", "IMGT/GENE-DB ID", "InterPro ID", "IPI ID", "KEGG Disease ID", "KEGG Gene ID", "KEGG Pathway ID", "KEGG Pathway Info", "KEGG Pathway Title", "LegioList ID", "Leproma ID", "Locus Tag", "MaizeGDB ID", "MGC(ZGC/XGC) ID", "MGC(ZGC/XGC) Image ID", "MGC(ZGC/XGC) Info", "MGI ID", "MIM ID", "MIM Info", "miRBase ID", "NCIPID Pathway Name", "NCIPID Protein Complex", "NCIPID Protein Interactor", "NCIPID PTM", "Orphanet ID", "PANTHER ID", "Paralog - Ens Gene ID", "PBR ID", "PDB ID", "PeroxiBase ID", "Pfam ID", "PharmGKB Drug Info", "PharmGKB Gene ID", "PIR ID", "PIRSF ID", "PptaseDB ID", "PRINTS ID", "ProDom ID", "PROSITE ID", "PseudoCAP ID", "PubMed ID", "Reactome Pathway Name", "REBASE ID", "RefSeq Genomic Accession", "RefSeq Genomic GI", "RefSeq mRNA Accession", "RefSeq ncRNA Accession", "RefSeq Nucleotide GI", "RefSeq Protein Accession", "RefSeq Protein GI", "Rfam ID", "RGD ID", "SGD ID", "SMART ID", "STRING Protein Interactor", "TAIR ID", "Taxon ID", "TCDB ID", "TIGRFAMs ID", "TubercuList ID", "UCSC ID", "UniGene ID", "UniProt Accession", "UniProt Enty Name", "UniProt Info", "UniProt Protein Name", "UniSTS ID", "VectorBase Gene ID", "VEGA Gene ID", "VEGA Protein ID", "VEGA Transcript ID", "WormBase Gene ID", "WormPep Protein ID", "XenBase Gene ID", "ZFIN ID" })); btnMapIDs.setText("Map IDs"); btnMapIDs.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnMapIDsActionPerformed(evt); } }); txtMapOutput.setEditable(false); txtMapOutput.setColumns(20); txtMapOutput.setRows(5); jScrollPane2.setViewportView(txtMapOutput); DefaultCaret caret = (DefaultCaret) txtMapOutput.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); txtBitScore.setText("0"); txtBitScore.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtBitScoreActionPerformed(evt); } }); jLabel2.setText("Hit E-Value Threshold:"); txtMapE.setText("10"); txtMapE.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtMapEActionPerformed(evt); } }); javax.swing.GroupLayout mapPaneLayout = new javax.swing.GroupLayout(mapPane); mapPane.setLayout(mapPaneLayout); mapPaneLayout .setHorizontalGroup(mapPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(prgMapping, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane2) .addGroup(mapPaneLayout.createSequentialGroup().addGap(23, 23, 23) .addGroup(mapPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(lblDBID) .addComponent(lblBitScore, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnMapIDs, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(36, 36, 36) .addGroup(mapPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( cbxDBID, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(mapPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(txtMapE, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE) .addComponent(txtBitScore, javax.swing.GroupLayout.Alignment.LEADING))) .addContainerGap(357, Short.MAX_VALUE))); mapPaneLayout.setVerticalGroup(mapPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mapPaneLayout.createSequentialGroup().addContainerGap() .addGroup(mapPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblDBID).addComponent(cbxDBID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(mapPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblBitScore).addComponent(txtBitScore, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(mapPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2).addComponent(txtMapE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(btnMapIDs) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(prgMapping, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE))); tabbedPane.addTab("Mapping", mapPane); btnGTermIdent.setText("Get GO Term Info"); btnGTermIdent.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnGTermIdentActionPerformed(evt); } }); lstQueries.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); lstQueries.setMaximumSize(new java.awt.Dimension(2147483647, 2147483647)); lstQueries.setMinimumSize(new java.awt.Dimension(562, 122)); jScrollPane6.setViewportView(lstQueries); txtTermInfo.setEditable(false); txtTermInfo.setColumns(20); txtTermInfo.setRows(5); jScrollPane4.setViewportView(txtTermInfo); txtSearchTerms.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtSearchTermsActionPerformed(evt); } }); lblMinFreqFilter.setText("Min Frequency:"); lblMaxFreqFilter.setText("Max Frequency:"); tblGOFreq.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { "GO ID", "Frequency" }) { Class[] types = new Class[] { java.lang.String.class, java.lang.String.class }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } }); jScrollPane8.setViewportView(tblGOFreq); javax.swing.GroupLayout identPaneLayout = new javax.swing.GroupLayout(identPane); identPane.setLayout(identPaneLayout); identPaneLayout.setHorizontalGroup(identPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(identPaneLayout.createSequentialGroup().addContainerGap().addGroup(identPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(identPaneLayout.createSequentialGroup().addGroup(identPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(prgIdentification, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(identPaneLayout.createSequentialGroup() .addGroup(identPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btnGTermIdent).addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(identPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane4).addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 586, Short.MAX_VALUE)))) .addContainerGap()) .addGroup(identPaneLayout.createSequentialGroup().addGroup(identPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(txtSearchTerms, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(identPaneLayout.createSequentialGroup() .addGroup(identPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lblMinFreqFilter).addComponent(lblMaxFreqFilter)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(identPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txtMaxFreqFilter, javax.swing.GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE) .addComponent(txtMinFreqFilter)))) .addGap(605, 605, 605))))); identPaneLayout.setVerticalGroup(identPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(identPaneLayout.createSequentialGroup().addGap(8, 8, 8) .addComponent(prgIdentification, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnGTermIdent) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(identPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(identPaneLayout.createSequentialGroup() .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)) .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtSearchTerms, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(identPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblMinFreqFilter).addComponent(txtMinFreqFilter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(8, 8, 8) .addGroup(identPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblMaxFreqFilter).addComponent(txtMaxFreqFilter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(16, 16, 16))); tabbedPane.addTab("Identification", identPane); btnFrequencyGraph.setText("Generate Frequency Graph"); btnFrequencyGraph.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFrequencyGraphActionPerformed(evt); } }); pnlChartHolder.setBackground(new java.awt.Color(153, 153, 153)); pnlChartHolder.setPreferredSize(new java.awt.Dimension(640, 480)); javax.swing.GroupLayout pnlChartHolderLayout = new javax.swing.GroupLayout(pnlChartHolder); pnlChartHolder.setLayout(pnlChartHolderLayout); pnlChartHolderLayout.setHorizontalGroup(pnlChartHolderLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); pnlChartHolderLayout.setVerticalGroup(pnlChartHolderLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 352, Short.MAX_VALUE)); btnWeb.setText("Create Web"); btnWeb.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnWebActionPerformed(evt); } }); lblMinHits.setText("Minimum Hits:"); lblMaxHits.setText("Maximum Hits:"); txtMinHits.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtMinHitsActionPerformed(evt); } }); txtMaxHits.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtMaxHitsActionPerformed(evt); } }); txtFilterGOID.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtFilterGOIDActionPerformed(evt); } }); lblFilterGOFamily.setText("GO Family filter: "); txtGTermInfo.setEditable(false); txtGTermInfo.setColumns(20); txtGTermInfo.setRows(5); txtGTermInfo.setMinimumSize(new java.awt.Dimension(164, 94)); jScrollPane7.setViewportView(txtGTermInfo); javax.swing.GroupLayout analysisPaneLayout = new javax.swing.GroupLayout(analysisPane); analysisPane.setLayout(analysisPaneLayout); analysisPaneLayout.setHorizontalGroup(analysisPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, analysisPaneLayout.createSequentialGroup() .addContainerGap() .addGroup(analysisPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(pnlChartHolder, javax.swing.GroupLayout.DEFAULT_SIZE, 779, Short.MAX_VALUE) .addComponent(prgChart, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, analysisPaneLayout .createSequentialGroup() .addGroup(analysisPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lblMinHits).addComponent(lblFilterGOFamily)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(analysisPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(analysisPaneLayout.createSequentialGroup() .addComponent(txtMinHits, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(lblMaxHits) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtMaxHits, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(txtFilterGOID)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(analysisPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btnFrequencyGraph).addComponent(btnWeb)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE))) .addContainerGap())); analysisPaneLayout.setVerticalGroup(analysisPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(analysisPaneLayout.createSequentialGroup().addContainerGap().addGroup(analysisPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(analysisPaneLayout.createSequentialGroup().addGroup(analysisPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnFrequencyGraph).addComponent(lblMinHits).addComponent(lblMaxHits) .addComponent(txtMinHits, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtMaxHits, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(analysisPaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblFilterGOFamily) .addComponent(txtFilterGOID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnWeb))) .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(prgChart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(pnlChartHolder, javax.swing.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE))); tabbedPane.addTab("Analysis", analysisPane); mnuFile.setText("File"); itmNewProject.setText("New Project"); itmNewProject.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { itmNewProjectActionPerformed(evt); } }); mnuFile.add(itmNewProject); itmLoadProject.setText("Load Project"); itmLoadProject.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { itmLoadProjectActionPerformed(evt); } }); mnuFile.add(itmLoadProject); chkDoCCs.setSelected(true); chkDoCCs.setText("Cellular Components"); chkDoCCs.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chkDoCCsActionPerformed(evt); } }); mnuFile.add(chkDoCCs); chkDoMFs.setSelected(true); chkDoMFs.setText("Molecular Functions"); chkDoMFs.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chkDoMFsActionPerformed(evt); } }); mnuFile.add(chkDoMFs); chkDoBPs.setSelected(true); chkDoBPs.setText("Biological Processes"); chkDoBPs.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chkDoBPsActionPerformed(evt); } }); mnuFile.add(chkDoBPs); mnuMenu.add(mnuFile); setJMenuBar(mnuMenu); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 814, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 514, Short.MAX_VALUE)); pack(); }
From source file:com.xilinx.ultrascale.gui.MainScreen.java
private void alignmentsOfTables() { // tblModel = new MyTableModel(dummydata, dmaColumnNames0); pcieSysmontable.getTableHeader().setReorderingAllowed(false); hostsysmontable.getTableHeader().setReorderingAllowed(false); pcieSysmontable.getColumnModel().getColumn(1).setPreferredWidth(5); hostsysmontable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); hostsysmontable.getColumnModel().getColumn(1).setMinWidth(10); hostsysmontable.getColumnModel().getColumn(1).setMaxWidth(60); tabbedPanel.remove(statusPanel);//w w w .jav a2 s. c o m this.setSize(this.getSize().width, this.getSize().height - 25); // update the message log. DefaultCaret caret = (DefaultCaret) messageLog.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); }
From source file:it.isislab.dmason.util.SystemManagement.Master.thrower.DMasonMaster.java
private void initComponents() { menuBar1 = new JMenuBar(); jMenuFile = new JMenu(); //menuItemOpen = new JMenuItem(); menuItemExit = new JMenuItem(); jMenuAbout = new JMenu(); menuItemInfo = new JMenuItem(); menuItemHelp = new JMenuItem(); panelMain = new JPanel(); jPanelContainerConnection = new JPanel(); jPanelConnection = new JPanel(); jLabelAddress = new JLabel(); textFieldAddress = new JTextField(); jLabelPort = new JLabel(); textFieldPort = new JTextField(); refreshServerLabel = new JLabel(); buttonRefreshServerLabel = new JButton(); jPanelContainerSettings = new JPanel(); jPanelSetDistribution = new JPanel(); jPanelSettings = new JPanel(); jLabelHorizontal = new JLabel(); jLabelSquare = new JLabel(); jLabelMaxDistance = new JLabel(); jLabelWidth = new JLabel(); jLabelInsertSteps = new JLabel(); textFieldMaxDistance = new JTextField(); textFieldWidth = new JTextField(); jLabelHeight = new JLabel(); textFieldHeight = new JTextField(); jLabelAgents = new JLabel(); textFieldAgents = new JTextField(); textFieldColumns = new JTextField(); textFieldRows = new JTextField(); textFieldSteps = new JTextField(); jLabelChooseSimulation = new JLabel(); jComboBoxChooseSimulation = new JComboBox(); jComboBoxNumRegionXPeer = new JComboBox(); jPanelContainerTabbedPane = new JPanel(); tabbedPane2 = new JTabbedPane(); jPanelDefault = new JPanel(); jPanelSimulation = new ModelPanel(tabbedPane2); labelSimulationConfigSet = new JLabel(); labelRegionsResume = new JLabel(); labelNumOfPeerResume = new JLabel(); labelRegForPeerResume = new JLabel(); labelWriteReg = new JLabel(); labelWriteNumOfPeer = new JLabel(); labelWriteRegForPeer = new JLabel(); labelWidthRegion = new JLabel(); labelheightRegion = new JLabel(); labelDistrMode = new JLabel(); labelWriteRegWidth = new JLabel(); labelWriteRegHeight = new JLabel(); labelWriteDistrMode = new JLabel(); graphicONcheckBox2 = new JCheckBox(); jPanelSetButton = new JPanel(); buttonSetConfigDefault = new JButton(); jPanelAdvanced = new JPanel(); jPanelAdvancedMain = new JPanel(); peerInfoStatus = new JDesktopPane(); internalFrame1 = new JInternalFrame(); architectureLabel = new JTextArea(); architectureLabel.setBackground(Color.BLACK); architectureLabel.setForeground(Color.GREEN); architectureLabel.setEditable(false); advancedConfirmBut = new JLabel(); graphicONcheckBox = new JCheckBox(); jCheckBoxLoadBalancing = new JCheckBox("Load Balancing", false); jCheckBoxLoadBalancing.setEnabled(true); jCheckBoxLoadBalancing.setSelected(false); jCheckBoxMPI = new JCheckBox("Enable MPI", false); jCheckBoxMPI.setEnabled(true);/*ww w .jav a 2 s.c o m*/ jCheckBoxMPI.setSelected(false); scrollPaneTree = new JScrollPane(); tree1 = new JTree(); buttonSetConfigAdvanced = new JButton(); jLabelPlayButton = new JLabel(); jLabelPauseButton = new JLabel(); jPanelNumStep = new JPanel(); jLabelStep = new JLabel(); jLabelStep.setHorizontalAlignment(SwingConstants.LEFT); jLabelStopButton = new JLabel(); scrollPane1 = new JScrollPane(); peerInfoStatus1 = new JDesktopPane(); root = new DefaultMutableTreeNode("Simulation"); ButtonGroup b = new ButtonGroup(); ip = textFieldAddress.getText(); port = textFieldPort.getText(); menuBar1 = new JMenuBar(); jMenuFile = new JMenu(); menuItemExit = new JMenuItem(); menuNewSim = new JMenuItem(); jMenuAbout = new JMenu(); menuItemInfo = new JMenuItem(); menuItemHelp = new JMenuItem(); scrollPane3 = new JScrollPane(); scrollPane4 = new JScrollPane(); notifyArea = new JTextArea(); panelConsole = new JPanel(); buttonSetConfigDefault2 = new JButton(); jPanelSetButton2 = new JPanel(); graphicONcheckBox = new JCheckBox(); graphicONcheckBox.setEnabled(false); graphicONcheckBox.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { withGui = graphicONcheckBox.isSelected(); } }); jLabelChooseSimulation = new JLabel(); jComboBoxChooseSimulation = new JComboBox(); loadSimulation(); selectedSimulation = ((SimComboEntry) jComboBoxChooseSimulation.getSelectedItem()).fullSimName; jPanelSimulation.updateHTML(selectedSimulation); jComboBoxChooseSimulation.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { // Prevent executing listener's actions two times if (e.getStateChange() != ItemEvent.SELECTED) return; selectedSimulation = ((SimComboEntry) jComboBoxChooseSimulation.getSelectedItem()).fullSimName; jPanelSimulation.updateHTML(selectedSimulation); isThin = isThinSimulation(selectedSimulation); jCheckBoxLoadBalancing.setSelected(false); jCheckBoxLoadBalancing.setEnabled(!isThin); initializeDefaultLabel(); } }); /*for(int i=2;i<100;i++) jComboRegions.addItem(i);*/ buttonRefreshServerLabel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { connect(); } }); refreshServerLabel.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent arg0) { if (starter.isConnected()) starter.execute("restart"); else JOptionPane.showMessageDialog(null, "Not connected to the Server!"); } @Override public void mousePressed(MouseEvent arg0) { } @Override public void mouseExited(MouseEvent arg0) { } @Override public void mouseEntered(MouseEvent arg0) { } @Override public void mouseClicked(MouseEvent arg0) { } }); jCheckBoxLoadBalancing.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { if (!isHorizontal) { if (jCheckBoxLoadBalancing.isSelected()) labelWriteDistrMode.setText("SQUARE BALANCED MODE"); else labelWriteDistrMode.setText("SQUARE MODE"); } if (isHorizontal) { if (jCheckBoxLoadBalancing.isSelected()) labelWriteDistrMode.setText("HORIZONTAL BALANCED MODE"); else labelWriteDistrMode.setText("HORIZONTAL MODE"); } } }); buttonSetConfigDefault2.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (initializeDefaultLabel()) submitCustomizeMode(); else JOptionPane.showMessageDialog(null, "To start a simulation must fill in all fields...!"); } }); buttonSetConfigDefault.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (initializeDefaultLabel()) submitDefaultMode(); else JOptionPane.showMessageDialog(null, "To start a simulation must fill in all fields...!"); } }); advancedConfirmBut.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent arg0) { confirm(); res -= (Integer) jComboBoxNumRegionXPeer.getSelectedItem(); withGui = graphicONcheckBox.isSelected(); jComboBoxNumRegionXPeer.removeAllItems(); graphicONcheckBox.setSelected(false); for (int i = 1; i <= res; i++) jComboBoxNumRegionXPeer.addItem(i); JOptionPane.showMessageDialog(null, "Region assigned !"); } @Override public void mousePressed(MouseEvent arg0) { } @Override public void mouseExited(MouseEvent arg0) { } @Override public void mouseEntered(MouseEvent arg0) { } @Override public void mouseClicked(MouseEvent arg0) { } }); //======== this ======== Container contentPane = getContentPane(); //======== menuBar1 ======== { { jMenuFile.setText(" File "); menuNewSim.setText("New "); menuNewSim.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { me.dispose(); me = null; DMasonMaster p = new DMasonMaster(); p.setVisible(true); } }); jMenuFile.add(menuNewSim); //---- menuItemExit ---- menuItemExit.setText("Exit"); menuItemExit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { me.dispose(); } }); jMenuFile.add(menuItemExit); } menuBar1.add(jMenuFile); menuBar1.add(getJMenuSystem()); //======== jMenuAbout ======== { jMenuAbout.setText(" ? "); //---- menuItemInfo ---- menuItemInfo.setText("Info"); menuItemInfo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null, Release.PRODUCT_RELEASE, "Info", 1); } }); jMenuAbout.add(menuItemInfo); //---- menuItenHelp ---- menuItemHelp.setText("Help"); menuItemHelp.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { try { java.net.URI uri = new java.net.URI( "http://isis.dia.unisa.it/projects/it.isislab.dmason/"); try { java.awt.Desktop.getDesktop().browse(uri); } catch (IOException e) { e.printStackTrace(); } } catch (URISyntaxException e) { e.printStackTrace(); } } }); jMenuAbout.add(menuItemHelp); } menuBar1.add(jMenuAbout); } setJMenuBar(menuBar1); //======== panelMain ======== { //======== jPanelContainerConnection ======== { //======== jPanelConnection ======== { jPanelConnection.setBorder(new TitledBorder("Connection")); jPanelConnection.setPreferredSize(new Dimension(215, 125)); //---- jLabelAddress ---- jLabelAddress.setText("IP Address :"); //---- textFieldAddress ---- textFieldAddress.setText("127.0.0.1"); //---- jLabelPort ---- jLabelPort.setText("Port :"); //---- textFieldPort ---- textFieldPort.setText("61616"); //---- refreshServerLabel ---- refreshServerLabel.setIcon(new ImageIcon("resources/image/refresh.png")); //---- buttonRefreshServerLabel ---- buttonRefreshServerLabel.setText("OK"); JLabel lblStatus = new JLabel("Communication Server status :"); lblStatusIcon = new JLabel(""); lblStatusIcon.setIcon(new ImageIcon("resources/image/status-down.png")); buttonActiveMQRestart = new JButton(""); buttonActiveMQRestart.setEnabled(false); buttonActiveMQRestart.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { notifyArea.append("ActiveMQ restarting...\n"); if (csManager.restartActiveMQ()) notifyArea.append("ActiveMQ restarted!\n"); checkCommunicationServerStatus(); } }); buttonActiveMQRestart.setMinimumSize(new Dimension(24, 24)); buttonActiveMQRestart.setMaximumSize(new Dimension(24, 24)); buttonActiveMQRestart.setPreferredSize(new Dimension(24, 24)); buttonActiveMQRestart.setIcon(new ImageIcon("resources/image/LH2 - Restart.png")); buttonActiveMQStart = new JButton(""); buttonActiveMQStart.setEnabled(false); buttonActiveMQStart.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { notifyArea.append("ActiveMQ starting...\n"); if (csManager.startActiveMQ()) notifyArea.append("ActiveMQ started!\n"); checkCommunicationServerStatus(); } }); buttonActiveMQStart.setPreferredSize(new Dimension(24, 24)); buttonActiveMQStart.setMinimumSize(new Dimension(24, 24)); buttonActiveMQStart.setMaximumSize(new Dimension(24, 24)); buttonActiveMQStart.setIcon(new ImageIcon("resources/image/LH2 - Shutdown.png")); buttonActiveMQStop = new JButton(""); buttonActiveMQStop.setEnabled(false); buttonActiveMQStop.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { notifyArea.append("ActiveMQ stopping...\n"); if (csManager.stopActiveMQ()) notifyArea.append("ActiveMQ stopped!\n"); checkCommunicationServerStatus(); } }); buttonActiveMQStop.setPreferredSize(new Dimension(24, 24)); buttonActiveMQStop.setMinimumSize(new Dimension(24, 24)); buttonActiveMQStop.setMaximumSize(new Dimension(24, 24)); buttonActiveMQStop.setIcon(new ImageIcon("resources/image/LH2 - Stop.png")); btnCheckPeers = new JButton("Check Peers"); btnCheckPeers.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { checkPeers(); } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } }); GroupLayout jPanelConnectionLayout = new GroupLayout(jPanelConnection); jPanelConnectionLayout.setHorizontalGroup(jPanelConnectionLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelConnectionLayout.createSequentialGroup().addGroup(jPanelConnectionLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelConnectionLayout.createSequentialGroup() .addGroup(jPanelConnectionLayout.createParallelGroup(Alignment.TRAILING) .addComponent(refreshServerLabel) .addGroup(jPanelConnectionLayout.createSequentialGroup() .addComponent(buttonActiveMQStart, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(buttonActiveMQRestart, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(buttonActiveMQStop, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(111).addComponent(jLabelAddress).addGap(18) .addComponent(textFieldAddress, GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE) .addGap(18).addComponent(jLabelPort).addGap(18) .addComponent(textFieldPort, GroupLayout.PREFERRED_SIZE, 85, GroupLayout.PREFERRED_SIZE) .addGap(46).addComponent(buttonRefreshServerLabel))) .addGap(51).addComponent(btnCheckPeers)) .addGroup(jPanelConnectionLayout.createSequentialGroup().addComponent(lblStatus) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(lblStatusIcon))) .addContainerGap(71, Short.MAX_VALUE))); jPanelConnectionLayout.setVerticalGroup(jPanelConnectionLayout .createParallelGroup(Alignment.TRAILING) .addGroup(jPanelConnectionLayout.createSequentialGroup().addGroup(jPanelConnectionLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelConnectionLayout.createSequentialGroup() .addGroup(jPanelConnectionLayout.createParallelGroup(Alignment.LEADING) .addComponent(lblStatus).addComponent(lblStatusIcon)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(jPanelConnectionLayout.createParallelGroup(Alignment.LEADING) .addComponent(buttonActiveMQRestart, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(buttonActiveMQStart, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(buttonActiveMQStop, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED, 1, Short.MAX_VALUE)) .addGroup(jPanelConnectionLayout.createSequentialGroup() .addContainerGap(18, Short.MAX_VALUE).addComponent(refreshServerLabel) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(jPanelConnectionLayout.createParallelGroup(Alignment.BASELINE) .addComponent(buttonRefreshServerLabel).addComponent(jLabelPort) .addComponent(textFieldPort, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE) .addComponent(jLabelAddress) .addComponent(textFieldAddress, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE) .addComponent(btnCheckPeers)))) .addGap(10))); jPanelConnectionLayout.linkSize(SwingConstants.HORIZONTAL, new Component[] { buttonActiveMQRestart, buttonActiveMQStart, buttonActiveMQStop }); jPanelConnection.setLayout(jPanelConnectionLayout); } GroupLayout jPanelContainerConnectionLayout = new GroupLayout(jPanelContainerConnection); jPanelContainerConnection.setLayout(jPanelContainerConnectionLayout); jPanelContainerConnectionLayout .setHorizontalGroup(jPanelContainerConnectionLayout.createParallelGroup() .addGroup(jPanelContainerConnectionLayout .createSequentialGroup().addContainerGap().addComponent(jPanelConnection, GroupLayout.PREFERRED_SIZE, 829, GroupLayout.PREFERRED_SIZE) .addContainerGap(153, Short.MAX_VALUE))); jPanelContainerConnectionLayout.setVerticalGroup( jPanelContainerConnectionLayout.createParallelGroup().addComponent(jPanelConnection, GroupLayout.PREFERRED_SIZE, 71, GroupLayout.PREFERRED_SIZE)); } //======== jPanelContainerSettings ======== { GroupLayout jPanelContainerSettingsLayout = new GroupLayout(jPanelContainerSettings); jPanelContainerSettings.setLayout(jPanelContainerSettingsLayout); jPanelContainerSettingsLayout.setHorizontalGroup( jPanelContainerSettingsLayout.createParallelGroup().addGap(0, 1, Short.MAX_VALUE)); jPanelContainerSettingsLayout.setVerticalGroup( jPanelContainerSettingsLayout.createParallelGroup().addGap(0, 481, Short.MAX_VALUE)); } //======== jPanelSetDistribution ======== { jPanelSetDistribution.setBorder(new TitledBorder("Settings")); //======== jPanelSettings ======== { //jLabelHorizontal.setIcon(new ImageIcon("it.isislab.dmason/resources/image/hori.png"))); //---- jLabelSquare ---- //jLabelSquare.setIcon(new ImageIcon("it.isislab.dmason/resources/image/square.png"))); //---- jLabelMaxDistance ---- jLabelMaxDistance.setText("MAX_DISTANCE :"); //---- jLabelWidth ---- jLabelWidth.setText("WIDTH :"); //---- jLabelInsertSteps ---- jLabelInsertSteps.setText("STEPS :"); //---- textFieldMaxDistance ---- textFieldMaxDistance.setText("1"); //---- textFieldWidth ---- textFieldWidth.setText("200"); //---- jLabelHeight ---- jLabelHeight.setText("HEIGHT :"); //---- textFieldHeight ---- textFieldHeight.setText("200"); //---- jLabelAgents ---- jLabelAgents.setText("AGENTS :"); //---- textFieldAgents ---- textFieldAgents.setText("15"); //---- textFieldSteps textFieldSteps.setText("100"); MouseListener textFieldMouseListener = new MouseListener() { @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseExited(MouseEvent e) { initializeDefaultLabel(); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub } }; textFieldAgents.addMouseListener(textFieldMouseListener); textFieldAgents.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { char v = e.getKeyChar(); if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) { e.consume(); } if (textFieldAgents.getText().length() > 0) initializeDefaultLabel(); } @Override public void keyReleased(KeyEvent e) { //initializeDefaultLabel(); } @Override public void keyPressed(KeyEvent e) { } }); textFieldColumns.addMouseListener(textFieldMouseListener); textFieldColumns.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { // TODO Auto-generated method stub char v = e.getKeyChar(); if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) { e.consume(); } if (textFieldColumns.getText().length() > 0) initializeDefaultLabel(); } @Override public void keyReleased(KeyEvent e) { // TODO Auto-generated method stub } @Override public void keyPressed(KeyEvent e) { // TODO Auto-generated method stub } }); textFieldMaxDistance.addMouseListener(textFieldMouseListener); textFieldMaxDistance.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { char v = e.getKeyChar(); if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) { e.consume(); } if (textFieldMaxDistance.getText().length() > 0) initializeDefaultLabel(); } @Override public void keyReleased(KeyEvent e) { //initializeDefaultLabel(); } @Override public void keyPressed(KeyEvent e) { } }); textFieldWidth.addMouseListener(textFieldMouseListener); textFieldWidth.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { char v = e.getKeyChar(); if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) { e.consume(); } if (textFieldWidth.getText().length() > 0) initializeDefaultLabel(); } @Override public void keyReleased(KeyEvent e) { //initializeDefaultLabel(); } @Override public void keyPressed(KeyEvent e) { } }); textFieldRows.addMouseListener(textFieldMouseListener); textFieldRows.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { char v = e.getKeyChar(); if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) { e.consume(); } if (textFieldRows.getText().length() > 0) initializeDefaultLabel(); } @Override public void keyReleased(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { } }); textFieldHeight.addMouseListener(textFieldMouseListener); textFieldHeight.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { char v = e.getKeyChar(); if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) { e.consume(); } if (textFieldHeight.getText().length() > 0) initializeDefaultLabel(); } @Override public void keyReleased(KeyEvent arg0) { //initializeDefaultLabel(); } @Override public void keyPressed(KeyEvent arg0) { } }); textFieldSteps.addMouseListener(textFieldMouseListener); textFieldSteps.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { char v = e.getKeyChar(); if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) { e.consume(); } if (textFieldSteps.getText().length() > 0) initializeDefaultLabel(); } @Override public void keyReleased(KeyEvent e) { // TODO Auto-generated method stub } @Override public void keyPressed(KeyEvent e) { // TODO Auto-generated method stub } }); //---- jLabelChooseSimulation ---- jLabelChooseSimulation.setText("Choose your simulation:"); //---- jComboBoxChooseSimulation ---- jComboBoxChooseSimulation.setMaximumRowCount(10); JLabel lblRows = new JLabel("ROWS :"); JLabel lblColumns = new JLabel("COLUMNS :"); textFieldRows.setText("1"); textFieldRows.setEnabled(false); textFieldRows.setColumns(10); rows = Integer.parseInt(textFieldRows.getText()); textFieldColumns.setText("2"); textFieldColumns.setEnabled(false); textFieldColumns.setColumns(10); columns = Integer.parseInt(textFieldColumns.getText()); textFieldSteps.setText("100"); textFieldSteps.setEnabled(false); textFieldSteps.setColumns(10); steps = 100; GroupLayout jPanelSettingsLayout = new GroupLayout(jPanelSettings); jPanelSettingsLayout.setHorizontalGroup(jPanelSettingsLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelSettingsLayout.createSequentialGroup().addGap(17) .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.LEADING) .addComponent(jLabelChooseSimulation, GroupLayout.PREFERRED_SIZE, 245, GroupLayout.PREFERRED_SIZE) .addGroup(jPanelSettingsLayout.createSequentialGroup().addGap(119) .addComponent(jLabelHorizontal)) .addComponent(jComboBoxChooseSimulation, GroupLayout.PREFERRED_SIZE, 214, GroupLayout.PREFERRED_SIZE) .addGroup(jPanelSettingsLayout.createSequentialGroup() .addGroup(jPanelSettingsLayout .createParallelGroup(Alignment.TRAILING) .addGroup(Alignment.LEADING, jPanelSettingsLayout .createSequentialGroup() .addGroup(jPanelSettingsLayout .createParallelGroup(Alignment.LEADING) .addComponent(lblRows, GroupLayout.PREFERRED_SIZE, 59, GroupLayout.PREFERRED_SIZE) .addComponent(lblColumns)) .addGap(60) .addGroup(jPanelSettingsLayout .createParallelGroup(Alignment.LEADING) .addComponent(jLabelSquare) .addComponent(textFieldColumns, GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE) .addComponent(textFieldRows, GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE))) .addGroup(Alignment.LEADING, jPanelSettingsLayout .createSequentialGroup() .addGroup(jPanelSettingsLayout .createParallelGroup(Alignment.LEADING) .addComponent(jLabelMaxDistance) .addComponent(jLabelWidth) .addComponent(jLabelHeight) .addComponent(jLabelAgents) .addComponent(jLabelInsertSteps) .addGap(132)) .addGroup(jPanelSettingsLayout .createParallelGroup(Alignment.LEADING) .addComponent(textFieldAgents, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldHeight, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldWidth, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldMaxDistance, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldSteps, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE) .addGap(20)))) .addGap(20))))); jPanelSettingsLayout.setVerticalGroup(jPanelSettingsLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelSettingsLayout.createSequentialGroup().addContainerGap() .addComponent(jLabelHorizontal).addGap(41) .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.LEADING) .addComponent(jLabelSquare) .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE) .addComponent(lblRows, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldRows, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE) .addComponent(textFieldColumns, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(lblColumns)) .addGap(18) .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE) .addComponent(jLabelMaxDistance).addComponent(textFieldMaxDistance, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE) .addComponent(jLabelWidth, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldWidth, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)) .addGap(10) .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE) .addComponent(jLabelHeight, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldHeight, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE) .addComponent(jLabelAgents).addComponent(textFieldAgents, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) //.addGap(10) .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE) .addComponent(jLabelInsertSteps, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldSteps, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)) .addGap(35).addComponent(jLabelChooseSimulation) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(jComboBoxChooseSimulation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(52))); jPanelSettings.setLayout(jPanelSettingsLayout); } //======== jPanelContainerTabbedPane ======== { //======== tabbedPane2 ======== { //======== jPanelDefault ======== { jPanelDefault.setBorder(new EtchedBorder()); jPanelDefault.setPreferredSize(new Dimension(350, 331)); //---- labelSimulationConfigSet ---- labelSimulationConfigSet.setText("Simulation Configuration Settings"); labelSimulationConfigSet.setFont(labelSimulationConfigSet.getFont().deriveFont( labelSimulationConfigSet.getFont().getStyle() | Font.BOLD, labelSimulationConfigSet.getFont().getSize() + 8f)); //---- labelRegionsResume ---- labelRegionsResume.setText("REGIONS :"); //---- labelNumOfPeerResume ---- labelNumOfPeerResume.setText("NUMBER OF PEERS :"); //---- labelRegForPeerResume ---- labelRegForPeerResume.setText("REGIONS FOR PEER :"); //---- labelWriteReg ---- labelWriteReg.setText("text"); //---- labelWriteNumOfPeer ---- labelWriteNumOfPeer.setText("text"); //---- labelWriteRegForPeer ---- labelWriteRegForPeer.setText("text"); //---- labelWidthRegion ---- labelWidthRegion.setText("REGION WIDTH :"); //---- labelheightRegion ---- labelheightRegion.setText("REGION HEIGHT :"); //---- labelDistrMode ---- labelDistrMode.setText("DISTRIBUTION MODE :"); //---- labelWriteRegWidth ---- labelWriteRegWidth.setText("text"); //---- labelWriteRegHeight ---- labelWriteRegHeight.setText("text"); //---- labelWriteDistrMode ---- labelWriteDistrMode.setText("text"); //---- graphicONcheckBox2 ---- graphicONcheckBox2.setText("Graphic ON"); //======== jPanelSetButton ======== { //---- buttonSetConfigDefault ---- buttonSetConfigDefault.setText("Set"); { jCheckBoxLoadBalancing.setText("Load Balancing"); } GroupLayout jPanelSetButtonLayout = new GroupLayout(jPanelSetButton); jPanelSetButton.setLayout(jPanelSetButtonLayout); jPanelSetButtonLayout.setVerticalGroup(jPanelSetButtonLayout.createSequentialGroup() .addGroup(jPanelSetButtonLayout.createParallelGroup().addGroup( GroupLayout.Alignment.TRAILING, jPanelSetButtonLayout.createSequentialGroup().addComponent( jCheckBoxMPI, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))) .addGroup(jPanelSetButtonLayout.createParallelGroup() .addGroup(GroupLayout.Alignment.LEADING, jPanelSetButtonLayout.createSequentialGroup().addComponent( jCheckBoxLoadBalancing, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)) .addGroup(GroupLayout.Alignment.LEADING, jPanelSetButtonLayout .createSequentialGroup() .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 0, Short.MAX_VALUE) .addComponent(buttonSetConfigDefault, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))) .addContainerGap()); jPanelSetButtonLayout.setHorizontalGroup(jPanelSetButtonLayout .createSequentialGroup() .addComponent(jCheckBoxMPI, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE) .addContainerGap(0, 0) .addComponent(jCheckBoxLoadBalancing, GroupLayout.PREFERRED_SIZE, 114, GroupLayout.PREFERRED_SIZE) .addGap(0, 150, Short.MAX_VALUE).addComponent(buttonSetConfigDefault, GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE) .addContainerGap(0, 0)); FlowLayout lsetbutt = new FlowLayout(); lsetbutt.addLayoutComponent("", jCheckBoxMPI); lsetbutt.addLayoutComponent("", jCheckBoxLoadBalancing); lsetbutt.addLayoutComponent("", buttonSetConfigDefault); jPanelSetButton.setLayout(lsetbutt); } GroupLayout jPanelDefaultLayout = new GroupLayout(jPanelDefault); jPanelDefaultLayout.setHorizontalGroup(jPanelDefaultLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelDefaultLayout.createSequentialGroup().addContainerGap() .addGroup(jPanelDefaultLayout.createParallelGroup(Alignment.LEADING) .addComponent(labelSimulationConfigSet, GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE) .addGroup(jPanelDefaultLayout.createSequentialGroup().addGap(6) .addGroup(jPanelDefaultLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelDefaultLayout .createSequentialGroup() .addGroup(jPanelDefaultLayout .createParallelGroup( Alignment.LEADING) .addComponent( labelNumOfPeerResume) .addComponent( labelRegForPeerResume) .addComponent(labelWidthRegion) .addComponent(labelheightRegion) .addComponent(labelDistrMode) .addComponent( labelRegionsResume)) .addPreferredGap( ComponentPlacement.RELATED, 218, Short.MAX_VALUE) .addGroup(jPanelDefaultLayout .createParallelGroup( Alignment.LEADING) .addComponent( labelWriteNumOfPeer, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(labelWriteReg) .addComponent( labelWriteRegForPeer) .addComponent( labelWriteRegWidth) .addComponent( labelWriteRegHeight) .addComponent( labelWriteDistrMode)) .addGap(118)) .addComponent(graphicONcheckBox2)))) .addGap(211)) .addGroup(jPanelDefaultLayout.createSequentialGroup() .addComponent(jPanelSetButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(23, Short.MAX_VALUE))); jPanelDefaultLayout.setVerticalGroup(jPanelDefaultLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelDefaultLayout.createSequentialGroup().addContainerGap() .addComponent(labelSimulationConfigSet, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE) .addGap(28) .addGroup(jPanelDefaultLayout.createParallelGroup(Alignment.TRAILING) .addGroup(jPanelDefaultLayout.createSequentialGroup() .addComponent(labelRegionsResume) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(labelNumOfPeerResume) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(labelRegForPeerResume).addGap(6) .addComponent(labelWidthRegion).addGap(6) .addComponent(labelheightRegion) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(labelDistrMode)) .addGroup(jPanelDefaultLayout.createSequentialGroup() .addComponent(labelWriteReg) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(labelWriteNumOfPeer) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(labelWriteRegForPeer).addGap(6) .addComponent(labelWriteRegWidth).addGap(6) .addComponent(labelWriteRegHeight) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(labelWriteDistrMode, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE) .addGap(8))) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(graphicONcheckBox2) .addPreferredGap(ComponentPlacement.RELATED, 82, Short.MAX_VALUE) .addComponent(jPanelSetButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))); jPanelDefault.setLayout(jPanelDefaultLayout); } tabbedPane2.addTab("Default", jPanelDefault); //======== jPanelSimulation ======== tabbedPane2.addTab("Simulation", jPanelSimulation); //======== End jPanelSimulation ======== //======== jPanelAdvanced ======== { jPanelAdvanced.setBorder(new EtchedBorder()); //======== jPanelAdvancedMain ======== { //======== scrollPaneTree ======== { //---- tree1 ---- tree1.setModel(new DefaultTreeModel(root)); DefaultTreeCellRenderer render = new DefaultTreeCellRenderer(); render.setOpenIcon(new ImageIcon("resources/image/network.png")); render.setLeafIcon(new ImageIcon("esource/image/computer.gif")); render.setClosedIcon(new ImageIcon("resources/image/network.png")); tree1.setCellRenderer(render); tree1.setRowHeight(25); scrollPaneTree.setViewportView(tree1); tree1.addTreeSelectionListener(new TreeSelectionListener() { @Override public void valueChanged(TreeSelectionEvent arg0) { if (arg0.getPath().getLastPathComponent().equals(root)) { jComboBoxNumRegionXPeer.setEnabled(true); advancedConfirmBut.setEnabled(true); graphicONcheckBox.setEnabled(true); total = Integer.parseInt(textFieldRows.getText()) * Integer.parseInt(textFieldColumns.getText()); //(Integer)jComboRegions.getSelectedItem(); res = total; jComboBoxNumRegionXPeer.removeAllItems(); for (int i = 1; i < res; i++) jComboBoxNumRegionXPeer.addItem(i); } else clickTreeListener(); } }); } //======== peerInfoStatus ======== { peerInfoStatus.setBorder(new TitledBorder("Settings")); peerInfoStatus.setBackground(Color.lightGray); //======== peerInfoStatus1 ======== { peerInfoStatus1.setBackground(Color.lightGray); peerInfoStatus1.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); peerInfoStatus1.setBorder(null); //======== internalFrame1 ======== { internalFrame1.setVisible(true); Container internalFrame1ContentPane = internalFrame1.getContentPane(); //======== scrollPane1 ======== { //---- label8 ---- architectureLabel.setText("Architecture Information"); scrollPane1.setViewportView(architectureLabel); } GroupLayout internalFrame1ContentPaneLayout = new GroupLayout( internalFrame1ContentPane); internalFrame1ContentPane.setLayout(internalFrame1ContentPaneLayout); internalFrame1ContentPaneLayout.setHorizontalGroup( internalFrame1ContentPaneLayout.createParallelGroup() .addGroup(internalFrame1ContentPaneLayout .createSequentialGroup().addContainerGap() .addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE) .addContainerGap())); internalFrame1ContentPaneLayout.setVerticalGroup( internalFrame1ContentPaneLayout.createParallelGroup() .addGroup(internalFrame1ContentPaneLayout .createSequentialGroup().addContainerGap() .addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE) .addContainerGap())); } peerInfoStatus1.add(internalFrame1, JLayeredPane.DEFAULT_LAYER); internalFrame1.setBounds(15, 0, 365, 160); } //---- graphicONcheckBox ---- graphicONcheckBox.setText("Graphic ON"); //---- advancedConfirmBut ---- advancedConfirmBut.setIcon(new ImageIcon("resources/image/ok.png")); GroupLayout peerInfoStatusLayout = new GroupLayout(peerInfoStatus); peerInfoStatus.setLayout(peerInfoStatusLayout); peerInfoStatusLayout.setHorizontalGroup(peerInfoStatusLayout .createParallelGroup() .addGroup(peerInfoStatusLayout.createSequentialGroup() .addGroup(peerInfoStatusLayout.createParallelGroup() .addGroup(peerInfoStatusLayout.createSequentialGroup() .addGap(26, 26, 26) .addComponent(graphicONcheckBox) .addGap(73, 73, 73) .addComponent(jComboBoxNumRegionXPeer, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(80, 80, 80) .addComponent(advancedConfirmBut, GroupLayout.PREFERRED_SIZE, 33, GroupLayout.PREFERRED_SIZE)) .addGroup(peerInfoStatusLayout.createSequentialGroup() .addContainerGap().addComponent(peerInfoStatus1, GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE))) .addContainerGap())); peerInfoStatusLayout.setVerticalGroup(peerInfoStatusLayout.createParallelGroup() .addGroup(peerInfoStatusLayout.createSequentialGroup() .addComponent(peerInfoStatus1, GroupLayout.PREFERRED_SIZE, 175, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(peerInfoStatusLayout .createParallelGroup(GroupLayout.Alignment.TRAILING) .addGroup(GroupLayout.Alignment.LEADING, peerInfoStatusLayout .createParallelGroup( GroupLayout.Alignment.BASELINE) .addComponent(graphicONcheckBox) .addComponent(jComboBoxNumRegionXPeer, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addComponent(advancedConfirmBut, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)) .addContainerGap(16, Short.MAX_VALUE))); } GroupLayout jPanelAdvancedMainLayout = new GroupLayout(jPanelAdvancedMain); jPanelAdvancedMain.setLayout(jPanelAdvancedMainLayout); jPanelAdvancedMainLayout.setHorizontalGroup(jPanelAdvancedMainLayout .createParallelGroup() .addGroup(jPanelAdvancedMainLayout.createSequentialGroup().addContainerGap() .addComponent(scrollPaneTree, GroupLayout.PREFERRED_SIZE, 207, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(peerInfoStatus, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); jPanelAdvancedMainLayout.setVerticalGroup(jPanelAdvancedMainLayout .createParallelGroup() .addGroup(GroupLayout.Alignment.TRAILING, jPanelAdvancedMainLayout .createSequentialGroup().addContainerGap() .addGroup(jPanelAdvancedMainLayout .createParallelGroup(GroupLayout.Alignment.TRAILING) .addComponent(peerInfoStatus, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(scrollPaneTree, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)) .addContainerGap())); } //======== jPanelSetButton2 ======== { //---- buttonSetConfigDefault2 ---- buttonSetConfigDefault2.setText("Set"); GroupLayout jPanelSetButton2Layout = new GroupLayout(jPanelSetButton2); jPanelSetButton2.setLayout(jPanelSetButton2Layout); jPanelSetButton2Layout.setHorizontalGroup(jPanelSetButton2Layout .createParallelGroup().addGroup(GroupLayout.Alignment.TRAILING, jPanelSetButton2Layout.createSequentialGroup() .addContainerGap(522, Short.MAX_VALUE) .addComponent(buttonSetConfigDefault2, GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE) .addGap(72, 72, 72))); jPanelSetButton2Layout.setVerticalGroup(jPanelSetButton2Layout.createParallelGroup() .addGroup(GroupLayout.Alignment.TRAILING, jPanelSetButton2Layout.createSequentialGroup() .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(buttonSetConfigDefault2).addContainerGap())); } GroupLayout jPanelAdvancedLayout = new GroupLayout(jPanelAdvanced); jPanelAdvancedLayout.setHorizontalGroup(jPanelAdvancedLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelAdvancedLayout.createSequentialGroup() .addGroup(jPanelAdvancedLayout.createParallelGroup(Alignment.LEADING) .addComponent(jPanelAdvancedMain, GroupLayout.DEFAULT_SIZE, 689, Short.MAX_VALUE) .addComponent(jPanelSetButton2, GroupLayout.PREFERRED_SIZE, 681, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jPanelAdvancedLayout.setVerticalGroup(jPanelAdvancedLayout .createParallelGroup(Alignment.TRAILING) .addGroup(jPanelAdvancedLayout.createSequentialGroup().addContainerGap() .addComponent(jPanelAdvancedMain, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(18).addComponent(jPanelSetButton2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))); jPanelAdvanced.setLayout(jPanelAdvancedLayout); } tabbedPane2.addTab("Advanced", jPanelAdvanced); } //======== panelConsole ======== { //======== scrollPane3 ======== { //---- textField1 ---- notifyArea.setEditable(false); DefaultCaret caret = (DefaultCaret) notifyArea.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); scrollPane3.setViewportView(notifyArea); } GroupLayout panelConsoleLayout = new GroupLayout(panelConsole); panelConsole.setLayout(panelConsoleLayout); panelConsoleLayout.setHorizontalGroup(panelConsoleLayout.createParallelGroup() .addGroup(panelConsoleLayout.createParallelGroup() .addGroup(panelConsoleLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(scrollPane3, GroupLayout.PREFERRED_SIZE, 679, GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) .addGap(0, 679, Short.MAX_VALUE)); panelConsoleLayout.setVerticalGroup(panelConsoleLayout.createParallelGroup() .addGroup(panelConsoleLayout.createParallelGroup() .addGroup(panelConsoleLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(scrollPane3, GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) .addGap(0, 76, Short.MAX_VALUE)); } GroupLayout jPanelContainerTabbedPaneLayout = new GroupLayout(jPanelContainerTabbedPane); jPanelContainerTabbedPaneLayout.setHorizontalGroup(jPanelContainerTabbedPaneLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelContainerTabbedPaneLayout.createSequentialGroup().addContainerGap() .addGroup(jPanelContainerTabbedPaneLayout.createParallelGroup(Alignment.LEADING) .addComponent(tabbedPane2, GroupLayout.PREFERRED_SIZE, 686, GroupLayout.PREFERRED_SIZE) .addComponent(panelConsole, GroupLayout.DEFAULT_SIZE, 708, Short.MAX_VALUE)) .addContainerGap())); jPanelContainerTabbedPaneLayout.setVerticalGroup(jPanelContainerTabbedPaneLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelContainerTabbedPaneLayout.createSequentialGroup().addGap(3) .addComponent(tabbedPane2, GroupLayout.PREFERRED_SIZE, 384, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panelConsole, GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE))); jPanelContainerTabbedPane.setLayout(jPanelContainerTabbedPaneLayout); } { jPanelDeploying = new JPanel(); tabbedPane2.addTab("Simulation Jar", null, jPanelDeploying, null); GroupLayout jPanelDeployingLayout = new GroupLayout(jPanelDeploying); jPanelDeploying.setLayout(jPanelDeployingLayout); { jButtonLoadJar = new JButton(); jButtonLoadJar.setText("Load Jar"); jButtonLoadJar.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { if (simulationFile != null) { File dest = new File(FTP_HOME + dirSeparator + SIMULATION_DIR + dirSeparator + simulationFile.getName()); try { FileUtils.copyFile(simulationFile, dest); Digester dg = new Digester(DigestAlgorithm.MD5); InputStream in = new FileInputStream(dest); Properties prop = new Properties(); try { prop.setProperty("MD5", dg.getDigest(in)); String fileName = FilenameUtils .removeExtension(simulationFile.getName()); //save properties to project root folder prop.store(new FileOutputStream(FTP_HOME + dirSeparator + SIMULATION_DIR + dirSeparator + fileName + ".hash"), null); } catch (IOException ex) { ex.printStackTrace(); } System.out.println("MD5: " + dg.getDigest(in)); loadSimulation(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }); } jPanelDeployingLayout.setVerticalGroup(jPanelDeployingLayout.createSequentialGroup() .addGap(22, 22, 22) .addGroup(jPanelDeployingLayout.createParallelGroup().addGroup( GroupLayout.Alignment.LEADING, jPanelDeployingLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jButtonLoadJar, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(getJTextFieldPathSimJar(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)) .addComponent(getJButtonChoseSimJar(), GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 286, GroupLayout.PREFERRED_SIZE)); jPanelDeployingLayout .setHorizontalGroup(jPanelDeployingLayout.createSequentialGroup().addGap(22, 22, 22) .addComponent(getJTextFieldPathSimJar(), GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(getJButtonChoseSimJar(), GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE) .addGap(24) .addComponent(jButtonLoadJar, GroupLayout.PREFERRED_SIZE, 146, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 155, Short.MAX_VALUE)); } jPanelRunBatchTests = new JPanel(); tabbedPane2.addTab("Run batch tests", null, jPanelRunBatchTests, null); JLabel lblSelectConfigurationFile = new JLabel("Select configuration file:"); textFieldConfigFilePath = new JTextField(); textFieldConfigFilePath.setColumns(10); JButton buttonChooseConfigFile = new JButton(); buttonChooseConfigFile.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { configFile = showFileChooser(); if (configFile != null) textFieldConfigFilePath.setText(configFile.getAbsolutePath()); } }); buttonChooseConfigFile.setIcon(new ImageIcon("it/isislab/dmason/resources/image/openFolder.png")); JButton buttonLoadConfig = new JButton("Start"); buttonLoadConfig.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { if (configFile.getName().contains(".xml")) { ClassLoader.getSystemClassLoader(); //File xsd = new File(xsdFilename); InputStream xsd = new FileInputStream("resources/batch/batchSchema.xsd"); if (xsd != null) { if (validateXML(configFile, xsd)) { Batch batch = loadConfigFromXML(configFile); if (batch != null) { textAreaBatchInfo.append(configFile.getName() + " loaded.\n"); if (batch.getNeededWorkers() > peers.size() || batch.getNeededWorkers() == 0) JOptionPane.showMessageDialog(DMasonMaster.this, "There are not enough workers to start the simulation"); else { textAreaBatchInfo .append("Simulation: " + batch.getSimulationName() + "\n"); textAreaBatchInfo.append( "Needed Worker: " + batch.getNeededWorkers() + "\n"); textAreaBatchInfo.append("Balance: " + batch.isBalanced() + "\n"); Set<List<EntryParam<String, Object>>> testList = generateTestsFrom( batch); textAreaBatchInfo .append("--------------------------------------\n"); textAreaBatchInfo .append("Number of experiments: " + testList.size() + "\n"); ConcurrentLinkedQueue<List<EntryParam<String, Object>>> testQueue = new ConcurrentLinkedQueue<List<EntryParam<String, Object>>>(); for (List<EntryParam<String, Object>> test : testList) testQueue.offer(test); //System.out.println("Test queue: "+testQueue.size()); try { List<List<EntryWorkerScore<Integer, String>>> workersPartition = Util .chopped(scoreList, batch.getNeededWorkers()); //System.out.println(workersPartition.toString()); testCount.set(0); totalTests = testList.size(); progressBarBatchTest.setValue(0); progressBarBatchTest.setString("0 %"); progressBarBatchTest.setStringPainted(true); batchLogger = Logger .getLogger(BatchExecutor.class.getCanonicalName()); batchStartedTime = System.currentTimeMillis(); textAreaBatchInfo.append("Batch started at: " + Util.getCurrentDateTime(batchStartedTime) + "\n"); textAreaBatchInfo .append("--------------------------------------\n"); batchLogger.debug("Started at: " + batchStartedTime); int i = 1; BatchExecutor batchExec; for (List<EntryWorkerScore<Integer, String>> workers : workersPartition) { try { batchExec = new BatchExecutor(batch.getSimulationName(), batch.isBalanced(), testQueue, master, connection, root.getChildCount(), getFPTAddress(), workers, "Batch" + i, 1, textAreaBatchInfo); batchExec.getObservable() .addObserver(DMasonMaster.this); batchExec.start(); //Thread.sleep(2000); //textAreaBatchInfo.append("Batch Executor "+i+" started\n"); i++; //not paraller simulation, I use only one batch executor if (!chckbxParallelBatch.isSelected()) break; } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } } catch (Exception e3) { // TODO Auto-generated catch block e3.printStackTrace(); } } } else JOptionPane.showMessageDialog(DMasonMaster.this, "Error when loading config file"); } else JOptionPane.showMessageDialog(DMasonMaster.this, "The configuration file is not a valid file"); } else JOptionPane.showMessageDialog(DMasonMaster.this, xsdFilename + " not exists, can't validate configuration file."); } else JOptionPane.showMessageDialog(DMasonMaster.this, "The file " + configFile.getName() + "is not a configuration file."); } catch (HeadlessException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } }); JPanel panel = new JPanel(); panel.setBorder( new TitledBorder(null, "Batch Status", TitledBorder.LEADING, TitledBorder.TOP, null, null)); chckbxParallelBatch = new JCheckBox("Parallel Batch"); GroupLayout gl_jPanelRunBatchTests = new GroupLayout(jPanelRunBatchTests); gl_jPanelRunBatchTests.setHorizontalGroup(gl_jPanelRunBatchTests .createParallelGroup(Alignment.LEADING) .addGroup(gl_jPanelRunBatchTests.createSequentialGroup().addContainerGap() .addGroup(gl_jPanelRunBatchTests.createParallelGroup(Alignment.LEADING) .addGroup(gl_jPanelRunBatchTests.createSequentialGroup() .addComponent(lblSelectConfigurationFile, GroupLayout.PREFERRED_SIZE, 139, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(textFieldConfigFilePath, GroupLayout.PREFERRED_SIZE, 250, GroupLayout.PREFERRED_SIZE) .addGap(10).addComponent(buttonChooseConfigFile, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_jPanelRunBatchTests.createSequentialGroup() .addComponent(chckbxParallelBatch).addGap(18) .addComponent(buttonLoadConfig)) .addComponent(panel, GroupLayout.PREFERRED_SIZE, 666, GroupLayout.PREFERRED_SIZE)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); gl_jPanelRunBatchTests.setVerticalGroup(gl_jPanelRunBatchTests .createParallelGroup(Alignment.LEADING) .addGroup(gl_jPanelRunBatchTests.createSequentialGroup().addContainerGap() .addGroup(gl_jPanelRunBatchTests.createParallelGroup(Alignment.TRAILING) .addComponent(buttonChooseConfigFile, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldConfigFilePath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(lblSelectConfigurationFile)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_jPanelRunBatchTests.createParallelGroup(Alignment.BASELINE) .addComponent(chckbxParallelBatch).addComponent(buttonLoadConfig)) .addPreferredGap(ComponentPlacement.RELATED, 14, Short.MAX_VALUE) .addComponent(panel, GroupLayout.PREFERRED_SIZE, 261, GroupLayout.PREFERRED_SIZE) .addContainerGap())); progressBarBatchTest = new JProgressBar(); JLabel lblProgress = new JLabel("Progress:"); GroupLayout gl_panel = new GroupLayout(panel); gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addGroup(gl_panel .createSequentialGroup().addContainerGap() .addGroup(gl_panel.createParallelGroup(Alignment.LEADING) .addComponent(scrollPane4, GroupLayout.DEFAULT_SIZE, 641, Short.MAX_VALUE) .addGroup(gl_panel.createSequentialGroup().addComponent(lblProgress).addGap(18) .addComponent(progressBarBatchTest, GroupLayout.PREFERRED_SIZE, 169, GroupLayout.PREFERRED_SIZE))) .addContainerGap())); gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel.createSequentialGroup().addContainerGap() .addGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(lblProgress) .addComponent(progressBarBatchTest, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(scrollPane4, GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel.setLayout(gl_panel); jPanelRunBatchTests.setLayout(gl_jPanelRunBatchTests); GroupLayout jPanelSetDistributionLayout = new GroupLayout(jPanelSetDistribution); jPanelSetDistributionLayout .setHorizontalGroup( jPanelSetDistributionLayout.createParallelGroup(Alignment.LEADING) .addGroup(jPanelSetDistributionLayout.createSequentialGroup() .addComponent(jPanelSettings, GroupLayout.PREFERRED_SIZE, 254, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(jPanelContainerTabbedPane, GroupLayout.PREFERRED_SIZE, 707, GroupLayout.PREFERRED_SIZE) .addContainerGap(21, Short.MAX_VALUE))); jPanelSetDistributionLayout.setVerticalGroup(jPanelSetDistributionLayout .createParallelGroup(Alignment.LEADING) .addGroup(jPanelSetDistributionLayout.createSequentialGroup() .addGroup(jPanelSetDistributionLayout.createParallelGroup(Alignment.LEADING) .addComponent(jPanelSettings, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jPanelContainerTabbedPane, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jPanelSetDistribution.setLayout(jPanelSetDistributionLayout); } textAreaBatchInfo = new JTextArea(); textAreaBatchInfo.setEditable(false); DefaultCaret caret = (DefaultCaret) textAreaBatchInfo.getCaret(); caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE); scrollPane4.setViewportView(textAreaBatchInfo); //---- jLabelPlayButton ---- jLabelPlayButton.setIcon(new ImageIcon("resources/image/NotStopped.png")); //---- jLabelPauseButton ---- jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOff.png")); //---- labelStopButton ---- jLabelPlayButton.setIcon(new ImageIcon("image/NotPlaying.png")); jLabelPlayButton.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent arg0) { } @Override public void mousePressed(MouseEvent arg0) { } @Override public void mouseExited(MouseEvent arg0) { } @Override public void mouseEntered(MouseEvent arg0) { } @Override public void mouseClicked(MouseEvent arg0) { jLabelPlayButton.setIcon(new ImageIcon("resources/image/Playing.png")); jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOff.png")); jLabelStopButton.setIcon(new ImageIcon("resources/image/NotStopped.png")); jLabelResetButton.setIcon(new ImageIcon("resources/image/NotReload.png")); try { master.play(); } catch (Exception e) { e.printStackTrace(); } } }); //---- labelStopButton2 ---- jLabelStopButton.setIcon(new ImageIcon("resources/image/NotStopped.png")); jLabelStopButton.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseClicked(MouseEvent e) { jLabelStopButton.setIcon(new ImageIcon("resources/image/Stopped.png")); jLabelPlayButton.setIcon(new ImageIcon("resources/image/NotPlaying.png")); jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOff.png")); try { Address FTPAddress = getFPTAddress(); if (FTPAddress != null) { UpdateData ud = new UpdateData("", FTPAddress); master.stop(ud); } } catch (Exception e1) { e1.printStackTrace(); } } }); //---- labelPauseButton ---- jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOff.png")); jLabelPauseButton.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseClicked(MouseEvent e) { jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOn.png")); jLabelStopButton.setIcon(new ImageIcon("resources/image/NotStopped.png")); jLabelPlayButton.setIcon(new ImageIcon("resources/image/NotPlaying.png")); try { master.pause(); } catch (Exception e1) { e1.printStackTrace(); } } }); //======== jPanelNumStep ======== { GroupLayout jPanelNumStepLayout = new GroupLayout(jPanelNumStep); jPanelNumStepLayout.setHorizontalGroup( jPanelNumStepLayout.createParallelGroup(Alignment.TRAILING).addGap(0, 25, Short.MAX_VALUE)); jPanelNumStepLayout.setVerticalGroup( jPanelNumStepLayout.createParallelGroup(Alignment.LEADING).addGap(0, 28, Short.MAX_VALUE)); jPanelNumStep.setLayout(jPanelNumStepLayout); jPanelNumStep.setPreferredSize(new java.awt.Dimension(89, 23)); } { jLabelResetButton = new JLabel(); jLabelResetButton.setIcon(new ImageIcon("resources/image/NotReload.png")); jLabelResetButton.setPreferredSize(new java.awt.Dimension(20, 20)); jLabelResetButton.setVisible(enableReset); } // for resetting simulation jLabelResetButton.addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent arg0) { if (connected) { jLabelStopButton.setIcon(new ImageIcon("resources/image/NotStopped.png")); jLabelPlayButton.setIcon(new ImageIcon("resources/image/NotPlaying.png")); jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOff.png")); jLabelResetButton.setIcon(new ImageIcon("resources/image/Reload.png")); //send message to workers for resetting simulation try { master.reset(); } catch (Exception e1) { e1.printStackTrace(); } //clean up topic from AcitveMQ connection.resetTopic(); setSystemSettingsEnabled(true); notifyArea.append("Simulation resetted\n"); } } @Override public void mouseEntered(MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseExited(MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mousePressed(MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseReleased(MouseEvent arg0) { // TODO Auto-generated method stub } }); writeStepLabel = new JLabel(); writeStepLabel.setText("0"); lblTotalSteps = new JLabel("Steps:"); GroupLayout panelMainLayout = new GroupLayout(panelMain); panelMainLayout.setHorizontalGroup(panelMainLayout.createParallelGroup(Alignment.LEADING) .addGroup(panelMainLayout.createSequentialGroup() .addComponent(jPanelContainerSettings, GroupLayout.PREFERRED_SIZE, 0, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(panelMainLayout.createParallelGroup(Alignment.LEADING) .addComponent(jPanelSetDistribution, 0, 986, Short.MAX_VALUE) .addGroup(panelMainLayout.createSequentialGroup().addGap(636) .addGroup(panelMainLayout.createParallelGroup(Alignment.TRAILING) .addComponent(jLabelStep, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addGroup(panelMainLayout.createSequentialGroup() .addComponent(lblTotalSteps) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(writeStepLabel))) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(jPanelNumStep, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addGroup(panelMainLayout.createParallelGroup(Alignment.LEADING) .addGroup(panelMainLayout.createSequentialGroup().addGap(24) .addComponent(jLabelPlayButton, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(jLabelPauseButton, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(jLabelStopButton, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)) .addGroup(panelMainLayout.createSequentialGroup().addGap(116) .addComponent(jLabelResetButton, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE))))) .addGap(12)) .addComponent(jPanelContainerConnection, 0, 1004, Short.MAX_VALUE)); panelMainLayout.setVerticalGroup(panelMainLayout.createParallelGroup(Alignment.LEADING) .addGroup(panelMainLayout.createSequentialGroup() .addComponent(jPanelContainerConnection, GroupLayout.PREFERRED_SIZE, 71, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(panelMainLayout.createParallelGroup(Alignment.LEADING) .addComponent(jPanelSetDistribution, GroupLayout.PREFERRED_SIZE, 518, GroupLayout.PREFERRED_SIZE) .addGroup(panelMainLayout.createSequentialGroup().addGap(29).addComponent( jPanelContainerSettings, GroupLayout.PREFERRED_SIZE, 489, GroupLayout.PREFERRED_SIZE))) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(panelMainLayout.createParallelGroup(Alignment.LEADING) .addComponent(jLabelStopButton, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabelPlayButton, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabelPauseButton, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabelResetButton, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE) .addGroup(panelMainLayout.createParallelGroup(Alignment.BASELINE) .addComponent(writeStepLabel, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE) .addComponent(lblTotalSteps)) .addGroup(panelMainLayout.createSequentialGroup() .addComponent(jLabelStep, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(jPanelNumStep, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE))) .addContainerGap(13, Short.MAX_VALUE))); panelMain.setLayout(panelMainLayout); } GroupLayout contentPaneLayout = new GroupLayout(contentPane); contentPaneLayout.setHorizontalGroup( contentPaneLayout.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING, contentPaneLayout .createSequentialGroup().addContainerGap().addComponent(panelMain, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); contentPaneLayout.setVerticalGroup( contentPaneLayout.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING, contentPaneLayout.createSequentialGroup().addContainerGap().addComponent(panelMain, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); contentPane.setLayout(contentPaneLayout); pack(); setLocationRelativeTo(null); refreshServerLabel.setVisible(false); jButtonChoseSimJar.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { simulationFile = showFileChooser(); if (simulationFile != null) jTextFieldPathSimJar.setText(simulationFile.getAbsolutePath()); } }); }