📄 infopanelfordrawable.java
字号:
String description ) { StringBuffer linebuf; Coord vertex; YaxisTreeNode node; TreeNode[] nodes; Integer lineID; double duration; int coords_length; int idx, ii; linebuf = new StringBuffer(); coords_length = coords.length; if ( coords_length > 1 ) { duration = coords[ coords_length-1 ].time - coords[ 0 ].time; linebuf.append( "duration" + description + " = " + tfmt.format( duration ) ); if ( num_cols < linebuf.length() ) num_cols = linebuf.length(); num_rows++; strbuf.append( linebuf.toString() + "\n" ); } for ( idx = 0; idx < coords_length; idx++ ) { linebuf = new StringBuffer( "[" + idx + "]: " ); vertex = coords[ idx ]; lineID = new Integer( vertex.lineID ); node = (YaxisTreeNode) map_line2treenodes.get( lineID ); nodes = node.getPath(); linebuf.append( "time" + description + " = " + fmt.format( vertex.time ) ); for ( ii = 1; ii < nodes.length; ii++ ) linebuf.append( ", " + y_colnames[ ii-1 ] + " = " + nodes[ ii ] ); if ( num_cols < linebuf.length() ) num_cols = linebuf.length(); num_rows++; strbuf.append( linebuf.toString() ); if ( idx < coords_length-1 ) strbuf.append( "\n" ); } } private void setEndCoordsText( final Coord start_vtx, final Coord final_vtx, double earliest_time, double latest_time, int coords_length ) { StringBuffer linebuf; Coord vertex; YaxisTreeNode node; TreeNode[] nodes; Integer lineID; double duration; int idx, ii; duration = latest_time - earliest_time; linebuf = new StringBuffer(); linebuf.append( "duration (max) = " + tfmt.format( duration ) ); if ( num_cols < linebuf.length() ) num_cols = linebuf.length(); num_rows++; strbuf.append( linebuf.toString() ); idx = 0; linebuf = new StringBuffer( "[" + idx + "]: " ); vertex = start_vtx; lineID = new Integer( vertex.lineID ); node = (YaxisTreeNode) map_line2treenodes.get( lineID ); nodes = node.getPath(); linebuf.append( "time (min) = " + fmt.format( earliest_time ) ); for ( ii = 1; ii < nodes.length; ii++ ) linebuf.append( ", " + y_colnames[ ii-1 ] + " = " + nodes[ ii ] ); if ( num_cols < linebuf.length() ) num_cols = linebuf.length(); num_rows++; strbuf.append( "\n" + linebuf.toString() ); idx = coords_length-1; linebuf = new StringBuffer( "[" + idx + "]: " ); vertex = final_vtx; lineID = new Integer( vertex.lineID ); node = (YaxisTreeNode) map_line2treenodes.get( lineID ); nodes = node.getPath(); linebuf.append( "time (max) = " + fmt.format( latest_time ) ); for ( ii = 1; ii < nodes.length; ii++ ) linebuf.append( ", " + y_colnames[ ii-1 ] + " = " + nodes[ ii ] ); if ( num_cols < linebuf.length() ) num_cols = linebuf.length(); num_rows++; strbuf.append( "\n" + linebuf.toString() ); } // For Real Primitive public void setPrimitiveText( final Primitive prime ) { this.setCoordsText( prime.getVertices(), "" ); String info_str; info_str = prime.toInfoBoxString().trim(); if ( info_str.length() > 0 ) { strbuf.append( "\n" + info_str ); num_rows++; } Drawable prime_parent; prime_parent = prime.getParent(); if ( prime_parent != null ) { info_str = prime_parent.toInfoBoxString().trim(); if ( info_str.length() > 0 ) { strbuf.append( "\n" + info_str ); num_rows++; } } } private int getPrintStatus( final Topology topo ) { if ( topo.isState() ) if ( Parameters.PREVIEW_STATE_DISPLAY.equals( PreviewState.CUMULATIVE_EXCLUSION ) || Parameters.PREVIEW_STATE_DISPLAY.equals( PreviewState.OVERLAP_EXCLUSION ) ) return CategoryWeight.PRINT_EXCL_RATIO; else return CategoryWeight.PRINT_INCL_RATIO; else // if ( topo.isArrow() ) return CategoryWeight.PRINT_INCL_RATIO; } // For Shadow Primitive public void setShadowText( final Shadow shade, final Category type ) { this.setEndCoordsText( shade.getStartVertex(), shade.getFinalVertex(), shade.getEarliestTime(), shade.getLatestTime(), shade.getVertices().length ); strbuf.append( "\n\n" ); this.setCoordsText( shade.getVertices(), " (ave)" ); strbuf.append( "\n" ); StringBuffer linebuf; Topology shade_topo; CategoryWeight[] twgts; CategoryWeight twgt; String twgt_str; int print_status; int idx; shade_topo = shade.getCategory().getTopology(); // linebuf = new StringBuffer( "Number of Real Drawables = " ); linebuf = new StringBuffer( "Number of Real " ); linebuf.append( shade_topo + "s = " ); linebuf.append( shade.getNumOfRealObjects() ); if ( num_cols < linebuf.length() ) num_cols = linebuf.length(); num_rows++; strbuf.append( "\n" + linebuf.toString() ); strbuf.append( "\n" ); print_status = getPrintStatus( shade_topo ); strbuf.append( "\n" + CategoryWeight.getPrintTitle(print_status) ); twgts = shade.arrayOfCategoryWeights(); for ( idx = 0; idx < twgts.length; idx++ ) { twgt = twgts[ idx ]; twgt_str = twgt.toInfoBoxString( print_status ); if ( twgt.getCategory().equals( type ) ) { twgt_str += " <---"; if ( num_cols < twgt_str.length() + 6 ) num_cols = twgt_str.length() + 6; } else { if ( num_cols < twgt_str.length() ) num_cols = twgt_str.length(); } num_rows++; strbuf.append( "\n" + twgt_str ); } } // For Real Composite public void setCompositeText( final Composite cmplx ) { Coord[] cmplx_coords; cmplx_coords = new Coord[] { cmplx.getStartVertex(), cmplx.getFinalVertex() }; this.setCoordsText( cmplx_coords, "" ); String info_str; info_str = cmplx.toInfoBoxString().trim(); if ( info_str.length() > 0 ) { strbuf.append( "\n" + info_str ); num_rows++; } Drawable cmplx_parent; cmplx_parent = cmplx.getParent(); if ( cmplx_parent != null ) { info_str = cmplx_parent.toInfoBoxString().trim(); if ( info_str.length() > 0 ) { strbuf.append( "\n" + info_str ); num_rows++; } } } } // End of private class TextAreaBuffer}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -