- * Represent an element that can be coloured (foreground/background
- * colours).
- *
- * @author niki
- *
- */
- public enum Element {
- DEFAULT, //
- TITLE_MAIN, TITLE_VARIABLE, TITLE_COUNT, //
- ACTION_KEY, ACTION_DESC, //
- 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, //
- VIEW_CONTACT_NAME, VIEW_CONTACT_NORMAL, VIEW_CONTACT_NOTES_TITLE, //
- ;
-
- /**
- * Get the foreground colour of this element.
- *
- * @return the colour
- */
- public TextColor getForegroundColor() {
- return UiColors.getInstance().getForegroundColor(this);
- }
-
- /**
- * Get the background colour of this element.
- *
- * @return the colour
- */
- public TextColor getBackgroundColor() {
- return UiColors.getInstance().getBackgroundColor(this);
- }
-
- /**
- * Create a new {@link Label} with the colours of this {@link Element}.
- *
- * @param text
- * the text of the {@link Label}
- *
- * @return the new {@link Label}
- */
- public Label createLabel(String text) {
- return UiColors.getInstance().createLabel(this, text);
- }
-
- /**
- * Theme a {@link Label} with the colours of this {@link Element}.
- *
- * @param lbl
- * the {@link Label}
- */
- public void themeLabel(Label lbl) {
- UiColors.getInstance().themeLabel(this, lbl);
- }
- }
-
- /**
- * 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;
- }
-
- /**
- * Create a new {@link Label} with the colours of the given {@link Element}.