1 package be
.nikiroo
.fanfix
.data
;
6 * A paragraph in a chapter of the story.
10 public class Paragraph
{
12 * A paragraph type, that will dictate how the paragraph will be handled.
16 public enum ParagraphType
{
17 /** Normal paragraph (text) */
21 /** A Break paragraph, i.e.: HR (Horizontal Line) or '* * *' or whatever */
23 /** Quotation (dialogue) */
25 /** An image (no text) */
29 private ParagraphType type
;
30 private String content
;
33 * Create a new {@link Paragraph} with the given values.
36 * the {@link ParagraphType}
38 * the content of this paragraph
40 public Paragraph(ParagraphType type
, String content
) {
42 this.content
= content
;
46 * Create a new {@link Paragraph} with the given image.
49 * the support that will be used to fetch the image via
50 * {@link Paragraph#getContentImage()}.
52 * the content image of this paragraph
54 public Paragraph(URL imageUrl
) {
55 this.type
= ParagraphType
.IMAGE
;
56 this.content
= imageUrl
.toString();
60 * The {@link ParagraphType}.
64 public ParagraphType
getType() {
69 * The {@link ParagraphType}.
74 public void setType(ParagraphType type
) {
79 * The content of this {@link Paragraph}.
83 public String
getContent() {
88 * The content of this {@link Paragraph}.
93 public void setContent(String content
) {
94 this.content
= content
;
98 * Display a DEBUG {@link String} representation of this object.
101 public String
toString() {
102 return String
.format("%s: [%s]", "" + type
, "" + content
);