1 | // Jomic - a viewer for comic book archives. |
2 | // Copyright (C) 2004-2011 Thomas Aglassinger |
3 | // |
4 | // This program is free software: you can redistribute it and/or modify |
5 | // it under the terms of the GNU General Public License as published by |
6 | // the Free Software Foundation, either version 3 of the License, or |
7 | // (at your option) any later version. |
8 | // |
9 | // This program is distributed in the hope that it will be useful, |
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | // GNU General Public License for more details. |
13 | // |
14 | // You should have received a copy of the GNU General Public License |
15 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | package net.sf.jomic.common; |
17 | |
18 | import net.sf.jomic.tools.ImageRenderSettings; |
19 | |
20 | /** |
21 | * Settings to specify how to render the images of a <code>ComicSheet</code>. |
22 | * |
23 | * @see net.sf.jomic.comic.ComicSheet |
24 | */ |
25 | public class ComicSheetRenderSettings extends ImageRenderSettings |
26 | { |
27 | /** |
28 | * Rotate image only if viewing as single page and it is portrait? |
29 | */ |
30 | public static final String ROTATE_ONLY_SINGLE_PORTRAIT_IMAGES = "rotateOnlySinglePortraitImages"; |
31 | |
32 | /** |
33 | * Show two pages at once? |
34 | */ |
35 | // TODO: rename to "showTwoPages" |
36 | public static final String SHOW_TWO_PAGES = "twoPageMode"; |
37 | |
38 | /** |
39 | * Read comic from right to left (manga mode)? |
40 | */ |
41 | // TODO: rename to "swapLeftAndRightImage" (without "s" at the end) |
42 | public static final String SWAP_LEFT_AND_RIGHT_IMAGE = "swapLeftAndRightImages"; |
43 | |
44 | public ComicSheetRenderSettings() { |
45 | super(); |
46 | } |
47 | |
48 | public void setRotateOnlySinglePortraitImages(boolean newRotate) { |
49 | setBooleanProperty(ROTATE_ONLY_SINGLE_PORTRAIT_IMAGES, newRotate); |
50 | } |
51 | |
52 | public void setSwapLeftAndRightImage(boolean newMode) { |
53 | setBooleanProperty(SWAP_LEFT_AND_RIGHT_IMAGE, newMode); |
54 | } |
55 | |
56 | public void setTwoPageMode(boolean newMode) { |
57 | setBooleanProperty(SHOW_TWO_PAGES, newMode); |
58 | } |
59 | |
60 | public boolean getRotateOnlySinglePortraitImages() { |
61 | return getBooleanProperty(ROTATE_ONLY_SINGLE_PORTRAIT_IMAGES); |
62 | } |
63 | |
64 | public boolean getSwapLeftAndRightImage() { |
65 | return getBooleanProperty(SWAP_LEFT_AND_RIGHT_IMAGE); |
66 | } |
67 | |
68 | public boolean getTwoPageMode() { |
69 | return getBooleanProperty(SHOW_TWO_PAGES); |
70 | } |
71 | } |