📄 rowprimitive.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -