Package base.drawable

Examples of base.drawable.TimeBoundingBox$IncreasingFinaltimeOrder


                              float  start_ypos, float  final_ypos,
                              float  avebox_height )
    {
        CategoryTimeBox[]  typeboxes;
        CategoryTimeBox    typebox;
        TimeBoundingBox    curr_timebox;
        Color              color;
        double             head_time, tail_time;
        float              head_ypos, tail_ypos, gap_ypos;
        int                count, idx;

        if ( start_ypos < final_ypos ) {
            head_ypos  = start_ypos;
            tail_ypos  = final_ypos;
        }
        else {
            head_ypos  = final_ypos;
            tail_ypos  = start_ypos;
        }

        // Draw CategoryTimeBox[] in descending ratio order
        count         = 0;
        curr_timebox  = avebox.getCurrentTimeBoundingBox();
        typeboxes     = avebox.arrayOfCategoryTimeBoxes();
        if (    isDisplayTypeEqualWeighted()
             || isDisplayTypeCumulative() ) {
            if (   head_ypos + avebox_height
                 < tail_ypos - avebox_height ) {
                head_time  = curr_timebox.getEarliestTime();
                tail_time  = curr_timebox.getLatestTime();
                count += drawForward( g, null, coord_xform,
                                      head_time, head_ypos,
                                      tail_time, tail_ypos );
                head_ypos += avebox_height;
                tail_ypos -= avebox_height;
            }
            for ( idx = typeboxes.length-1; idx >= 0; idx-- ) {
                typebox    = typeboxes[ idx ];
                color      = typebox.getCategoryColor();
                head_time  = typebox.getEarliestTime();
                tail_time  = typebox.getLatestTime();
                count += drawForward( g, color, coord_xform,
                                      head_time, head_ypos,
                                      tail_time, tail_ypos );
            }
        }
        else { // OverlapXXclusionRatio
            if (   head_ypos + avebox_height
                 < tail_ypos - avebox_height ) {
                head_time  = curr_timebox.getEarliestTime();
                tail_time  = curr_timebox.getLatestTime();
                count += drawForward( g, null, coord_xform,
                                      head_time, head_ypos,
                                      tail_time, tail_ypos );
                head_ypos += avebox_height;
                tail_ypos -= avebox_height;
View Full Code Here


                                        float start_ypos, float final_ypos,
                                        float avebox_height )
    {
        CategoryTimeBox[]  typeboxes;
        CategoryTimeBox    typebox;
        TimeBoundingBox    curr_timebox;
        double             head_time, tail_time;
        float              head_ypos, tail_ypos, gap_ypos;
        boolean            hasBoundary;
        int                idx;

        if ( start_ypos < final_ypos ) {
            head_ypos  = start_ypos;
            tail_ypos  = final_ypos;
        }
        else {
            head_ypos  = final_ypos;
            tail_ypos  = start_ypos;
        }

        if ( pt.y < coord_xform.convertRowToPixel( head_ypos ) )
            return null;

        if ( pt.y > coord_xform.convertRowToPixel( tail_ypos ) )
            return null;

        // Search CategoryTimeBox[] in ascending ratio order
        curr_timebox  = avebox.getCurrentTimeBoundingBox();
        typeboxes     = avebox.arrayOfCategoryTimeBoxes();
        if (    isDisplayTypeEqualWeighted()
             || isDisplayTypeCumulative() ) {
            if (   head_ypos + avebox_height
                 < tail_ypos - avebox_height ) {
                head_ypos  += avebox_height;
                tail_ypos  -= avebox_height;
                hasBoundary = true;
            }
            else
                hasBoundary = false;
            for ( idx = 0; idx < typeboxes.length; idx++ ) {
                typebox    = typeboxes[ idx ];
                head_time  = typebox.getEarliestTime();
                tail_time  = typebox.getLatestTime();
                if ( isPixelIn( coord_xform, pt,
                                head_time, head_ypos,
                                tail_time, tail_ypos ) )
                    return typebox;
            }
            if ( hasBoundary ) {
                head_ypos -= avebox_height;
                tail_ypos += avebox_height;
                head_time  = curr_timebox.getEarliestTime();
                tail_time  = curr_timebox.getLatestTime();
                if ( isPixelIn( coord_xform, pt,
                                head_time, head_ypos,
                                tail_time, tail_ypos ) )
                    return avebox;
            }
        }
        else { // OverlapXXclusionRatio
            if (   head_ypos + avebox_height
                 < tail_ypos - avebox_height ) {
                head_ypos  += avebox_height;
                tail_ypos  -= avebox_height;
                hasBoundary = true;
            }
            else
                hasBoundary = false;
            gap_ypos   = ( tail_ypos - head_ypos ) / ( typeboxes.length * 2 );
            head_ypos += gap_ypos * (typeboxes.length-1);
            tail_ypos -= gap_ypos * (typeboxes.length-1);
            for ( idx = 0; idx < typeboxes.length; idx++ ) {
                typebox    = typeboxes[ idx ];
                head_time  = typebox.getEarliestTime();
                tail_time  = typebox.getLatestTime();
                if ( isPixelIn( coord_xform, pt,
                                head_time, head_ypos,
                                tail_time, tail_ypos ) )
                    return typebox;
                head_ypos -= gap_ypos;
                tail_ypos += gap_ypos;
            }
            if ( hasBoundary ) {
                head_ypos += gap_ypos;
                tail_ypos -= gap_ypos;
                head_ypos -= avebox_height;
                tail_ypos += avebox_height;
                head_time  = curr_timebox.getEarliestTime();
                tail_time  = curr_timebox.getLatestTime();
                if ( isPixelIn( coord_xform, pt,
                                head_time, head_ypos,
                                tail_time, tail_ypos ) )
                    return avebox;
            }
View Full Code Here

TOP

Related Classes of base.drawable.TimeBoundingBox$IncreasingFinaltimeOrder

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.