e9f909da7674ffd41f580e6e59dc2ec88f27e5ad
[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 public void read() throws IOException {
9 if (getStory() == null) {
10 throw new IOException("No story to read");
11 }
12
13 open(getLibrary(), getStory().getMeta().getLuid());
14 }
15
16 public void read(int chapter) throws IOException {
17 // TODO: show a special page?
18 read();
19 }
20
21 public void browse(String source) {
22 try {
23 TuiReaderApplication app = new TuiReaderApplication(getLibrary()
24 .getListBySource(source), this);
25 new Thread(app).start();
26 } catch (Exception e) {
27 Instance.syserr(e);
28 }
29 }
30 }