本文整理汇总了Java中com.lowagie.text.Font.setStyle方法的典型用法代码示例。如果您正苦于以下问题:Java Font.setStyle方法的具体用法?Java Font.setStyle怎么用?Java Font.setStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lowagie.text.Font
的用法示例。
在下文中一共展示了Font.setStyle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: getFont
import com.lowagie.text.Font; //导入方法依赖的package包/类
public static Font getFont(boolean bold, boolean italic, boolean underline, Color color) {
Font font = getFont(bold, italic);
if (underline) font.setStyle(font.getStyle() + Font.UNDERLINE);
if (color != null) font.setColor(color);
return font;
}
示例3: getSmallFont
import com.lowagie.text.Font; //导入方法依赖的package包/类
public static Font getSmallFont(boolean bold, boolean italic, boolean underline, Color color) {
Font font = getSmallFont(bold, italic);
if (underline) font.setStyle(font.getStyle() + Font.UNDERLINE);
if (color != null) font.setColor(color);
return font;
}
示例4: getDescription
import com.lowagie.text.Font; //导入方法依赖的package包/类
/**
* This message creates the description element at the beginning of the exported document.
*
* @param queryInstance
* The query instance to extract needed data from.
* @param user
* The user.
* @param fullDateFormatter
* Formatter for full dates.
* @param dateFormatter
* Formatter for short dates.r.
* @param resourcesManager
* The resources manager to retrieve resources from.
* @return An object to be used as a description.
* @throws NoteNotFoundException
* Exception.
* @throws AuthorizationException
* Exception.
*/
private Element getDescription(NoteQueryParameters queryInstance, User user,
DateFormat dateFormatter, DateFormat fullDateFormatter,
ResourceBundleManager resourcesManager) throws NoteNotFoundException,
AuthorizationException {
Collection<Object> elements = new ArrayList<Object>();
Font boldFont = new Font();
boldFont.setStyle(Font.BOLD);
elements.add(RtfElementFactory.createChunk("\n"));
Locale locale = user.getLanguageLocale();
elements.add(RtfElementFactory.createChunk(
resourcesManager.getText("export.postlist.filter.header", locale), boldFont));
elements.add(RtfElementFactory.createChunk("\n"));
elements.add(getFilters(queryInstance, user, dateFormatter, resourcesManager));
return RtfElementFactory.createPhrase(elements);
}
示例5: 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;
}
示例6: 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;
}