X-Git-Url: http://git.nikiroo.be/?p=jvcard.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2Ftui%2FUiColors.java;h=589579a6281caebdcb61d04ea04d46ff251c8fcf;hp=834641da514d1fcdf2ebf93342d3f4daa127822c;hb=296a0b75515b3a7424b98292c87cbbf2272b73f9;hpb=bcb54330afff6a443ab43ee3d38cc7f863c701b7 diff --git a/src/be/nikiroo/jvcard/tui/UiColors.java b/src/be/nikiroo/jvcard/tui/UiColors.java index 834641d..589579a 100644 --- a/src/be/nikiroo/jvcard/tui/UiColors.java +++ b/src/be/nikiroo/jvcard/tui/UiColors.java @@ -18,6 +18,7 @@ public class UiColors { private Map mapForegroundColor = null; private Map mapBackgroundColor = null; + private boolean utf = true; /** * Get the (unique) instance of this class. @@ -34,10 +35,10 @@ public class UiColors { } public enum Element { - DEFAULT, // + DEFAULT, // TITLE_MAIN, TITLE_VARIABLE, TITLE_COUNT, // ACTION_KEY, ACTION_DESC, // - LINE_MESSAGE, LINE_MESSAGE_ERR, LINE_MESSAGE_QUESTION, LINE_MESSAGE_ANS, // + LINE_MESSAGE, LINE_MESSAGE_ERR, LINE_MESSAGE_QUESTION, LINE_MESSAGE_ANS, // CONTACT_LINE, CONTACT_LINE_SEPARATOR, CONTACT_LINE_SELECTED, CONTACT_LINE_SEPARATOR_SELECTED, CONTACT_LINE_DIRTY, CONTACT_LINE_DIRTY_SELECTED; /** @@ -67,6 +68,25 @@ public class UiColors { } } + /** + * Check if unicode characters should be used. + * + * @return TRUE to allow unicode + */ + public boolean isUnicode() { + return utf; + } + + /** + * Allow or disallow unicode characters in the program. + * + * @param utf + * TRUE to allow unuciode, FALSE to only allow ASCII characters + */ + public void setUnicode(boolean utf) { + this.utf = utf; + } + private Label createLabel(Element el, String text) { Label lbl = new Label(text); themeLabel(el, lbl); @@ -117,8 +137,7 @@ public class UiColors { addEl(Element.LINE_MESSAGE_ANS, TextColor.ANSI.BLUE, TextColor.ANSI.BLACK); addEl(Element.TITLE_MAIN, TextColor.ANSI.WHITE, TextColor.ANSI.BLUE); - addEl(Element.TITLE_VARIABLE, TextColor.ANSI.GREEN, - TextColor.ANSI.BLUE); + addEl(Element.TITLE_VARIABLE, TextColor.ANSI.GREEN, TextColor.ANSI.BLUE); addEl(Element.TITLE_COUNT, TextColor.ANSI.RED, TextColor.ANSI.BLUE); } @@ -126,5 +145,4 @@ public class UiColors { mapForegroundColor.put(el, fore); mapBackgroundColor.put(el, back); } - }