Examples of Drawable


Examples of base.drawable.Drawable

    private void setRealDrawableExclusion()
    {
        Object[]          timeblocks;
        Stack             nesting_stack;
        Iterator          dobjs_itr;
        Drawable          curr_dobj, stacked_dobj;

        timeblocks     = set_timeblocks.toArray();
        nesting_stack  = new Stack();

        //  Assume dobjs_itr returns in Increasing Starttime order
        dobjs_itr      = list_nestables.iterator();
        while ( dobjs_itr.hasNext() ) {
            curr_dobj  = (Drawable) dobjs_itr.next();
            curr_dobj.initExclusion( timeblocks );
            while ( ! nesting_stack.empty() ) {
                stacked_dobj = (Drawable) nesting_stack.peek();
                if ( stacked_dobj.covers( curr_dobj ) ) {
                    stacked_dobj.decrementExclusion( curr_dobj.getExclusion() );
                    break;
                }
                else
                    nesting_stack.pop();
            }
View Full Code Here

Examples of base.drawable.Drawable

    }

    private void adjustMapOfCategoryWeightFs()
    {
        Iterator          dobjs_itr;
        Drawable          curr_dobj;
        Category          dobj_type;
        CategoryWeightF   dobj_twgf;
        float             excl_ratio;

        dobjs_itr      = list_nestables.iterator();
        while ( dobjs_itr.hasNext() ) {
            curr_dobj  = (Drawable) dobjs_itr.next();
            excl_ratio = (float) ( curr_dobj.getExclusion() / box_duration );
            dobj_type  = curr_dobj.getCategory();
            // CategoryWeightF is guaranteed to be in map_type2twgf
            dobj_twgf  = (CategoryWeightF) map_type2twgf.get( dobj_type );
            dobj_twgf.addExclusiveRatio( excl_ratio );
        }
        list_nestables.clear();
View Full Code Here

Examples of base.drawable.Drawable

    // This is for a backward NEW SEARCH
    public Drawable previousDrawable( double searching_time )
    {
        Iterator  dobjs;
        Drawable  dobj;
        /*
           Use an infinite TimeBoundingBox so iteratorOfAllDrawables() returns
           all drawables in the memory disregarding the treefloor's timebounds
        */
        dobjs = treetrunk.iteratorOfAllDrawables( TimeBoundingBox.ALL_TIMES,
                                                  DECRE_STARTTIME_ORDER,
                                                  isConnectedComposite,
                                                  IS_NESTABLE );
        criteria.initMatch();
        while ( dobjs.hasNext() ) {
            dobj    = (Drawable) dobjs.next();
            if (    dobj.getCategory().isVisiblySearchable()
                 && dobj.getEarliestTime() <= searching_time
                 && dobj.containSearchable()
                 && criteria.isMatched( dobj ) ) {
                last_found_dobj = dobj;
                return last_found_dobj;
            }
        }
View Full Code Here

Examples of base.drawable.Drawable

    // This is for a backward CONTINUING SEARCH
    public Drawable previousDrawable()
    {
        Iterator  dobjs;
        Drawable  dobj;

        if ( last_found_dobj == null ) {
            System.err.println( "SearchTreeTrunk.previousDrawable(): "
                              + "Unexpected error, last_found_dobj == null" );
            return null;
        }
        /*
           Use an infinite TimeBoundingBox so iteratorOfAllDrawables() returns
           all drawables in the memory disregarding the treefloor's timebounds
        */
        dobjs = treetrunk.iteratorOfAllDrawables( TimeBoundingBox.ALL_TIMES,
                                                  DECRE_STARTTIME_ORDER,
                                                  isConnectedComposite,
                                                  IS_NESTABLE );
        criteria.initMatch();
        while ( dobjs.hasNext() ) {
            dobj    = (Drawable) dobjs.next();
            if (    dobj.getCategory().isVisiblySearchable()
                 && DECRE_STARTTIME_ORDER.compare( dobj, last_found_dobj ) > 0
                 && dobj.containSearchable()
                 && criteria.isMatched( dobj ) ) {
                last_found_dobj = dobj;
                return last_found_dobj;
            }
        }
View Full Code Here

Examples of base.drawable.Drawable

    // This is for a forward NEW SEARCH
    public Drawable nextDrawable( double searching_time )
    {
        Iterator  dobjs;
        Drawable  dobj;
        /*
           Use an infinite TimeBoundingBox so iteratorOfAllDrawables() returns
           all drawables in the memory disregarding the treefloor's timebounds
        */
        dobjs = treetrunk.iteratorOfAllDrawables( TimeBoundingBox.ALL_TIMES,
                                                  INCRE_STARTTIME_ORDER,
                                                  isConnectedComposite,
                                                  IS_NESTABLE );
        criteria.initMatch();
        while ( dobjs.hasNext() ) {
            dobj    = (Drawable) dobjs.next();
            if (    dobj.getCategory().isVisiblySearchable()
                 && dobj.getEarliestTime() >= searching_time
                 && dobj.containSearchable()
                 && criteria.isMatched( dobj ) ) {
                last_found_dobj = dobj;
                return last_found_dobj;
            }
        }
View Full Code Here

Examples of base.drawable.Drawable

    // This is for a forward CONTINUING SEARCH
    public Drawable nextDrawable()
    {
        Iterator  dobjs;
        Drawable  dobj;

        if ( last_found_dobj == null ) {
            System.err.println( "SearchTreeTrunk.nextDrawable(): "
                              + "Unexpected error, last_found_dobj == null" );
            return null;
        }
        /*
           Use an infinite TimeBoundingBox so iteratorOfAllDrawables() returns
           all drawables in the memory disregarding the treefloor's timebounds
        */
        dobjs = treetrunk.iteratorOfAllDrawables( TimeBoundingBox.ALL_TIMES,
                                                  INCRE_STARTTIME_ORDER,
                                                  isConnectedComposite,
                                                  IS_NESTABLE );
        criteria.initMatch();
        while ( dobjs.hasNext() ) {
            dobj    = (Drawable) dobjs.next();
            if (    dobj.getCategory().isVisiblySearchable()
                 && INCRE_STARTTIME_ORDER.compare( dobj, last_found_dobj ) > 0
                 && dobj.containSearchable()
                 && criteria.isMatched( dobj ) ) {
                last_found_dobj = dobj;
                return last_found_dobj;
            }
        }
View Full Code Here

Examples of base.drawable.Drawable

    public BufForTimeAveBoxes
    createBufForTimeAveBoxes( final TimeBoundingBox  timebox )
    {
        BufForTimeAveBoxes  buf2statboxes;
        Iterator            dobjs, sobjs;
        Drawable            dobj;
        Shadow              sobj;

        buf2statboxes   = new BufForTimeAveBoxes( timebox );
        criteria.initMatch();

        // Merge Nestable Shadows
        sobjs = treetrunk.iteratorOfLowestFloorShadows( timebox,
                                                        INCRE_STARTTIME_ORDER,
                                                        IS_NESTABLE );
        while ( sobjs.hasNext() ) {
            sobj = (Shadow) sobjs.next();
            if (    sobj.getCategory().isVisiblySearchable()
                 && sobj.containSearchable()
                 && criteria.isMatched( sobj ) ) {
                buf2statboxes.mergeWithNestable( sobj );
            }
        }

        // Merge Nestable Real Drawables
        dobjs = treetrunk.iteratorOfRealDrawables( timebox,
                                                   INCRE_STARTTIME_ORDER,
                                                   isConnectedComposite,
                                                   IS_NESTABLE );
        while ( dobjs.hasNext() ) {
            dobj = (Drawable) dobjs.next();
            if (    dobj.getCategory().isVisiblySearchable()
                 && dobj.containSearchable()
                 && criteria.isMatched( dobj ) ) {
                buf2statboxes.mergeWithNestable( dobj );
            }
        }

        // Compute ExclusiveDurationRatio of CategoryWeights in buf2statboxes
        buf2statboxes.setNestingExclusion();

        // Merge Nestless Real Drawables
        dobjs = treetrunk.iteratorOfRealDrawables( timebox,
                                                   INCRE_STARTTIME_ORDER,
                                                   isConnectedComposite,
                                                   !IS_NESTABLE );
        while ( dobjs.hasNext() ) {
            dobj = (Drawable) dobjs.next();
            if (    dobj.getCategory().isVisiblySearchable()
                 && dobj.containSearchable()
                 && criteria.isMatched( dobj ) ) {
                buf2statboxes.mergeWithNestless( dobj );
            }
        }
View Full Code Here

Examples of base.drawable.Drawable

        next_drawable  = this.getNextInQueue();
    }

    private Drawable getNextInQueue()
    {
        Drawable   next_dobj;
        while ( drawables_itr.hasNext() ) {
            next_dobj = (Drawable) drawables_itr.next();
            if ( next_dobj.overlaps( timeframe ) )
                return next_dobj;
        }
        return null;
    }
View Full Code Here

Examples of base.drawable.Drawable

        return next_drawable != null;
    }

    public Object next()
    {
        Drawable  returning_dobj;

        returning_dobj = next_drawable;
        next_drawable  = this.getNextInQueue();
        return returning_dobj;
    }
View Full Code Here

Examples of base.drawable.Drawable

            return this_floor_obj != null;
        }

        public Object next()
        {
            Drawable     next_drawable;
            Iterator     next_floor_itr;
            boolean      isFore, isOK;

            next_drawable  = this_floor_obj;
            this_floor_obj = null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.