コード例 #1
0
  /** Set the font in the label to that in the model, or failing that, as per user's default */
  protected void setLabelFont() {
    String fontName = fDiagramModelConnection.getFont();
    Font font = FontFactory.get(fontName);

    // Adjust for Windows DPI
    if (PlatformUtils.isWindows()) {
      font = FontFactory.getAdjustedWindowsFont(font);
    }

    getConnectionLabel().setFont(font);
  }
コード例 #2
0
  @Override
  public void setFont(Font f) {
    if (PlatformUtils.isWindows()) {
      f = FontFactory.getAdjustedWindowsFont(f);
    }

    super.setFont(f);
  }
コード例 #3
0
  /** Set the font to that in the model, or failing that, as per user's default */
  protected void setFont() {
    String fontName = fDiagramModelObject.getFont();
    setFont(FontFactory.get(fontName));

    // Need to do this after font change
    if (getTextControl() != null) {
      getTextControl().revalidate();
    }
  }