Package logformat.slog2

Examples of logformat.slog2.LineIDMap


        Kind               next_kind;
        Topology           topo;
        CategoryMap        objdefs;   // Drawable def'n
        Map                shadefs;   // Shadow   def'n
        Category           objdef;
        LineIDMapList      lineIDmaps;
        LineIDMap          lineIDmap;
        Primitive          prime_obj;
        Composite          cmplx_obj;
        long               Nobjs;

        TreeTrunk          treetrunk;
        double             prev_dobj_endtime;
        double             curr_dobj_endtime;
        long               offended_Nobjs;
        Drawable           offended_dobj;



        //  Initialize prev_dobj_endtime to avoid complaint by compiler
        prev_dobj_endtime = Double.NEGATIVE_INFINITY;
        offended_Nobjs    = Integer.MIN_VALUE;
        offended_dobj     = null;

        out_filename      = null;
        del_iobjdefs      = null;
        parseCmdLineArgs( args );
        if ( out_filename == null )
            out_filename  = TraceName.getDefaultSLOG2Name( in_filename );

        objdefs       = new CategoryMap();
        shadefs       = new HashMap();
        lineIDmaps    = new LineIDMapList();
        Nobjs         = 0;

        // Initialize the SLOG-2 file for piped-input, output for this program.
        dobj_ins   = new WrappedInputLog( in_filename );
        if ( dobj_ins == null ) {
            System.err.println( "Null input logfile!" );
            System.exit( 1 );
        }
        if ( ! dobj_ins.isSLOG2() ) {
            System.err.println( in_filename + " is NOT SLOG-2 file!." );
            System.exit( 1 );
        }
        String err_msg;
        if ( (err_msg = dobj_ins.getCompatibleHeader()) != null ) {
            System.err.print( err_msg );
            WrappedInputLog.stdoutConfirmation();
        }
        dobj_ins.initialize();

        /* */    Date time1 = new Date();
        slog_outs  = new OutputLog( out_filename );

        //  Set Tree properties, !optional!
        //  TreeNode's minimum size, without any drawable/shadow, is 38 bytes.
        //  Drawable;s minimum size is 32 bytes, whether it is state/arrow.
        //  Arrow( with 2 integer infovalues ) is 40 bytes long.
        //  So, for 1 state primitive leaf, the size is 38 + 40 = 78 .
        if ( leaf_bytesize > 0 )
            slog_outs.setTreeLeafByteSize( leaf_bytesize );
        else
            slog_outs.setTreeLeafByteSize( dobj_ins.getTreeLeafByteSize() );
        if ( num_children_per_node > 0 )
            slog_outs.setNumChildrenPerNode( num_children_per_node );
        else
            slog_outs.setNumChildrenPerNode( dobj_ins.getNumChildrenPerNode() );

        treetrunk = new TreeTrunk( slog_outs, shadefs );
        /* */    Date time2 = new Date();
        while ( ( next_kind = dobj_ins.peekNextKind() ) != Kind.EOF ) {
            if ( next_kind == Kind.TOPOLOGY ) {
                topo = dobj_ins.getNextTopology();
                // Put in the default Shadow categories in case the original
                // does not have any shadow categories, i.e no shadows.
                objdef = Category.getShadowCategory( topo );
                objdefs.put( new Integer( objdef.getIndex() ), objdef );
                shadefs.put( topo, objdef );
            }
            else if ( next_kind == Kind.YCOORDMAP ) {
                lineIDmap = new LineIDMap( dobj_ins.getNextYCoordMap() );
                lineIDmaps.add( lineIDmap );
            }
            else if ( next_kind == Kind.CATEGORY ) {
                objdef = dobj_ins.getNextCategory();
                if ( objdef.isShadowCategory() ) {
                    objdefs.put( new Integer( objdef.getIndex() ), objdef );
View Full Code Here


                                  UIManager.get( "ScrollBar.minimumThumbSize" );        sb_minThumbSz.width = 4;
        UIManager.put( "ScrollBar.minimumThumbSize", sb_minThumbSz );


        /* Initialize the YaxisMaps through the initialization of YaxisTree */
        LineIDMapList lineIDmaps = slog_ins.getLineIDMapList();
        LineIDMap     lineIDmap  = (LineIDMap) lineIDmaps.get( view_ID );
        String[]      y_colnames = lineIDmap.getColumnLabels();
        y_maps      = new YaxisMaps( lineIDmap );
        y_tree      = new YaxisTree( y_maps.getTreeRoot() );
        y_maps.setTreeView( y_tree );  
                    /* done YaxisMaps initialization */
 
View Full Code Here

        public DrawableIterator( int kind_idx )
        {
            PipedInputLog.this.next_kind_idx  = kind_idx;
   
            TimeBoundingBox  timeframe;
            TreeDir          treedir;
            TreeDirValue     root_dir;
           
            treedir = PipedInputLog.super.getTreeDir();
            // System.out.println( treedir );
   
            root_dir  = (TreeDirValue) treedir.get( treedir.firstKey() );
            timeframe = new TimeBoundingBox( root_dir.getTimeBoundingBox() );
            dobj_itr  = PipedInputLog.super.iteratorOfRealDrawables( timeframe,
                                                      TRACE_ORDER,
                                                      InputLog.ITERATE_ALL );
            if ( dobj_itr.hasNext() )
View Full Code Here

        {
            PipedInputLog.this.next_kind_idx  = kind_idx;
   
            TimeBoundingBox  timeframe;
            TreeDir          treedir;
            TreeDirValue     root_dir;
           
            treedir = PipedInputLog.super.getTreeDir();
            // System.out.println( treedir );
   
            root_dir  = (TreeDirValue) treedir.get( treedir.firstKey() );
            timeframe = new TimeBoundingBox( root_dir.getTimeBoundingBox() );
            dobj_itr  = PipedInputLog.super.iteratorOfRealDrawables( timeframe,
                                                      TRACE_ORDER,
                                                      InputLog.ITERATE_ALL );
            if ( dobj_itr.hasNext() )
                next_dobj = (Drawable) dobj_itr.next();
View Full Code Here

        TopWindow.Control.setShowLegendButtonEnabled( !val );
    }

    public static void main( String[] args )
    {
        InputLog       in_slog_ins;
        LegendFrame    frame;

        checkVersion();
        parseCmdLineArgs( args );

        System.out.print( "Reading the SLOG-2 file ...... " );
        in_slog_ins  = new InputLog( in_filename );
        System.out.println( "Done." );
        String err_msg;
        if ( in_slog_ins == null ) {
            Dialogs.error( null, "Null InputLog!!" );
            in_slog_ins = null;
            System.exit( 1 );
        }
        if ( ! in_slog_ins.isSLOG2() ) {
            Dialogs.error( null, in_filename + " is NOT a SLOG-2 file!" );
            in_slog_ins = null;
            System.exit( 1 );
        }
        if ( (err_msg = in_slog_ins.getCompatibleHeader() ) != null ) {
            if ( ! Dialogs.confirm( null, err_msg
                                  + "Check the following version history "
                                  + "for compatibility.\n\n"
                                  + logformat.slog2.Const.VERSION_HISTORY + "\n"
                                  + "Do you still want to continue reading "
                                  + "the logfile ?" ) ) {
                in_slog_ins = null;
                System.exit( 1 );
            }
        }

        System.out.println( "Starting the SLOG-2 Legend .... " );
        in_slog_ins.initialize();
        frame     = new LegendFrame( in_slog_ins );
        // frame.pack() has to be called after the object is created
        frame.pack();
        frame.setVisible( true );
    }
View Full Code Here

                Dialogs.error( window,
                               "File " + logname + " cannot be read." );
                return null;
            }

            InputLog slog = null;
            try {
                slog = new InputLog( logname );
            } catch ( NullPointerException nperr ) {
                Dialogs.error( window,
                               "NullPointerException when initializing "
                             + logname + "!" );
                return null;
View Full Code Here

        String              convertor;
        String              path2jardir, path2tracelib;
        String              infile_name, outfile_name, jar_path;
        String              option4jar;
        File                infile, outfile, jar_file;
        InputLog            slog_ins;
        RuntimeExecCommand  exec_cmd;

        SwingProcessWorker  conv_worker;
        ProgressAction      conv_progress;

        // Check the validity of the Input File
        infile_name   = cmd_infile.getText();
        infile        = new File( infile_name );
        if ( ! infile.exists() ) {
            Dialogs.error( top_window,
                           infile_name + " does not exist!\n"
                         + "No conversion will take place." );
            return null;
        }
        if ( infile.isDirectory() ) {
            Dialogs.error( top_window,
                           infile_name + " is a directory!\n"
                         + "No conversion will take place." );
            return null;
        }
        if ( ! infile.canRead() ) {
            Dialogs.error( top_window,
                           "File " + infile_name + " is NOT readable!\n"
                         + "No conversion will take place." );
            return null;
        }
        slog_ins = null;
        try {
            slog_ins = new InputLog( infile_name );
        } catch ( NullPointerException nperr ) {
            slog_ins = null;
        } catch ( Exception err ) {
            slog_ins = null;
        }
        if ( slog_ins != null && slog_ins.isSLOG2() ) {
            Dialogs.error( top_window,
                           infile_name + " is already a SLOG-2 file!\n"
                         + "No conversion will take place." );
            cmd_outfile.setText( infile_name );
            return null;
View Full Code Here

                                 "\t It is too old to run this viewer." );
    }

    public static void main( String[] args )
    {
        InputLog       in_slog_ins;
        TimelineFrame  frame;
        String         err_msg;

        checkVersion();
        parseCmdLineArgs( args );

        // Debug.setActive( true ); Debug.initTextArea();

        System.out.print( "Reading the SLOG-2 file ...... " );
        in_slog_ins  = new InputLog( in_filename );
        if ( in_slog_ins == null ) {
            Dialogs.error( TopWindow.First.getWindow(), "Null InputLog!" );
            System.exit( 1 );
        }
        if ( ! in_slog_ins.isSLOG2() ) {
            Dialogs.error( TopWindow.First.getWindow(),
                           in_filename + " is NOT a SLOG-2 file!" );
            in_slog_ins = null;
            System.exit( 1 );
        }
        if ( (err_msg = in_slog_ins.getCompatibleHeader() ) != null ) {
            if ( ! Dialogs.confirm( TopWindow.First.getWindow(),
                            err_msg
                          + "Check the following version history "
                          + "for compatibility.\n\n"
                          + logformat.slog2.Const.VERSION_HISTORY + "\n"
                          + "Do you still want to continue reading "
                          + "the logfile ?" ) ) {
                 in_slog_ins = null;
                 System.exit( 1 );
            }
        }
        in_slog_ins.initialize();
        System.out.println( "Done." );

        /*  Initialization  */
        Parameters.initSetupFile();
        Parameters.readFromSetupFile( null );
View Full Code Here

    private static       double   time_final_ftr    = 1.0;
    private static       short    lowest_depth      = 0;

    public static final void main( String[] args )
    {
        InputLog         slog_ins;
        // CategoryMap      objdefs;
        TreeTrunk        treetrunk;
        TreeNode         treeroot;
        TimeBoundingBox  timebounds;
        String           err_msg;

        parseCmdLineArgs( args );

        slog_ins   = new InputLog( in_filename );
        if ( slog_ins == null ) {
            System.err.println( "Null input logfile!" );
            System.exit( 1 );
        }
        if ( ! slog_ins.isSLOG2() ) {
            System.err.println( in_filename + " is NOT SLOG-2 file!." );
            System.exit( 1 );
        }
        if ( (err_msg = slog_ins.getCompatibleHeader()) != null ) {
            System.err.print( err_msg );
            InputLog.stdoutConfirmation();
        }
        slog_ins.initialize();
        System.out.println( slog_ins );

        treetrunk  = new TreeTrunk( slog_ins, Drawable.INCRE_STARTTIME_ORDER );
        treetrunk.initFromTreeTop();
        treeroot   = treetrunk.getTreeRoot();
        if ( treeroot == null ) {
            System.out.println( "SLOG-2 file, " + in_filename + " "
                              + "contains no drawables" );
            slog_ins.close();
            System.exit( 0 );
        }

        timebounds = new TimeBoundingBox( treeroot );
        resetTimeBounds( timebounds );
        System.err.println( "Time Window is " + timebounds );

        treetrunk.growInTreeWindow( treeroot, lowest_depth, timebounds );
        if ( printNode )
            System.out.println( treetrunk.toString() );
        else
            System.out.println( treetrunk.toString( timebounds ) );
       
        slog_ins.close();
    }
View Full Code Here

    private static String             in_filename;
    private static short              depth_max, depth;

    public static final void main( String[] args )
    {
        InputLog          slog_ins;
        TreeTrunk         treetrunk;
        TreeNode          treeroot;
        TimeBoundingBox   timeframe_root, timeframe_old, timeframe;
        String            err_msg;

        parseCmdLineArgs( args );

        slog_ins   = new InputLog( in_filename );
        if ( slog_ins == null ) {
            System.err.println( "Null input logfile!" );
            System.exit( 1 );
        }
        if ( ! slog_ins.isSLOG2() ) {
            System.err.println( in_filename + " is NOT SLOG-2 file!." );
            System.exit( 1 );
        }
        if ( (err_msg = slog_ins.getCompatibleHeader()) != null ) {
            System.err.print( err_msg );
            InputLog.stdoutConfirmation();
        }
        slog_ins.initialize();
        // System.out.println( slog_ins );

        // Initialize the TreeTrunk
        treetrunk  = new TreeTrunk( slog_ins, Drawable.INCRE_STARTTIME_ORDER );
        treetrunk.setDebuggingEnabled( isVerbose );
        treetrunk.initFromTreeTop();
        treeroot        = treetrunk.getTreeRoot();
        if ( treeroot == null ) {
            System.out.println( "SLOG-2 file, " + in_filename + " "
                              + "contains no drawables" );
            slog_ins.close();
            System.exit( 0 );
        }
        timeframe_root  = new TimeBoundingBox( treeroot );
        depth_max       = treeroot.getTreeNodeID().depth;
        System.out.println( "TimeWindow = " + timeframe_root
                          + " @ dmax = " + depth_max );
        timeframe_old   = new TimeBoundingBox( timeframe_root );

        // Grow to a fixed size first
        // Init depth before getTimeWindowFromStdin()
        depth           = depth_max;
        timeframe       = getTimeWindowFromStdin( timeframe_old );
        System.out.println( "TimeWindow = " + timeframe
                          + " @ d = " + depth );
        treetrunk.growInTreeWindow( treeroot, depth, timeframe );
        if ( printAll )
            System.out.println( treetrunk.toString( timeframe ) );
        else
            System.out.println( treetrunk.toStubString() );
        timeframe_old = timeframe;

        // Navigate the slog2 tree
        while (    ( timeframe = getTimeWindowFromStdin( timeframe_old ) )
                != null ) {
            System.out.println( "TimeWindow = " + timeframe
                              + " @ d = " + depth );
            if ( changedPrintAll
               ||   treetrunk.updateTimeWindow( timeframe_old, timeframe )
                  > TreeTrunk.TIMEBOX_EQUAL ) {
                if ( printAll )
                    //System.out.println( treetrunk.toFloorString( timeframe ) );
                    System.out.println( treetrunk.toString( timeframe ) );
                    // System.out.println( treetrunk.toString() );
                else
                    System.out.println( treetrunk.toStubString() );
                timeframe_old = timeframe;
                changedPrintAll = false;
            }
        }

        slog_ins.close();
    }
View Full Code Here

TOP

Related Classes of logformat.slog2.LineIDMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.