mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-28 14:57:12 +00:00
separated media classes from media DTO's
This commit is contained in:
1 parent
8ff9797d29
commit
3e87d32e52
12 files changed
+308
-189
No files matched your search
+2
-2
@@ -14,7 +14,7 @@ import com.google.gwt.safehtml.shared.UriUtils;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.user.client.Command;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sse.common.media.ImageMetadataDTO;
|
||||
import com.sap.sse.gwt.client.media.ImageDTO;
|
||||
|
||||
/**
|
||||
* Image carousel that uses the open source "slick carousel".
|
||||
@@ -52,7 +52,7 @@ import com.sap.sse.common.media.ImageMetadataDTO;
|
||||
*
|
||||
* Created by pgtaboada on 10.11.14.
|
||||
*/
|
||||
public class ImageCarousel<TYPE extends ImageMetadataDTO> extends Widget {
|
||||
public class ImageCarousel<TYPE extends ImageDTO> extends Widget {
|
||||
|
||||
private static SlickSliderUiBinder ourUiBinder = GWT.create(SlickSliderUiBinder.class);
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.sap.sse.gwt.client.media;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
import com.sap.sse.common.media.MimeType;
|
||||
|
||||
public abstract class AbstractMediaDTO implements IsSerializable {
|
||||
protected String title;
|
||||
|
||||
protected String subtitle;
|
||||
|
||||
protected Date createdAtDate;
|
||||
|
||||
protected String copyright;
|
||||
|
||||
protected MimeType mimeType;
|
||||
|
||||
protected List<String> tags = new ArrayList<String>();
|
||||
|
||||
protected String sourceRef;
|
||||
|
||||
/** for GWT */
|
||||
protected AbstractMediaDTO() {
|
||||
}
|
||||
|
||||
public AbstractMediaDTO(String sourceRef, MimeType mimeType, Date createdAtDate) {
|
||||
this.sourceRef = sourceRef;
|
||||
this.mimeType = mimeType;
|
||||
this.createdAtDate = createdAtDate;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getSubtitle() {
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
public void setSubtitle(String subtitle) {
|
||||
this.subtitle = subtitle;
|
||||
}
|
||||
|
||||
public Date getCreatedAtDate() {
|
||||
return createdAtDate;
|
||||
}
|
||||
|
||||
public void setCreatedAtDate(Date createdAtDate) {
|
||||
this.createdAtDate = createdAtDate;
|
||||
}
|
||||
|
||||
public String getCopyright() {
|
||||
return copyright;
|
||||
}
|
||||
|
||||
public void setCopyright(String copyright) {
|
||||
this.copyright = copyright;
|
||||
}
|
||||
|
||||
public MimeType getMimeType() {
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
public void setMimeType(MimeType mimeType) {
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
public List<String> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(List<String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public String getSourceRef() {
|
||||
return sourceRef;
|
||||
}
|
||||
|
||||
public void setSourceRef(String sourceRef) {
|
||||
this.sourceRef = sourceRef;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.sap.sse.gwt.client.media;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.sap.sse.common.media.ImageSize;
|
||||
import com.sap.sse.common.media.MimeType;
|
||||
|
||||
public class ImageDTO extends AbstractMediaDTO {
|
||||
|
||||
/** for GWT */
|
||||
protected ImageDTO() {
|
||||
}
|
||||
|
||||
private int widthInPx;
|
||||
private int heightInPx;
|
||||
|
||||
public ImageDTO(String imageRef, ImageSize size, Date createdAtDate) {
|
||||
super(imageRef, MimeType.image, createdAtDate);
|
||||
this.widthInPx = size.getWidth();
|
||||
this.heightInPx = size.getHeight();
|
||||
}
|
||||
|
||||
public ImageDTO(String imageRef, int heightInPx, int widthInPx, Date createdAtDate) {
|
||||
super(imageRef, MimeType.image, createdAtDate);
|
||||
this.widthInPx = widthInPx;
|
||||
this.heightInPx = heightInPx;
|
||||
}
|
||||
|
||||
public int getWidthInPx() {
|
||||
return widthInPx;
|
||||
}
|
||||
|
||||
public int getHeightInPx() {
|
||||
return heightInPx;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.sap.sse.gwt.client.media;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.sap.sse.common.media.MimeType;
|
||||
|
||||
public class VideoDTO extends AbstractMediaDTO {
|
||||
private int lengthInSeconds;
|
||||
private String thumbnailRef;
|
||||
|
||||
/** for GWT */
|
||||
protected VideoDTO() {
|
||||
}
|
||||
|
||||
public VideoDTO(String videoRef, MimeType mimeType, Date createdAtDate) {
|
||||
super(videoRef, mimeType, createdAtDate);
|
||||
}
|
||||
|
||||
public int getLengthInSeconds() {
|
||||
return lengthInSeconds;
|
||||
}
|
||||
|
||||
public void setLengthInSeconds(int lengthInSeconds) {
|
||||
this.lengthInSeconds = lengthInSeconds;
|
||||
}
|
||||
|
||||
public String getThumbnailRef() {
|
||||
return thumbnailRef;
|
||||
}
|
||||
|
||||
public void setThumbnailRef(String thumbnailRef) {
|
||||
this.thumbnailRef = thumbnailRef;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user