package be.nikiroo.fanfix.data;
-import java.net.URL;
+import java.awt.image.BufferedImage;
/**
* A paragraph in a chapter of the story.
private ParagraphType type;
private String content;
+ private BufferedImage contentImage;
private long words;
/**
/**
* Create a new {@link Paragraph} with the given image.
*
- * @param imageUrl
- * the image as an URL
+ * @param contentImage
+ * the image
*/
- public Paragraph(URL imageUrl) {
- this(ParagraphType.IMAGE, imageUrl.toString(), 1);
+ public Paragraph(BufferedImage contentImage) {
+ this(ParagraphType.IMAGE, null, 1);
+ this.contentImage = contentImage;
}
/**
}
/**
- * The content of this {@link Paragraph}.
+ * The content of this {@link Paragraph} if it is not an image.
*
* @return the content
*/
this.content = content;
}
+ /**
+ * The content of this {@link Paragraph} if it is an image.
+ *
+ * @return the content
+ */
+ public BufferedImage getContentImage() {
+ return contentImage;
+ }
+
/**
* The number of words (or images) in this {@link Paragraph}.
*