summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:34:57 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:34:57 +0000
commit3385be57ce493a6e5f06117b652a38780ab834ab (patch)
treeac0cad33c670bce4f9002baa52c8d1395c53688d
parent504ea458062a37dea8f2f34c9259b9b962474659 (diff)
downloadpdf-over-3385be57ce493a6e5f06117b652a38780ab834ab.tar.gz
pdf-over-3385be57ce493a6e5f06117b652a38780ab834ab.tar.bz2
pdf-over-3385be57ce493a6e5f06117b652a38780ab834ab.zip
Use switches for theme selection
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@394 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java56
1 files changed, 40 insertions, 16 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java
index 4b557e1e..ecf84865 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java
@@ -48,22 +48,40 @@ public class Constants {
public static final int MAINBAR_HEIGHT = 60;
/** Main bar active background - light start of gradient */
- public static final Color MAINBAR_ACTIVE_BACK_LIGHT =
- theme == Themes.DEFAULT ?
- new Color(display, 0xB4, 0xCD, 0xEC) :
- new Color(display, 0xEC, 0xAD, 0xE7);
+ public static final Color MAINBAR_ACTIVE_BACK_LIGHT = getMainbarActiveBackLight();
+ private static Color getMainbarActiveBackLight() {
+ switch (theme) {
+ default:
+ case DEFAULT:
+ return new Color(display, 0xB4, 0xCD, 0xEC);
+ case GEMPLUSH:
+ return new Color(display, 0xEC, 0xAD, 0xE7);
+ }
+ }
/** Main bar active background - dark end of gradient */
- public static final Color MAINBAR_ACTIVE_BACK_DARK =
- theme == Themes.DEFAULT ?
- new Color(display, 0x6B, 0xA5, 0xD9) :
- new Color(display, 0xD9, 0x53, 0x9C);
+ public static final Color MAINBAR_ACTIVE_BACK_DARK = getMainbarActiveBackDark();
+ private static Color getMainbarActiveBackDark() {
+ switch (theme) {
+ default:
+ case DEFAULT:
+ return new Color(display, 0x6B, 0xA5, 0xD9);
+ case GEMPLUSH:
+ return new Color(display, 0xD9, 0x53, 0x9C);
+ }
+ }
/** Main bar inactive background */
- public static final Color MAINBAR_INACTIVE_BACK =
- theme == Themes.DEFAULT ?
- new Color(display, 0xD4, 0xE7, 0xF1) :
- new Color(display, 0xF1, 0xD1, 0xE8);
+ public static final Color MAINBAR_INACTIVE_BACK = getMainbarInactiveBack();
+ private static Color getMainbarInactiveBack() {
+ switch (theme) {
+ default:
+ case DEFAULT:
+ return new Color(display, 0xD4, 0xE7, 0xF1);
+ case GEMPLUSH:
+ return new Color(display, 0xF1, 0xD1, 0xE8);
+ }
+ }
/** Main bar active text color */
public static final Color MAINBAR_ACTIVE_TEXTCOLOR = new Color(display, 0x00, 0x00, 0x00);
@@ -93,10 +111,16 @@ public class Constants {
public static final String RES_ICON = "/icons/icon.png"; //$NON-NLS-1$
/** Config image resource */
- public static final String RES_IMG_CONFIG =
- theme == Themes.DEFAULT ?
- "/img/config.png" : //$NON-NLS-1$
- "/img/config_p.png"; //$NON-NLS-1$
+ public static final String RES_IMG_CONFIG = getResImgConfig();
+ private static String getResImgConfig() {
+ switch (theme) {
+ default:
+ case DEFAULT:
+ return "/img/config.png"; //$NON-NLS-1$
+ case GEMPLUSH:
+ return "/img/config_p.png"; //$NON-NLS-1$
+ }
+ }
/** Config inactive image resource */
public static final String RES_IMG_CONFIG_DISABLED = "/img/config_disabled.png"; //$NON-NLS-1$