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


Java P类代码示例

本文整理汇总了Java中com.hp.gagawa.java.elements.P的典型用法代码示例。如果您正苦于以下问题:Java P类的具体用法?Java P怎么用?Java P使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


P类属于com.hp.gagawa.java.elements包,在下文中一共展示了P类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addLine

import com.hp.gagawa.java.elements.P; //导入依赖的package包/类
public HtmlReportComposer addLine(ReportMessageType type, String format, Object... args) {
    Text textNode = new Text(String.format(format, args));
    Font fontNode = new Font();
    P paragraphNode = new P();
    B boldNode = null;

    if (type.bold) {
        boldNode = new B();
        boldNode.appendChild(textNode);
    }

    fontNode.setSize(FONT_SIZE).setColor(type.color).setFace(FONT_TYPE).appendChild(boldNode == null ? textNode : boldNode);
    paragraphNode.setStyle("margin:0px;padding-bottom:" + LINE_BOTTOM_PADDING).appendChild(fontNode);

    doc.body.appendChild(paragraphNode);
    return this;
}
 
开发者ID:andreyfomenkov,项目名称:green-cat,代码行数:18,代码来源:HtmlReportComposer.java

示例2: printFailure

import com.hp.gagawa.java.elements.P; //导入依赖的package包/类
@Override
protected void printFailure(final StringBuilder result) {
    result.append(new P().appendText("Parse failed!").write());
}
 
开发者ID:uwnlp,项目名称:neuralccg,代码行数:5,代码来源:GatedHtmlPrinter.java

示例3: genAlbums

import com.hp.gagawa.java.elements.P; //导入依赖的package包/类
private void genAlbums(File albumsHtml, ArrayList<File> albumsPropsFiles, File root)
{
	File albumFolder = albumsHtml.getParentFile();
	if (!albumFolder.exists())
		albumFolder.mkdirs();
	Document albums = new Document(DocumentType.HTMLTransitional);
	albums = initDocumentHeader(albums, "Alben", albumsHtml, null, root, true);
	Div albumContainer = new Div();
	albumContainer.setCSSClass("picture_container");
	Ul albumlist = new Ul();
	for (File albumProps : albumsPropsFiles)
	{
		Properties albumsProps = loadProperties(albumProps);
		Div innerItem = new Div();
		Li item = new Li();
		String relativeImg = "";
		File photoFolder = FileUtils.resolveRelativePath(albumProps, albumsProps.getProperty(AlbumInfoKey.PHOTO_DIR.toString()));
		File coverDir = new File("" + photoFolder + "/" + albumsProps.getProperty(AlbumInfoKey.COVER_PHOTO_ID.toString()));
		File coverXml = FileUtils.resolveRelativePath(coverDir, albumsProps.getProperty(AlbumInfoKey.PHOTO_INFO.toString()));
		Properties coverProps = loadProperties(coverXml);
		File photo = FileUtils.resolveRelativePath(coverXml, coverProps.getProperty(PhotoInfoKey.FILE.toString()));
		relativeImg = FileUtils.getWayTo(albumsHtml, photo);
		A albumLink = new A();
		Img cover = new Img(albumsProps.getProperty(AlbumInfoKey.NAME.toString()), relativeImg);
		innerItem.setCSSClass("album_picture");
		innerItem.appendChild(cover);
		albumLink.appendChild(innerItem);
		File singleAlbumHtml = new File("" + albumsHtml.getParentFile() + "/" + albumsProps.getProperty(AlbumInfoKey.ID.toString()) + "/album.html");
		albumLink.setHref(FileUtils.getWayTo(albumsHtml, singleAlbumHtml));
		String albumName = albumsProps.getProperty(AlbumInfoKey.NAME.toString());
		String desc = albumsProps.getProperty(AlbumInfoKey.DESCRIPTION.toString());
		P textBelow = new P();
		if (albumName != null)
			textBelow.appendText(albumName);
		if (desc != null)
			textBelow.appendText("<br/>" + desc);
		innerItem.appendChild(textBelow);
		item.appendChild(albumLink);
		albumlist.appendChild(item);
		genAlbum(albumsProps, albumProps, singleAlbumHtml, root);
	}
	albumContainer.appendChild(albumlist);
	albums.body.appendChild(albumContainer);
	writeDocument(albums, albumsHtml);
}
 
开发者ID:RStoeckl,项目名称:themis-fb,代码行数:46,代码来源:HTMLGenerator.java

示例4: genAlbum

import com.hp.gagawa.java.elements.P; //导入依赖的package包/类
private void genAlbum(Properties albumProps, File albumXml, File albumHtml, File root)
{
	Document albumFile = new Document(DocumentType.HTMLTransitional);
	File photoHtmlContainer = albumHtml.getParentFile();
	if (!photoHtmlContainer.exists())
		photoHtmlContainer.mkdirs();
	File coverXml = FileUtils.resolveRelativePath(FileUtils.resolveRelativePath(albumXml, albumProps.getProperty(AlbumInfoKey.PHOTO_DIR.toString()) + "/" + albumProps.getProperty(AlbumInfoKey.COVER_PHOTO_ID.toString())), albumProps.getProperty(AlbumInfoKey.PHOTO_INFO.toString()));
	Properties coverProps = loadProperties(coverXml);
	File cover = FileUtils.resolveRelativePath(coverXml, coverProps.getProperty(PhotoInfoKey.FILE.toString()));
	albumFile = initDocumentHeader(albumFile, albumProps.getProperty(AlbumInfoKey.NAME.toString(), "Album"), albumHtml, cover, root, true);
	Div photoContainer = new Div();
	photoContainer.setCSSClass("picture_container");
	Ul photoList = new Ul();
	for (File photoFolder : FileUtils.resolveRelativePath(albumXml, albumProps.getProperty(AlbumInfoKey.PHOTO_DIR.toString())).listFiles())
	{
		File photoXml = FileUtils.resolveRelativePath(photoFolder, albumProps.getProperty(AlbumInfoKey.PHOTO_INFO.toString()));
		Properties photoProps = loadProperties(photoXml);
		Li photoItem = new Li();
		A photoLink = new A();
		File photoHtml = new File("" + albumHtml.getParentFile() + "/" + photoProps.getProperty(PhotoInfoKey.ID.toString()) + ".html");
		photoLink.setHref(FileUtils.getWayTo(albumHtml, photoHtml));
		Div innerItem = new Div().setCSSClass("album_picture");
		String relativePhoto = FileUtils.getWayTo(albumHtml, FileUtils.resolveRelativePath(photoXml, photoProps.getProperty(PhotoInfoKey.FILE.toString())));
		innerItem.appendChild(new Img("Photo", relativePhoto));
		innerItem.appendChild(new P().appendText("Likes: " + photoProps.getProperty(PhotoInfoKey.LIKES.toString())));
		photoLink.appendChild(innerItem);
		photoItem.appendChild(photoLink);
		photoList.appendChild(photoItem);
		ArrayList<Node> commentNodes = new ArrayList<>();
		File comments = new File("" + photoXml.getParentFile() + "/" + photoProps.getProperty(PhotoInfoKey.COMMENT_DIR.toString()));
		if (comments.exists())
			for (File f : comments.listFiles())
				commentNodes.add(genComment(f, photoHtml));
		genPhotoFile(photoProps, photoHtml, photoXml, root, commentNodes.toArray(new Node[commentNodes.size()]));
	}
	Div sideInfos = new Div();
	sideInfos.setCSSClass("sidebar");
	sideInfos.appendChild(wrapInfos(AlbumInfoKey.values(), albumProps, true));
	photoContainer.appendChild(photoList);
	albumFile.body.appendChild(sideInfos);
	albumFile.body.appendChild(photoContainer);
	writeDocument(albumFile, albumHtml);
}
 
开发者ID:RStoeckl,项目名称:themis-fb,代码行数:44,代码来源:HTMLGenerator.java


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