Package base.drawable

Examples of base.drawable.TimeBoundingBox


            return;

        if ( node_dobj_order != null )
            treeroot.reorderDrawables( node_dobj_order );
        depth_root     = treeroot.getTreeNodeID().depth;
        timeframe_root = new TimeBoundingBox( treeroot );
        duration_root  = timeframe_root.getDuration();
        depth_init     = depth_root;
        iZoom_level    = 0;
        tZoomFactor    = (double) slog_ins.getNumChildrenPerNode();
        logZoomFactor  = Math.log( tZoomFactor );
View Full Code Here


            dobj_order         = itrOrder;
               
            isStartTimeOrdered = dobj_order.isStartTimeOrdered();

            TreeNode         treeroot;
            TimeBoundingBox  timebox_root;

            treetrunk    = new TreeTrunk( InputLog.this, dobj_order );
            treetrunk.initFromTreeTop();
            treeroot     = treetrunk.getTreeRoot();
            if ( treeroot == null ) {
                next_drawable = null;
                return;
            }
            timebox_root = new TimeBoundingBox( treeroot );
            // System.err.println( "Time Window is " + timebox_root );

            Iterator         entries;
            Map.Entry        entry;
            TreeNodeID       ID;
            TreeDirValue     val;
            TimeBoundingBox  timebox;
            /*
                timebox_set stores the TimeBoundingBoxes of all the leaf
                TreeNodes, these TimeBoundingBoxes are non-overlapping,
                so both TimeBoundingBox's INCRE_STARTTIME_ORDER and
                DECRE_FINALTIME_ORDER will arrange the non-overlapping
                timeboxes in the same increasing time order.  Similarly,
                TimeBoundingBox's DECRE_STARTTIME_ORDER and
                DECRE_FINALTIME_ORDER will arrange the non-overlapping
                in the same decreasing time order.
            */
            timebox_set = new TreeSet( dobj_order.getTimeBoundingBoxOrder() );
            entries      = treedir.entrySet().iterator();
            while ( entries.hasNext() ) {
                entry    = (Map.Entry) entries.next();
                ID       = (TreeNodeID) entry.getKey();
                val      = (TreeDirValue) entry.getValue();
                if ( ID.isLeaf() ) {
                    timebox = new TimeBoundingBox( val.getTimeBoundingBox() );
                    timebox_set.add( timebox );
                    // System.out.println( ID + " -> " + timebox );
                }
            }
            if ( dobj_order.isIncreasingTimeOrdered() ) {
                timebox = (TimeBoundingBox) timebox_set.first();
                timebox.setEarliestTime( timebox_root.getEarliestTime() );
                // System.out.println( "first_timebox -> " + timebox );
                timebox = (TimeBoundingBox) timebox_set.last();
                timebox.setLatestTime( timebox_root.getLatestTime() );
                // System.out.println( "last_timebox -> " + timebox );
            }
            else {
                timebox = (TimeBoundingBox) timebox_set.first();
                timebox.setLatestTime( timebox_root.getLatestTime() );
                // System.out.println( "first_timebox -> " + timebox );
                timebox = (TimeBoundingBox) timebox_set.last();
                timebox.setEarliestTime( timebox_root.getEarliestTime() );
                // System.out.println( "last_timebox -> " + timebox );
            }

            // Setup the iterator, timeboxes, to be used by nextObjGrpItr()
            timeboxes   = timebox_set.iterator();
View Full Code Here

            next_drawable  = this.getNextInQueue();
        }

        protected Iterator nextObjGrpItr( final TimeBoundingBox tframe )
        {
            TimeBoundingBox  timebox;
            Iterator         nestable_itr, nestless_itr;
            Iterator         dobj_itr;

            while ( timeboxes.hasNext() ) {
                timebox    = (TimeBoundingBox) timeboxes.next();
                current_timebox = timebox.getIntersection( tframe );
                if ( current_timebox != null ) {
                    treetrunk.scrollTimeWindowTo( current_timebox );
                    // System.out.println( current_timebox + ":" );
                    // System.out.println( treetrunk.toStubString() );
                    nestable_itr = null;
View Full Code Here

    }

    public void readObject( DataInput ins )
    throws java.io.IOException
    {
        timebounds = new TimeBoundingBox( ins );
        blockptr   = new FileBlockPtr( ins );
    }
View Full Code Here

        depth_init      = (short) ( depth_max
                                  - Parameters.INIT_SLOG2_LEVEL_READ + 1 );
        if ( depth_init < 0 )
            depth_init = 0;
        treetrunk.growInTreeWindow( treeroot, depth_init,
                                    new TimeBoundingBox( treeroot ) );
        treetrunk.setNumOfViewsPerUpdate( ScrollableObject.NumViewsTotal );

        isConnectedComposite = false;
        if ( methods != null && methods.length > 0 )
            isConnectedComposite = methods[ 0 ].isConnectCompositeState();
View Full Code Here

            zero_time = new Date();

        if ( root_frame == null )
            root_frame  = (Frame) SwingUtilities.windowForComponent( this );
        if ( timeframe4imgs == null )
            timeframe4imgs = new TimeBoundingBox( imgs_times );

        // Read the SLOG-2 TreeNodes within TimeFrame into memory
        /*
           The cursor needs to be set from the top container, so even when
           the mouse is at other components, e.g. ScrollbarTime,
View Full Code Here

        zoom_redo_stack.clear();
    }

    private void updateZoomStack( Stack zoom_stack )
    {
        TimeBoundingBox vport_timebox;
        vport_timebox = new TimeBoundingBox();
        vport_timebox.setEarliestTime( tView_init );
        vport_timebox.setLatestFromEarliest( tView_extent );
        zoom_stack.push( vport_timebox );
    }
View Full Code Here

    public void zoomUndo()
    {
        if ( ! zoom_undo_stack.empty() ) {
            this.updateZoomStack( zoom_redo_stack );
            TimeBoundingBox vport_timebox;
            vport_timebox = (TimeBoundingBox) zoom_undo_stack.pop();
            this.zoomBack( vport_timebox.getEarliestTime(),
                           vport_timebox.getDuration() );
            vport_timebox = null;
        }
    }
View Full Code Here

    public void zoomRedo()
    {
        if ( ! zoom_redo_stack.empty() ) {
            this.updateZoomStack( zoom_undo_stack );
            TimeBoundingBox vport_timebox;
            vport_timebox = (TimeBoundingBox) zoom_redo_stack.pop();
            this.zoomBack( vport_timebox.getEarliestTime(),
                           vport_timebox.getDuration() );
            vport_timebox = null;
        }
    }
View Full Code Here

                                           double      starttime,
                                           double      finaltime )
    {
        CategoryTimeBox[]  typeboxes;
        CategoryTimeBox    typebox;
        TimeBoundingBox    curr_timebox;
        boolean            isInclusive;
        double             prev_time, interval, duration;
        int                vis_typeboxes_length, idx;

        typeboxes  = avebox.arrayOfCategoryTimeBoxes();
        if ( isDisplayTypeExclusiveRatio() )
            Arrays.sort( typeboxes, CategoryTimeBox.EXCL_RATIO_ORDER );
        else // OverlapInclusionRatio, CumulativeInclusionRatio, FitMostLegends
            Arrays.sort( typeboxes, CategoryTimeBox.INCL_RATIO_ORDER );

        /*
           CategoryTimeBox[] is in ascending order of the respective ratio
           set TimeBoundingBox of CategoryTimeBox[] in descending ratio order
        */

        curr_timebox  = avebox.getCurrentTimeBoundingBox();
        curr_timebox.reinitialize();
        if ( isDisplayTypeEqualWeighted() ) {
            vis_typeboxes_length = 0;
            for ( idx = typeboxes.length-1; idx >= 0; idx-- ) {
                 if ( typeboxes[ idx ].isCategoryVisiblySearchable() )
                     vis_typeboxes_length++ ;
            }
            prev_time  = starttime;
            interval   = ( finaltime - starttime ) / vis_typeboxes_length;
            for ( idx = typeboxes.length-1; idx >= 0; idx-- ) {
                typebox   = typeboxes[ idx ];
                if ( typebox.isCategoryVisiblySearchable() ) {
                    typebox.setEarliestTime( prev_time );
                    typebox.setLatestFromEarliest( interval );
                    prev_time = typebox.getLatestTime();
                    curr_timebox.affectTimeBounds( typebox );
                }
            }
        }
        else {
            isInclusive  = ! isDisplayTypeExclusiveRatio();
            if ( isDisplayTypeCumulative() ) { // CumulativeXXclusionRatio
                prev_time  = starttime;
                duration   = finaltime - starttime;
                for ( idx = typeboxes.length-1; idx >= 0; idx-- ) {
                    typebox   = typeboxes[ idx ];
                    if ( typebox.isCategoryVisiblySearchable() ) {
                        interval  = duration
                                  * typebox.getCategoryRatio( isInclusive );
                        typebox.setEarliestTime( prev_time );
                        typebox.setLatestFromEarliest( interval );
                        prev_time = typebox.getLatestTime();
                        curr_timebox.affectTimeBounds( typebox );
                    }
               }
            }
            else // OverlapInclusionRatio, OverlapExclusiveRatio
                duration   = finaltime - starttime;
                for ( idx = typeboxes.length-1; idx >= 0; idx-- ) {
                    typebox   = typeboxes[ idx ];
                    if ( typebox.isCategoryVisiblySearchable() ) {
                        interval  = duration
                                  * typebox.getCategoryRatio( isInclusive );
                        typebox.setEarliestTime( starttime );
                        typebox.setLatestFromEarliest( interval );
                        curr_timebox.affectTimeBounds( typebox );
                    }
               }
            }
        }
    }
View Full Code Here

TOP

Related Classes of base.drawable.TimeBoundingBox

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.