rowprimitive.java
来自「考勤管理系统源码」· Java 代码 · 共 65 行
JAVA
65 行
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Layout;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core.*;import java.util.*;class RowPrimitive implements IHtmlPrimitive{ private Style style; private HAlignment horizontalAlignment; private VAlignment verticalAlignment; private HashMap cells = new HashMap(); private int maxColumn = -1; RowPrimitive() { } /** Specify the style class that is applied to the cell. */ void setStyle(Style style) { this.style = style; } void setAlignment(HAlignment horizontalAlignment, VAlignment verticalAlignment) { this.horizontalAlignment = horizontalAlignment; this.verticalAlignment = verticalAlignment; } void setCellAt(int column, CellPrimitive cell) { cells.put(""+column, cell); maxColumn = Math.max(maxColumn, column); } /** Build the content for this primitive and append it to * the specified buffer.*/ public void buildContent(StringBuffer buffer) { String class_string = Formatting.convertToAttribute("class", style); String align_string = Formatting.convertToAttribute("align", horizontalAlignment); String valign_string = Formatting.convertToAttribute("valign", verticalAlignment); buffer.append("<tr" +class_string+align_string+valign_string+ ">"); // add cells int ctr = 0; while (ctr <= maxColumn) { CellPrimitive cell = (CellPrimitive) cells.get(""+ctr); if (cell != null) { cell.buildContent(buffer); ctr += cell.getColumnSpan(); } else { buffer.append("<td></td>"); ctr++; } } buffer.append("</tr>"); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?