/** * @since 2.1.6 private is now protected */ protected void calculateWidths() { if (totalWidth <= 0) return; float total = 0; int numCols = getNumberOfColumns(); for (int k = 0; k < numCols; ++k) total += relativeWidths[k]; for (int k = 0; k < numCols; ++k) absoluteWidths[k] = totalWidth * relativeWidths[k] / total; }
/** * @since 2.1.6 private is now protected */ protected void calculateWidths() { if (totalWidth <= 0) return; float total = 0; int numCols = getNumberOfColumns(); for (int k = 0; k < numCols; ++k) total += relativeWidths[k]; for (int k = 0; k < numCols; ++k) absoluteWidths[k] = totalWidth * relativeWidths[k] / total; }
/** * @since 2.1.6 private is now protected */ protected void calculateWidths() { if (totalWidth <= 0) return; float total = 0; int numCols = getNumberOfColumns(); for (int k = 0; k < numCols; ++k) total += relativeWidths[k]; for (int k = 0; k < numCols; ++k) absoluteWidths[k] = totalWidth * relativeWidths[k] / total; }
public void columnBreak() { if ( colIdx + 1 < layoutTable.getNumberOfColumns() ) { setColIdx( colIdx + 1 ); } else { pageBreak(); } }
public void columnBreak() { if ( colIdx + 1 < layoutTable.getNumberOfColumns() ) { setColIdx( colIdx + 1 ); } else { pageBreak(); } }
public void columnBreak() { if ( colIdx + 1 < layoutTable.getNumberOfColumns() ) { setColIdx( colIdx + 1 ); } else { pageBreak(); } }
public void columnBreak() { if ( colIdx + 1 < layoutTable.getNumberOfColumns() ) { setColIdx( colIdx + 1 ); } else { pageBreak(); } }
/** * Sets the full width of the table from the absolute column width. * * @param columnWidth the absolute width of each column * @throws DocumentException if the number of widths is different than the number * of columns */ public void setTotalWidth(float columnWidth[]) throws DocumentException { if (columnWidth.length != getNumberOfColumns()) throw new DocumentException("Wrong number of columns."); totalWidth = 0; for (int k = 0; k < columnWidth.length; ++k) totalWidth += columnWidth[k]; setWidths(columnWidth); }
/** * Sets the percentage width of the table from the absolute column width. * * @param columnWidth the absolute width of each column * @param pageSize the page size * @throws DocumentException */ public void setWidthPercentage(float columnWidth[], Rectangle pageSize) throws DocumentException { if (columnWidth.length != getNumberOfColumns()) throw new IllegalArgumentException("Wrong number of columns."); float totalWidth = 0; for (int k = 0; k < columnWidth.length; ++k) totalWidth += columnWidth[k]; widthPercentage = totalWidth / (pageSize.getRight() - pageSize.getLeft()) * 100f; setWidths(columnWidth); }
public void columnBreak() { if ( colIdx + 1 < layoutTable.getNumberOfColumns() ) { setColIdx( colIdx + 1 ); simulateText(); } else { pageBreak(); } }
public void columnBreak() { if ( colIdx + 1 < layoutTable.getNumberOfColumns() ) { setColIdx( colIdx + 1 ); simulateText(); } else { pageBreak(); } }
/** * Sets the relative widths of the table. * * @param relativeWidths the relative widths of the table. * @throws DocumentException if the number of widths is different than the number * of columns */ public void setWidths(float relativeWidths[]) throws DocumentException { if (relativeWidths.length != getNumberOfColumns()) throw new DocumentException("Wrong number of columns."); this.relativeWidths = new float[relativeWidths.length]; System.arraycopy(relativeWidths, 0, this.relativeWidths, 0, relativeWidths.length); absoluteWidths = new float[relativeWidths.length]; totalHeight = 0; calculateWidths(); calculateHeights(true); }
public void columnBreak() { if ( colIdx + 1 < layoutTable.getNumberOfColumns() ) { setColIdx( colIdx + 1 ); simulateText(); } else { pageBreak(); } }
public void columnBreak() { if ( colIdx + 1 < layoutTable.getNumberOfColumns() ) { setColIdx( colIdx + 1 ); simulateText(); } else { pageBreak(); } }
/** * Sets the full width of the table from the absolute column width. * * @param columnWidth the absolute width of each column * @throws DocumentException if the number of widths is different than the number * of columns */ public void setTotalWidth(float[] columnWidth) throws DocumentException { if (columnWidth.length != getNumberOfColumns()) throw new DocumentException(MessageLocalization.getComposedMessage("wrong.number.of.columns")); totalWidth = 0; for (int k = 0; k < columnWidth.length; ++k) totalWidth += columnWidth[k]; setWidths(columnWidth); }
/** * Sets the relative widths of the table. * * @param relativeWidths the relative widths of the table. * @throws DocumentException if the number of widths is different than the number * of columns */ public void setWidths(float relativeWidths[]) throws DocumentException { if (relativeWidths.length != getNumberOfColumns()) throw new DocumentException(MessageLocalization.getComposedMessage("wrong.number.of.columns")); this.relativeWidths = new float[relativeWidths.length]; System.arraycopy(relativeWidths, 0, this.relativeWidths, 0, relativeWidths.length); absoluteWidths = new float[relativeWidths.length]; totalHeight = 0; calculateWidths(); calculateHeights(true); }
/** * Sets the full width of the table from the absolute column width. * * @param columnWidth the absolute width of each column * @throws DocumentException if the number of widths is different than the number * of columns */ public void setTotalWidth(float columnWidth[]) throws DocumentException { if (columnWidth.length != getNumberOfColumns()) throw new DocumentException(MessageLocalization.getComposedMessage("wrong.number.of.columns")); totalWidth = 0; for (int k = 0; k < columnWidth.length; ++k) totalWidth += columnWidth[k]; setWidths(columnWidth); }
/** * Sets the relative widths of the table. * * @param relativeWidths the relative widths of the table. * @throws DocumentException if the number of widths is different than the number * of columns */ public void setWidths(float[] relativeWidths) throws DocumentException { if (relativeWidths.length != getNumberOfColumns()) throw new DocumentException(MessageLocalization.getComposedMessage("wrong.number.of.columns")); this.relativeWidths = new float[relativeWidths.length]; System.arraycopy(relativeWidths, 0, this.relativeWidths, 0, relativeWidths.length); absoluteWidths = new float[relativeWidths.length]; totalHeight = 0; calculateWidths(); calculateHeights(true); }
/** * Sets the percentage width of the table from the absolute column width. * * @param columnWidth the absolute width of each column * @param pageSize the page size * @throws DocumentException */ public void setWidthPercentage(float[] columnWidth, Rectangle pageSize) throws DocumentException { if (columnWidth.length != getNumberOfColumns()) throw new IllegalArgumentException(MessageLocalization.getComposedMessage("wrong.number.of.columns")); float totalWidth = 0; for (int k = 0; k < columnWidth.length; ++k) totalWidth += columnWidth[k]; widthPercentage = totalWidth / (pageSize.getRight() - pageSize.getLeft()) * 100f; setWidths(columnWidth); }
/** * Sets the percentage width of the table from the absolute column width. * * @param columnWidth the absolute width of each column * @param pageSize the page size * @throws DocumentException */ public void setWidthPercentage(float columnWidth[], Rectangle pageSize) throws DocumentException { if (columnWidth.length != getNumberOfColumns()) throw new IllegalArgumentException(MessageLocalization.getComposedMessage("wrong.number.of.columns")); float totalWidth = 0; for (int k = 0; k < columnWidth.length; ++k) totalWidth += columnWidth[k]; widthPercentage = totalWidth / (pageSize.getRight() - pageSize.getLeft()) * 100f; setWidths(columnWidth); }