⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cellprimitive.java

📁 考勤管理系统源码
💻 JAVA
字号:
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Layout;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core.*;/** The CellPrimitive class encapsulates the logic for producing *  cells within a table*/class CellPrimitive implements IHtmlPrimitive{  private Style style;  private HAlignment horizontalAlignment;  private VAlignment verticalAlignment;  private int columnSpan = -1;  private IHtmlPrimitive content;  /** Construct a cell primitive with the specified primitive   *  as its content. */  CellPrimitive(IHtmlPrimitive content)  {    this.content = content;  }  /** Specify the style class that is applied to the cell. */  void setStyle(Style style)  {    this.style = style;  }  /** Set the horizontal and vertical alignment of the contents   *  of the cell. */  void setAlignment(HAlignment horizontalAlignment, VAlignment verticalAlignment)  {    this.horizontalAlignment = horizontalAlignment;    this.verticalAlignment = verticalAlignment;  }  /** Set the number of columns that this cell should span. */  void setColumnSpan(int columnSpan)  {    this.columnSpan = columnSpan;  }  // return column span, but return 1 if it is not set.  int getColumnSpan()  {    return Math.max(this.columnSpan, 1);  }  /** 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);    String colspan_string = Formatting.convertToAttribute("colspan", columnSpan);    buffer.append("<td" +class_string+align_string+valign_string+colspan_string+ ">");    content.buildContent(buffer);    buffer.append("</td>");  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -