|
|
@ -12,27 +12,32 @@ import com.fr.report.cell.CellElement; |
|
|
|
import com.fr.report.cell.CellElementComparator; |
|
|
|
import com.fr.report.cell.CellElementComparator; |
|
|
|
import com.fr.report.cell.TemplateCellElement; |
|
|
|
import com.fr.report.cell.TemplateCellElement; |
|
|
|
import com.fr.report.elementcase.TemplateElementCase; |
|
|
|
import com.fr.report.elementcase.TemplateElementCase; |
|
|
|
|
|
|
|
import com.fr.stable.unit.FU; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* The clip of CellElement. |
|
|
|
* The clip of CellElement. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class CellElementsClip implements Cloneable, java.io.Serializable { |
|
|
|
public class CellElementsClip implements Cloneable, java.io.Serializable { |
|
|
|
private int column; |
|
|
|
|
|
|
|
private int row; |
|
|
|
|
|
|
|
private int columnSpan = 0; |
|
|
|
private int columnSpan = 0; |
|
|
|
private int rowSpan = 0; |
|
|
|
private int rowSpan = 0; |
|
|
|
|
|
|
|
private FU[] columnWidth; |
|
|
|
|
|
|
|
private FU[] rowHeight; |
|
|
|
private TemplateCellElement[] clips; |
|
|
|
private TemplateCellElement[] clips; |
|
|
|
|
|
|
|
|
|
|
|
public CellElementsClip(int column, int row, int columnSpan, int rowSpan, TemplateCellElement[] clips) { |
|
|
|
public CellElementsClip(int columnSpan, int rowSpan, FU[] columnWidth , FU[] rowHeight, TemplateCellElement[] clips) { |
|
|
|
this.column = column; |
|
|
|
|
|
|
|
this.row = row; |
|
|
|
|
|
|
|
this.columnSpan = columnSpan; |
|
|
|
this.columnSpan = columnSpan; |
|
|
|
this.rowSpan = rowSpan; |
|
|
|
this.rowSpan = rowSpan; |
|
|
|
|
|
|
|
this.columnWidth = columnWidth ; |
|
|
|
|
|
|
|
this.rowHeight = rowHeight; |
|
|
|
this.clips = clips; |
|
|
|
this.clips = clips; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CellElementsClip(int columnSpan, int rowSpan, TemplateCellElement[] clips) { |
|
|
|
|
|
|
|
this.columnSpan = columnSpan; |
|
|
|
|
|
|
|
this.rowSpan = rowSpan; |
|
|
|
|
|
|
|
this.clips = clips; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String compateExcelPaste() { |
|
|
|
public String compateExcelPaste() { |
|
|
|
Arrays.sort(this.clips, CellElementComparator.getRowFirstComparator()); |
|
|
|
Arrays.sort(this.clips, CellElementComparator.getRowFirstComparator()); |
|
|
|
|
|
|
|
|
|
|
@ -86,16 +91,18 @@ public class CellElementsClip implements Cloneable, java.io.Serializable { |
|
|
|
), false); |
|
|
|
), false); |
|
|
|
} |
|
|
|
} |
|
|
|
//设置单元格的宽高
|
|
|
|
//设置单元格的宽高
|
|
|
|
pasteWidthAndHeight(ec, column, row, columnSpan, rowSpan); |
|
|
|
if(this.columnWidth != null && this.rowHeight != null){ |
|
|
|
|
|
|
|
pasteWidthAndHeight(ec, column, row, columnSpan, rowSpan); |
|
|
|
|
|
|
|
} |
|
|
|
return new CellSelection(column, row, columnSpan, rowSpan); |
|
|
|
return new CellSelection(column, row, columnSpan, rowSpan); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void pasteWidthAndHeight(TemplateElementCase ec, int column, int row, int columnSpan, int rowSpan){ |
|
|
|
public void pasteWidthAndHeight(TemplateElementCase ec, int column, int row, int columnSpan, int rowSpan){ |
|
|
|
for(int i = 0; i<columnSpan; i++){ |
|
|
|
for(int i = 0; i < columnSpan; i++){ |
|
|
|
for(int j = 0; j<rowSpan; j++){ |
|
|
|
ec.setColumnWidth(column + i, columnWidth[i]); |
|
|
|
ec.setColumnWidth(column + i, ec.getColumnWidth(this.column + i)); |
|
|
|
} |
|
|
|
ec.setRowHeight(row + j, ec.getRowHeight(this.row + j)); |
|
|
|
for(int j = 0; j < rowSpan; j++){ |
|
|
|
} |
|
|
|
ec.setRowHeight(row + j, rowHeight[j]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|