Esempio n. 1
0
  public void initChatControl(Text chat) {
    chat.setFont(iniAppearance.getFontChat());
    chat.setBackground(iniAppearance.getColorBackground());
    chat.setForeground(iniAppearance.getColorForeground());

    chatControls.add(chat);
  }
Esempio n. 2
0
  public void initLogControl(StyledText log) {
    log.setFont(iniAppearance.getFontLog());
    log.setBackground(iniAppearance.getColorLogBackground());
    log.setForeground(iniAppearance.getColorLogBackground());

    logControls.add(log);
  }
Esempio n. 3
0
  public void initControl(Control control) {
    control.setFont(iniAppearance.getFontGlobal());
    control.setBackground(iniAppearance.getColorBackground());
    control.setForeground(iniAppearance.getColorForeground());

    controls.add(control);
  }
Esempio n. 4
0
  public void applyFont(FontType type, FontData data) {
    Font newFont = new Font(SwtUtils.DISPLAY, data);
    Font oldFont = null;

    switch (type) {
      case GLOBAL:
        {
          oldFont = iniAppearance.getFontGlobal();

          for (Control control : controls) {
            if (control.isDisposed()) continue;

            control.setFont(newFont);
          }

          for (Label label : labels) {
            if (label.isDisposed()) continue;

            label.setFont(newFont);
          }

          for (Button button : buttons) {
            if (button.isDisposed()) continue;

            button.setFont(newFont);
          }

          iniAppearance.setFontGlobal(newFont);
          break;
        }
      case LOG:
        {
          oldFont = iniAppearance.getFontLog();

          for (StyledText control : logControls) {
            if (control.isDisposed()) continue;

            control.setFont(newFont);
          }

          iniAppearance.setFontLog(newFont);
          break;
        }
      case CHAT:
        {
          oldFont = iniAppearance.getFontChat();

          for (Text control : chatControls) {
            if (control.isDisposed()) continue;

            control.setFont(newFont);
          }

          iniAppearance.setFontChat(newFont);
          break;
        }
    }

    if (oldFont != null) oldFont.dispose();
  }
Esempio n. 5
0
  public void applyColor(ColorType type, RGB rgb) {
    Color newColor = new Color(SwtUtils.DISPLAY, rgb);
    Color oldColor = null;

    switch (type) {
      case BACKGROUND:
        {
          oldColor = iniAppearance.getColorBackground();

          for (Control control : controls) {
            if (control.isDisposed()) continue;

            control.setBackground(newColor);
          }
          for (Text chat : chatControls) {
            if (chat.isDisposed()) continue;

            chat.setBackground(newColor);
          }

          iniAppearance.setColorBackground(newColor);
          break;
        }
      case FOREGROUND:
        {
          oldColor = iniAppearance.getColorForeground();

          for (Control control : controls) {
            if (control.isDisposed()) continue;

            control.setForeground(newColor);
          }
          for (Text chat : chatControls) {
            if (chat.isDisposed()) continue;

            chat.setForeground(newColor);
          }

          iniAppearance.setColorForeground(newColor);
          break;
        }
      case LOG_BACKGROUND:
        {
          oldColor = iniAppearance.getColorLogBackground();

          for (StyledText text : logControls) {
            if (text.isDisposed()) continue;

            text.setBackground(newColor);
            text.setForeground(newColor);
          }

          iniAppearance.setColorLogBackground(newColor);
        }
    }

    if (oldColor != null) oldColor.dispose();
  }
Esempio n. 6
0
  public void initControl(Button button) {
    button.setFont(iniAppearance.getFontGlobal());

    buttons.add(button);
  }
Esempio n. 7
0
  public void initControl(Label label) {
    label.setFont(iniAppearance.getFontGlobal());

    labels.add(label);
  }