Exemple #1
0
  /** Initializes the theme. */
  protected void initializeTheme() {
    putLnfResource("black", new ColorLnfResource(0, 0, 0)); // $NON-NLS-1$
    putLnfResource("white", new ColorLnfResource(255, 255, 255)); // $NON-NLS-1$

    if (getTheme() != null) {
      getTheme().customizeLnf(this);
    }
  }
Exemple #2
0
  /**
   * Creates a new {@link FontLnfResource} and adds it to the {@link RienaDefaultLnf}. So next time,
   * a fontDescriptor with this key will be used to fetch the font, the cached instance will be
   * returned.
   *
   * @return the font defined by this descriptor or <code>null</code> if no registered font can be
   *     found by the lnfKeyConstants key.
   */
  private Font updateFont() {
    if (key == null) {
      return null;
    }

    final Font font = lnf.getFont(key);
    if (font == null || font.getFontData().length == 0) {
      return null;
    }

    final String fontName = font.getFontData()[0].getName();
    final FontData fontData = new FontData(fontName, height, style);
    final FontLnfResource fontResource = new FontLnfResource(fontData);
    lnf.putLnfResource(this.toString(), fontResource);
    return getFont();
  }