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


Java Photo.getId方法代码示例

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


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

示例1: FlickrResultOption

import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
public FlickrResultOption(Photo photo)
{
	this.photo = photo;
	this.value = photo.getId();
	this.description = photo.getDescription();
	this.disabled = false;
}
 
开发者ID:equella,项目名称:Equella,代码行数:8,代码来源:FlickrSearchResultsSection.java

示例2: execute

import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
@Override
protected void execute() {
    try {
        for(int i=0; i<photos.size();i++) {
            Photo p = photos.get(i);
            String url = "https://farm" + p.getFarm() + ".staticflickr.com/" + p.getServer()
                    + "/" + p.getId() + "_" + p.getOriginalSecret() + "_o." + p
                    .getOriginalFormat();
            downloadTempPhoto(url, p.getId() + "_o", p.getOriginalFormat());
            p.setGeoData(getLocation(p.getId()));
            logger.debug("Got geodata=[{},{}]", p.getGeoData().getLatitude(),p.getGeoData().getLongitude());

            if (!isRunning()) {
                logger.debug("Download interrupted.");
                return;
            }

            callback.accept(p);
            progressCallback.accept((double) (i + 1) / (double) photos.size());
        }
        progressCallback.accept(1.0);
    }
    catch (FlickrException | ServiceException e) {
        logger.error(e.getMessage());
        errorHandler.propagate(new ServiceException("Failed to download photo", e));
    }
}
 
开发者ID:travelimg,项目名称:travelimg,代码行数:28,代码来源:FlickrServiceImpl.java

示例3: generateFilename

import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
private String generateFilename(Photo p, int size) {
	String suffix = sizes.getSuffix(size);
	if (size == Size.ORIGINAL) {
		return p.getId() + "_" + p.getOriginalSecret() + suffix + "." + p.getOriginalFormat();
	}
	else {
		return p.getId() + "_" + p.getSecret() + suffix + ".jpg";
	}
}
 
开发者ID:lutana-de,项目名称:easyflickrbackup,代码行数:10,代码来源:GUI.java

示例4: PhotoDTO

import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
public PhotoDTO(Photo photo) {
    this.title = photo.getTitle();
    this.description = photo.getDescription();
    this.url = photo.getUrl();
    this.id = photo.getId();
    this.ownerName = photo.getOwner().getRealName() != null ? photo.getOwner().getRealName() : photo.getOwner().getUsername();

    resolveLargestSize(photo);
    this.setSquareUrl(photo.getSquareSize().getSource());
}
 
开发者ID:eriklupander,项目名称:hipstacaster,代码行数:11,代码来源:PhotoDTO.java

示例5: PhotosNotInASet

import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
public PhotosNotInASet(Configuration configuration, Flickr flickr) throws IOException, SAXException, FlickrException {
	super(configuration);

       if(configuration.limitDownloadsToSets.size() > 0) {
           return;
       }

	Logger.getLogger(getClass()).info("Downloading list of photos that are not in a set");

	int pageNum = 1;
	while (true) {
		PhotoList photos = flickr.getPhotosInterface().getNotInSet(500, pageNum);
		if (photos.size() == 0)
			break;

		for (int i = 0; i < photos.size(); i++) {
			Photo photo = (Photo) photos.get(i);
			if (this.primaryPhotoId == null) {
				this.primaryPhotoId = photo.getId();
				this.primaryPhotoSmallSquareUrl = photo.getSmallSquareUrl();
			}

			this.photoSet.add(photo);
		}
		pageNum++;
	}

	Logger.getLogger(getClass()).info(String.format("There are a total of %s photos that are not in a set", this.photoSet.size()));
}
 
开发者ID:masneyb,项目名称:flickrdownload,代码行数:30,代码来源:PhotosNotInASet.java

示例6: buildOriFlickrUrl

import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
private String buildOriFlickrUrl(Photo p){
    return "https://farm" + p.getFarm() + ".staticflickr.com/" + p.getServer()
            + "/" + p.getId() + "_" + p.getOriginalSecret() + "_o." + p
            .getOriginalFormat();
}
 
开发者ID:travelimg,项目名称:travelimg,代码行数:6,代码来源:FlickrServiceTest.java

示例7: buildFlickrUrl

import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
private String buildFlickrUrl(Photo p){
    return "https://farm" + p.getFarm() + ".staticflickr.com/" + p.getServer() + "/" + p.getId() + "_" + p.getSecret() + "_z." + p.getOriginalFormat();
}
 
开发者ID:travelimg,项目名称:travelimg,代码行数:4,代码来源:FlickrServiceTest.java


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