List of usage examples for javax.swing WindowConstants EXIT_ON_CLOSE
int EXIT_ON_CLOSE
To view the source code for javax.swing WindowConstants EXIT_ON_CLOSE.
Click Source Link
From source file:mainpackage.FrmXuatThongTin.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//from ww w . j a v a 2 s. com */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jTabbedPane1 = new javax.swing.JTabbedPane(); pnMap = new javax.swing.JPanel(); map = new org.openstreetmap.gui.jmapviewer.JMapViewer(); btnZoomIn = new javax.swing.JButton(); btnZoomOut = new javax.swing.JButton(); pnCommand = new javax.swing.JPanel(); btnStartStop = new javax.swing.JButton(); btnExit = new javax.swing.JButton(); btnRunMotor = new javax.swing.JButton(); lblCommand = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); txtaDataInfo = new javax.swing.JTextArea(); lblDataInformation = new javax.swing.JLabel(); lblDate = new javax.swing.JLabel(); lblDisplayDate = new javax.swing.JLabel(); pnTable = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); tblDatabase = new javax.swing.JTable(); jScrollPane3 = new javax.swing.JScrollPane(); txtaTestPacket = new javax.swing.JTextArea(); pnGraph = new javax.swing.JPanel(); cbbGraphSelection = new javax.swing.JComboBox(); pnDisplayGraph = new javax.swing.JPanel(); lblTitle = new javax.swing.JLabel(); lblLogoBachKhoa = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jTabbedPane1.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N pnMap.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); pnMap.add(map, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 840, 510)); btnZoomIn.setFont(new java.awt.Font("Times New Roman", 0, 24)); // NOI18N btnZoomIn.setText("Zoom in"); btnZoomIn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomInActionPerformed(evt); } }); pnMap.add(btnZoomIn, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 520, -1, -1)); btnZoomOut.setFont(new java.awt.Font("Times New Roman", 0, 24)); // NOI18N btnZoomOut.setText("Zoom out"); btnZoomOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZoomOutActionPerformed(evt); } }); pnMap.add(btnZoomOut, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 520, -1, -1)); pnCommand.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 255))); btnStartStop.setFont(new java.awt.Font("Times New Roman", 0, 24)); // NOI18N btnStartStop.setText("Start"); btnStartStop.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnStartStopActionPerformed(evt); } }); pnCommand.add(btnStartStop); btnExit.setFont(new java.awt.Font("Times New Roman", 0, 24)); // NOI18N btnExit.setText("Exit"); btnExit.setMaximumSize(new java.awt.Dimension(85, 37)); btnExit.setMinimumSize(new java.awt.Dimension(85, 37)); btnExit.setPreferredSize(new java.awt.Dimension(85, 37)); btnExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnExitActionPerformed(evt); } }); pnCommand.add(btnExit); btnRunMotor.setFont(new java.awt.Font("Times New Roman", 0, 24)); // NOI18N btnRunMotor.setText("Run motor"); btnRunMotor.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnRunMotorActionPerformed(evt); } }); pnCommand.add(btnRunMotor); pnMap.add(pnCommand, new org.netbeans.lib.awtextra.AbsoluteConstraints(890, 50, 210, 100)); lblCommand.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N lblCommand.setText("Command"); pnMap.add(lblCommand, new org.netbeans.lib.awtextra.AbsoluteConstraints(890, 30, -1, -1)); txtaDataInfo.setColumns(20); txtaDataInfo.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N txtaDataInfo.setRows(5); jScrollPane1.setViewportView(txtaDataInfo); pnMap.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(890, 190, 210, 270)); lblDataInformation.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N lblDataInformation.setText("Node Information"); pnMap.add(lblDataInformation, new org.netbeans.lib.awtextra.AbsoluteConstraints(890, 170, -1, -1)); lblDate.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N lblDate.setText("Date"); pnMap.add(lblDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(890, 480, -1, -1)); pnMap.add(lblDisplayDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(890, 510, -1, -1)); jTabbedPane1.addTab("Map", pnMap); pnTable.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); tblDatabase.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); tblDatabase.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N tblDatabase.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null, null, null, null } }, new String[] { "Node ID", "Address", "Location", "Temperature", "Humidity", "Signal Strength", "Timer" })); jScrollPane2.setViewportView(tblDatabase); pnTable.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, 1080, 170)); txtaTestPacket.setColumns(20); txtaTestPacket.setRows(5); jScrollPane3.setViewportView(txtaTestPacket); pnTable.add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 300, 300, 260)); jTabbedPane1.addTab("Table", pnTable); pnGraph.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); cbbGraphSelection.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--Ch?n Node--" })); cbbGraphSelection.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cbbGraphSelectionActionPerformed(evt); } }); pnGraph.add(cbbGraphSelection, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 10, -1, -1)); pnDisplayGraph.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); pnGraph.add(pnDisplayGraph, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 40, 1130, 530)); jTabbedPane1.addTab("Graph", pnGraph); getContentPane().add(jTabbedPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 117, 1140, 610)); lblTitle.setFont(new java.awt.Font("Wide Latin", 1, 48)); // NOI18N lblTitle.setForeground(new java.awt.Color(255, 51, 51)); lblTitle.setText("Smart Agriculture"); getContentPane().add(lblTitle, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 40, -1, -1)); lblLogoBachKhoa.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mainpackage/LogoBachKhoa.png"))); // NOI18N getContentPane().add(lblLogoBachKhoa, new org.netbeans.lib.awtextra.AbsoluteConstraints(930, 0, 130, 140)); setBounds(0, 0, 1150, 768); }
From source file:analisis_proyecto1.Ventana_principal.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.// w w w . j ava 2s. co m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { HeapSort = new javax.swing.JDialog(); jLabel4 = new javax.swing.JLabel(); numbers = new javax.swing.JSpinner(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jLabel6 = new javax.swing.JLabel(); simulacion_heap = new javax.swing.JDialog(); par_cercano = new javax.swing.JDialog(); jLabel8 = new javax.swing.JLabel(); coor_y = new javax.swing.JSpinner(); coor_x = new javax.swing.JSpinner(); jLabel9 = new javax.swing.JLabel(); jButton6 = new javax.swing.JButton(); jLabel10 = new javax.swing.JLabel(); jButton5 = new javax.swing.JButton(); jLabel7 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jLabel5 = new javax.swing.JLabel(); HeapSort.getContentPane().setLayout(null); jLabel4.setFont(new java.awt.Font("Consolas", 1, 18)); // NOI18N jLabel4.setForeground(new java.awt.Color(240, 240, 240)); jLabel4.setText("Agregar elementos del arreglo"); HeapSort.getContentPane().add(jLabel4); jLabel4.setBounds(70, 30, 300, 46); numbers.setModel(new javax.swing.SpinnerNumberModel()); HeapSort.getContentPane().add(numbers); numbers.setBounds(390, 30, 56, 38); jButton3.setText("Agregar"); jButton3.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton3MouseClicked(evt); } }); HeapSort.getContentPane().add(jButton3); jButton3.setBounds(250, 120, 104, 40); jButton4.setText("Continuar"); jButton4.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton4MouseClicked(evt); } }); HeapSort.getContentPane().add(jButton4); jButton4.setBounds(380, 120, 87, 40); jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/image2.png"))); // NOI18N HeapSort.getContentPane().add(jLabel6); jLabel6.setBounds(0, -310, 1070, 530); javax.swing.GroupLayout simulacion_heapLayout = new javax.swing.GroupLayout( simulacion_heap.getContentPane()); simulacion_heap.getContentPane().setLayout(simulacion_heapLayout); simulacion_heapLayout.setHorizontalGroup(simulacion_heapLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 804, Short.MAX_VALUE)); simulacion_heapLayout.setVerticalGroup(simulacion_heapLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 439, Short.MAX_VALUE)); par_cercano.getContentPane().setLayout(null); jLabel8.setFont(new java.awt.Font("Consolas", 1, 18)); // NOI18N jLabel8.setForeground(new java.awt.Color(240, 240, 240)); jLabel8.setText("Ingrese la coordenada X y Y de cada punto:"); par_cercano.getContentPane().add(jLabel8); jLabel8.setBounds(140, 0, 430, 60); par_cercano.getContentPane().add(coor_y); coor_y.setBounds(350, 90, 60, 40); par_cercano.getContentPane().add(coor_x); coor_x.setBounds(260, 90, 60, 40); jLabel9.setFont(new java.awt.Font("Consolas", 1, 18)); // NOI18N jLabel9.setForeground(new java.awt.Color(240, 240, 240)); jLabel9.setText("X"); par_cercano.getContentPane().add(jLabel9); jLabel9.setBounds(290, 60, 40, 30); jButton6.setFont(new java.awt.Font("Consolas", 1, 18)); // NOI18N jButton6.setText("Continuar"); jButton6.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton6MouseClicked(evt); } }); par_cercano.getContentPane().add(jButton6); jButton6.setBounds(330, 180, 130, 40); jLabel10.setFont(new java.awt.Font("Consolas", 1, 18)); // NOI18N jLabel10.setForeground(new java.awt.Color(240, 240, 240)); jLabel10.setText("Y"); par_cercano.getContentPane().add(jLabel10); jLabel10.setBounds(370, 60, 20, 30); jButton5.setFont(new java.awt.Font("Consolas", 1, 18)); // NOI18N jButton5.setText("Agregar"); jButton5.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton5MouseClicked(evt); } }); par_cercano.getContentPane().add(jButton5); jButton5.setBounds(180, 180, 110, 40); jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/image2.png"))); // NOI18N par_cercano.getContentPane().add(jLabel7); jLabel7.setBounds(-560, -330, 1390, 610); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); getContentPane().setLayout(null); jLabel1.setFont(new java.awt.Font("Consolas", 1, 36)); // NOI18N jLabel1.setForeground(new java.awt.Color(240, 240, 240)); jLabel1.setText("Analisis de Lagoritmos"); getContentPane().add(jLabel1); jLabel1.setBounds(10, 20, 500, 41); jLabel2.setFont(new java.awt.Font("Consolas", 1, 18)); // NOI18N jLabel2.setForeground(new java.awt.Color(240, 240, 240)); jLabel2.setText("Laurenn Alecxandra Cruz Vargas"); getContentPane().add(jLabel2); jLabel2.setBounds(20, 80, 410, 37); jLabel3.setFont(new java.awt.Font("Consolas", 1, 18)); // NOI18N jLabel3.setForeground(new java.awt.Color(240, 240, 240)); jLabel3.setText("11211190"); getContentPane().add(jLabel3); jLabel3.setBounds(120, 120, 136, 30); jButton1.setText("HeapSort"); jButton1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton1MouseClicked(evt); } }); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1); jButton1.setBounds(350, 160, 130, 42); jButton2.setText("Par mas cercano"); jButton2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton2MouseClicked(evt); } }); getContentPane().add(jButton2); jButton2.setBounds(350, 250, 130, 50); jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/lines-of-code.jpg"))); // NOI18N getContentPane().add(jLabel5); jLabel5.setBounds(-70, 0, 860, 380); pack(); }
From source file:stratego.neural.net.SimulatedAnnealing.java
private static void plotDataSet(List<NamedDataSet> ArraySetList, String name, String xAxis, String yAxis, boolean legend) throws IOException { String plot_title = name;//from www .ja v a2 s. co m XYSeriesCollection plotData = new XYSeriesCollection(); for (NamedDataSet ns : ArraySetList) { XYSeries series = new XYSeries(ns.getName()); double[] data = ns.getArray(); for (int i = 0; i < data.length; i++) { series.add((double) i, data[i]); } plotData.addSeries(series); } String title = plot_title; String xAxisLabel = xAxis; String yAxisLabel = yAxis; PlotOrientation orientation = PlotOrientation.VERTICAL; //boolean legend = true; // might wanna set this to true at some point, but research the library boolean tooltips = false; boolean urls = false; JFreeChart chart = ChartFactory.createScatterPlot(title, xAxisLabel, yAxisLabel, plotData, orientation, legend, tooltips, urls); JPanel panel = new ChartPanel(chart); JFrame f = new JFrame(); f.add(panel); f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); f.pack(); f.setTitle(plot_title); f.setVisible(true); // ChartUtilities.saveChartAsJPEG(new File("src/Graphs/test_graph_1.JPEG"),chart,1280,1024); }
From source file:com.farouk.projectapp.FirstGUI.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./* w w w. ja v a 2s . co m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel5 = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); DefaultTableModel a = new DefaultTableModel(); jTable2 = new javax.swing.JTable() { public boolean isCellEditable(int d, int c) { return false; } @Override public Component prepareRenderer(TableCellRenderer renderer, int row, int col) { Component comp = super.prepareRenderer(renderer, row, col); String value = getModel().getValueAt(row, 0).toString(); int a = SQLConnect.ifReported(userID, value); if (a == 1) { comp.setBackground(Color.red); } else { comp.setBackground(Color.white); comp.setForeground(Color.black); } return comp; } }; jButton5 = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jSeparator2 = new javax.swing.JSeparator(); jButton10 = new javax.swing.JButton(); jLabel10 = new javax.swing.JLabel(); jPanel15 = new javax.swing.JPanel(); jPanel16 = new javax.swing.JPanel(); jTextField6 = new javax.swing.JTextField(); jTextField7 = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); jButton13 = new javax.swing.JButton(); jButton14 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jPanel10 = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); jEditorPane1 = new javax.swing.JEditorPane(); jButton15 = new javax.swing.JButton(); jButton19 = new javax.swing.JButton(); jTextField4 = new javax.swing.JTextField(); jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jTextField1 = new javax.swing.JTextField(); jPanel3 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); jScrollPane5 = new javax.swing.JScrollPane(); jTable3 = new javax.swing.JTable() { public boolean isCellEditable(int d, int c) { return false; } }; jButton6 = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); jSeparator1 = new javax.swing.JSeparator(); jPanel8 = new javax.swing.JPanel(); jScrollPane3 = new javax.swing.JScrollPane(); DefaultListModel modelCompaniesName = new DefaultListModel(); try { for (String p : SQLConnect.getAllCompaniesNames()) { modelCompaniesName.addElement(p); } } catch (Exception e) { e.printStackTrace(); } jList1 = new javax.swing.JList(); jLabel3 = new javax.swing.JLabel(); jButton4 = new javax.swing.JButton(); jButton9 = new javax.swing.JButton(); jLabel9 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jButton8 = new javax.swing.JButton(); jPanel7 = new javax.swing.JPanel(); jTextField2 = new javax.swing.JTextField(); jPasswordField1 = new javax.swing.JPasswordField(); jButton11 = new javax.swing.JButton(); jButton12 = new javax.swing.JButton(); jPanel9 = new javax.swing.JPanel(); jLabel11 = new javax.swing.JLabel(); jButton17 = new javax.swing.JButton(); jLabel12 = new javax.swing.JLabel(); jButton18 = new javax.swing.JButton(); jTextField3 = new javax.swing.JTextField(); jLabel15 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); jMenuItem2 = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTabbedPane1.setToolTipText(""); jTabbedPane1.setMinimumSize(new java.awt.Dimension(150, 200)); jTabbedPane1.setPreferredSize(new java.awt.Dimension(200, 200)); jScrollPane1.setViewportView(jTable2); jTable2.setModel(a); try { UpdatejTable2(); } catch (Exception e) { e.printStackTrace(); } jTable2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTable2MouseClicked(evt); } }); jTable2.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { jTable2KeyReleased(evt); } }); jScrollPane1.setViewportView(jTable2); jButton5.setText("Refresh My Portfolio"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jLabel4.setText(" Last Refreshed : "); jButton10.setText("Refresh Company"); jButton10.setVisible(false); jButton10.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton10ActionPerformed(evt); } }); jLabel10.setText("Total is : " + String.valueOf(total.doubleValue()) + ""); jTextField6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField6ActionPerformed(evt); } }); jTextField6.setVisible(false); jTextField7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField7ActionPerformed(evt); } }); jLabel14.setText("N of Actions"); javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16); jPanel16.setLayout(jPanel16Layout); jPanel16Layout.setHorizontalGroup(jPanel16Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup() .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup() .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(34, 34, 34).addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel14)) .addGap(0, 3, Short.MAX_VALUE))); jPanel16Layout.setVerticalGroup(jPanel16Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel16Layout.createSequentialGroup() .addComponent(jLabel14) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(13, 13, 13))); jButton13.setText("Buy"); jButton13.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton13ActionPerformed(evt); } }); jButton14.setText("Sell"); jButton14.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton14ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15); jPanel15.setLayout(jPanel15Layout); jPanel15Layout .setHorizontalGroup( jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel15Layout.createSequentialGroup().addComponent(jButton13) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton14).addGap(166, 166, 166)) .addGroup(jPanel15Layout.createSequentialGroup() .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel15Layout .setVerticalGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel15Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel15Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton14).addComponent(jButton13)))); jButton7.setText("Get News !"); jButton7.setVisible(false); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); jButton3.setText("Report"); jButton3.setVisible(false); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jPanel10.setVisible(false); jScrollPane2.setViewportView(jEditorPane1); javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10); jPanel10.setLayout(jPanel10Layout); jPanel10Layout.setHorizontalGroup( jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( jPanel10Layout.createSequentialGroup().addGap(39, 39, 39).addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE))); jPanel10Layout.setVerticalGroup(jPanel10Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel10Layout .createSequentialGroup().addContainerGap().addComponent(jScrollPane2).addContainerGap())); jButton15.setText("Automate"); jButton15.setVisible(false); jButton15.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton15ActionPerformed(evt); } }); jButton19.setText("Alert"); jButton19.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton19ActionPerformed(evt); } }); jTextField4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField4ActionPerformed(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().addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1) .addGroup(jPanel6Layout.createSequentialGroup().addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel6Layout.createSequentialGroup().addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jButton19, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton3).addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel6Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() .addGroup(jPanel6Layout.createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel10) .addComponent(jButton10)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel6Layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton5) .addComponent(jLabel4))) .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel6Layout.createSequentialGroup().addGap(70, 70, 70) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 419, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))))) .addContainerGap())); jPanel6Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { jButton3, jTextField4 }); jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addComponent(jButton7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton15).addComponent(jButton3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel6Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jButton19) .addGroup(jPanel6Layout.createSequentialGroup().addGap(1, 1, 1) .addComponent(jTextField4))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(9, 9, 9)) .addGroup(jPanel6Layout.createSequentialGroup() .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel6Layout.createSequentialGroup() .addGroup(jPanel6Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton5).addComponent(jButton10)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel6Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4).addComponent(jLabel10)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())))); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); jTabbedPane1.addTab(" My Portfolio ", jPanel5); jTextField1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jButton1.setText("Search"); jButton1.setAlignmentY(0.3F); jButton1.setAutoscrolls(true); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Clear"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addGap(2, 2, 2) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jButton2) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton2)) .addContainerGap())); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(51, 51, 51))); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField1).addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jLabel1.setText("Name of Company to look for : "); jTable3.setModel(a); jScrollPane5.setViewportView(jTable3); jScrollPane5.setVisible(false); jButton6.setText("Refresh Company"); jButton6.setVisible(false); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jLabel2.setText(null); jLabel2.setVisible(false); 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(jScrollPane5) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2).addComponent(jButton6)))) .addContainerGap())); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup().addGap(5, 5, 5).addComponent(jButton6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(19, 19, 19))); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup().addGap(82, 82, 82) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1).addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 598, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 236, Short.MAX_VALUE))) .addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(36, 36, 36).addComponent(jLabel1) .addGap(18, 18, 18) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(210, Short.MAX_VALUE))); jTabbedPane1.addTab(" Search ", jPanel1); jList1.setModel(modelCompaniesName); jList1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jList1MouseClicked(evt); } }); jScrollPane3.setViewportView(jList1); jLabel3.setText(" List of Companies (NASDAQ)"); javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8); jPanel8.setLayout(jPanel8Layout); jPanel8Layout .setHorizontalGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addGroup(jPanel8Layout.createSequentialGroup().addComponent(jLabel3).addGap(0, 50, Short.MAX_VALUE))); jPanel8Layout.setVerticalGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup().addGap(5, 5, 5).addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent( jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 613, Short.MAX_VALUE))); jButton4.setText("Refresh All"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jButton9.setVisible(false); jButton9.setText("Quit"); jButton9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton9ActionPerformed(evt); } }); jLabel9.setText("All prices are in ."); jLabel8.setVisible(false); jButton8.setText("Stop"); jButton8.setVisible(false); jTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField2ActionPerformed(evt); } }); jPasswordField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPasswordField1ActionPerformed(evt); } }); jButton11.setText("Log in"); jButton11.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton11ActionPerformed(evt); } }); jButton12.setText("Create account"); jButton12.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton12ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout .setHorizontalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jPanel7Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { jPasswordField1, jTextField2 }); jPanel7Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { jButton11, jButton12 }); jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton11)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton12).addContainerGap())); jPanel7Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { jPasswordField1, jTextField2 }); jLabel11.setFont(new java.awt.Font("Tahoma", 0, 17)); // NOI18N jButton17.setText("Log out"); jButton17.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton17ActionPerformed(evt); } }); jButton18.setText("Change Limit"); jButton18.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton18ActionPerformed(evt); } }); jTextField3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField3ActionPerformed(evt); } }); jPanel9.setVisible(false); javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9); jPanel9.setLayout(jPanel9Layout); jPanel9Layout.setHorizontalGroup(jPanel9Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup() .addContainerGap(18, Short.MAX_VALUE) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel9Layout.createSequentialGroup() .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton18)) .addGroup(jPanel9Layout.createSequentialGroup() .addGroup(jPanel9Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup().addComponent(jLabel11) .addGap(30, 30, 30)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup().addComponent(jLabel12) .addGap(18, 18, 18))) .addComponent(jButton17))) .addGap(36, 36, 36))); jPanel9Layout.setVerticalGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup().addComponent(jLabel11) .addGap(18, 18, 18).addComponent(jLabel12)) .addComponent(jButton17)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup( jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jButton18).addGroup(jPanel9Layout.createSequentialGroup() .addGap(1, 1, 1).addComponent(jTextField3))) .addContainerGap())); jLabel6.setVisible(false); jMenu1.setText("File"); jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK)); jMenuItem1.setText("Quit"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu1.add(jMenuItem1); jMenuBar1.add(jMenu1); jMenu2.setText("Help"); jMenuItem2.setText("About"); jMenuItem2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem2ActionPerformed(evt); } }); jMenu2.add(jMenuItem2); jMenuBar1.add(jMenu2); 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().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup().addComponent(jButton4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton8))) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(jLabel6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel8).addGap(85, 85, 85).addComponent(jLabel7) .addGap(77, 77, 77).addComponent(jButton9)) .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 931, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup().addComponent(jLabel9) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(53, 53, 53).addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18)) .addGroup(layout.createSequentialGroup().addComponent(jLabel15) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton9).addComponent(jButton4).addComponent(jLabel8) .addComponent(jButton8).addComponent(jLabel6).addComponent(jLabel7)) .addContainerGap()) .addGroup(layout.createSequentialGroup().addGap(16, 16, 16).addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(68, 68, 68) .addComponent(jLabel9)) .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 515, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel15) .addGap(0, 0, Short.MAX_VALUE))); jTabbedPane1.getAccessibleContext().setAccessibleName(""); pack(); }
From source file:org.mahasen.client.gui.MahasenClient.java
/** * This method is called from within the constructor to * initialize the form./*w w w .ja v a 2s . com*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); clientTabbedPane = new javax.swing.JTabbedPane(); uploadPanel = new javax.swing.JPanel(); uploadFileChooserButton = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); uploadTagsTextField = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); uploadButton = new javax.swing.JButton(); jLabel16 = new javax.swing.JLabel(); javax.swing.JButton uploadAddPropertiesButton = new javax.swing.JButton(); jLabel20 = new javax.swing.JLabel(); folderStructureText = new javax.swing.JTextField(); downloadPanel = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); downloadTextField = new javax.swing.JTextField(); downloadButton = new javax.swing.JButton(); jLabel19 = new javax.swing.JLabel(); downloadRepoChooseButton = new javax.swing.JButton(); chosenDirectroyLabel = new javax.swing.JLabel(); deletePanel = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); deleteTextField = new javax.swing.JTextField(); deleteButton = new javax.swing.JButton(); searchPanel = new javax.swing.JPanel(); searchButton = new javax.swing.JButton(); jLabel8 = new javax.swing.JLabel(); rangeBasedPanel = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); initialValueTextField = new javax.swing.JTextField(); lastValueTextField = new javax.swing.JTextField(); jComboBox3 = new javax.swing.JComboBox(); customPropertyPanel2 = new javax.swing.JPanel(); jLabel11 = new javax.swing.JLabel(); customPropertyTextField2 = new javax.swing.JTextField(); propertryBasedPanel = new javax.swing.JPanel(); jLabel10 = new javax.swing.JLabel(); propertyValueTextField = new javax.swing.JTextField(); jLabel12 = new javax.swing.JLabel(); jComboBox2 = new javax.swing.JComboBox(); customPropertyPanel1 = new javax.swing.JPanel(); jLabel13 = new javax.swing.JLabel(); customPropertyTextField1 = new javax.swing.JTextField(); jComboBox1 = new javax.swing.JComboBox(); jLabel14 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); SearchResult = new javax.swing.JTextArea(); tagBasedPanel = new javax.swing.JPanel(); jLabel15 = new javax.swing.JLabel(); tagTextField = new javax.swing.JTextField(); advancedSearchButton = new javax.swing.JButton(); updatePanel = new javax.swing.JPanel(); updateButton = new javax.swing.JButton(); updateAddNewPropertyButton = new javax.swing.JButton(); updateTagsTextField = new javax.swing.JTextField(); jLabel9 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); updateFileNameTextField = new javax.swing.JTextField(); jLabel18 = new javax.swing.JLabel(); logoutButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); loggedInAsLabel = new javax.swing.JLabel(); userNameLabel = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Mahasen Client"); uploadFileChooserButton.setText("Choose a File :"); uploadFileChooserButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { uploadFileChooserButtonActionPerformed(evt); } }); jLabel2.setText("Tags :"); jLabel3.setText("(enter tags seperated by commas \",\")"); uploadButton.setText("Upload"); uploadButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { uploadButtonActionPerformed(evt); } }); uploadAddPropertiesButton.setText("Add Properties"); // NOI18N uploadAddPropertiesButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { uploadAddPropertiesButtonaddPropertiesButtonActionPerformed(evt); } }); jLabel20.setText("Folder Structure:"); javax.swing.GroupLayout uploadPanelLayout = new javax.swing.GroupLayout(uploadPanel); uploadPanel.setLayout(uploadPanelLayout); uploadPanelLayout.setHorizontalGroup(uploadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(uploadPanelLayout.createSequentialGroup().addContainerGap() .addGroup(uploadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(uploadFileChooserButton) .addGroup(uploadPanelLayout.createSequentialGroup().addGap(8, 8, 8) .addGroup(uploadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel20).addComponent(jLabel2)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE) .addGroup(uploadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(folderStructureText) .addComponent(jLabel16, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE) .addComponent(uploadTagsTextField, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(60, 60, 60)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, uploadPanelLayout.createSequentialGroup() .addGap(167, 167, 167) .addGroup(uploadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(uploadButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE) .addComponent(uploadAddPropertiesButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)) .addGap(165, 165, 165))); uploadPanelLayout.setVerticalGroup(uploadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(uploadPanelLayout.createSequentialGroup().addGap(74, 74, 74) .addGroup(uploadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(uploadFileChooserButton).addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(58, 58, 58) .addGroup(uploadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2).addComponent(uploadTagsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jLabel3) .addGap(22, 22, 22) .addGroup(uploadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(folderStructureText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel20)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 48, Short.MAX_VALUE) .addComponent(uploadAddPropertiesButton).addGap(18, 18, 18).addComponent(uploadButton) .addGap(60, 60, 60))); clientTabbedPane.addTab("Upload", uploadPanel); jLabel1.setText("Name of the File :"); downloadTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { downloadTextFieldActionPerformed(evt); } }); downloadButton.setText("Download"); downloadButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { downloadButtonActionPerformed(evt); } }); jLabel19.setText("Download Repo :"); downloadRepoChooseButton.setText("Choose Directory :"); downloadRepoChooseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { downloadRepoChooseButtonActionPerformed(evt); } }); chosenDirectroyLabel.setText("No Directory Chosen."); javax.swing.GroupLayout downloadPanelLayout = new javax.swing.GroupLayout(downloadPanel); downloadPanel.setLayout(downloadPanelLayout); downloadPanelLayout.setHorizontalGroup(downloadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(downloadPanelLayout.createSequentialGroup().addGroup(downloadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(downloadPanelLayout.createSequentialGroup().addGap(21, 21, 21) .addGroup(downloadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1).addComponent(jLabel19)) .addGap(18, 18, 18) .addGroup(downloadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(downloadPanelLayout.createSequentialGroup().addGap(16, 16, 16) .addComponent(chosenDirectroyLabel)) .addComponent(downloadRepoChooseButton).addComponent(downloadTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(downloadPanelLayout.createSequentialGroup().addGap(158, 158, 158).addComponent( downloadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(31, Short.MAX_VALUE))); downloadPanelLayout .setVerticalGroup(downloadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(downloadPanelLayout.createSequentialGroup().addGap(132, 132, 132) .addGroup(downloadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(downloadTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(19, 19, 19) .addGroup(downloadPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel19).addComponent(downloadRepoChooseButton)) .addGap(7, 7, 7).addComponent(chosenDirectroyLabel).addGap(37, 37, 37) .addComponent(downloadButton).addContainerGap(149, Short.MAX_VALUE))); clientTabbedPane.addTab("Download", downloadPanel); jLabel4.setText("Name of the FIle :"); deleteButton.setText("Delete"); deleteButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteButtonActionPerformed(evt); } }); javax.swing.GroupLayout deletePanelLayout = new javax.swing.GroupLayout(deletePanel); deletePanel.setLayout(deletePanelLayout); deletePanelLayout.setHorizontalGroup(deletePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(deletePanelLayout.createSequentialGroup() .addGroup(deletePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(deletePanelLayout.createSequentialGroup().addGap(23, 23, 23) .addComponent(jLabel4).addGap(18, 18, 18).addComponent(deleteTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(deletePanelLayout.createSequentialGroup().addGap(165, 165, 165) .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(30, Short.MAX_VALUE))); deletePanelLayout.setVerticalGroup(deletePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(deletePanelLayout.createSequentialGroup().addGap(133, 133, 133) .addGroup(deletePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(deleteTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) .addGap(101, 101, 101).addComponent(deleteButton).addContainerGap(152, Short.MAX_VALUE))); clientTabbedPane.addTab("Delete", deletePanel); searchButton.setText("Search"); searchButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { searchButtonActionPerformed(evt); } }); jLabel8.setText("Search results :"); rangeBasedPanel.setName("Panel1"); // NOI18N jLabel5.setText("Property Name"); jLabel6.setText("Initial Value"); jLabel7.setText("Last Value"); initialValueTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { initialValueTextFieldActionPerformed(evt); } }); jComboBox3.setModel(new javax.swing.DefaultComboBoxModel( new String[] { "File Name", "File Size", "Uploaded Date", "Custom Property" })); jComboBox3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jComboBox3ActionPerformed(evt); } }); jLabel11.setText("Custom Property Name"); customPropertyTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { customPropertyTextField2ActionPerformed(evt); } }); javax.swing.GroupLayout customPropertyPanel2Layout = new javax.swing.GroupLayout(customPropertyPanel2); customPropertyPanel2.setLayout(customPropertyPanel2Layout); customPropertyPanel2Layout.setHorizontalGroup(customPropertyPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(customPropertyPanel2Layout.createSequentialGroup().addGap(20, 20, 20) .addComponent(jLabel11) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE) .addComponent(customPropertyTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(31, 31, 31))); customPropertyPanel2Layout.setVerticalGroup(customPropertyPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(customPropertyPanel2Layout.createSequentialGroup().addContainerGap(18, Short.MAX_VALUE) .addGroup(customPropertyPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel11).addComponent(customPropertyTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))); javax.swing.GroupLayout rangeBasedPanelLayout = new javax.swing.GroupLayout(rangeBasedPanel); rangeBasedPanel.setLayout(rangeBasedPanelLayout); rangeBasedPanelLayout.setHorizontalGroup(rangeBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rangeBasedPanelLayout.createSequentialGroup().addGap(21, 21, 21).addComponent(jLabel5) .addGap(86, 86, 86).addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(customPropertyPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(rangeBasedPanelLayout.createSequentialGroup().addGap(18, 18, 18).addComponent(jLabel6) .addGap(110, 110, 110).addComponent(initialValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(rangeBasedPanelLayout.createSequentialGroup().addGap(18, 18, 18).addComponent(jLabel7) .addGap(117, 117, 117).addComponent(lastValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE))); rangeBasedPanelLayout.setVerticalGroup( rangeBasedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rangeBasedPanelLayout.createSequentialGroup().addGap(10, 10, 10) .addGroup(rangeBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rangeBasedPanelLayout.createSequentialGroup().addGap(7, 7, 7) .addComponent(jLabel5)) .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(8, 8, 8) .addComponent(customPropertyPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(14, 14, 14) .addGroup(rangeBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rangeBasedPanelLayout.createSequentialGroup().addGap(9, 9, 9) .addComponent(jLabel6)) .addComponent(initialValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(15, 15, 15) .addGroup(rangeBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rangeBasedPanelLayout.createSequentialGroup().addGap(6, 6, 6) .addComponent(jLabel7)) .addComponent(lastValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))); propertryBasedPanel.setName("propertryBasedPanel"); // NOI18N jLabel10.setText("Property Value"); propertyValueTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { propertyValueTextFieldActionPerformed(evt); } }); propertyValueTextField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { searchKeyTped(evt); } }); jLabel12.setText("Property Name"); jComboBox2.setModel(new javax.swing.DefaultComboBoxModel( new String[] { "File Name", "File Size", "Uploaded Date", "Folder Structure", "Custom Property" })); jComboBox2.setMinimumSize(new java.awt.Dimension(166, 25)); jComboBox2.setOpaque(false); jComboBox2.setPreferredSize(new java.awt.Dimension(166, 25)); jComboBox2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jComboBox2ActionPerformed(evt); } }); jLabel13.setText("Custom Property Name"); customPropertyTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { customPropertyTextField1ActionPerformed(evt); } }); javax.swing.GroupLayout customPropertyPanel1Layout = new javax.swing.GroupLayout(customPropertyPanel1); customPropertyPanel1.setLayout(customPropertyPanel1Layout); customPropertyPanel1Layout.setHorizontalGroup(customPropertyPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, customPropertyPanel1Layout .createSequentialGroup().addContainerGap() .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE) .addGap(18, 18, 18).addComponent(customPropertyTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(25, 25, 25))); customPropertyPanel1Layout.setVerticalGroup(customPropertyPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(customPropertyPanel1Layout.createSequentialGroup().addContainerGap() .addGroup(customPropertyPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(customPropertyTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel13)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout propertryBasedPanelLayout = new javax.swing.GroupLayout(propertryBasedPanel); propertryBasedPanel.setLayout(propertryBasedPanelLayout); propertryBasedPanelLayout.setHorizontalGroup(propertryBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(propertryBasedPanelLayout.createSequentialGroup().addGroup(propertryBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, propertryBasedPanelLayout .createSequentialGroup().addContainerGap() .addGroup(propertryBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(propertryBasedPanelLayout.createSequentialGroup() .addGap(12, 12, 12) .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 75, Short.MAX_VALUE) .addComponent(propertyValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(24, 24, 24)) .addComponent(customPropertyPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addGroup(propertryBasedPanelLayout.createSequentialGroup().addGap(25, 25, 25) .addComponent(jLabel12) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 80, Short.MAX_VALUE) .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(23, 23, 23))) .addContainerGap())); propertryBasedPanelLayout.setVerticalGroup(propertryBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(propertryBasedPanelLayout.createSequentialGroup().addGap(20, 20, 20) .addGroup(propertryBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel12)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(customPropertyPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(7, 7, 7) .addGroup(propertryBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(propertyValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel10)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel( new String[] { "Property Search", "Range Based Search", "Tag Search" })); jComboBox1.setInheritsPopupMenu(true); jComboBox1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jComboBox1ActionPerformed(evt); } }); jLabel14.setText("Search Type"); SearchResult.setColumns(20); SearchResult.setRows(5); jScrollPane1.setViewportView(SearchResult); tagBasedPanel.setName("Panel1"); // NOI18N jLabel15.setText("Tags to search :"); tagTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tagTextFieldActionPerformed(evt); } }); javax.swing.GroupLayout tagBasedPanelLayout = new javax.swing.GroupLayout(tagBasedPanel); tagBasedPanel.setLayout(tagBasedPanelLayout); tagBasedPanelLayout.setHorizontalGroup(tagBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tagBasedPanelLayout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 54, Short.MAX_VALUE) .addComponent(tagTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); tagBasedPanelLayout.setVerticalGroup( tagBasedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, tagBasedPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(tagBasedPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tagTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel15)) .addContainerGap())); advancedSearchButton.setText("Advanced Search"); advancedSearchButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { advancedSearchButtonActionPerformed(evt); } }); javax.swing.GroupLayout searchPanelLayout = new javax.swing.GroupLayout(searchPanel); searchPanel.setLayout(searchPanelLayout); searchPanelLayout.setHorizontalGroup(searchPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(searchPanelLayout.createSequentialGroup().addGroup(searchPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(searchPanelLayout.createSequentialGroup().addContainerGap().addComponent( tagBasedPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(searchPanelLayout.createSequentialGroup().addGap(54, 54, 54) .addGroup(searchPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 403, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(searchPanelLayout.createSequentialGroup().addGap(34, 34, 34) .addGroup(searchPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(advancedSearchButton) .addGroup(searchPanelLayout.createSequentialGroup() .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32).addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGroup(searchPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, searchPanelLayout.createSequentialGroup().addContainerGap().addComponent( propertryBasedPanel, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, searchPanelLayout.createSequentialGroup().addGap(12, 12, 12).addComponent( rangeBasedPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, searchPanelLayout.createSequentialGroup() .addContainerGap(187, Short.MAX_VALUE).addComponent(searchButton, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(184, 184, 184))); searchPanelLayout.setVerticalGroup(searchPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(searchPanelLayout.createSequentialGroup().addGap(16, 16, 16) .addComponent(advancedSearchButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(searchPanelLayout.createSequentialGroup().addGap(5, 5, 5).addComponent( jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(7, 7, 7) .addComponent(propertryBasedPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(rangeBasedPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tagBasedPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(26, 26, 26).addComponent(searchButton).addGap(11, 11, 11).addComponent(jLabel8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); clientTabbedPane.addTab("Search", searchPanel); updateButton.setText("Update"); updateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { updateButtonActionPerformed(evt); } }); updateAddNewPropertyButton.setText("Add New Property"); updateAddNewPropertyButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { updateAddNewPropertyButtonActionPerformed(evt); } }); jLabel9.setText("Tags :"); jLabel17.setText("(enter tags seperated by commas \",\")"); jLabel18.setText("FileName :"); javax.swing.GroupLayout updatePanelLayout = new javax.swing.GroupLayout(updatePanel); updatePanel.setLayout(updatePanelLayout); updatePanelLayout.setHorizontalGroup(updatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(updatePanelLayout.createSequentialGroup().addGroup(updatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(updatePanelLayout.createSequentialGroup().addGap(42, 42, 42) .addGroup(updatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel17) .addGroup(updatePanelLayout.createSequentialGroup() .addGroup(updatePanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel9).addComponent(jLabel18)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(updatePanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(updateAddNewPropertyButton) .addComponent(updateTagsTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE) .addComponent(updateFileNameTextField))))) .addGroup(updatePanelLayout.createSequentialGroup().addGap(173, 173, 173).addComponent( updateButton, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(58, Short.MAX_VALUE))); updatePanelLayout.setVerticalGroup(updatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(updatePanelLayout.createSequentialGroup().addGap(55, 55, 55) .addGroup(updatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(updateFileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel18)) .addGap(18, 18, 18).addComponent(updateAddNewPropertyButton).addGap(18, 18, 18) .addGroup(updatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel9).addComponent(updateTagsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(jLabel17).addGap(89, 89, 89).addComponent(updateButton) .addContainerGap(121, Short.MAX_VALUE))); clientTabbedPane.addTab("Update", updatePanel); logoutButton.setText("Logout"); logoutButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { logoutButtonActionPerformed(evt); } }); cancelButton.setText("Cancel"); cancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButtonActionPerformed(evt); } }); loggedInAsLabel.setText("Logged in as :"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(6, 6, 6) .addComponent(loggedInAsLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(userNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(29, 29, 29) .addComponent(logoutButton, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(39, 39, 39) .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(45, 45, 45)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(clientTabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 491, 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() .addComponent(clientTabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 485, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cancelButton).addComponent(logoutButton)) .addGroup(jPanel1Layout.createSequentialGroup().addGap(2, 2, 2) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(loggedInAsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(userNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(47, Short.MAX_VALUE))); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width - 515) / 2, (screenSize.height - 590) / 2, 515, 590); }
From source file:gtu._work.ui.ExecuteOpener.java
private void initGUI() { final SwingActionUtil swingUtil = SwingActionUtil.newInstance(this); ToolTipManager.sharedInstance().setInitialDelay(0); try {/*from ww w . j a va 2s . co m*/ { this.setTitle("execute browser"); this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); this.setPreferredSize(new java.awt.Dimension(870, 551)); this.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { swingUtil.invokeAction("frame.mouseClicked", evt); } }); } { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1); jTabbedPane1.setPreferredSize(new java.awt.Dimension(384, 265)); jTabbedPane1.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent evt) { swingUtil.invokeAction("jTabbedPane1.stateChanged", evt); } }); jTabbedPane1.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { swingUtil.invokeAction("jTabbedPane1.mouseClicked", evt); } }); { jPanel1 = new JPanel(); BorderLayout jPanel1Layout = new BorderLayout(); jPanel1.setLayout(jPanel1Layout); jTabbedPane1.addTab("file list", null, jPanel1, null); { jPanel4 = new JPanel(); BorderLayout jPanel4Layout = new BorderLayout(); jPanel4.setLayout(jPanel4Layout); jPanel1.add(jPanel4, BorderLayout.NORTH); jPanel4.setPreferredSize(new java.awt.Dimension(508, 81)); { jScrollPane1 = new JScrollPane(); jPanel4.add(jScrollPane1, BorderLayout.CENTER); { exeArea = new JTextArea(); jScrollPane1.setViewportView(exeArea); } } { jPanel5 = new JPanel(); BorderLayout jPanel5Layout = new BorderLayout(); jPanel5.setLayout(jPanel5Layout); jPanel4.add(jPanel5, BorderLayout.EAST); jPanel5.setPreferredSize(new java.awt.Dimension(202, 81)); { addArea = new JButton(); jPanel5.add(addArea, BorderLayout.CENTER); addArea.setText("addArea"); addArea.setPreferredSize(new java.awt.Dimension(58, 30)); addArea.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("addArea.actionPerformed", evt); } }); } } { queryText = new JTextField(); jPanel4.add(queryText, BorderLayout.NORTH); queryText.getDocument() .addDocumentListener(JCommonUtil.getDocumentListener(new HandleDocumentEvent() { public void process(DocumentEvent event) { try { String query = JCommonUtil.getDocumentText(event); Pattern ptn = Pattern.compile(query); DefaultListModel model = new DefaultListModel(); for (Object key : prop.keySet()) { String val = key.toString(); if (val.contains(query)) { model.addElement(key); continue; } if (ptn.matcher(val).find()) { model.addElement(key); continue; } } execList.setModel(model); } catch (Exception ex) { } } })); } } { jPanel3 = new JPanel(); jPanel1.add(jPanel3, BorderLayout.CENTER); BorderLayout jPanel3Layout = new BorderLayout(); jPanel3.setLayout(jPanel3Layout); jPanel3.setPreferredSize(new java.awt.Dimension(480, 220)); { jScrollPane2 = new JScrollPane(); jPanel3.add(jScrollPane2, BorderLayout.CENTER); { DefaultListModel execListModel = new DefaultListModel(); for (Object obj : prop.keySet()) { execListModel.addElement((String) obj); } execList = new JList(); jScrollPane2.setViewportView(execList); execList.setModel(execListModel); execList.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { swingUtil.invokeAction("execList.keyPressed", evt); } }); execList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { swingUtil.invokeAction("execList.valueChanged", evt); } }); execList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { swingUtil.invokeAction("execList.mouseClicked", evt); } }); } } } { jPanel6 = new JPanel(); jPanel1.add(jPanel6, BorderLayout.SOUTH); jPanel6.setPreferredSize(new java.awt.Dimension(741, 47)); { saveList = new JButton(); jPanel6.add(saveList); saveList.setText("save list to default properties"); saveList.setPreferredSize(new java.awt.Dimension(227, 28)); saveList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("saveList.actionPerformed", evt); } }); } { clearExecList = new JButton(); jPanel6.add(clearExecList); clearExecList.setText("clear properties"); clearExecList.setPreferredSize(new java.awt.Dimension(170, 28)); clearExecList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("clearExecList.actionPerformed", evt); } }); } { reloadList = new JButton(); jPanel6.add(reloadList); reloadList.setText("reload list"); reloadList.setPreferredSize(new java.awt.Dimension(156, 28)); reloadList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("reloadList.actionPerformed", evt); } }); } { contentFilterBtn = new JButton(); jPanel6.add(contentFilterBtn); contentFilterBtn.setText("content filter"); contentFilterBtn.setPreferredSize(new java.awt.Dimension(176, 27)); contentFilterBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("contentFilterBtn.actionPerformed", evt); } }); } } } { jPanel2 = new JPanel(); FlowLayout jPanel2Layout = new FlowLayout(); jTabbedPane1.addTab("config", null, jPanel2, null); jPanel2.setPreferredSize(new java.awt.Dimension(573, 300)); jPanel2.setLayout(jPanel2Layout); { executeAll = new JButton(); jPanel2.add(executeAll); executeAll.setText("execute all files"); executeAll.setPreferredSize(new java.awt.Dimension(137, 27)); executeAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("execute.actionPerformed", evt); } }); } { browser = new JButton(); jPanel2.add(browser); browser.setText("add file"); browser.setPreferredSize(new java.awt.Dimension(140, 28)); browser.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("browser.actionPerformed", evt); } }); } { loadProp = new JButton(); jPanel2.add(loadProp); loadProp.setText("load properties"); loadProp.setPreferredSize(new java.awt.Dimension(158, 32)); loadProp.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("loadProp.actionPerformed", evt); } }); } { executeExport = new JButton(); jPanel2.add(executeExport); executeExport.setText("export list"); executeExport.setPreferredSize(new java.awt.Dimension(145, 31)); executeExport.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("executeExport.actionPerformed", evt); } }); } { exportListHasOrignTree = new JButton(); jPanel2.add(exportListHasOrignTree); exportListHasOrignTree.setText("export list has orign tree"); exportListHasOrignTree.setPreferredSize(new java.awt.Dimension(204, 32)); exportListHasOrignTree.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("exportListHasOrignTree.actionPerformed", evt); } }); } { moveFiles = new JButton(); jPanel2.add(moveFiles); moveFiles.setText("move selected"); moveFiles.setPreferredSize(new java.awt.Dimension(161, 31)); moveFiles.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("moveFiles.actionPerformed", evt); } }); } { deleteSelected = new JButton(); jPanel2.add(deleteSelected); deleteSelected.setText("delete selected"); deleteSelected.setPreferredSize(new java.awt.Dimension(165, 31)); deleteSelected.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("deleteSelected.actionPerformed", evt); } }); } { loadClipboardPath = new JButton(); jPanel2.add(loadClipboardPath); loadClipboardPath.setText("load clipboard path"); loadClipboardPath.setPreferredSize(new java.awt.Dimension(222, 31)); loadClipboardPath.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("loadClipboardPath.actionPerformed", evt); } }); } { deleteEmptyDir = new JButton(); jPanel2.add(deleteEmptyDir); deleteEmptyDir.setText("delete empty dir"); deleteEmptyDir.setPreferredSize(new java.awt.Dimension(222, 31)); deleteEmptyDir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("deleteEmptyDir.actionPerformed", evt); } }); } { openSvnUpdate = new JButton(); jPanel2.add(openSvnUpdate); openSvnUpdate.setText("list svn new or modify file"); openSvnUpdate.setPreferredSize(new java.awt.Dimension(210, 34)); openSvnUpdate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("openSvnUpdate.actionPerformed", evt); } }); } } { jPanel7 = new JPanel(); BorderLayout jPanel7Layout = new BorderLayout(); jPanel7.setLayout(jPanel7Layout); jTabbedPane1.addTab("properties", null, jPanel7, null); { jScrollPane3 = new JScrollPane(); jPanel7.add(jScrollPane3, BorderLayout.CENTER); jScrollPane3.setPreferredSize(new java.awt.Dimension(741, 415)); { DefaultListModel propertiesListModel = new DefaultListModel(); propertiesList = new JList(); reloadCurrentDirPropertiesList(); jScrollPane3.setViewportView(propertiesList); propertiesList.setModel(propertiesListModel); propertiesList.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { swingUtil.invokeAction("propertiesList.keyPressed", evt); } }); propertiesList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { swingUtil.invokeAction("propertiesList.mouseClicked", evt); } }); } } } { jPanel8 = new JPanel(); BorderLayout jPanel8Layout = new BorderLayout(); jTabbedPane1.addTab("scanner", null, jPanel8, null); jPanel8.setLayout(jPanel8Layout); { jPanel9 = new JPanel(); jPanel8.add(jPanel9, BorderLayout.NORTH); jPanel9.setPreferredSize(new java.awt.Dimension(741, 187)); { scanDirText = new JTextField(); scanDirText.setToolTipText("scan dir"); jPanel9.add(scanDirText); scanDirText.setPreferredSize(new java.awt.Dimension(225, 24)); scanDirText.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { swingUtil.invokeAction("scanDirText.mouseClicked", evt); } }); } { jScrollPane6 = new JScrollPane(); jPanel9.add(jScrollPane6); jScrollPane6.setPreferredSize(new java.awt.Dimension(168, 69)); { scannerText = new JTextArea(); scannerText.setToolTipText("query condition"); jScrollPane6.setViewportView(scannerText); } } { fileScan = new JButton(); jPanel9.add(fileScan); fileScan.setText("start / stop"); fileScan.setPreferredSize(new java.awt.Dimension(113, 24)); fileScan.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("fileScan.actionPerformed", evt); } }); } { useRegexOnly = new JCheckBox(); jPanel9.add(useRegexOnly); useRegexOnly.setText("regex only"); } { DefaultComboBoxModel scanTypeModel = new DefaultComboBoxModel(); for (ScanType s : ScanType.values()) { scanTypeModel.addElement(s); } scanType = new JComboBox(); scanType.setToolTipText("scan type"); jPanel9.add(scanType); scanType.setModel(scanTypeModel); scanType.setPreferredSize(new java.awt.Dimension(147, 24)); } { DefaultComboBoxModel jComboBox1Model = new DefaultComboBoxModel(); for (FileOrDirType f : FileOrDirType.values()) { jComboBox1Model.addElement(f); } fileOrDirTypeCombo = new JComboBox(); jPanel9.add(fileOrDirTypeCombo); fileOrDirTypeCombo.setModel(jComboBox1Model); fileOrDirTypeCombo.setToolTipText("scan file or directory!"); } { addListToExecList = new JButton(); jPanel9.add(addListToExecList); addListToExecList.setText("add list to file list"); addListToExecList.setPreferredSize(new java.awt.Dimension(158, 24)); addListToExecList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("addListToExecList.actionPerformed", evt); } }); } { ignoreScanText = new JTextField(); ignoreScanText.setToolTipText("ignore scan condition"); ignoreScanText.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { if (!JMouseEventUtil.buttonLeftClick(2, evt)) { return; } String ignore = null; if (StringUtils.isBlank(ignore = ignoreScanText.getText())) { return; } DefaultListModel model = (DefaultListModel) ignoreScanList.getModel(); model.addElement(ignore); } }); jPanel9.add(ignoreScanText); ignoreScanText.setPreferredSize(new java.awt.Dimension(153, 24)); } { jScrollPane5 = new JScrollPane(); jPanel9.add(jScrollPane5); jScrollPane5.setPreferredSize(new java.awt.Dimension(125, 73)); jScrollPane5.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); jScrollPane5.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); { DefaultListModel ignoreScanListModel = new DefaultListModel(); ignoreScanList = new JList(); ignoreScanList.setToolTipText("ignore scan condition list"); jScrollPane5.setViewportView(ignoreScanList); ignoreScanList.setModel(ignoreScanListModel); ignoreScanList.setPreferredSize(new java.awt.Dimension(125, 73)); ignoreScanList.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { JListUtil.newInstance(ignoreScanList).defaultJListKeyPressed(evt); } }); } } { innerScannerText = new JTextField(); innerScannerText.setToolTipText("inner scan query condition"); jPanel9.add(innerScannerText); innerScannerText.setPreferredSize(new java.awt.Dimension(164, 24)); innerScannerText.addMouseListener(new MouseAdapter() { Thread innerScanThread = null; boolean innerScanStop = false; public void mouseClicked(MouseEvent evt) { if (!JMouseEventUtil.buttonLeftClick(2, evt)) { return; } final String innerText = innerScannerText.getText(); if (arrayBackupForInnerScan == null) { return; } innerScanStop = true; if (innerScanThread == null || innerScanThread.getState() == Thread.State.TERMINATED) { innerScanThread = new Thread(Thread.currentThread().getThreadGroup(), new Runnable() { public void run() { innerScanStop = false; System.out.println( toString() + " ... start!! ==> " + innerScanStop); DefaultListModel model = new DefaultListModel(); scanList.setModel(model); for (int ii = 0; ii < arrayBackupForInnerScan.length; ii++) { if (arrayBackupForInnerScan[ii].toString() .contains(innerText)) { model.addElement(arrayBackupForInnerScan[ii]); } if (innerScanStop) { System.out.println(toString() + " ... over!! ==> " + innerScanStop); break; } } System.out.println(toString() + " ... run over!! ==> " + innerScanStop); } }, "innerScanner_" + System.currentTimeMillis()); innerScanThread.setDaemon(true); innerScanThread.start(); } } }); } } { jScrollPane4 = new JScrollPane(); jPanel8.add(jScrollPane4, BorderLayout.CENTER); { DefaultListModel scanListModel = new DefaultListModel(); scanList = new JList(); jScrollPane4.setViewportView(scanList); scanList.setModel(scanListModel); scanList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { swingUtil.invokeAction("scanList.mouseClicked", evt); } }); scanList.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { swingUtil.invokeAction("scanList.keyPressed", evt); } }); } } { scannerStatus = new JLabel(); jPanel8.add(scannerStatus, BorderLayout.SOUTH); scannerStatus.setPreferredSize(new java.awt.Dimension(741, 27)); } } } swingUtil.addAction("moveFiles.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { DefaultListModel model = (DefaultListModel) execList.getModel(); if (model.getSize() == 0 || execList.getSelectedValues().length == 0) { JOptionPaneUtil.newInstance().iconErrorMessage() .showMessageDialog("no selected file can move!", "ERROR"); return; } File exportListTo = FileUtil.getDefaultExportDir(ExecuteOpener.class, true); File file = null; List<File> list = new ArrayList<File>(); for (Object obj : execList.getSelectedValues()) { file = new File((String) obj); if (file.exists() && file.isFile()) { list.add(file); } } File fromBaseDir = FileUtil.exportReceiveBaseDir(list); System.out.println("fromBaseDir = " + fromBaseDir); int cutLen = 0; if (fromBaseDir != null) { cutLen = fromBaseDir.getAbsolutePath().length(); } StringBuilder err = new StringBuilder(); File newFile = null; for (Object obj : execList.getSelectedValues()) { file = new File((String) obj); if (file.exists() && file.isFile()) { newFile = new File(exportListTo + "/" + file.getParent().substring(cutLen), file.getName()); newFile.getParentFile().mkdirs(); System.out.println("move to : " + newFile); file.renameTo(newFile); if (!newFile.exists()) { err.append(file + "\n"); } } } if (err.length() > 0) { JOptionPaneUtil.newInstance().iconErrorMessage() .showMessageDialog("move file error : \n" + err, "ERROR"); } else { JOptionPaneUtil.newInstance().iconInformationMessage().showMessageDialog( "move file success : " + execList.getSelectedValues().length, "SUCCESS"); } } }); swingUtil.addAction("deleteSelected.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { StringBuilder sb = new StringBuilder(); for (Object obj : execList.getSelectedValues()) { sb.append(new File((String) obj).getName() + "\n"); } if (JOptionPaneUtil.ComfirmDialogResult.YES_OK_OPTION != JOptionPaneUtil.newInstance() .confirmButtonYesNo().iconWaringMessage() .showConfirmDialog("are you sure delete file : \n" + sb, "DELETE")) { return; } File file = null; sb = new StringBuilder(); for (Object obj : execList.getSelectedValues()) { file = new File((String) obj); if (!file.exists()) { continue; } if (file.isDirectory() && file.list().length == 0) { if (!file.delete()) { sb.append(file.getName() + "\n"); } continue; } if (!file.delete()) { sb.append(file.getName() + "\n"); } } if (sb.length() != 0) { JOptionPaneUtil.newInstance().iconErrorMessage() .showMessageDialog("delete error list :\n" + sb, "ERROR"); } else { JOptionPaneUtil.newInstance().iconPlainMessage().showMessageDialog("delete completed!", "SUCCESS"); } } }); swingUtil.addAction("loadClipboardPath.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { File file = new File(ClipboardUtil.getInstance().getContents()); if (!file.exists()) { return; } List<File> list = new ArrayList<File>(); FileUtil.searchFileMatchs(file, ".*", list); prop.clear(); for (File f : list) { if (f.isFile()) { prop.setProperty(f.getAbsolutePath(), ""); } } DefaultListModel model = new DefaultListModel(); for (Object key : prop.keySet()) { model.addElement(key); } execList.setModel(model); } }); swingUtil.addAction("deleteEmptyDir.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { File file = JFileChooserUtil.newInstance().selectDirectoryOnly().showOpenDialog() .getApproveSelectedFile(); if (file == null) { JOptionPaneUtil.newInstance().iconErrorMessage().showMessageDialog("file is not correct!", "ERROR"); return; } if (JOptionPaneUtil.ComfirmDialogResult.YES_OK_OPTION != JOptionPaneUtil.newInstance() .iconWaringMessage().confirmButtonYesNo() .showConfirmDialog("are you sure delete empty dir in \n" + file, "WARRNING")) { return; } List<File> delDir = new ArrayList<File>(); FileUtil.deleteEmptyDir(file, delDir); JOptionPaneUtil.newInstance().iconInformationMessage().showMessageDialog( "delete dir list : \n" + delDir.toString().replace(',', '\n'), "DELETE"); } }); swingUtil.addAction("browser.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { File file = JFileChooserUtil.newInstance().selectFileAndDirectory().showOpenDialog() .getApproveSelectedFile(); if (file != null) { DefaultListModel model = (DefaultListModel) execList.getModel(); model.addElement(file.getAbsolutePath()); } } }); swingUtil.addAction("addArea.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { if (StringUtils.isBlank(exeArea.getText())) { return; } DefaultListModel model = (DefaultListModel) execList.getModel(); StringTokenizer token = new StringTokenizer(exeArea.getText(), "\t\n\r\f"); while (token.hasMoreElements()) { String val = ((String) token.nextElement()).trim(); model.addElement(val); prop.put(val, ""); } } }); swingUtil.addAction("execute.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { DefaultListModel model = (DefaultListModel) execList.getModel(); for (Enumeration<?> enu = model.elements(); enu.hasMoreElements();) { String val = (String) enu.nextElement(); exec(val); } } }); swingUtil.addAction("execList.keyPressed", new Action() { public void action(EventObject evt) throws Exception { JListUtil.newInstance(execList).defaultJListKeyPressed(evt); } }); //DEFAULT PROP SAVE swingUtil.addAction("saveList.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { String orignName = JOptionPaneUtil.newInstance().iconPlainMessage() .showInputDialog("input properties file name", "SAVE"); File saveFile = null; if (StringUtils.isNotBlank(orignName)) { String fileName = orignName; if (!fileName.toLowerCase().endsWith(".properties")) { fileName += ".properties"; } fileName = ExecuteOpener.class.getSimpleName() + "_" + fileName; prop.clear(); DefaultListModel model = (DefaultListModel) execList.getModel(); for (Enumeration<?> enu = model.elements(); enu.hasMoreElements();) { String val = (String) enu.nextElement(); prop.put(val, ""); } saveFile = new File(jarPositionDir, fileName); } else { saveFile = currentPropFile; } prop.store(new FileOutputStream(saveFile), orignName); JOptionPaneUtil.newInstance().iconPlainMessage().showMessageDialog(saveFile, "PROPERTIES CREATE"); } }); swingUtil.addAction("clearExecList.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { // prop.clear(); // reloadExecListProperties(prop); execList.setModel(new DefaultListModel()); } }); swingUtil.addAction("execList.mouseClicked", new Action() { public void action(EventObject evt) throws Exception { // right button single click event if (JMouseEventUtil.buttonRightClick(1, evt)) { JPopupMenuUtil popupUtil = JPopupMenuUtil.newInstance(execList).applyEvent(evt); if (execList.getSelectedValues().length == 1) { popupUtil.addJMenuItem( JFileExecuteUtil.newInstance(new File((String) execList.getSelectedValues()[0])) .createDefaultJMenuItems()); popupUtil.addJMenuItem("----------------", false); } popupUtil.addJMenuItem("eclipse home", new ActionListener() { public void actionPerformed(ActionEvent e) { DefaultListModel model = (DefaultListModel) execList.getModel(); Object[] arry = model.toArray(); for (Object obj : arry) { try { Runtime.getRuntime().exec(String.format("cmd /c call \"%s\" \"%s\"", "C:/?/eclipse_jee/eclipse.exe", obj)); } catch (IOException ex) { JCommonUtil.handleException(ex); } } } }); popupUtil.addJMenuItem("eclipse company", new ActionListener() { public void actionPerformed(ActionEvent e) { DefaultListModel model = (DefaultListModel) execList.getModel(); Object[] arry = model.toArray(); for (Object obj : arry) { try { Runtime.getRuntime().exec(String.format("cmd /c call \"%s\" \"%s\"", "C:/?/iisi_eclipse/eclipse.exe", obj)); } catch (IOException ex) { JCommonUtil.handleException(ex); } } } }); popupUtil.addJMenuItem("----------------", false); popupUtil// .addJMenuItem("sort list", new ActionListener() { public void actionPerformed(ActionEvent e) { DefaultListModel model = (DefaultListModel) execList.getModel(); Object[] arry = model.toArray(); Arrays.sort(arry); DefaultListModel model2 = new DefaultListModel(); for (Object obj : arry) { model2.addElement(obj); } execList.setModel(model2); } }).addJMenuItem("keep exists", new ActionListener() { public void actionPerformed(ActionEvent e) { DefaultListModel model = (DefaultListModel) execList.getModel(); DefaultListModel model2 = new DefaultListModel(); for (Object obj : model.toArray()) { if (new File((String) obj).exists()) { model2.addElement(obj); } } execList.setModel(model2); } }).addJMenuItem("remove duplicate", new ActionListener() { public void actionPerformed(ActionEvent e) { DefaultListModel model = (DefaultListModel) execList.getModel(); DefaultListModel model2 = new DefaultListModel(); Set<String> set = new HashSet<String>(); for (Object obj : model.toArray()) { set.add((String) obj); } for (String val : set) { model2.addElement(val); } execList.setModel(model2); } }).addJMenuItem("remove folder", new ActionListener() { public void actionPerformed(ActionEvent e) { DefaultListModel model = (DefaultListModel) execList.getModel(); for (int ii = 0; ii < model.getSize(); ii++) { if (new File((String) model.getElementAt(ii)).isDirectory()) { model.removeElementAt(ii); ii--; } } } }).addJMenuItem("remove empty folder", new ActionListener() { public void actionPerformed(ActionEvent e) { DefaultListModel model = (DefaultListModel) execList.getModel(); File dir = null; for (int ii = 0; ii < model.getSize(); ii++) { dir = new File((String) model.getElementAt(ii)); if (dir.isDirectory() && dir.list().length == 0) { model.removeElementAt(ii); ii--; } } } }).addJMenuItem("----------------", false) .addJMenuItem("diff left : " + (diffLeft != null ? diffLeft.getName() : ""), true, new ActionListener() { public void actionPerformed(ActionEvent arg0) { File value = new File( (String) JListUtil.getLeadSelectionObject(execList)); if (value != null && value.isFile() && value.exists()) { diffLeft = value; } } }) .addJMenuItem("diff right : " + (diffRight != null ? diffRight.getName() : ""), true, new ActionListener() { public void actionPerformed(ActionEvent arg0) { File value = new File( (String) JListUtil.getLeadSelectionObject(execList)); if (value != null && value.isFile() && value.exists()) { diffRight = value; } } }) .addJMenuItem((diffLeft != null && diffRight != null) ? "diff compare" : "", (diffLeft != null && diffRight != null), new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { Runtime.getRuntime().exec(String.format( "cmd /c call TortoiseMerge.exe /base:\"%s\" /theirs:\"%s\"", diffLeft, diffRight)); } catch (IOException ex) { JCommonUtil.handleException(ex); } } }) .addJMenuItem((execList.getSelectedValues().length == 2) ? "diff compare" : "", (execList.getSelectedValues().length == 2), new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { Runtime.getRuntime().exec(String.format( "cmd /c call TortoiseMerge.exe /base:\"%s\" /theirs:\"%s\"", execList.getSelectedValues()[0], execList.getSelectedValues()[1])); } catch (IOException ex) { JCommonUtil.handleException(ex); } } }) .addJMenuItem("----------------", false)// .show();// } // left button double click event int pos = execList.getLeadSelectionIndex(); if (pos == -1) { return; } if (((MouseEvent) evt).getClickCount() < 2) { return; } DefaultListModel model = (DefaultListModel) execList.getModel(); String val = (String) model.getElementAt(pos); exec(val); } }); swingUtil.addAction("loadProp.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { File file = JFileChooserUtil.newInstance().selectFileOnly().showOpenDialog() .getApproveSelectedFile(); if (file == null) { JOptionPaneUtil.newInstance().iconErrorMessage().showMessageDialog("file not correct!", "ERROR"); return; } reloadExecListProperties(file); setTitle("load prop : " + file.getName()); } }); swingUtil.addAction("reloadList.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { reloadExecListProperties(prop); } }); swingUtil.addAction("exportListHasOrignTree.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { DefaultListModel model = (DefaultListModel) execList.getModel(); if (model.isEmpty()) { JOptionPaneUtil.newInstance().iconErrorMessage().showMessageDialog("no file can export!", "ERROR"); return; } List<File> allList = new ArrayList<File>(); for (int ii = 0; ii < model.getSize(); ii++) { allList.add(new File((String) model.getElementAt(ii))); } File baseDir = FileUtil.exportReceiveBaseDir(allList); System.out.println("common base dir : " + baseDir); boolean dynamicBaseDir = baseDir == null; File tmp = null; File copyTo = null; int realCopyCount = 0; File exportListTo = FileUtil.getDefaultExportDir(ExecuteOpener.class, true); for (int ii = 0; ii < model.getSize(); ii++) { String val = (String) model.getElementAt(ii); if (StringUtils.isBlank(val)) { continue; } tmp = new File(val); if (tmp.isDirectory()) { continue; } File copyFrom = getCorrectFile(tmp); if (dynamicBaseDir) { baseDir = FileUtil.getRoot(copyFrom); } copyTo = FileUtil.exportFileToTargetPath(copyFrom, baseDir, exportListTo); if (!copyTo.getParentFile().exists()) { copyTo.getParentFile().mkdirs(); } System.out.println("## file : " + tmp + " -- > " + copyFrom); System.out.println("\t copy to : " + copyTo); FileUtil.copyFile(copyFrom, copyTo); realCopyCount++; } JOptionPaneUtil.newInstance().iconInformationMessage().showMessageDialog( "copy completed!\ntotal : " + model.getSize() + "\ncopy : " + realCopyCount, "SUCCESS"); } }); swingUtil.addAction("executeExport.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { DefaultListModel model = (DefaultListModel) execList.getModel(); if (model.isEmpty()) { JOptionPaneUtil.newInstance().iconErrorMessage().showMessageDialog("no file can export!", "ERROR"); return; } File tmp = null; File copyTo = null; int realCopyCount = 0; File exportListTo = FileUtil.getDefaultExportDir(ExecuteOpener.class, true); BufferedWriter writer = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(exportListTo + "/output_log.txt"), "BIG5")); for (int ii = 0; ii < model.getSize(); ii++) { String val = (String) model.getElementAt(ii); if (StringUtils.isBlank(val)) { continue; } tmp = new File(val); if (tmp.isDirectory()) { continue; } if (isNeedToCopy(exportListTo, tmp)) { File copyFrom = getCorrectFile(tmp); System.out.println("## file : " + tmp + " -- > " + copyFrom); copyTo = new File(exportListTo, copyFrom.getName()); for (int jj = 0; copyTo.exists(); jj++) { String name = copyFrom.getName(); int pos = name.lastIndexOf("."); String prefix = name.substring(0, pos); String rearfix = name.substring(pos); copyTo = new File(exportListTo, prefix + "_R" + jj + rearfix); } FileUtil.copyFile(copyFrom, copyTo); writer.write(tmp.getAbsolutePath() + (!tmp.getName().equals(copyTo.getName()) ? "\t [rename] : " + copyTo.getName() : "")); realCopyCount++; } else { writer.write(tmp.getAbsolutePath() + "\t [has same file, ommit!]"); } writer.newLine(); } writer.flush(); writer.close(); JOptionPaneUtil.newInstance().iconInformationMessage().showMessageDialog( "copy completed!\ntotal : " + model.getSize() + "\ncopy : " + realCopyCount, "SUCCESS"); } }); swingUtil.addAction("jTabbedPane1.mouseClicked", new Action() { public void action(EventObject evt) throws Exception { if (!JMouseEventUtil.buttonLeftClick(2, evt)) { return; } File file = new File(getTitle()); if (file.exists()) { JOptionPaneUtil.newInstance().iconPlainMessage().showMessageDialog(file, "current properties"); } ClipboardUtil.getInstance().setContents(file); } }); swingUtil.addAction("propertiesList.mouseClicked", new Action() { public void action(EventObject evt) throws Exception { File file = (File) propertiesList.getSelectedValue(); JPopupMenuUtil.newInstance(propertiesList).applyEvent(evt) .addJMenuItem("reload list", new ActionListener() { public void actionPerformed(ActionEvent paramActionEvent) { reloadCurrentDirPropertiesList(); } }).addJMenuItem(JFileExecuteUtil.newInstance(file).createDefaultJMenuItems()).show(); if (file == null) { return; } if (!JMouseEventUtil.buttonLeftClick(2, evt)) { return; } prop.clear(); prop.load(new FileInputStream(file)); currentPropFile = file; reloadExecListProperties(prop); setTitle("properties : " + file.getName()); } }); swingUtil.addAction("propertiesList.keyPressed", new Action() { public void action(EventObject evt) throws Exception { if (!JMouseEventUtil.buttonLeftClick(2, evt)) { return; } JListUtil.newInstance(propertiesList).defaultJListKeyPressed(evt); } }); swingUtil.addAction("jTabbedPane1.stateChanged", new Action() { public void action(EventObject evt) throws Exception { if (jTabbedPane1.getSelectedIndex() == 2) { reloadCurrentDirPropertiesList(); } } }); swingUtil.addAction("scanList.keyPressed", new Action() { public void action(EventObject evt) throws Exception { JListUtil.newInstance(scanList).defaultJListKeyPressed(evt); } }); swingUtil.addAction("scanList.mouseClicked", new Action() { public void action(EventObject evt) throws Exception { System.out.println("index = " + scanList.getLeadSelectionIndex()); final Object[] vals = scanList.getSelectedValues(); if (vals == null || vals.length == 0) { return; } JPopupMenuUtil.newInstance(scanList).applyEvent(evt) .addJMenuItem("add to file list : " + vals.length, new ActionListener() { public void actionPerformed(ActionEvent arg0) { File file = null; DefaultListModel model = (DefaultListModel) execList.getModel(); for (Object v : vals) { file = (File) v; model.addElement(file.getAbsolutePath()); } } }).show(); } }); swingUtil.addAction("fileScan.actionPerformed", new Action() { Thread scanMainThread = null; public void action(EventObject evt) throws Exception { String scanText_ = scannerText.getText(); final boolean anyFileMatch = StringUtils.isEmpty(scanText_); final String scanText = anyFileMatch ? UUID.randomUUID().toString() : scanText_; final FileOrDirType fileOrDirType = (FileOrDirType) fileOrDirTypeCombo.getSelectedItem(); String scanDir_ = scanDirText.getText(); final File scanDir = new File(scanDir_); if (StringUtils.isEmpty(scanDir_)) { JOptionPaneUtil.newInstance().iconErrorMessage() .showMessageDialog("scan dir text can't empty!", "ERROR"); return; } if (!scanDir.exists()) { JOptionPaneUtil.newInstance().iconErrorMessage().showMessageDialog("directory is't exists!", "ERROR"); return; } Object[] igArry_ = ((DefaultListModel) ignoreScanList.getModel()).toArray(); final String[] igArry = new String[igArry_.length]; for (int ii = 0; ii < igArry.length; ii++) { igArry[ii] = (String) igArry_[ii]; } final boolean ignoreCheck = igArry.length > 0; final DefaultListModel model = new DefaultListModel(); final StringTokenizer tok = new StringTokenizer(scanText); if (scanMainThread == null || scanMainThread.getState() == Thread.State.TERMINATED) { scanMainThread = new Thread(Thread.currentThread().getThreadGroup(), new Runnable() { ScanType scanTp; public void run() { currentScannerThreadStop = false; final long startTime = System.currentTimeMillis(); scanTp = (ScanType) scanType.getSelectedItem(); List<Thread> threadList = new ArrayList<Thread>(); final Map<String, Integer> matchCountMap = new HashMap<String, Integer>(); for (; tok.hasMoreElements();) { final String scanVal = (String) tok.nextElement(); System.out.println("add scan condition = " + scanVal); Pattern ppp = null; try { ppp = Pattern.compile(scanVal); } catch (Exception ex) { System.out.println(ex); } final Pattern scanTextPattern = ppp; Thread currentScannerThread = new Thread( Thread.currentThread().getThreadGroup(), new Runnable() { int matchCount = 0; void addElement(File file) { if (scanTp.filter(anyFileMatch, scanVal, scanTextPattern, file, ignoreCheck, igArry)) { for (int ii = 0;; ii++) { try { model.addElement(file); matchCount++; break; } catch (Exception ex) { System.err.println( file + ", error occor !!! ==> " + ex); if (ii > 10) { break; } } } } } void find(File file) { if (currentScannerThreadStop) { return; } if (file == null || !file.exists()) { System.out .println("file == null || !file.exists()\t" + file); return; } scannerStatus.setText( model.getSize() + " : " + file.getAbsolutePath()); if (file.isDirectory()) { if (file.listFiles() != null) { for (File f : file.listFiles()) { find(f); } } else { System.out .println("file.listFiles() == null!!\t" + file); } switch (fileOrDirType) { case DIRECTORY_ONLY: addElement(file); break; case ALL: addElement(file); break; } } if (file.isFile()) { switch (fileOrDirType) { case FILE_ONLY: addElement(file); break; case ALL: addElement(file); break; } } } public void run() { find(scanDir); matchCountMap.put(scanVal, matchCount); } }, "file_scann_" + System.currentTimeMillis()); currentScannerThread.setDaemon(true); currentScannerThread.start(); threadList.add(currentScannerThread); } for (;;) { try { Thread.sleep(1000); boolean allTerminated = true; for (int ii = 0; ii < threadList.size(); ii++) { if (threadList.get(ii).getState() != Thread.State.TERMINATED) { allTerminated = false; break; } } if (allTerminated) { System.out.println("all done..."); break; } } catch (InterruptedException e) { JCommonUtil.handleException(e); } } long endTime = System.currentTimeMillis() - startTime; String status = "scan completed \n during :" + endTime + "\n file : " + model.getSize() + "\n \tResult : \n " + matchCountMap; JOptionPaneUtil.newInstance().iconPlainMessage().showMessageDialog(status, "COMPLETED"); scannerStatus.setText(status); scanList.setModel(model); arrayBackupForInnerScan = ((DefaultListModel) scanList.getModel()).toArray(); currentScannerThreadStop = false; } }, "file_scann_main_" + System.currentTimeMillis()); scanMainThread.setDaemon(true); scanMainThread.start(); } else { if (JCommonUtil._JOptionPane_showConfirmDialog_yesNoOption( "scanner is running \n want to stop??", "WARNING")) { currentScannerThreadStop = true; } } } }); swingUtil.addAction("scanDirText.mouseClicked", new Action() { public void action(EventObject evt) throws Exception { if (!JMouseEventUtil.buttonLeftClick(2, evt)) { return; } File dir = JFileChooserUtil.newInstance().selectDirectoryOnly().showOpenDialog() .getApproveSelectedFile(); if (dir == null) { return; } scanDirText.setText(dir.getAbsolutePath()); } }); swingUtil.addAction("addListToExecList.actionPerformed", new Action() { Thread moveThread = null; public void action(EventObject evt) throws Exception { if (moveThread != null && moveThread.getState() != Thread.State.TERMINATED) { JCommonUtil._jOptionPane_showMessageDialog_error("add list process already running!"); return; } moveThread = new Thread(Thread.currentThread().getThreadGroup(), new Runnable() { public void run() { DefaultListModel model = (DefaultListModel) scanList.getModel(); DefaultListModel model2 = (DefaultListModel) execList.getModel(); for (int ii = 0; ii < model.getSize(); ii++) { File f = (File) model.getElementAt(ii); model2.addElement(f.getAbsolutePath()); } if (model.getSize() > 1000) { JCommonUtil._jOptionPane_showMessageDialog_info( "add list completed!\n" + model.getSize()); } } }, "addListToExecList.actionPerformed_" + System.currentTimeMillis()); moveThread.setDaemon(true); moveThread.start(); } }); swingUtil.addAction("openSvnUpdate.actionPerformed", new Action() { Pattern svnPattern = Pattern.compile("^(?:[M|\\?])\\s+\\d*\\s+(.+)$"); Thread svnThread = null; public void action(EventObject evt) throws Exception { if (svnThread != null && svnThread.getState() != Thread.State.TERMINATED) { JCommonUtil._jOptionPane_showMessageDialog_error("svn scan process already running!"); return; } final File svnDir = JCommonUtil._jFileChooser_selectDirectoryOnly(); if (svnDir == null) { JCommonUtil._jOptionPane_showMessageDialog_error("dir is not correct!"); return; } svnThread = new Thread(Thread.currentThread().getThreadGroup(), new Runnable() { public void run() { try { Process process = Runtime.getRuntime() .exec(String.format("svn status -u \"%s\"", svnDir)); BufferedReader reader = new BufferedReader( new InputStreamReader(process.getInputStream())); Matcher matcher = null; File file = null; DefaultListModel model = new DefaultListModel(); List<File> scanList = new ArrayList<File>(); for (String line = null; (line = reader.readLine()) != null;) { matcher = svnPattern.matcher(line); if (matcher.find()) { file = new File(matcher.group(1)); if (file.isFile()) { model.addElement(file.getAbsolutePath()); } if (file.isDirectory()) { scanList.clear(); FileUtil.searchFileMatchs(file, ".*", scanList); for (File f : scanList) { model.addElement(f.getAbsolutePath()); } } } else { System.out.println("ignore : [" + line + "]"); } } reader.close(); execList.setModel(model); setTitle("svn : " + svnDir); JCommonUtil._jOptionPane_showMessageDialog_info("svn scan completed!"); } catch (IOException e) { JCommonUtil.handleException(e); } } }, "svn_scan" + System.currentTimeMillis()); svnThread.setDaemon(true); svnThread.start(); } }); swingUtil.addAction("contentFilterBtn.actionPerformed", new Action() { Thread thread = null; String encode = Charset.defaultCharset().displayName(); public void action(EventObject evt) throws Exception { if (thread != null && thread.getState() != Thread.State.TERMINATED) { JCommonUtil._jOptionPane_showMessageDialog_error("scan process already running!"); return; } final String filter = JCommonUtil._jOptionPane_showInputDialog("input filter content?"); if (StringUtils.isEmpty(filter)) { JCommonUtil._jOptionPane_showMessageDialog_error("filter is empty!"); return; } Pattern tmpPattern = null; try { tmpPattern = Pattern.compile(filter); } catch (Exception ex) { } final Pattern filterPattern = tmpPattern; try { encode = JCommonUtil._jOptionPane_showInputDialog("input encode?", encode); } catch (Exception ex) { JCommonUtil._jOptionPane_showMessageDialog_error("error encode!"); return; } thread = new Thread(Thread.currentThread().getThreadGroup(), new Runnable() { public void run() { DefaultListModel model = (DefaultListModel) execList.getModel(); DefaultListModel model_ = new DefaultListModel(); File file = null; BufferedReader reader = null; for (int ii = 0; ii < model.getSize(); ii++) { file = new File((String) model.getElementAt(ii)); if (!file.exists()) { continue; } try { reader = new BufferedReader( new InputStreamReader(new FileInputStream(file), encode)); for (String line = null; (line = reader.readLine()) != null;) { if (line.contains(filter)) { model_.addElement(file.getAbsolutePath()); break; } if (filterPattern != null && filterPattern.matcher(line).find()) { model_.addElement(file.getAbsolutePath()); break; } } reader.close(); } catch (Exception e) { JCommonUtil.handleException(e); } } execList.setModel(model_); JCommonUtil._jOptionPane_showMessageDialog_info("completed!"); } }, UUID.randomUUID().toString()); thread.setDaemon(true); thread.start(); } }); swingUtil.addAction("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", new Action() { public void action(EventObject evt) throws Exception { } }); this.setSize(870, 551); } catch (Exception e) { e.printStackTrace(); } }
From source file:org.astrojournal.gui.AJMainGUI.java
/** * Set AstroJournal window./*from w w w. java2s .com*/ */ private void setAJWindow() { // Configure AJMainGUI with basic parameters setTitle(AJMetaInfo.NAME.getInfo() + " " + AJMetaInfo.VERSION.getInfo()); setIconImage(new ImageIcon(ClassLoader.getSystemResource("graphics/logo/aj_icon_32.png")).getImage()); setSize(550, 580); setMinimumSize(new Dimension(520, 450)); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setResizable(true); getContentPane().setLayout(new BorderLayout()); }
From source file:com.act.analysis.surfactant.SurfactantLabeler.java
public void runAnalysis(String licensePath, File inputFile, File outputFile, File inchiSourceFile, String inchiJoinField) throws Exception { LicenseManager.setLicenseFile(licensePath); // If a separate InChI source was specified, build a map from the join key to that source's per-molecule data. Map<String, Map<String, String>> inchiSource = null; if (inchiSourceFile != null) { TSVParser inchiSourceParser = new TSVParser(); inchiSourceParser.parse(inchiSourceFile); List<Map<String, String>> inchiSourceData = inchiSourceParser.getResults(); inchiSource = new HashMap<>(inchiSourceData.size()); int i = 0; for (Map<String, String> row : inchiSourceData) { i++;/*from ww w . j a v a 2s. c o m*/ if (!row.containsKey(inchiJoinField)) { throw new RuntimeException( String.format("Missing inchi join field %s on row %d of inchi source file %s", inchiJoinField, i, inchiSourceFile.getAbsolutePath())); } inchiSource.put(row.get(inchiJoinField), row); } System.out.format("Loaded %d inchi source entries from %s\n", inchiSource.size(), inchiSourceFile.getAbsolutePath()); } // Create the visualization environment. JFrame jFrame = new JFrame(); jFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); MSpaceEasy mspace = new MSpaceEasy(1, 2, true); mspace.addCanvas(jFrame.getContentPane()); mspace.setSize(1200, 600); jFrame.pack(); jFrame.setVisible(true); /* Read all the input chemicals at once. We don't expect this file to be too big. Do this before touching the * (possibly non-empty) results file in case there's a problem with the input. */ TSVParser inputChemsParser = new TSVParser(); inputChemsParser.parse(inputFile); List<Map<String, String>> chemicals = inputChemsParser.getResults(); /* Read in any old results to find where we left off, and write them back to the (truncated) results file again. * TODO: add append mode to TSVWriter. This re-writing stuff is kinda silly. */ List<Map<String, String>> oldResults = new ArrayList<>(); if (outputFile.exists()) { TSVParser oldResultsParser = new TSVParser(); oldResultsParser.parse(outputFile); oldResults.addAll(oldResultsParser.getResults()); } TSVWriter<String, String> resultsWriter = new TSVWriter<>(Arrays.asList("name", "id", "inchi", "label")); resultsWriter.open(outputFile); Set<String> knownInchis = new HashSet<>(); for (Map<String, String> row : oldResults) { knownInchis.add(row.get("inchi")); resultsWriter.append(row); } resultsWriter.flush(); int molNumber = 0; try { Console c = System.console(); while (molNumber < chemicals.size()) { // Copy the source data; we're gonna add some fields to it, and a clean copy might come in handy. Map<String, String> r = new HashMap<>(chemicals.get(molNumber)); // Lookup the InChI source data by this row's join field if a source is defined. if (inchiSource != null) { Map<String, String> sourceData = inchiSource.get(chemicals.get(molNumber).get(inchiJoinField)); r.put("inchi", sourceData.get("inchi")); r.put("name", sourceData.get("name")); } String inchi = r.get("inchi"); // If we've already seen this InChI, skip it and move to the next molecule. Also de-duplicates a little bit. if (knownInchis.contains(inchi)) { System.out.format("Skpping known molecule %d\n", molNumber); molNumber++; continue; } knownInchis.add(inchi); /* Remove all existing molecules from the visualizer, draw the new one, and then reset/refresh to ensure both * panels are displayed (sometimes one of the visualizations is corrupted w/o user input due to some strange * mspace issue). */ mspace.removeAllComponents(); drawMolecule(mspace, MolImporter.importMol(inchi)); jFrame.pack(); mspace.resetAll(); mspace.refresh(); // Very liberally ask for a label. TODO: figure out how to accept key input on the jFrame (tried+failed once). System.out.format("%s (%s)\n", r.get("name"), inchiJoinField == null ? "" : r.get(inchiJoinField)); System.out.format("Input (?/1/0):\n"); String line = c.readLine(); String label = "?"; switch (line) { case "1": label = "1"; break; case "0": label = "0"; break; } r.put("label", label); resultsWriter.append(r); // Flush every time to ensure a clean exit when the user gets tired of labeling. It happens. resultsWriter.flush(); molNumber++; } } finally { resultsWriter.close(); } System.out.format("Done.\n"); }
From source file:stratego.neural.net.NeuralNetTest.java
private static void plotDataSet(List<NamedDataSet> ArraySetList) { XYSeriesCollection plotData = new XYSeriesCollection(); for (NamedDataSet ns : ArraySetList) { XYSeries series = new XYSeries(ns.getName()); double[] data = ns.getArray(); for (int i = 0; i < data.length; i++) { series.add((double) i, data[i]); }/* w w w . ja v a 2s . c o m*/ plotData.addSeries(series); } String title = "Overfitting Data"; String xAxisLabel = "Epochs"; String yAxisLabel = "Accuracy"; PlotOrientation orientation = PlotOrientation.VERTICAL; boolean legend = true; // might wanna set this to true at some point, but research the library boolean tooltips = false; boolean urls = false; JFreeChart chart = ChartFactory.createScatterPlot(title, xAxisLabel, yAxisLabel, plotData, orientation, legend, tooltips, urls); JPanel panel = new ChartPanel(chart); JFrame f = new JFrame(); f.add(panel); f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); f.pack(); f.setTitle("Overfitting data"); f.setVisible(true); }
From source file:EnrollFingerprint.Verify.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./*from ww w . jav a 2 s .co m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonGroup1 = new javax.swing.ButtonGroup(); jPanelBackground = new javax.swing.JPanel(); picFingerprint = new javax.swing.JLabel(); jPanelConsole = new javax.swing.JPanel(); txtConsole = new javax.swing.JTextField(); lblConsole = new javax.swing.JLabel(); btnCancel = new javax.swing.JButton(); jPanelLog = new javax.swing.JPanel(); JScrollPane1 = new javax.swing.JScrollPane(); txtLog = new javax.swing.JTextArea(); lblLog = new javax.swing.JLabel(); btnVerify = new javax.swing.JButton(); lblStatus = new javax.swing.JLabel(); btnFind = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Almacenar Huellas"); setResizable(false); jPanelBackground.setBackground(new java.awt.Color(238, 241, 245)); picFingerprint.setBackground(new java.awt.Color(255, 255, 255)); picFingerprint.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jPanelConsole.setBackground(new java.awt.Color(255, 255, 255)); txtConsole.setEditable(false); txtConsole.setForeground(new java.awt.Color(136, 136, 136)); txtConsole.setText("Consola de estado"); lblConsole.setForeground(new java.awt.Color(136, 136, 136)); lblConsole.setText("Consola:"); javax.swing.GroupLayout jPanelConsoleLayout = new javax.swing.GroupLayout(jPanelConsole); jPanelConsole.setLayout(jPanelConsoleLayout); jPanelConsoleLayout.setHorizontalGroup(jPanelConsoleLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelConsoleLayout.createSequentialGroup().addContainerGap() .addGroup(jPanelConsoleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtConsole).addGroup(jPanelConsoleLayout.createSequentialGroup() .addComponent(lblConsole).addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); jPanelConsoleLayout.setVerticalGroup(jPanelConsoleLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelConsoleLayout.createSequentialGroup() .addGap(5, 5, 5).addComponent(lblConsole) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtConsole, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(15, Short.MAX_VALUE))); btnCancel.setText("Cancelar"); btnCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCancelActionPerformed(evt); } }); jPanelLog.setBackground(new java.awt.Color(255, 255, 255)); txtLog.setEditable(false); txtLog.setColumns(20); txtLog.setForeground(new java.awt.Color(168, 168, 168)); txtLog.setRows(5); JScrollPane1.setViewportView(txtLog); lblLog.setForeground(new java.awt.Color(136, 136, 136)); lblLog.setText("Estado:"); javax.swing.GroupLayout jPanelLogLayout = new javax.swing.GroupLayout(jPanelLog); jPanelLog.setLayout(jPanelLogLayout); jPanelLogLayout.setHorizontalGroup(jPanelLogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelLogLayout.createSequentialGroup().addContainerGap() .addGroup(jPanelLogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(JScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE) .addGroup(jPanelLogLayout.createSequentialGroup().addComponent(lblLog).addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); jPanelLogLayout.setVerticalGroup(jPanelLogLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelLogLayout.createSequentialGroup().addContainerGap().addComponent(lblLog) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(JScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE) .addContainerGap())); btnVerify.setText("Verificar Huella"); btnVerify.setEnabled(false); btnVerify.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnVerifyActionPerformed(evt); } }); lblStatus.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N lblStatus.setText("Intentos"); btnFind.setText("Cargar Huellas"); btnFind.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFindActionPerformed(evt); } }); javax.swing.GroupLayout jPanelBackgroundLayout = new javax.swing.GroupLayout(jPanelBackground); jPanelBackground.setLayout(jPanelBackgroundLayout); jPanelBackgroundLayout.setHorizontalGroup(jPanelBackgroundLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelBackgroundLayout.createSequentialGroup().addContainerGap() .addGroup(jPanelBackgroundLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanelBackgroundLayout.createSequentialGroup() .addComponent(picFingerprint, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanelBackgroundLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanelConsole, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanelLog, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addGroup(jPanelBackgroundLayout.createSequentialGroup().addComponent(lblStatus) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnFind) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnVerify) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnCancel))) .addContainerGap())); jPanelBackgroundLayout.setVerticalGroup(jPanelBackgroundLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelBackgroundLayout.createSequentialGroup().addContainerGap() .addGroup(jPanelBackgroundLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelBackgroundLayout.createSequentialGroup() .addComponent(jPanelConsole, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanelLog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(picFingerprint, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE) .addGroup(jPanelBackgroundLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnCancel).addComponent(btnVerify).addComponent(lblStatus) .addComponent(btnFind)) .addContainerGap())); btnFind.getAccessibleContext().setAccessibleName("Cargar Huellas"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanelBackground, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanelBackground, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); pack(); }