当前位置: 首页>>代码示例>>Java>>正文


Java Font.setSize方法代码示例

本文整理汇总了Java中com.lowagie.text.Font.setSize方法的典型用法代码示例。如果您正苦于以下问题:Java Font.setSize方法的具体用法?Java Font.setSize怎么用?Java Font.setSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.lowagie.text.Font的用法示例。


在下文中一共展示了Font.setSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createFont

import com.lowagie.text.Font; //导入方法依赖的package包/类
private Font createFont( int fontType )
{
    Font font = new Font();
    font.setFamily( FONTFAMILY );

    switch ( fontType )
    {
    case FONTTYPE_BODY:
        font.setSize( FONTSIZE_BODY );
        font.setColor( Color.BLACK );
        break;
    case FONTTYPE_TITLE:
        font.setSize( FONTSIZE_TITLE );
        font.setStyle( java.awt.Font.BOLD );
        font.setColor( new Color( 0, 0, 128 ) ); // Navy Color
        break;
    case FONTTYPE_DESCRIPTION:
        font.setSize( FONTSIZE_DESCRIPTION );
        font.setColor( Color.DARK_GRAY );
        break;
    case FONTTYPE_SECTIONHEADER:
        font.setSize( FONTSIZE_SECTIONHEADER );
        font.setStyle( java.awt.Font.BOLD );
        font.setColor( new Color( 70, 130, 180 ) ); // Steel Blue Color
        break;
    case FONTTYPE_FOOTER:
        font.setSize( FONTSIZE_FOOTER );
        break;
    default:
        font.setSize( FONTSIZE_BODY );
        break;
    }

    return font;
}
 
开发者ID:dhis2,项目名称:dhis2-core,代码行数:36,代码来源:PdfFormFontSettings.java

示例2: getFilters

import com.lowagie.text.Font; //导入方法依赖的package包/类
/**
 * This method returns the current filter settings as an unordered list.
 *
 * @param queryParameters
 *            The query instance with filter settings.
 * @param resourcesManager
 *            The {@link ResourceBundleManager}.
 * @param user
 *            The user.
 * @param dateFormatter
 *            Date formater.
 * @throws NoteNotFoundException
 *             NoteNotFoundException
 * @throws AuthorizationException
 *             Exception.
 * @return Filters as {@link List}.
 */
private Element getFilters(NoteQueryParameters queryParameters, User user,
        DateFormat dateFormatter, ResourceBundleManager resourcesManager)
                throws NoteNotFoundException, AuthorizationException {

    List filters = new List(List.UNORDERED);
    filters.setIndentationLeft(20);
    if (queryParameters.getNoteId() != null) {
        filters.add(RtfElementFactory.createListItem(resourcesManager.getText(
                "export.postlist.filter.single.post", user.getLanguageLocale())));
        return filters;
    }

    handleFollowFavoriteDirectOnly(queryParameters, user.getLanguageLocale(), resourcesManager,
            filters);
    TaggingCoreItemUTPExtension utpExt = queryParameters.getTypeSpecificExtension();
    handleUsersFilter(resourcesManager, user.getLanguageLocale(), filters,
            queryParameters.getUserToBeNotified());
    handleParentPostFilter(resourcesManager, dateFormatter, user.getLanguageLocale(), filters,
            utpExt);
    handleDatesFilter(queryParameters, user.getLanguageLocale(), dateFormatter,
            resourcesManager, filters);
    handleBlogFilter(resourcesManager, user.getLanguageLocale(), filters, utpExt);
    handleDiscussionFilter(resourcesManager, user.getLanguageLocale(), dateFormatter,
            queryParameters.getDiscussionId(), filters);

    if (queryParameters.getUserIds() != null) {
        final Collection<String> authorList = new ArrayList<String>();
        for (Long id : queryParameters.getUserIds()) {
            ServiceLocator.instance().getService(UserManagement.class)
            .getUserById(id, new Converter<User, Object>() {
                @Override
                public Object convert(User source) {
                    authorList.add(UserNameHelper.getDetailedUserSignature(source));
                    return null;
                }
            });
        }
        filters.add(RtfElementFactory.createListItem(resourcesManager.getText(
                "export.postlist.filter.authors", user.getLanguageLocale(),
                StringUtils.join(authorList, ", "))));
    }

    handleTagsFilter(queryParameters.getLogicalTags(), queryParameters.getTagIds(),
            user.getLanguageLocale(), resourcesManager, filters);
    handleUserSearchFilter(queryParameters.getUserSearchFilters(), user.getLanguageLocale(),
            resourcesManager, filters);

    if (queryParameters.getFullTextSearchFilters() != null) {
        filters.add(RtfElementFactory.createListItem(resourcesManager.getText(
                "export.postlist.filter.text", user.getLanguageLocale(),
                StringUtils.join(queryParameters.getFullTextSearchFilters(), " "))));
    }
    if (filters.size() == 0) {
        Font italic = new Font();
        italic.setSize(10);
        italic.setStyle(Font.ITALIC);
        Element empty = RtfElementFactory.createListItem(
                resourcesManager.getText("export.postlist.filter.none",
                        user.getLanguageLocale()), italic);
        filters.add(empty);
    }
    return filters;
}
 
开发者ID:Communote,项目名称:communote-server,代码行数:81,代码来源:RtfNoteWriter.java

示例3: setFontStyle

import com.lowagie.text.Font; //导入方法依赖的package包/类
/** 
 * 功能说明:设置字体的样式</BR> 
 * 修改日期:2011-04-27 
 * @author myclover 
 * @param family  字体类型 
 * @param color   字体颜色 
 * @param size    字体大小,22f为二号,18f为小二号,16f为三号 
 * @param style   字体样式 
 * @return 
 */  
public static Font setFontStyle(String family , Color color , float size , int style){  
    Font font = new Font();  
    font.setFamily(family);  
    font.setColor(color);  
    font.setSize(size);  
    font.setStyle(style);  
    return font;  
}
 
开发者ID:wkeyuan,项目名称:DWSurvey,代码行数:19,代码来源:DocStyleUtils.java


注:本文中的com.lowagie.text.Font.setSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。