// Create output
ServiceListExporterSlides sles = new ServiceListExporterSlides(fileName, width, height);
try{
ServiceListTable slt = ServiceListTable.getActiveInstance();
ContentRender r = sles.getRender();
ImageListServiceRenderer img = new ImageListServiceRenderer();
img.setImageWithoutTempFile(BackgroundConfig.getInstance().getBackgroundImg());
r.paintBackground(img);
int slideCount = 0;
/* initial empty slide */
if (cbEmptySlide.isSelected()){
sles.addEmptySlide();
slideCount++;
}
pbProgress.setMaximum(slt.getRowCount());
for (int i=0; i<slt.getRowCount(); i++){
Object o = slt.getServiceItem(i);
pbProgress.setValue(i);
if (o instanceof Song){
Song s = (Song) o;
r.setTemplate(s.getTemplate());
r.setTitle(s.getTitle());
r.setSongAuthor(s.getSongAuthor());
r.setSongSource(s.getSongSource());
r.setCopyright(s.getCopyright());
for (int k=0; k<s.getRowCount(); k++){
slideCount++;
r.setSlide(s.getSlideText(k));
if (k < s.getRowCount()-1){
r.setNextSlide(s.getSlideText(k+1));
}else{
r.setNextSlide("");
}
/* start rendering */
r.slideChange(-1);
/* wait render thread to render the slide */
while (slideCount > sles.getSlideCount()){
try {
Thread.sleep(200);
} catch (InterruptedException ex) {
// ignore
}
if (sles.getSlideCount() == -1){
throw new DocumentException(java.util.ResourceBundle.getBundle("datasoul/internationalize").getString("INTERNAL ERROR"));
}
}
}
/* empty slide after songs */
if (cbEmptySlide.isSelected()){
sles.addEmptySlide();
slideCount++;
}
}else if (o instanceof TextServiceItem){
TextServiceItem t = (TextServiceItem) o;
r.setTemplate(t.getTemplate());
r.setTitle(t.getTitle());
for (int k=0; k<t.getRowCount(); k++){
slideCount++;
r.setSlide(t.getSlideText(k));
if (k < t.getRowCount()-1){
r.setNextSlide(t.getSlideText(k+1));
}else{
r.setNextSlide("");
}
/* start rendering */
r.slideChange(-1);
/* wait render thread to render the slide */
while (slideCount > sles.getSlideCount()){
try {
Thread.sleep(200);
} catch (InterruptedException ex) {