📄 photodataimpl.java
字号:
public void setTimestamp(Date timestamp) { if (timestamp != null) { setExtension(new GphotoTimestamp(timestamp)); } else { removeExtension(GphotoTimestamp.class); } } /** * @return the exif:tags ExifTags for the photo. */ public ExifTags getExifTags() { return getExtension(ExifTags.class); } /** * Set the exif tags on the photo this item is about. * * @param tags the exif tags for the photo. */ public void setExifTags(ExifTags tags) { if (tags != null) { setExtension(tags); } else { removeExtension(ExifTags.class); } } /** * @return true if comments are enabled in the photo the item represents. */ public Boolean getCommentsEnabled() { return getBooleanValue(GphotoCommentsEnabled.class); } /** * Set the whether comments are enabled in the photo this item represents. * * @param commentsEnabled true if comments are enabled in the photo. */ public void setCommentsEnabled(Boolean commentsEnabled) { if (commentsEnabled != null) { setExtension(new GphotoCommentsEnabled(commentsEnabled)); } else { removeExtension(GphotoCommentsEnabled.class); } } /** * @return the comment count on the photo this item represents. */ public Integer getCommentCount() throws ParseException { return getIntegerValue(GphotoCommentCount.class); } /** * Set the number of comments on the photo this item represents. * * @param commentCount the number of comments on the photo. */ public void setCommentCount(Integer commentCount) { if (commentCount != null) { setExtension(new GphotoCommentCount(commentCount)); } else { removeExtension(GphotoCommentCount.class); } } /** * @return the media:group element on the extension point. */ public MediaGroup getMediaGroup() { return getExtension(MediaGroup.class); } /** * @return the media:keywords that are the keywords on the item. */ public MediaKeywords getKeywords() { MediaGroup group = getMediaGroup(); if (group != null) { return group.getKeywords(); } return null; } /** * Set the media:keywords to use. This will create media:group as well. */ public void setKeywords(MediaKeywords keywords) { MediaGroup group = getExtension(MediaGroup.class); if (group == null) { group = new MediaGroup(); addExtension(group); } group.setKeywords(keywords); } public List<String> getStreamIds() { List<GphotoStreamId> exts = getRepeatingExtension(GphotoStreamId.class); List<String> streamIds = new ArrayList<String>(exts.size()); for (GphotoStreamId streamId : exts) { streamIds.add(streamId.getValue()); } return streamIds; } public void addStreamId(String streamId) { addRepeatingExtension(new GphotoStreamId(streamId)); } /** * Sets the geo-location of where the photo was taken. * * @param lat The latitude coordinate, between -90 and 90 degrees. * @param lon The longitude coordinate, between -180 and 180 degrees. */ public void setGeoLocation(Double lat, Double lon) { geoData.setGeoLocation(lat, lon); } /** * Sets the geo-location of where the photo was taken. * * @param point A point containing the latitude and longitude coordinates. */ public void setGeoLocation(Point point) { geoData.setGeoLocation(point); } /** * Gets the geo-location of where the photo was taken. * @return a Point that contains the geo-coordinates (latitude and longitude). */ public Point getGeoLocation() { return geoData.getGeoLocation(); } /** * Simple position element, has a single float for the position. */ public static class GphotoPosition extends GphotoConstruct { public GphotoPosition() { this(null); } public GphotoPosition(Float position) { super("position", position == null ? null : position.toString()); } public static ExtensionDescription getDefaultDescription() { return new ExtensionDescription(GphotoPosition.class, Namespaces.PHOTOS_NAMESPACE, "position"); } } /** * Simple width element, has a single long for the width. */ public static class GphotoWidth extends GphotoConstruct { public GphotoWidth() { this(null); } public GphotoWidth(Long width) { super("width", width == null ? null : width.toString()); } public static ExtensionDescription getDefaultDescription() { return new ExtensionDescription(GphotoWidth.class, Namespaces.PHOTOS_NAMESPACE, "width"); } } /** * Simple height element, has a single long for the height. */ public static class GphotoHeight extends GphotoConstruct { public GphotoHeight() { this(null); } public GphotoHeight(Long height) { super("height", height == null ? null : height.toString()); } public static ExtensionDescription getDefaultDescription() { return new ExtensionDescription(GphotoHeight.class, Namespaces.PHOTOS_NAMESPACE, "height"); } } /** * Simple rotation element, has a single int for the rotation. */ public static class GphotoRotation extends GphotoConstruct { public GphotoRotation() { this(null); } public GphotoRotation(Integer rotation) { super("rotation", rotation == null ? null : rotation.toString()); } public static ExtensionDescription getDefaultDescription() { return new ExtensionDescription(GphotoRotation.class, Namespaces.PHOTOS_NAMESPACE, "rotation"); } } /** * Simple size element, has a single long for the size. */ public static class GphotoSize extends GphotoConstruct { public GphotoSize() { this(null); } public GphotoSize(Long size) { super("size", size == null ? null : size.toString()); } public static ExtensionDescription getDefaultDescription() { return new ExtensionDescription(GphotoSize.class, Namespaces.PHOTOS_NAMESPACE, "size"); } } /** * Simple client element, has a single string for the client. */ public static class GphotoClient extends GphotoConstruct { public GphotoClient() { this(null); } public GphotoClient(String client) { super("client", client); } public static ExtensionDescription getDefaultDescription() { return new ExtensionDescription(GphotoClient.class, Namespaces.PHOTOS_NAMESPACE, "client"); } } /** * Simple checksum element, has a single string for the checksum. * Checksums are provided by clients of the system. */ public static class GphotoChecksum extends GphotoConstruct { public GphotoChecksum() { this(null); } public GphotoChecksum(String checksum) { super("checksum", checksum); } public static ExtensionDescription getDefaultDescription() { return new ExtensionDescription(GphotoChecksum.class, Namespaces.PHOTOS_NAMESPACE, "checksum"); } } /** * Simple exif_time element, has the date of the photo from its exif data. * @deprecated use {@link ExifTags} instead. */ @Deprecated public static class GphotoExifTime extends GphotoConstruct { public GphotoExifTime() { this(null); } public GphotoExifTime(Date exifDate) { super("exiftime", exifDate == null ? null : Long.toString(exifDate.getTime())); } public static ExtensionDescription getDefaultDescription() { return new ExtensionDescription(GphotoExifTime.class, Namespaces.PHOTOS_NAMESPACE, "exiftime"); } } /** * Simple videosrc element, has the url to the video source of the item. */ public static class GphotoVideoUrl extends GphotoConstruct { public GphotoVideoUrl() { this(null); } public GphotoVideoUrl(String videoUrl) { super("videosrc", videoUrl); } public static ExtensionDescription getDefaultDescription() { return new ExtensionDescription(GphotoVideoUrl.class, Namespaces.PHOTOS_NAMESPACE, "videosrc"); } } public static class GphotoStreamId extends GphotoConstruct { public GphotoStreamId() { this(null); } public GphotoStreamId(String streamId) { super("streamId", streamId); } public static ExtensionDescription getDefaultDescription() { return new ExtensionDescription(GphotoStreamId.class, Namespaces.PHOTOS_NAMESPACE, "streamId", false, true, false); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -