📄 canvastimeline.java
字号:
isConnectedComposite, true ); while ( dobjs.hasNext() ) { dobj = (Drawable) dobjs.next(); if ( dobj.getCategory().isVisible() ) { dobj.setStateRowAndNesting( coord_xform, map_line2row, nesting_stacks ); } } int N_nestable = 0, N_nestless = 0; int N_nestable_drawn = 0, N_nestless_drawn = 0; // Draw Nestable Real Drawables dobjs = treetrunk.iteratorOfRealDrawables( timebounds, INCRE_STARTTIME_ORDER, isConnectedComposite, true ); while ( dobjs.hasNext() ) { dobj = (Drawable) dobjs.next(); if ( dobj.getCategory().isVisible() ) { N_nestable_drawn += dobj.drawOnCanvas( offGraphics, coord_xform, map_line2row, drawn_boxes ); N_nestable += dobj.getNumOfPrimitives(); } } // Draw Nestable Shadows sobjs = treetrunk.iteratorOfLowestFloorShadows( timebounds, INCRE_STARTTIME_ORDER, true ); while ( sobjs.hasNext() ) { sobj = (Shadow) sobjs.next(); if ( sobj.getCategory().isVisible() ) { N_nestable_drawn += sobj.drawOnCanvas( offGraphics, coord_xform, map_line2row, drawn_boxes ); N_nestable += sobj.getNumOfPrimitives(); } } // Set AntiAliasing from Parameters for all slanted lines offGraphics.setRenderingHint( RenderingHints.KEY_ANTIALIASING, Parameters.ARROW_ANTIALIASING.toValue() ); // Draw Nestless Shadows /* sobjs = treetrunk.iteratorOfLowestFloorShadows( timebounds, INCRE_STARTTIME_ORDER, false ); while ( sobjs.hasNext() ) { sobj = (Shadow) sobjs.next(); if ( sobj.getCategory().isVisible() ) { N_nestless_drawn += sobj.drawOnCanvas( offGraphics, coord_xform, map_line2row, drawn_boxes ); N_nestless += sobj.getNumOfPrimitives(); } } */ // Draw all Nestless Real Drawables and Shadows dobjs = treetrunk.iteratorOfAllDrawables( timebounds, INCRE_STARTTIME_ORDER, isConnectedComposite, false ); while ( dobjs.hasNext() ) { dobj = (Drawable) dobjs.next(); if ( dobj.getCategory().isVisible() ) { N_nestless_drawn += dobj.drawOnCanvas( offGraphics, coord_xform, map_line2row, drawn_boxes ); N_nestless += dobj.getNumOfPrimitives(); } } if ( Profile.isActive() ) Profile.println( "CanvasTimeline.drawOneOffImage(): " + "R_NestAble = " + N_nestable_drawn + "/" + N_nestable + ", " + "R_NestLess = " + N_nestless_drawn + "/" + N_nestless ); // System.out.println( treetrunk.toStubString() ); offGraphics.dispose(); } } // endof drawOneOffImage() public InfoDialog getPropertyAt( final Point local_click, final TimeBoundingBox vport_timeframe ) { /* System.out.println( "\nshowPropertyAt() " + local_click ); */ CoordPixelImage coord_xform; // Local Coordinate Transform coord_xform = new CoordPixelImage( this, row_height, super.getTimeBoundsOfImages() ); double clicked_time = coord_xform.convertPixelToTime( local_click.x ); // Determine the timeframe of the current view by vport_timeframe // System.out.println( "CurrView's timeframe = " + vport_timeframe ); Map map_line2treeleaf = y_maps.getMapOfLineIDToTreeLeaf(); Map map_line2row = y_maps.getMapOfLineIDToRowID(); if ( map_line2row == null ) { if ( ! y_maps.update() ) Dialogs.error( root_frame, "Error in updating YaxisMaps!" ); map_line2row = y_maps.getMapOfLineIDToRowID(); } Iterator sobjs; Shadow sobj; Iterator dobjs; Drawable dobj; Drawable clicked_dobj; // Search Nestless Drawables in reverse drawing order dobjs = treetrunk.iteratorOfAllDrawables( vport_timeframe, DECRE_STARTTIME_ORDER, isConnectedComposite, false ); while ( dobjs.hasNext() ) { dobj = (Drawable) dobjs.next(); if ( dobj.getCategory().isVisible() ) { clicked_dobj = dobj.getDrawableAt( coord_xform, map_line2row, local_click ); if ( clicked_dobj != null && clicked_dobj.getCategory().isVisible() ) { return new InfoDialogForDrawable( root_frame, clicked_time, map_line2treeleaf, y_colnames, clicked_dobj ); } } } // Search Nestless Shadows in reverse drawing order /* sobjs = treetrunk.iteratorOfLowestFloorShadows( vport_timeframe, DECRE_STARTTIME_ORDER, false ); while ( sobjs.hasNext() ) { sobj = (Shadow) sobjs.next(); if ( sobj.getCategory().isVisible() ) { clicked_dobj = sobj.getDrawableAt( coord_xform, map_line2row, local_click ); if ( clicked_dobj != null && clicked_dobj.getCategory().isVisible() ) { return new InfoDialogForDrawable( root_frame, clicked_time, map_line2treeleaf, y_colnames, clicked_dobj ); } } } */ // Search Nestable Shadows in reverse drawing order sobjs = treetrunk.iteratorOfLowestFloorShadows( vport_timeframe, DECRE_STARTTIME_ORDER, true ); while ( sobjs.hasNext() ) { sobj = (Shadow) sobjs.next(); if ( sobj.getCategory().isVisible() ) { clicked_dobj = sobj.getDrawableAt( coord_xform, map_line2row, local_click ); if ( clicked_dobj != null && clicked_dobj.getCategory().isVisible() ) { return new InfoDialogForDrawable( root_frame, clicked_time, map_line2treeleaf, y_colnames, clicked_dobj ); } } } // Search Nestable Drawables in reverse drawing order dobjs = treetrunk.iteratorOfRealDrawables( vport_timeframe, DECRE_STARTTIME_ORDER, isConnectedComposite, true ); while ( dobjs.hasNext() ) { dobj = (Drawable) dobjs.next(); if ( dobj.getCategory().isVisible() ) { clicked_dobj = dobj.getDrawableAt( coord_xform, map_line2row, local_click ); if ( clicked_dobj != null && clicked_dobj.getCategory().isVisible() ) { return new InfoDialogForDrawable( root_frame, clicked_time, map_line2treeleaf, y_colnames, clicked_dobj ); } } } return super.getTimePropertyAt( local_click ); } // endof getPropertyAt() public Rectangle localRectangleForDrawable( final Drawable dobj ) { CoordPixelImage coord_xform; Rectangle local_rect; int rowID; float nesting_ftr; float rStart, rFinal; int xloc, yloc, width, height; // local_rect is created with CanvasTimeline's pixel coordinate system coord_xform = new CoordPixelImage( this, row_height, super.getTimeBoundsOfImages() ); xloc = coord_xform.convertTimeToPixel( dobj.getEarliestTime() ); width = coord_xform.convertTimeToPixel( dobj.getLatestTime() ) - xloc; /* assume RowID and NestingFactor have been calculated */ rowID = dobj.getRowID(); nesting_ftr = dobj.getNestingFactor(); rStart = (float) rowID - nesting_ftr / 2.0f; rFinal = rStart + nesting_ftr; yloc = coord_xform.convertRowToPixel( rStart ); height = coord_xform.convertRowToPixel( rFinal ) - yloc; local_rect = new Rectangle( xloc, yloc, width, height ); return local_rect; } private InfoPanelForDrawable createInfoPanelForDrawable( Drawable dobj ) { InfoPanelForDrawable info_popup; Map map_line2treeleaf = y_maps.getMapOfLineIDToTreeLeaf(); info_popup = new InfoPanelForDrawable( map_line2treeleaf, y_colnames, dobj ); return info_popup; } // NEW search starting from the specified time public SearchPanel searchPreviousComponent( double searching_time ) { Drawable dobj = tree_search.previousDrawable( searching_time ); if ( dobj != null ) return this.createInfoPanelForDrawable( dobj ); else return null; } // CONTINUING search public SearchPanel searchPreviousComponent() { Drawable dobj = tree_search.previousDrawable(); if ( dobj != null ) return this.createInfoPanelForDrawable( dobj ); else return null; } // NEW search starting from the specified time public SearchPanel searchNextComponent( double searching_time ) { Drawable dobj = tree_search.nextDrawable( searching_time ); if ( dobj != null ) return this.createInfoPanelForDrawable( dobj ); else return null; } // CONTINUING search public SearchPanel searchNextComponent() { Drawable dobj = tree_search.nextDrawable(); if ( dobj != null ) return this.createInfoPanelForDrawable( dobj ); else return null; } // Interface for SummarizableView public InitializableDialog createSummary( final Dialog dialog, final TimeBoundingBox timebox ) { BufForTimeAveBoxes buf4statboxes; buf4statboxes = tree_search.createBufForTimeAveBoxes( timebox ); // System.out.println( "Statistics = " + buf4statboxes ); return new StatlineDialog( dialog, timebox, y_maps.getLineIDMap(), buf4statboxes ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -