-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite flow of description + no i18n needed anymore for the slide items
- Loading branch information
Florent Mariotti
committed
Feb 27, 2025
1 parent
8e05449
commit c94a377
Showing
6 changed files
with
59 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 22 additions & 2 deletions
24
backend/src/main/java/fr/cgi/magneto/model/slides/SlideDescription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,35 @@ | ||
package fr.cgi.magneto.model.slides; | ||
|
||
import fr.cgi.magneto.core.constants.Slideshow; | ||
import fr.cgi.magneto.helper.SlideHelper; | ||
import org.apache.poi.sl.usermodel.TextParagraph; | ||
import org.apache.poi.xslf.usermodel.XSLFSlide; | ||
import org.apache.poi.xslf.usermodel.XSLFTextBox; | ||
import org.apache.poi.xslf.usermodel.XSLFTextParagraph; | ||
import org.apache.poi.xslf.usermodel.XSLFTextRun; | ||
|
||
public class SlideDescription extends Slide { | ||
|
||
public SlideDescription(String description) { | ||
public SlideDescription(String description, String title) { | ||
this.description = description; | ||
this.title = title; | ||
} | ||
|
||
@Override | ||
public Object createApacheSlide(XSLFSlide newSlide) { | ||
return null; | ||
|
||
SlideHelper.createTitle(newSlide, title, | ||
Slideshow.DESCRIPTION_TITLE_HEIGHT, Slideshow.DESCRIPTION_TITLE_FONT_SIZE, TextParagraph.TextAlign.LEFT); | ||
|
||
XSLFTextBox textBox = SlideHelper.createContent(newSlide); | ||
|
||
XSLFTextParagraph paragraph = textBox.addNewTextParagraph(); | ||
paragraph.setTextAlign(TextParagraph.TextAlign.LEFT); | ||
XSLFTextRun textRun = paragraph.addNewTextRun(); | ||
textRun.setText(description); | ||
textRun.setFontSize(Slideshow.DESCRIPTION_FONT_SIZE); | ||
textRun.setFontFamily(Slideshow.DEFAULT_FONT); | ||
|
||
return newSlide; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters