private void populateLists() {
    // Populate font names list
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    String[] saFontNames = ge.getAvailableFontFamilyNames();
    String currentFont = ChartUIUtil.getFontName(fdCurrent);
    cmbFontNames.add(ChartUIUtil.FONT_AUTO);
    if (ChartUIUtil.FONT_AUTO.equals(currentFont)) {
      cmbFontNames.select(0);
    }
    for (int iC = 0; iC < saFontNames.length; iC++) {
      cmbFontNames.add(saFontNames[iC]);
      if (saFontNames[iC].equalsIgnoreCase(currentFont)) {
        cmbFontNames.select(iC + 1);
      }
    }
    if (cmbFontNames.getSelectionIndex() == -1) {
      cmbFontNames.select(0);
    }

    // Select alignment button
    if (isAlignmentEnabled
        && fdCurrent.getAlignment() != null
        && fdCurrent.getAlignment().isSetHorizontalAlignment()
        && fdCurrent.getAlignment().isSetVerticalAlignment()) {
      HorizontalAlignment ha = fdCurrent.getAlignment().getHorizontalAlignment();
      VerticalAlignment va = fdCurrent.getAlignment().getVerticalAlignment();
      if (HorizontalAlignment.LEFT_LITERAL.equals(ha)) {
        if (VerticalAlignment.TOP_LITERAL.equals(va)) {
          btnATopLeft.setSelection(true);
        } else if (VerticalAlignment.BOTTOM_LITERAL.equals(va)) {
          btnABottomLeft.setSelection(true);
        } else {
          btnACenterLeft.setSelection(true);
        }
      } else if (HorizontalAlignment.RIGHT_LITERAL.equals(ha)) {
        if (VerticalAlignment.TOP_LITERAL.equals(va)) {
          btnATopRight.setSelection(true);
        } else if (VerticalAlignment.BOTTOM_LITERAL.equals(va)) {
          btnABottomRight.setSelection(true);
        } else {
          btnACenterRight.setSelection(true);
        }
      } else {
        if (VerticalAlignment.TOP_LITERAL.equals(va)) {
          btnATopCenter.setSelection(true);
        } else if (VerticalAlignment.BOTTOM_LITERAL.equals(va)) {
          btnABottomCenter.setSelection(true);
        } else {
          btnACenter.setSelection(true);
        }
      }
    }
  }
 private void updatePreview() {
   FontDefinition fd = fdCurrent.copyInstance();
   ChartUIUtil.getFlippedAlignment(fd.getAlignment(), isFlippedAxes());
   fcPreview.setFontDefinition(fd);
   fcPreview.redraw();
 }
  private void createRotationPanel() {
    Composite cmpRotation = new Composite(cmpContent, SWT.NONE);
    {
      GridLayout layout = new GridLayout(3, false);
      layout.verticalSpacing = 5;
      layout.horizontalSpacing = 5;
      layout.marginHeight = 7;
      layout.marginWidth = 7;
      cmpRotation.setLayout(layout);
      GridData gd = new GridData(GridData.FILL_BOTH);
      gd.horizontalSpan = 3;
      gd.heightHint = 150;
      cmpRotation.setLayoutData(gd);
    }

    Label lblRotation = new Label(cmpRotation, SWT.NONE);
    {
      lblRotation.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
      lblRotation.setText(Messages.getString("FontDefinitionDialog.Lbl.Rotation")); // $NON-NLS-1$
    }

    ascRotation =
        new AngleSelectorComposite(
            cmpRotation,
            SWT.BORDER,
            ChartUIUtil.getFontRotation(fdCurrent),
            Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    GridData gdASCRotation = new GridData(GridData.FILL_BOTH);
    gdASCRotation.horizontalSpan = 2;
    ascRotation.setLayoutData(gdASCRotation);
    ascRotation.setAngleChangeListener(this);

    Label lblDegree = new Label(cmpRotation, SWT.NONE);
    {
      lblDegree.setLayoutData(new GridData());
      lblDegree.setText(Messages.getString("FontDefinitionDialog.Label.Degree")); // $NON-NLS-1$
    }

    iscRotation =
        new IntegerSpinControl(cmpRotation, SWT.NONE, ChartUIUtil.getFontRotation(fdCurrent));
    GridData gdISCRotation = new GridData(GridData.FILL_HORIZONTAL);
    gdISCRotation.horizontalSpan = 2;
    iscRotation.setLayoutData(gdISCRotation);
    iscRotation.setMinimum(-90);
    iscRotation.setMaximum(90);
    iscRotation.setIncrement(1);
    iscRotation.addListener(this);

    Label lblPreview = new Label(cmpContent, SWT.NONE);
    {
      lblPreview.setText(Messages.getString("FontDefinitionDialog.Lbl.Preview")); // $NON-NLS-1$
      lblPreview.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
    }

    FillLayout flPreview = new FillLayout();
    flPreview.marginHeight = 2;
    flPreview.marginWidth = 3;
    Composite grpPreview = new Composite(cmpContent, SWT.NONE);
    GridData gdGRPPreview = new GridData(GridData.FILL_BOTH);
    gdGRPPreview.horizontalSpan = 4;
    grpPreview.setLayoutData(gdGRPPreview);
    grpPreview.setLayout(flPreview);

    fcPreview = new FontCanvas(grpPreview, SWT.BORDER, fdCurrent, cdCurrent, true, true, true);
  }
 protected Control createContents(Composite parent) {
   ChartUIUtil.bindHelp(parent, ChartHelpContextIds.DIALOG_FONT_EDITOR);
   getShell()
       .setText(Messages.getString("FontDefinitionDialog.Title.FontDescriptor")); // $NON-NLS-1$
   return super.createContents(parent);
 }