Exemplo n.º 1
0
  public static void modifyTablesFont(int delta) {
    int currentSize = ApplicationSettings.GUI_TABLES_FONT_SIZE.getValue();
    if (currentSize == 0 || delta == 0) {
      currentSize = getDefaultFont().getSize();
    }

    int newSize = currentSize + delta;
    if (TABLE_FONT_SIZE_MIN <= newSize && newSize <= TABLE_FONT_SIZE_MAX) {
      ApplicationSettings.GUI_TABLES_FONT_SIZE.setValue(currentSize + delta);
      Font f = setupTableFont(UIManager.getLookAndFeelDefaults());

      changeTablesFont(f);
    }
  }
Exemplo n.º 2
0
  private static Font setupTableFont(UIDefaults defaults) {
    int sizeSetting = ApplicationSettings.GUI_TABLES_FONT_SIZE.getValue();
    if (sizeSetting != 0
        && (sizeSetting < TABLE_FONT_SIZE_MIN || TABLE_FONT_SIZE_MAX < sizeSetting)) {
      ApplicationSettings.GUI_TABLES_FONT_SIZE.setValue(0);
      sizeSetting = 0;
    }

    Font f;
    if (sizeSetting != 0) {
      f = defaults.getFont("defaultFont").deriveFont((float) sizeSetting);
    } else {
      f = defaults.getFont("defaultFont");
    }

    defaults.put("Table.font", new FontUIResource(f));

    return f;
  }