Пример #1
0
  /**
   * If the font is set to null, then the font used to display today's date as text will default to
   * the L&F's Label default font.
   *
   * <p>Otherwise, the font used to display today's date is set as given.
   *
   * @param font The font to set.
   */
  public void setTodayFont(Font font) {
    if (font == null && todayFont != null || !font.equals(todayFont)) {

      todayFont = font;
      if (isDisplayable()) setupTodayFont();
    }
  }
Пример #2
0
  /**
   * If the font is set to null, then the day font will default to 9/11th's of the L&amp;F's Button
   * default font.
   *
   * <p>Otherwise, the day font is set as given.
   *
   * @param font The font to set.
   */
  public void setDayFont(Font font) {
    if (font == null && dayFont != null || !font.equals(dayFont)) {

      dayFont = font;
      if (isDisplayable()) setupDayFonts();
    }
  }
Пример #3
0
  /**
   * If the font is set to null, then the title font (for the Month Year title) will default to the
   * L&amp;F's Label default font.
   *
   * <p>Otherwise, the title font is set as given.
   *
   * @param font The font to set.
   */
  public void setTitleFont(Font font) {
    if (font == null && titleFont != null || !font.equals(titleFont)) {

      titleFont = font;
      if (isDisplayable()) setupTitleFont();
    }
  }
Пример #4
0
  /**
   * Set current font. Default to Plain Courier 11 if null.
   *
   * @param font new font.
   */
  public void setFont(Font font) {

    if (font != null) {
      m_localGraphicsState.setFont(font);
      if (font.getName().equals(m_psGraphicsState.getFont().getName())
          && (m_psGraphicsState.getFont().getStyle() == font.getStyle())
          && (m_psGraphicsState.getFont().getSize() == yScale(font.getSize()))) return;
      m_psGraphicsState.setFont(
          new Font(font.getName(), font.getStyle(), yScale(getFont().getSize())));
    } else {
      m_localGraphicsState.setFont(new Font("Courier", Font.PLAIN, 11));
      m_psGraphicsState.setFont(getFont());
    }

    m_printstream.println("/(" + replacePSFont(getFont().getPSName()) + ")" + " findfont");
    m_printstream.println(yScale(getFont().getSize()) + " scalefont setfont");
  }
Пример #5
0
  /** Set the day-of-week labels' font. */
  protected void setupDayOfWeekFonts() {
    Font font;
    if (dayOfWeekLabels == null) return;

    // If not null, use what the user gave us

    font = dayOfWeekFont;

    // Otherwise, use 9/11 of the L&F default for a label

    if (font == null) {
      font = UIManager.getFont("Label.font");
      font = font.deriveFont((float) (font.getSize2D() * 9.0 / 11.0));
    }

    // Set the day of week labels' font

    for (int day = 0; day < 7; day++) {
      dayOfWeekLabels[day].setFont(font);
    }
  }
Пример #6
0
  /** Set the day labels' font. */
  protected void setupDayFonts() {
    Font font;
    if (dayButtons == null) return;

    // If null, use what the user gave us

    font = dayFont;

    // Otherwise, use 9/11 of the L&F default for a button

    if (font == null) {
      font = UIManager.getFont("Button.font");
      font = font.deriveFont((float) (font.getSize2D() * 9.0 / 11.0));
    }

    // Set the day labels' font

    for (int row = 0; row < 6; row++) {
      for (int day = 0; day < 7; day++) {
        dayButtons[row][day].setFont(font);
      }
    }
  }