Renames and jDo
[fanfix.git] / src / be / nikiroo / fanfix / reader / TuiReader.java
1 package be.nikiroo.fanfix.reader;
2
3 import java.io.IOException;
4
5 import be.nikiroo.fanfix.Instance;
6
7 class TuiReader extends BasicReader {
8 @Override
9 public void read() throws IOException {
10 if (getStory() == null) {
11 throw new IOException("No story to read");
12 }
13
14 open(getLibrary(), getStory().getMeta().getLuid());
15 }
16
17 @Override
18 public void read(int chapter) throws IOException {
19 // TODO: show a special page?
20 read();
21 }
22
23 @Override
24 public void browse(String source) {
25 try {
26 TuiReaderApplication app = new TuiReaderApplication(getLibrary()
27 .getListBySource(source), this);
28 new Thread(app).start();
29 } catch (Exception e) {
30 Instance.syserr(e);
31 }
32 }
33 }