本文整理汇总了Java中net.sf.jasperreports.components.table.Cell.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Cell.getHeight方法的具体用法?Java Cell.getHeight怎么用?Java Cell.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jasperreports.components.table.Cell
的用法示例。
在下文中一共展示了Cell.getHeight方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initHeader
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
private Rectangle initHeader(Rectangle p, BaseColumn bc, int type, String grName) {
int y = p.y;
int h = 0;
int w = bc.getWidth();
Cell c = getCell(bc, type, grName);
if (c != null) {
y = p.y + c.getHeight();
h = c.getHeight();
boundsMap.put(c, new Rectangle(p.x, p.y, w, h));
}
if (bc instanceof ColumnGroup) {
Rectangle pi = new Rectangle(p.x, y, w, h);
int hi = 0;
for (BaseColumn bcg : ((ColumnGroup) bc).getColumns()) {
pi = initHeader(pi, bcg, type, grName);
pi.setLocation(pi.x, y);
if (hi < pi.height)
hi = pi.height;
}
h += hi;
}
return new Rectangle(p.x + w, y, w, h);
}
示例2: initFooter
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
private Rectangle initFooter(Rectangle p, BaseColumn bc, int type, String grName) {
int y = p.y;
int h = 0;
int w = bc.getWidth();
Cell c = getCell(bc, type, grName);
if (bc instanceof ColumnGroup) {
Rectangle pi = new Rectangle(p.x, y, w, h);
int hi = 0;
for (BaseColumn bcg : ((ColumnGroup) bc).getColumns()) {
pi = initFooter(pi, bcg, type, grName);
pi.setLocation(pi.x, y);
if (hi < pi.height)
hi = pi.height;
}
h += hi;
}
if (c != null) {
y = p.y + h;
int cellHeight = c.getHeight();
boundsMap.put(c, new Rectangle(p.x, y, w, cellHeight));
h += cellHeight;
}
return new Rectangle(p.x + w, y, w, h);
}
示例3: visitColumn
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
@Override
public Void visitColumn(Column column)
{
Cell cell = columnCell(column);
if (!isEmpty(cell))
{
int rowSpan = cell.getRowSpan() == null ? 1 : cell.getRowSpan();
int rowLevel = level + rowSpan - 1;
JRDesignElementGroup elementGroup = bandInfo.getRowElementGroup(rowLevel);
JRElement cellElement = createColumnCell(column, elementGroup, cell);
elementGroup.addElement(cellElement);
bandInfo.cellAdded(level, new CellInfo(cellElement, rowSpan, fillColumn.getColSpan()));
yOffset += cell.getHeight();
}
xOffset += column.getWidth();
return null;
}
示例4: initDetail
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
private Rectangle initDetail(Rectangle p, BaseColumn bc) {
int h = 0;
int w = 0;
if (bc != null && bc instanceof Column) {
Cell c = ((Column) bc).getDetailCell();
w = bc.getWidth();
if (c != null)
h = c.getHeight();
boundsMap.put(c, new Rectangle(p.x, p.y, w, h));
}
return new Rectangle(p.x + w, p.y, w, h);
}
示例5: getBounds
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
public Rectangle getBounds(int width, Cell cell, BaseColumn col) {
Rectangle b = boundsMap.get(cell);
if (b != null)
return b;
int w = col != null ? col.getWidth() : 0;
int h = cell != null ? cell.getHeight() : 0;
return new Rectangle(0, 0, w, h);
}
示例6: isEmpty
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
@Override
protected boolean isEmpty(Cell cell)
{
if (super.isEmpty(cell))
{
return true;
}
// also threat zero height cells as empty.
// FIXME only doing this for the detail cells to minimize impact, it should apply to all cells
List<JRChild> children = cell.getChildren();
return cell.getHeight() == 0 && (children == null || children.isEmpty());
}
示例7: getBounds
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
public Rectangle getBounds(int width, Cell cell, StandardBaseColumn col) {
Rectangle b = getAWT2SWTRectangle(tableUtil.getCellBounds().get(cell));
if (b != null)
return b;
int w = col != null ? col.getWidth() : 0;
int h = cell != null ? cell.getHeight() : 0;
return new Rectangle(0, 0, w, h);
}
示例8: toString
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
@Override
public String toString() {
Cell c = TableUtil.getCell(column, type, grName);
String ctype = column instanceof StandardColumnGroup ? "GR" : "COL";
String str = "[" + type + ":" + ctype + ":" + hashCode() + "]";
if (c != null)
str += "[h:" + c.getHeight() + "]";
else
str += "[++++]";
return str;
}
示例9: execute
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
@Override
public void execute() {
tbManager.initMaps();
if (hmap == null)
hmap = new HashMap<DesignCell, Integer>();
hmap.clear();
if (wmap == null)
wmap = new HashMap<StandardColumnGroup, Integer>();
wmap.clear();
TableMatrix mh = tbManager.getMatrixHelper();
Map<ColumnCell, Rectangle> map = mh.getCells();
for (ColumnCell cc : map.keySet()) {
Rectangle b = cc.getBounds();
if (cc.column instanceof StandardColumnGroup) {
if (b.width != cc.column.getWidth()) {
wmap.put((StandardColumnGroup) cc.column,
cc.column.getWidth());
((StandardColumnGroup) cc.column).setWidth(b.width);
}
continue;
}
Cell dc = TableUtil.getCell(cc.column, cc.type, cc.grName);
if (dc == null)
continue;
int oldh = dc.getHeight();
if (b.height != dc.getHeight()) {
((DesignCell) dc).setHeight(b.height);
} else
continue;
hmap.put((DesignCell) dc, oldh);
}
tbManager.initMaps();
tbManager.refresh();
}
示例10: getCellHeight
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
private static int getCellHeight(BaseColumn bc, int type, String grName) {
Cell cell = null;
switch (type) {
case TableUtil.TABLE_HEADER:
cell = bc.getTableHeader();
break;
case TableUtil.TABLE_FOOTER:
cell = bc.getTableFooter();
break;
case TableUtil.COLUMN_HEADER:
cell = bc.getColumnHeader();
break;
case TableUtil.COLUMN_FOOTER:
cell = bc.getColumnFooter();
break;
case TableUtil.COLUMN_DETAIL:
if (bc instanceof StandardColumn)
cell = ((StandardColumn) bc).getDetailCell();
break;
case TableUtil.COLUMN_GROUP_HEADER:
cell = bc.getGroupHeader(grName);
break;
case TableUtil.COLUMN_GROUP_FOOTER:
cell = bc.getGroupFooter(grName);
break;
}
if (cell != null)
return cell.getHeight();
return -1;
}
示例11: setCellHeightDelta
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
public static int setCellHeightDelta(BaseColumn bc, int type,
String grName, int delta) {
int dif = 0;
Cell cell = TableUtil.getCell(bc, type, grName);
if (cell != null) {
DesignCell designCell = (DesignCell) cell;
int height = cell.getHeight() + delta;
if (height < 0) {
dif = height;
height = 0;
}
designCell.setHeight(height);
}
return dif;
}
示例12: getSectionHeight
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
private int getSectionHeight(StandardColumnGroup standardColumnGroup, byte sectionType, String groupName)
{
int headerHeight = 0;
Cell cell = getCellOfType(standardColumnGroup, sectionType, groupName);
if (cell != null)
{
headerHeight = cell.getHeight();
}
List<BaseColumn> columns = standardColumnGroup.getColumns();
// Check sub columns...
int maxChildrenHeaderHeight = 0;
for (BaseColumn c : columns)
{
if (c instanceof StandardColumn)
{
cell = getCellOfType(c, sectionType, groupName);
if (cell != null && cell.getHeight().intValue() > maxChildrenHeaderHeight) maxChildrenHeaderHeight = cell.getHeight().intValue();
}
else if (c instanceof StandardColumnGroup)
{
int gh = getSectionHeight((StandardColumnGroup)c, sectionType, groupName);
maxChildrenHeaderHeight = (gh > maxChildrenHeaderHeight) ? gh : maxChildrenHeaderHeight;
}
}
return headerHeight + maxChildrenHeaderHeight;
}
示例13: visitColumnGroup
import net.sf.jasperreports.components.table.Cell; //导入方法依赖的package包/类
@Override
public Void visitColumnGroup(ColumnGroup columnGroup)
{
Cell cell = columnGroupCell(columnGroup);
int rowSpan;
if (cell == null)
{
rowSpan = 0;
}
else if (cell.getRowSpan() == null)
{
rowSpan = 1;
}
else
{
rowSpan = cell.getRowSpan();
}
int origXOffset = xOffset;
int origYOffset = yOffset;
int colSpan = 0;
for (FillColumn subcolumn : fillColumn.getSubcolumns())
{
ReportBandCreator subVisitor = createSubVisitor(subcolumn,
xOffset, origYOffset, level + rowSpan);
subVisitor.visit();
xOffset = subVisitor.xOffset;
if (subVisitor.yOffset > yOffset)
{
yOffset = subVisitor.yOffset;
}
colSpan += subcolumn.getColSpan();
}
colSpan = colSpan == 0 ? 1 : colSpan;
if (cell != null)
{
int rowLevel = level + rowSpan - 1;
JRDesignElementGroup elementGroup = bandInfo.getRowElementGroup(rowLevel);
JRElement cellElement = createCell(elementGroup, cell,
columnGroup.getWidth(), fillColumn.getWidth(),
origXOffset, yOffset, null, deriveUUID(), false);
elementGroup.addElement(cellElement);
bandInfo.cellAdded(level, new CellInfo(cellElement, rowSpan, colSpan));
yOffset += cell.getHeight();
}
return null;
}