1 package be
.nikiroo
.fanfix
.output
;
3 import java
.io
.IOException
;
5 import be
.nikiroo
.fanfix
.Instance
;
6 import be
.nikiroo
.fanfix
.bundles
.StringId
;
7 import be
.nikiroo
.fanfix
.data
.Chapter
;
8 import be
.nikiroo
.fanfix
.data
.Paragraph
.ParagraphType
;
10 class InfoText
extends Text
{
12 private char openQuote
= Instance
.getInstance().getTrans().getCharacter(StringId
.OPEN_SINGLE_QUOTE
);
13 private char closeQuote
= Instance
.getInstance().getTrans().getCharacter(StringId
.CLOSE_SINGLE_QUOTE
);
14 private char openDoubleQuote
= Instance
.getInstance().getTrans().getCharacter(StringId
.OPEN_DOUBLE_QUOTE
);
15 private char closeDoubleQuote
= Instance
.getInstance().getTrans().getCharacter(StringId
.CLOSE_DOUBLE_QUOTE
);
18 public String
getDefaultExtension(boolean readerTarget
) {
23 protected void writeChapterHeader(Chapter chap
) throws IOException
{
26 if (chap
.getName() != null && !chap
.getName().isEmpty()) {
27 writer
.write(Instance
.getInstance().getTrans().getString(StringId
.CHAPTER_NAMED
, chap
.getNumber(),
30 writer
.write(Instance
.getInstance().getTrans().getString(StringId
.CHAPTER_UNNAMED
, chap
.getNumber()));
37 protected void writeTextLine(ParagraphType type
, String line
)
42 StringBuilder builder
= new StringBuilder();
43 for (char car
: line
.toCharArray()) {
45 builder
.append("---");
46 } else if (car
== '–') {
48 } else if (car
== openDoubleQuote
) {
50 } else if (car
== closeDoubleQuote
) {
52 } else if (car
== openQuote
) {
54 } else if (car
== closeQuote
) {
61 line
= builder
.toString();
67 super.writeTextLine(type
, line
);