Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * TraceViewer.java
    *
    * Created on April 16, 2002, 2:41 PM
    */
   
   package tools.tracesviewer;
   
   import javax.swing.*;
  import java.awt.*;
  import java.awt.event.*;
  import java.util.*;
  import java.net.*;
  import java.io.*;

Author(s):
deruelle
Version:
1.0
  
  public class TracesViewer extends javax.swing.JFrame {
  
      private boolean standaloneViewer = false;
  
      private String logFile;
  
      // Menus
      protected JMenuBar menuBar;
      protected JMenu displayAllSessionsMenu;
      protected JMenu optionsMenu;
      protected JMenu refreshMenu;
      protected JMenu aboutMenu;
      protected JMenu helpMenu;
      protected JMenu quitMenu;
  
      protected JMenuItem animationMenuItem;
      protected JMenuItem stackIdMenuItem;
  
      // The container: contain panels (one left and one center)
      protected JPanel firstPanel;
      protected JPanel secondPanel;
      protected JPanel firstSubPanel;
      protected JPanel secondSubPanel;
      protected JPanel thirdSubPanel;
  
      protected JButton scriptButton;
      //protected JButton refreshButton;
      protected Choice choice;
  
  
      // All the components inside the second panel
      protected JLabel sessionsLabel;
      protected TracesSessionsList tracesSessionsList;
      protected JButton messageContentButton;
      protected TextArea messageContentTextArea;
  
      protected TracesSessions tracesSessions;
      protected TracesCanvas tracesCanvas;
  
      protected static String rmiHost;
      protected static String rmiPort;
      protected static String stackId;
  
      protected static Image actorsImage = null;
      protected static Image backgroundImage = null;
      protected static Image facesImage = null;
      protected static Image logoNist = null;
  
      protected TracesAnimationThread animationThread = null;

    
Call this constructor when you want to construct a visualizer from traces that you have already read.

Parameters:
titles is an array containing the titles for the traces.
traces is an array containing an array of XML Formatted traces.
  
      public TracesViewer(
          Hashtable traces,
          String logName,
          String logDescription,
          String auxInfo) {
          //System.out.println("**** TRACE ******:\n"+trace+"\n");
          TracesSessions tss = new TracesSessions();
          Enumeration elements = traces.elements();
          tss.setName(logName);
           = logName;
          while (elements.hasMoreElements()) {
              MessageLogList mll = (MessageLogListelements.nextElement();
              TracesSession ts = new TracesSession(mll);
              ts.setName(logName);
              ts.setInfo(auxInfo);
              ts.setLogDescription(logDescription);
              tss.add(ts);
          }
  
          = new ListenerTracesViewer(this);
 
         // The order is important!!!!!
         // Look at the rmi registry for new traces
         // tracesSessions=refreshTracesSessions();
         this. = tss;
         this. = true;
         initComponents();
         // Initialisation of the tracesSessionsList:
         // Initialisation of the Thread for the animations:
 
         // width, height
         this.setSize(670, 620);
         this.setLocation(0, 0);
     }
 
     // Constructor for the GUILauncher only!!!!!
     public TracesViewer(
         String title,
         String aRmiHost,
         String aRmiPort,
         String aStackId) {
         super(title);
         try {
             /*
                 Toolkit toolkit=Toolkit.getDefaultToolkit();
                 backgroundImage=toolkit.getImage("./images/back.gif");
                 actorsImage=toolkit.getImage("./images/comp.gif");
                 facesImage=toolkit.getImage("./images/faces.jpg");
                 logoNist=toolkit.getImage("./images/nistBanner.jpg");
              */
 
             Toolkit toolkit = Toolkit.getDefaultToolkit();
             // this.backgroundImage=toolkit.getImage(back);
             URL url = TracesViewer.class.getResource("images/back.gif");
             // System.out.println("url:"+url.toString());
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource("images/comp.gif");
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource("images/faces.jpg");
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource("images/nistBanner.jpg");
              = toolkit.getImage(url);
 
         } catch (Exception e) {
              = null;
              = null;
              = null;
              = null;
             ..println("Problem with the Toolkit: no loaded images!!!");
             e.printStackTrace();
         }
 
          = aRmiHost;
          = aRmiPort;
          = aStackId;
 
          = new ListenerTracesViewer(this);
 
         // The order is important!!!!!
         // Look at the rmi registry for new traces
          = refreshTracesSessions();
         initComponents();
         // Initialisation of the tracesSessionsList:
         // Initialisation of the Thread for the animations:
 
         // width, height
         this.setSize(670, 620);
         // this.setLocation(0,0);
         this.show();
     }
 
     // Constructor for the Application only!!!!!
     public TracesViewer(
         String title,
         String aRmiHost,
         String aRmiPort,
         String aStackId,
         String back,
         String faces,
         String actors,
         String aLogoNist) {
         super(title);
         try {
             Toolkit toolkit = Toolkit.getDefaultToolkit();
             //System.out.println("back:"+back);
             // this.backgroundImage=toolkit.getImage(back);
             URL url = TracesViewer.class.getResource(back);
             //  System.out.println("url:"+url.toString());
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource(actors);
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource(faces);
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource(aLogoNist);
              = toolkit.getImage(url);
 
         } catch (Exception e) {
              = null;
              = null;
              = null;
              = null;
             ..println("Images are not loaded.");
 
             e.printStackTrace();
         }
 
          = aRmiHost;
          = aRmiPort;
          = aStackId;
 
          = new ListenerTracesViewer(this);
 
         // The order is important!!!!!
         // Look at the rmi registry for new traces
          = refreshTracesSessions();
         initComponents();
         // Initialisation of the tracesSessionsList:
         // Initialisation of the Thread for the animations:
 
         // width, height
         this.setSize(670, 620);
         this.setLocation(0, 0);
         this.show();
     }

    
constructor for the proxy **************************************
 
 
     // Constructor for the Application only!!!!!
     public TracesViewer(
         String logFile,
         Hashtable traces,
         String logName,
         String logDescription,
         String auxInfo,
         String title,
         String back,
         String faces,
         String actors,
         String aLogoNist) {
         super(title);
         this. = logFile;
         //System.out.println("back:"+back);
         try {
 
             Toolkit toolkit = Toolkit.getDefaultToolkit();
             //System.out.println("back:"+back);
             // this.backgroundImage=toolkit.getImage(back);
             URL url = TracesViewer.class.getResource(back);
             //  System.out.println("url:"+url.toString());
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource(actors);
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource(faces);
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource(aLogoNist);
              = toolkit.getImage(url);
 
             /*
                Toolkit toolkit=Toolkit.getDefaultToolkit();
                backgroundImage=toolkit.getImage(back);
                actorsImage=toolkit.getImage(actors);
                facesImage=toolkit.getImage(faces);
                this.logoNist=logoNist;
              */
         } catch (Exception e) {
              = null;
              = null;
              = null;
              = null;
             ..println("Images are not loaded.");
 
             e.printStackTrace();
         }
 
         TracesSessions tss = new TracesSessions();
         tss.setName(logName);
         if (traces != null) {
             Enumeration elements = traces.elements();
             while (elements.hasMoreElements()) {
                 MessageLogList mll = (MessageLogListelements.nextElement();
                 TracesSession ts = new TracesSession(mll);
                 ts.setName(logName);
                 ts.setInfo(auxInfo);
                 ts.setLogDescription(logDescription);
                 tss.add(ts);
             }
         }
         if (tss.isEmpty()) {
             TracesSession ts = new TracesSession();
             ts.setName("No available session, refresh");
             tss.add(ts);
         }
 
          = new ListenerTracesViewer(this);
 
         this. = tss;
         initComponents();
         // Initialisation of the tracesSessionsList:
         // Initialisation of the Thread for the animations:
 
         // width, height
         this.setSize(670, 620);
         this.setLocation(0, 0);
     }

    
Use this constructor when retrieving a trace from a log file.
 
     public TracesViewer(
         String title,
         String logFile,
         String back,
         String faces,
         String actors,
         String logoNist) {
         super(title);
         this. = logFile;
          = new ListenerTracesViewer(this);
 
         // The order is important!!!!!
         // Look at the rmi registry for new traces
          = refreshTracesSessions();
         initComponents();
         // Initialisation of the tracesSessionsList:
         // Initialisation of the Thread for the animations:
 
         // width, height
         this.setSize(670, 620);
         this.setLocation(0, 0);
         this.show();
 
     }

    
/
 
 
     // Constructor for the daemon only!!!!!
     public TracesViewer(
         String port,
         String logFile,
         Hashtable traces,
         String logName,
         String logDescription,
         String auxInfo,
         String title,
         String back,
         String faces,
         String actors,
         String aLogoNist) {
         super(title);
         this. = logFile;
 
         try {
             Toolkit toolkit = Toolkit.getDefaultToolkit();
             URL url = TracesViewer.class.getResource(back);
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource(actors);
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource(faces);
              = toolkit.getImage(url);
             url = TracesViewer.class.getResource(aLogoNist);
              = toolkit.getImage(url);
         } catch (Exception e) {
              = null;
              = null;
              = null;
              = null;
             ..println("Images are not loaded.");
 
             e.printStackTrace();
         }
 
         TracesSessions tss = new TracesSessions();
         tss.setName(logName);
         if (traces != null) {
             Enumeration elements = traces.elements();
             while (elements.hasMoreElements()) {
                 MessageLogList mll = (MessageLogListelements.nextElement();
                 TracesSession ts = new TracesSession(mll);
                 ts.setName(logName);
                 ts.setInfo(auxInfo);
                 ts.setLogDescription(logDescription);
                 tss.add(ts);
             }
         }
         if (tss.isEmpty()) {
             TracesSession ts = new TracesSession();
             ts.setName("No available session, refresh");
             tss.add(ts);
         }
 
          = new ListenerTracesViewer(this);
 
         this. = tss;
         initComponents();
         // Initialisation of the tracesSessionsList:
         // Initialisation of the Thread for the animations:
 
         // width, height
         this.setSize(670, 620);
         this.setLocation(0, 0);
 
         try {
             // Try to open a connection:
             TracesSocket ts = new TracesSocket(logFileport);
             ts.start();
         } catch (Exception e) {
             e.printStackTrace();
         }
         this.show();
     }

    
/
 
 
         TracesSessions retval = null;
         TracesSessions tss = new TracesSessions();
         String trace = null;
         try {
             if (this. != null) {
                 File file = new File(this.);
                 char[] cbuf = new char[(intfile.length()];
                 FileReader fr = new FileReader(file);
                 fr.read(cbuf);
                 fr.close();
                 trace = new String(cbuf);
 
             }
             //System.out.println("**** TRACE ******:\n"+trace+"\n");
             if (trace != null && !trace.equals("")) {
                 LogFileParser parser = new LogFileParser();
                 Hashtable traces = parser.parseLogsFromString(trace);
                 Enumeration elements = traces.elements();
                 while (elements.hasMoreElements()) {
                     MessageLogList mll =
                         (MessageLogListelements.nextElement();
                     TracesSession ts = new TracesSession(mll);
                     ts.setName(parser.logName);
                     ts.setLogDescription(parser.logDescription);
                     ts.setInfo(parser.auxInfo);
                     tss.add(ts);
                 }
                 tss.setName(parser.logName);
 
                 retval = tss;
             } else {
                 TracesSession ts = new TracesSession();
                 ts.setName("No available session, refresh");
                 tss.add(ts);
                 retval = tss;
             }
         } catch (Exception e) {
             ..println("*** Exception retrieving trace ***");
             e.printStackTrace();
             TracesSession ts = new TracesSession();
             ts.setName("No available session, refresh");
             tss.add(ts);
             retval = tss;
         }
 
          = retval;
         return ;
     }
 
     public TracesSessions getTracesSessions() {
         return ;
     }

    
/
 
 
     private void initComponents() {

        
The main container **************************
 
 
         Container container = this.getContentPane();
         container.setLayout(new BoxLayout(container.));
         //container.setLayout( new PercentLayout() );
         container.setBackground(.);
 
         addWindowListener(new WindowAdapter() {
             public void windowClosing(WindowEvent e) {
                 ..println("Trace viewer closed!");
                 // System.exit(0);
             }
         });

        
Menu bar ************************************
 
          = new JMenuBar();
         setJMenuBar();
 
         //Build a second menu in the menu bar.
          = new JMenu("      Options      ");
         .setToolTipText("Some options related to the GUI");
          = new JMenuItem("    Animation    ");
             "Animation of the entire selected session");
             public void actionPerformed(ActionEvent evt) {
                 .animationActionPerformed(evt);
             }
         });
         .add();
 
         // create a menu and add it to the menubar
          = new JMenu("    Display Sessions    ");
             "Display all the retrieved sessions in a separate windows");
             public void mouseClicked(MouseEvent evt) {
                 .displayAllSessionsMouseEvent(evt);
             }
         });
         // add the Controls menu to the menu bar
 
         // create a menu and add it to the menubar
          = new JMenu("   Refresh   ");
         .setBackground(new Color(51, 153, 255));
         .setToolTipText("Get the new traces");
         .addMouseListener(new MouseAdapter() {
             public void mouseClicked(MouseEvent evt) {
                 .refreshActionPerformed(evt);
             }
         });
         // add the Controls menu to the menu bar
         .add();
 
         //...create and add some menus...
         .add(Box.createHorizontalGlue());
 
          = new JMenu("    Help    ");
         .setToolTipText("Some useful notes about this tool");
         .addMouseListener(new MouseAdapter() {
             public void mouseClicked(MouseEvent evt) {
                 .helpMenuMouseEvent(evt);
             }
         });
         .add();
 
          = new JMenu("    About    ");
         .setToolTipText("Some advertises about the creators!");
         .addMouseListener(new MouseAdapter() {
             public void mouseClicked(MouseEvent evt) {
                 .aboutMenuMouseEvent(evt);
             }
         });
         .add();
 
          = new JMenu("    Quit    ");
         .setToolTipText("Quit the traces viewer");
         .addMouseListener(new MouseAdapter() {
             public void mouseClicked(MouseEvent evt) {
                 close();
             }
         });
         .add();

        
FIRST PANEL ******************************
 
 
          = new JPanel();
         // If put to False: we see the container's background
         .setOpaque(false);
         .setLayout(new PercentLayout());
         //firstPanel.setLayout(  new BorderLayout() );
         container.add();
 
         // Sub right panel:
         // topx %, topy %, width %, height % 73, 100-> 65, 95
         PercentLayoutConstraint firstPanelConstraint =
             new PercentLayoutConstraint(30, 0, 70, 100);
          = new TracesSessionsList();
             public void itemStateChanged(ItemEvent e) {
                 .tracesSessionsListStateChanged(e);
             }
         });
         .setFont(new Font("Dialog", 1, 14));
 
         ScrollPane scroll = new ScrollPane(.);
         TracesSession tracesSession =
             (TracesSession.firstElement();
         String name = tracesSession.getName();
         String logDescription = tracesSession.getLogDescription();
         String callId = .getCallId(name);
         String origin = .getOrigin(name);
 
         // Warning: to put before for the canvas!!!!
         TextArea messageContentTextArea = new TextArea();
          = new JButton("SIP Message:");
         if (name.equals("No available session, refresh")) {
              =
                 new TracesCanvas(
                     tracesSession,
                     messageContentTextArea,
                     "unknown",
                     this);
         } else if (
             logDescription == null || logDescription.trim().equals("")) {
              =
                 new TracesCanvas(
                     tracesSession,
                     messageContentTextArea,
                     origin,
                     this);
         } else {
             //  System.out.println("logDesc44:"+logDescription);
              =
                 new TracesCanvas(
                     tracesSession,
                     messageContentTextArea,
                     logDescription,
                     this);
         }
 
         // The ScrollPane for the Canvas
         scroll.add();
         .add(scrollfirstPanelConstraint);

        
SECOND PANEL ******************************
 
 
         //  left panel:
          = new JPanel();
         // rows, columns
         //  secondPanel.setLayout(new GridLayout(3,1,0,0) );
         .setLayout(new BorderLayout());
         // topx %, topy %, width %, height %
         PercentLayoutConstraint secondPanelConstraint =
             new PercentLayoutConstraint(0, 0, 30, 100);
         .add(secondPanelConstraint);

        
FIRST SUB PANEL ********************************
 
 
         // Sub left panel:
          = new JPanel();
         // Top, left, bottom, right
         .setBorder(BorderFactory.createEmptyBorder(5, 5, 7, 5));
 
         if (!) {
             // rows, columns, gap, gap
             .setLayout(new GridLayout(2, 1, 3, 6));
             .add(.);
 
             JPanel panelGrid = new JPanel();
             panelGrid.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
             panelGrid.setLayout(new GridLayout(2, 1, 0, 0));
 
             JPanel panelBox = new JPanel();
             panelBox.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
             panelBox.setLayout(new BorderLayout());
 
             JLabel scriptLabel = new JLabel("Display the event script:");
             scriptLabel.setToolTipText(
                 "Display the content of the selected script");
 
             scriptLabel.setHorizontalAlignment(.);
             scriptLabel.setForeground(.);
             scriptLabel.setFont(new Font("Dialog", 1, 14));
             // If put to true: we see the label's background
             scriptLabel.setOpaque(true);
             panelGrid.add(scriptLabel);
 
              = new Choice();
             panelBox.add(.);
 
              = new JButton("Open");
             .setToolTipText(
                 "Get the script controlling the current session");
             .setFont(new Font("Dialog", 1, 14));
             .setFocusPainted(false);
             .setBackground(new Color(186, 175, 175));
             .setBorder(new BevelBorder(.));
             panelBox.add(.);
             .addActionListener(new ActionListener() {
                 public void actionPerformed(ActionEvent evt) {
                     .scriptActionPerformed(evt);
                 }
             });
             panelGrid.add(panelBox);
             .add(panelGrid);
             //initComboBox();
 
             /*
             refreshButton=new JButton("Refresh");
             refreshButton.setToolTipText("Refresh all the sessions");
             refreshButton.setFont(new Font ("Dialog", 1, 14));
             refreshButton.setFocusPainted(false);
             //refreshButton.setBackground(new Color(186,175,175));
             refreshButton.setBackground( new Color(51,153,255));
             refreshButton.setBorder(new BevelBorder(BevelBorder.RAISED));
             refreshButton.setVerticalAlignment(AbstractButton.CENTER);
             refreshButton.setHorizontalAlignment(AbstractButton.CENTER);
             firstSubPanel.add(refreshButton);
             refreshButton.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent evt) {
                      listenerTracesViewer.refreshActionPerformed(evt);
                }
             }
             );
              */
             ImageIcon icon;
             if ( != null) {
                 icon = new ImageIcon();
 
                 JLabel label = new JLabel(icon);
                 label.setVisible(true);
                 label.setToolTipText("The NIST logo!!!");
                 //label.setHorizontalAlignment(AbstractButton.CENTER);
                 label.setForeground(.);
                 //label.setFont(new Font ("Dialog", 1, 14));
                 label.setOpaque(false);
                 .add(label);
             }
         } else {
             // rows, columns, gap, gap
             .setLayout(new GridLayout(1, 1, 3, 6));
             .add(.);
 
             ImageIcon icon;
             if ( != null) {
                 icon = new ImageIcon();
                 JLabel label = new JLabel(icon);
                 label.setVisible(true);
                 label.setToolTipText("The NIST logo!!!");
                 label.setHorizontalAlignment(.);
                 label.setForeground(.);
                 label.setFont(new Font("Dialog", 1, 14));
                 label.setOpaque(false);
                 .add(label);
             }
         }

        
SECOND SUB PANEL **************************************
 
         JPanel panel = new JPanel();
         panel.setLayout(new GridLayout(2, 1, 0, 0));
         .add(panel.);
          = new JPanel();
         .setLayout(new BorderLayout());
         //secondPanel.add(secondSubPanel);
         panel.add();
 
          = new JLabel("Sessions available:");
         .setToolTipText("All the sessions currently available");
         // Alignment of the text
         // Color of the text
         // Size of the text
         .setFont(new Font("Dialog", 1, 14));
         // If put to true: we see the label's background
         .setOpaque(true);
         .setBorder(BorderFactory.createLineBorder(.));
 
         ScrollPane scrollList = new ScrollPane(.);
         scrollList.add();
         //secondSubPanel.add(scrollList,BorderLayout.CENTER);
         .add(.);

        
THIRD SUB PANEL **************************************
 
 
          = new JPanel();
         .setLayout(new BorderLayout());
         //secondPanel.add(thirdSubPanel);
         panel.add();
 
             "Display all the content of the current SIP message");
         // Alignment of the text
         // Color of the text
         // Size of the text
         .setFont(new Font("Dialog", 1, 14));
         // If put to true: we see the label's background
         .setOpaque(true);
             BorderFactory.createLineBorder(.));
             public void actionPerformed(ActionEvent evt) {
                 .debugActionPerformed(evt);
             }
         });
         messageContentTextArea.setBackground(.);
         messageContentTextArea.setEditable(false);
         messageContentTextArea.setFont(new Font("Dialog", 1, 12));
         messageContentTextArea.setForeground(.);
         .add(messageContentTextArea.);
 
         validateTree();
     }
 
     public void close() {
         ..println("Trace viewer closed!");
         this.dispose();
         //  System.exit(0);
 
     }
 
     public static void usage() {
         ..println("***************************************");
         ..println("*** missing or incorrect parameters ***");
         ..println("*************************************\n");
         ..println("When you create your SIP Stack specify");
         ..println("gov.nist.javax.sip.stack.SERVER_LOG = fileName\n");
         ..println("gov.nist.javax.sip.stack.DEBUG_LOG = debugFileName\n");
         ..println("*************************************");
         ..println(
         "Use this tool to view the signaling trace as a sequence Diagram");
         ..println"Usage (if classpath correctly set):\n\n");
         ..println("When viewing from a server file:\n" +
         " --> java tools.tracesviewer.tracesViewer -debug_file debugFileName\n");
         ..println("When viewing from a debug file:\n" +
             " --> java tools.tracesviewer.tracesViewer -server_file fileName");
         ..println("*************************************\n" );
         System.exit(0);
     }
 
     // This method is only used by the GUI proxy!!!!!
     // We do not need to use the prompt!!!
     public static void main(String args[]) {
         try {
             if (args.length == 0) {
                 ..println("Using default parameters!");
                 ..println(
                     "Everything is Ok ... Launching the Traces viewer");
                 TracesViewer tracesViewer =
                     new TracesViewer(
                         "Traces viewer",
                         "127.0.0.1",
                         "1099",
                         "127.0.0.1:5060");
 
             } else if (args[0].equals("-debug_file")) {
                 String fileName = args[1];
                 LogFileParser parser = new LogFileParser();
                 Hashtable traces = parser.parseLogsFromDebugFile(fileName);
 
                 new TracesViewer(
                     fileName,
                     traces,
                     parser.logName,
                     parser.logDescription,
                     parser.auxInfo,
                     "traces viewer",
                     "images/back.gif",
                     "images/faces.jpg",
                     "images/comp.gif",
                     "images/nistBanner.jpg")
                     .show();
 
                 return;
 
             } else if (args[0].equals("-server_file")) {
                 String fileName = args[1];
                 LogFileParser parser = new LogFileParser();
                 Hashtable traces = parser.parseLogsFromFile(fileName);
 
                 new TracesViewer(
                     fileName,
                     traces,
                     parser.logName,
                     parser.logDescription,
                     parser.auxInfo,
                     "traces viewer",
                     "images/back.gif",
                     "images/faces.jpg",
                     "images/comp.gif",
                     "images/nistBanner.jpg")
                     .show();
 
                 return;
 
             } else if (args[0].equals("-daemon")) {
 
                 int length = args.length;
 
                 String port = "10000";
                 String fileName = "NOT SET";
                 for (int k = 0; k < lengthk++) {
 
                     if (args[k].equals("-server_file")) {
                         fileName = args[k + 1];
                         k++;
                     } else if (args[k].equals("-port")) {
                         port = args[k + 1];
                         k++;
                     }
                 }
                 LogFileParser parser = new LogFileParser();
                 Hashtable traces = parser.parseLogsFromFile(fileName);
 
                 new TracesViewer(
                     port,
                     fileName,
                     traces,
                     parser.logName,
                     parser.logDescription,
                     parser.auxInfo,
                     "traces viewer daemon",
                     "images/back.gif",
                     "images/faces.jpg",
                     "images/comp.gif",
                     "images/nistBanner.jpg")
                     .show();
 
                 return;
 
             } else {
                 int length = args.length;
 
                 String rmiHost = "127.0.0.1";
                 String rmiPort = "1099";
                 String stackId = null;
                 String back = null;
                 String faces = null;
                 String actors = null;
                 String logoNist = null;
                 boolean launcher = false;
                 for (int k = 0; k < lengthk++) {
                     if (args[k].equals("-rmihost")) {
                         rmiHost = args[k + 1];
                         k++;
                     } else if (args[k].equals("-rmiport")) {
                         rmiPort = args[k + 1];
                         k++;
                     } else if (args[k].equals("-stackId")) {
                         stackId = args[k + 1];
                         k++;
                     } else if (args[k].equals("-back")) {
                         launcher = true;
                         back = args[k + 1];
                         k++;
                     } else if (args[k].equals("-faces")) {
                         faces = args[k + 1];
                         k++;
                     } else if (args[k].equals("-actors")) {
                         actors = args[k + 1];
                         k++;
                     } else if (args[k].equals("-logoNist")) {
                         logoNist = args[k + 1];
                         k++;
                     } else
                         usage();
                 }
                 TracesViewer tracesViewer;
                 if (rmiHost == null) {
                     ..println("Assuming RMI host = 127.0.0.1");
                 }
                 if (stackId == null) {
                     ..println(
                         "Stack Id (name) not specified Bailing!"
                             + " Please specify stackId (JAIN stack name) "
                             + " using -stackId flag");
                     System.exit(0);
                 }
 
                 if (launcher)
                     tracesViewer =
                         new TracesViewer(
                             "Traces viewer",
                             rmiHost,
                             rmiPort,
                             stackId,
                             back,
                             faces,
                             actors,
                             logoNist);
                 else
                     tracesViewer =
                         new TracesViewer(
                             "Traces viewer",
                            rmiHost,
                            rmiPort,
                            stackId);
                ..println(
                    "Everything is Ok ... Launching the Traces viewer");
            }
        } catch (Exception e) {
            ..println("Problem starting viewer. I give up :)");
            e.printStackTrace();
        }
    }