Skip to content

Commit

Permalink
feat(slideshow) : #MAG-544 add description slide
Browse files Browse the repository at this point in the history
  • Loading branch information
Florent Mariotti committed Feb 26, 2025
1 parent c70879b commit 8c15de8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ public class Slideshow {
public static final int MARGIN_LEFT = 140;
public static final int MARGIN_TOP_TITLE = 40;
public static final int WIDTH = 1000;
public static final String DEFAULT_FONT = "Roboto";

// Constantes pour les titres
public static final int TITLE_HEIGHT = 70;
public static final Double TITLE_FONT_SIZE = 44.0;
public static final int DESCRIPTION_TITLE_HEIGHT = 75;
public static final Double DESCRIPTION_TITLE_FONT_SIZE = 55.0;
public static final int MAIN_TITLE_HEIGHT = 100;
public static final Double MAIN_TITLE_FONT_SIZE = 100.0;

Expand All @@ -23,6 +26,7 @@ public class Slideshow {
public static final int CONTENT_MARGIN_TOP = 140;
public static final int MAIN_CONTENT_MARGIN_TOP = 300;
public static final Double CONTENT_FONT_SIZE = 36.0;
public static final Double DESCRIPTION_FONT_SIZE = 24.0;

// Constantes pour les images
public static final int MAIN_IMAGE_CONTENT_HEIGHT = 400;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ private Future<XMLSlideShow> createFreeLayoutSlideObjects(Board board, UserInfos
XSLFSlide titleApacheSlide = createTitleSlide(board, documents, i18nHelper);
ppt.createSlide().importContent(titleApacheSlide);

//DESCRIPTION
XSLFSlide descriptionApacheSlide = createDescriptionSlide(board, i18nHelper);
ppt.createSlide().importContent(descriptionApacheSlide);

// Utiliser l'ordre des cartes du Board
for (Card boardCard : board.cards()) {
String cardId = boardCard.getId();
Expand Down Expand Up @@ -222,6 +226,25 @@ private XSLFSlide createTitleSlide(Board board, List<Map<String, Object>> docume
return slide;
}

private XSLFSlide createDescriptionSlide(Board board, I18nHelper i18nHelper) {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();

SlideHelper.createTitle(slide, i18nHelper.translate("magneto.create.board.description"),
Slideshow.DESCRIPTION_TITLE_HEIGHT, Slideshow.DESCRIPTION_TITLE_FONT_SIZE, TextParagraph.TextAlign.LEFT);

XSLFTextBox textBox = SlideHelper.createContent(slide);

XSLFTextParagraph paragraph = textBox.addNewTextParagraph();
paragraph.setTextAlign(TextParagraph.TextAlign.LEFT);
XSLFTextRun textRun = paragraph.addNewTextRun();
textRun.setText(board.getDescription());
textRun.setFontSize(Slideshow.DESCRIPTION_FONT_SIZE);
textRun.setFontFamily(Slideshow.DEFAULT_FONT);

return slide;
}

private Slide createSlideFromCard(Card card, SlideFactory slideFactory, JsonObject slideShowData,
List<Map<String, Object>> documents) {
SlideProperties.Builder propertiesBuilder = new SlideProperties.Builder()
Expand Down

0 comments on commit 8c15de8

Please sign in to comment.