Subversion Repository Public Repository

TransPort_Tracking

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.transtracking.views;

import com.bestray.healthcarecommonutil.util.SimpleGradientPanel;
import java.awt.Color;
import java.awt.Toolkit;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.prefs.Preferences;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import javax.swing.JTree;
import javax.swing.UIManager;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreePath;
import com.bestray.transtracking.controller.LoginController;
import com.bestray.transtracking.util.PreferenceUtil;
import com.bestray.trastrack.domain.User;
import java.util.Enumeration;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreeSelectionModel;

/**
 *
 * @author user3
 */
public class TransportHome extends javax.swing.JFrame {

    /**
     * Creates new form TransportHome
     */
    public static JTree fileTree;
  
    private JTextArea fileDetailsTextArea = new JTextArea();
        public static JPanel panel = new SimpleGradientPanel();
    String s;
    public TransportHome() {
        super("Kumar Syndicate Transport Tracking System");
        setIconImage(Toolkit.getDefaultToolkit() 
            .getImage(TransportTrackHome.class.getResource("/images/truck64.png")));
        fileDetailsTextArea.setEditable(true);
        
        //setIconImage(Toolkit.getDefaultToolkit().getImage("/images/frame icon.png"));
        //setSize(Toolkit.getDefaultToolkit().getScreenSize());
        // Calendar cal = new GregorianCalendar();
        //int month = cal.get(Calendar.MONTH);
        //int day = cal.get(Calendar.DAY_OF_MONTH);
        //int year = cal.get(Calendar.YEAR);
        validate();
        
       //setSize(1200, 700);
         DefaultMutableTreeNode root =
                new DefaultMutableTreeNode("Home");
         
        DefaultMutableTreeNode child;
        DefaultMutableTreeNode grandChild;
        DefaultMutableTreeNode grandChild1;
        child = new DefaultMutableTreeNode("Master Data Entry");
        root.add(child);
        
        grandChild =
                new DefaultMutableTreeNode("Company Master");
               
        child.add(grandChild);
        grandChild =
                new DefaultMutableTreeNode("Employee Master");
               
        child.add(grandChild);
        

        grandChild =
                new DefaultMutableTreeNode("Client Master");
        child.add(grandChild);
        

        grandChild =
                new DefaultMutableTreeNode("Party Master");
        child.add(grandChild);
        

        grandChild =
                new DefaultMutableTreeNode("Vehicle Owner Master");
        child.add(grandChild);
        

        grandChild =
                new DefaultMutableTreeNode("Vehicle Master");
        child.add(grandChild);
       

        grandChild =
                new DefaultMutableTreeNode("Task Master");
        child.add(grandChild);
        
        
        
        child = new DefaultMutableTreeNode("Transaction Entry - Client");
        root.add(child);
        
        grandChild =
                new DefaultMutableTreeNode("Lorry Freight Entry");
        child.add(grandChild);
        /*grandChild =
                new DefaultMutableTreeNode("Client(Money In)");
        child.add(grandChild);*/
        grandChild =
                new DefaultMutableTreeNode("Client Collection Entry");
        child.add(grandChild);
        
        
        
        /*grandChild =
                new DefaultMutableTreeNode("Maintenence(Done)");
        child.add(grandChild);*/

        /*grandChild =
                new DefaultMutableTreeNode("Party(Money Out)");
        child.add(grandChild);*/
        child = new DefaultMutableTreeNode("Transaction Entry - Party");
        root.add(child);
        grandChild =
                new DefaultMutableTreeNode("Vehicle Alert Setup");
        child.add(grandChild);
        grandChild =
                new DefaultMutableTreeNode("Expense On Vehicle");
        child.add(grandChild);
        grandChild =
                new DefaultMutableTreeNode("Oil Entry On Vehicle");
        child.add(grandChild);
         grandChild =
                new DefaultMutableTreeNode("Payment Voucher Entry");
        child.add(grandChild);
       
        grandChild =
                new DefaultMutableTreeNode("Drivers Payment Entry");
        child.add(grandChild);
        grandChild =
                new DefaultMutableTreeNode("Vehicle Owner Payment");
        child.add(grandChild);
       /* grandChild =
                new DefaultMutableTreeNode("Journals Entry");
        child.add(grandChild);*/
        child = new DefaultMutableTreeNode("Transaction Entry - Office");
        root.add(child);
        grandChild =
                new DefaultMutableTreeNode("Office Expense");
        child.add(grandChild);
        grandChild =
                new DefaultMutableTreeNode("Cost To Vehicle Entry");
        child.add(grandChild);
        child = new DefaultMutableTreeNode("Book Keeping");
        root.add(child);
        
        grandChild =
                new DefaultMutableTreeNode("Maintenence Done");
        child.add(grandChild);
        grandChild =
                new DefaultMutableTreeNode("Loan  Maintenance");
        child.add(grandChild);
        
        grandChild =
                new DefaultMutableTreeNode("Balance Sheet");
        child.add(grandChild);
       
        child = new DefaultMutableTreeNode("Reports");
        root.add(child);
        child = new DefaultMutableTreeNode("Database Backup and Restore");
        root.add(child);
      
       /* grandChild =
                new DefaultMutableTreeNode("Client Report");
        child.add(grandChild);
       
        grandChild =
                new DefaultMutableTreeNode("Payment Report");
        child.add(grandChild);*/
        
        fileTree = new JTree(root);  
        class MyTreeCellRenderer extends DefaultTreeCellRenderer{
            public MyTreeCellRenderer(){
                setBackgroundNonSelectionColor(new java.awt.Color(200, 225, 250));
                setBackground(new java.awt.Color(200, 225, 250));
                setFont(new java.awt.Font("Microsoft Sans Serif", 0, 15));
            }
            public Color getBackground(){
                return null;
            }
        }
         //DefaultTreeCellRenderer renderer2 = new DefaultTreeCellRenderer();
        
        MyTreeCellRenderer renderer2 = new MyTreeCellRenderer();
        renderer2.setOpenIcon(null);
        renderer2.setClosedIcon(null);
        renderer2.setLeafIcon(null);
        fileTree.setBackground(new java.awt.Color(200, 225, 250));
        fileTree.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 14));
        fileTree.setRowHeight(22);
        fileTree.setCellRenderer(renderer2);
        fileTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
        
        panel.setBackground(new java.awt.Color(255, 255, 255));
        
        TreeNode root1 = (TreeNode) fileTree.getModel().getRoot();
        expandAll(fileTree, new TreePath(root1));
        //panel.setSize(1051, 623);
       
        fileTree.addTreeSelectionListener(new TreeSelectionListener() {
            public void valueChanged(TreeSelectionEvent event) {
              //  File file = (File) fileTree.getLastSelectedPathComponent();
              //  fileDetailsTextArea.setText(getFileDetails(file));
                  panel.removeAll();
                  TreePath[] paths = event.getPaths();
                  
                // Iterate through all affected nodes
                for (int i = 0; i < paths.length; i++) {
                    if (event.isAddedPath(i)) {
                       panel.updateUI();
                       
         try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                /*if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }*/UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
                
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(TransportTrackHome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(TransportTrackHome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(TransportTrackHome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(TransportTrackHome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
                       
                      if(paths[i].getLastPathComponent().toString().equals("Company Master")){
                        panel.add(new CompanyMaster()) ; 
                       } 
                      if(paths[i].getLastPathComponent().toString().equals("Employee Master")){
                        panel.add(new EmployeeMasterView()) ; 
                       }
                       if(paths[i].getLastPathComponent().toString().equals("Client Master")){
                        panel.add(new Client()) ; 
                       }
                       if(paths[i].getLastPathComponent().toString().equals("Vehicle Owner Master")){
                        panel.add(new VehicleOwnerMaster()) ; 
                       }
                       if(paths[i].getLastPathComponent().toString().equals("Vehicle Master")){
                        panel.add(new VehicleMaster()) ; 
                       }
                       if(paths[i].getLastPathComponent().toString().equals("Party Master")){
                        panel.add(new PartyMaster()) ; 
                       }
                       if(paths[i].getLastPathComponent().toString().equals("Task Master")){
                        panel.add(new TaskMaster()) ; 
                       }
                       if(paths[i].getLastPathComponent().toString().equals("Lorry Freight Entry")){
                        panel.add(new NewJobEntry()) ; 
                       }
                       if(paths[i].getLastPathComponent().toString().equals("Client Collection Entry")){
                        panel.add(new ClientCollectionEntry()) ; 
                       }
                        if(paths[i].getLastPathComponent().toString().equals("Maintenence Done")){
                        panel.add(new MaintenaceDone()) ; 
                       }
                        if(paths[i].getLastPathComponent().toString().equals("Vehicle Alert Setup")){
                        panel.add(new VehicleMaintenancePanel()) ; 
                       }
                          if(paths[i].getLastPathComponent().toString().equals("Loan  Maintenance")){
                        panel.add(new NewReceptsVoucher()) ; 
                       }
                          if(paths[i].getLastPathComponent().toString().equals("Payment Voucher Entry")){
                        panel.add(new NewPaymentsVoucher()) ; 
                       }
                           if(paths[i].getLastPathComponent().toString().equals("Drivers Payment Entry")){
                        panel.add(new DriverPaymentPannel()) ; 
                       }
                           /* if(paths[i].getLastPathComponent().toString().equals("Journals Entry")){
                        panel.add(new JournalContraVoucherPannel()) ; 
                       }*/
                             if(paths[i].getLastPathComponent().toString().equals("Oil Entry On Vehicle")){
                        panel.add(new OilEntryPannel()) ; 
                       }
                            if(paths[i].getLastPathComponent().toString().equals("Home")){
                        panel.add(new AlertPanel()) ; 
                       }
                            if(paths[i].getLastPathComponent().toString().equals("Transaction Entry")){
                        panel.add(new SearchPanel()) ; 
                       }
                            if(paths[i].getLastPathComponent().toString().equals("Expense On Vehicle")){
                        panel.add(new ExpensePanel()) ; 
                       }
                       /*     if(paths[i].getLastPathComponent().toString().equals("Transaction Entry - Client")){
                        panel.add(new Transaction_Client()) ; 
                       }*/
                            if(paths[i].getLastPathComponent().toString().equals("Balance Sheet")){
                        panel.add(new BalanceSheet()) ; 
                       }
                             if(paths[i].getLastPathComponent().toString().equals("Reports")){
                        panel.add(new NewReports()) ; 
                       }
                             if(paths[i].getLastPathComponent().toString().equals("Office Expense")){
                        panel.add(new OfficeExpensePanel()) ; 
                       }
                             if(paths[i].getLastPathComponent().toString().equals("Cost To Vehicle Entry")){
                        panel.add(new CostToVehicleEntry()) ; 
                       }
                             if(paths[i].getLastPathComponent().toString().equals("Database Backup and Restore")){
                        panel.add(new DatabaseBackupAndRestore()) ; 
                       }
                             if(paths[i].getLastPathComponent().toString().equals("Vehicle Owner Payment")){
                        panel.add(new VehicleOwnerPayment()) ; 
                       }
                        setVisible(true);
                       
                        // This node has been selected
                      //  new RegistrationForm(splitPane);
                       
                      // fileDetailsTextArea.setText(new RegistrationController());
                       // fileDetailsTextArea.setText(paths[i].getLastPathComponent().toString());
                       // System.out.println(paths[i].getLastPathComponent().toString());
                        break;
                    } else {
                        // This node has been deselected
                        break;
                    }
                } 
            }
        });
        
        initComponents();
        searchTree(fileTree, fileTree.getPathForRow(0), "Home");
        setExtendedState(this.getExtendedState() | this.MAXIMIZED_BOTH);
        //setSize(Toolkit.getDefaultToolkit().getScreenSize());
    }
    
    /*public void currentdate(){
        Calendar cal = new GregorianCalendar();
        int month = cal.get(Calendar.MONTH);
        int day = cal.get(Calendar.DAY_OF_MONTH);
        int year = cal.get(Calendar.YEAR);
        date_show.setText(day+"/"+(month+1)+"/"+year);
    }*/

    /**
     * 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.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        date_show = new javax.swing.JLabel();
        userName = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jSplitPane1 = new javax.swing.JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, new  JScrollPane(
            fileTree), new JScrollPane(panel));

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jPanel1.setBackground(new java.awt.Color(51, 51, 255));
    jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

    Calendar cal = new GregorianCalendar();
    int month = cal.get(Calendar.MONTH);
    int day = cal.get(Calendar.DAY_OF_MONTH);
    int year = cal.get(Calendar.YEAR);
    date_show.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
    date_show.setForeground(new java.awt.Color(255, 255, 255));
    date_show.setText("Date: "+day+"/"+(month+1)+"/"+year);

    userName.setFont(new java.awt.Font("Tahoma", 1, 12));
    userName.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
    Preferences myPrefObj = Preferences.userRoot();
    try{
        User user = (User)PreferenceUtil.getObject(myPrefObj, "user");
        userName.setForeground(new java.awt.Color(255, 255, 255));
        userName.setText("User: "+user.getFirstName()+" "+ user.getLastName());
    }catch(Exception e){
        System.out.println("Exception "+e.getMessage());
    }
    userName.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

    jButton1.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 12)); // NOI18N
    jButton1.setForeground(new java.awt.Color(255, 255, 255));
    jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/logout.png"))); // NOI18N
    jButton1.setText("Logout");
    jButton1.setContentAreaFilled(false);
    jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel1Layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(userName, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(153, 153, 153)
            .addComponent(date_show, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 326, Short.MAX_VALUE)
            .addComponent(jButton1)
            .addGap(5, 5, 5))
    );
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
            .addComponent(date_show, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(userName, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
    );

    userName.getAccessibleContext().setAccessibleName("");
    userName.getAccessibleContext().setAccessibleDescription("");

    jSplitPane1.setDividerLocation(233);
    jSplitPane1.setDividerSize(2);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addComponent(jSplitPane1)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(2, 2, 2)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE))
    );

    pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
         setVisible(false);
        new LoginController();
    }//GEN-LAST:event_jButton1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                /*if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }*/UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(TransportHome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(TransportHome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(TransportHome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(TransportHome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TransportHome().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel date_show;
    private javax.swing.JButton jButton1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JLabel userName;
    // End of variables declaration//GEN-END:variables
    private static void searchTree(JTree tree, TreePath path, String q) {
    TreeNode node = (TreeNode)path.getLastPathComponent();
    if (node==null) return;
    if (node.toString().equals(q)) {
      tree.addSelectionPath(path);
    }
    if (!node.isLeaf() && node.getChildCount()>=0) {
      java.util.Enumeration e = node.children();
      while (e.hasMoreElements()) {
        searchTree(tree, path.pathByAddingChild(e.nextElement()), q);
      }
    }
  }
    
    private void expandAll(JTree tree, TreePath parent) {
    TreeNode node = (TreeNode) parent.getLastPathComponent();
    if (node.getChildCount() >= 0) {
      for (Enumeration e = node.children(); e.hasMoreElements();) {
        TreeNode n = (TreeNode) e.nextElement();
        TreePath path = parent.pathByAddingChild(n);
        expandAll(tree, path);
      }
    }
    tree.expandPath(parent);
    // tree.collapsePath(parent);
  }
}

Commits for TransPort_Tracking/TransPortTracking/src/main/java/com/bestray/transtracking/views/TransportHome.java

Diff revisions: vs.
Revision Author Commited Message
1 girijabapi picture girijabapi Sat 28 Jul, 2018 05:29:14 +0000