// dealing with area's'option
Collection<OptionData> options = area.getOptions();
Iterator<OptionData> iOptions = options.iterator();
// create an itemize
List itemize = new List(false,20);
Paragraph optionsPar = new Paragraph("OPTIONS",fntRomanOption);
optionsPar.setSpacingAfter(12);
doc.add(optionsPar);
// create the table for actor/option wedges
// rows
int actorsNumber = data.getColumns().size();
// columns
int optionsNumber = options.size();
Iterator<ColumnData> iActors = data.getColumns().iterator();
Table table = new Table(optionsNumber+1, actorsNumber+1);
table.setWidth(100);
table.setBorderWidth(1);
//table.setBorderColor(new Color(0, 0, 255));
table.setPadding(4);
table.setSpacing(0);
// first cell has to be void
table.addCell(new Cell("Options/\r\nWedges"),0,0);
int row = 1;
while (iActors.hasNext()){
Cell app = new Cell(iActors.next().getTitle());
//app.setNoWrap(true);
app.setHorizontalAlignment(Element.ALIGN_CENTER);
app.setVerticalAlignment(Element.ALIGN_CENTER);
table.addCell(app,row++,0);
}
row = 1;
int column = 1;
while (iOptions.hasNext()){
// working with a single option
OptionData o = iOptions.next();
String optionName = o.getTitle();
if ((optionName==null)||(optionName.length()==0)) optionName = "No (Option) name provided.";
//Paragraph optionNamePar = new Paragraph(optionName, fntRomanOptionTitle);
Paragraph optionNamePar = new Paragraph(optionName, fntRomanOptionTitle);
ListItem item = new ListItem(optionNamePar);
String optionDescription = o.getDescription();
if ((optionDescription!=null)&&(optionDescription.length()!=0)) {
//Paragraph optionDescriptionPar = new Paragraph("\r\n" + optionDescription, fntRomanOptionDescription);
Paragraph optionDescriptionPar = new Paragraph("\r\n" + optionDescription, fntRomanOptionDescription);
optionDescriptionPar.setSpacingAfter(12);
//optionDescriptionPar.setSpacingBefore(0);
item.add(optionDescriptionPar);
}
itemize.add(item);
// prepare the table
iActors = data.getColumns().iterator();
row = 0;
//System.out.println("option: " + o.getTitle());