TGFretBoardConfig.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:TuxGuitar-1.3.1-fork 作者:
private FontData getFontChooser(final Composite parent,String title,FontData fontData){
    final FontData selection = new FontData(fontData.getName(),fontData.getHeight(),fontData.getStyle());

    Label label = new Label(parent, SWT.NULL);
    label.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, true));
    label.setText(title);

    Button button = new Button(parent, SWT.PUSH);
    button.setLayoutData(getAlignmentData(MINIMUM_CONTROL_WIDTH,SWT.FILL));
    button.setText(TuxGuitar.getProperty("choose"));
    button.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent arg0) {
            Font font = new Font(parent.getDisplay(),selection);
            FontDialog fontDialog = new FontDialog(parent.getShell());
            fontDialog.setFontList(font.getFontData());
            FontData fd = fontDialog.open();
            if(fd != null){
                selection.setName( fd.getName() );
                selection.setHeight( fd.getHeight() );
                selection.setStyle( fd.getStyle() );
            }
            font.dispose();
        }
    });
    return selection;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号