Class Canvas
- java.lang.Object
-
- de.digitalcollections.iiif.model.sharedcanvas.Resource<Canvas>
-
- de.digitalcollections.iiif.model.sharedcanvas.Canvas
-
public class Canvas extends Resource<Canvas>
A virtual container that represents a page or view and has content resources associated with it or with parts of it.The canvas provides a frame of reference for the layout of the content. The concept of a canvas is borrowed from standards like PDF and HTML, or applications like Photoshop and Powerpoint, where the display starts from a blank canvas and images, text and other resources are “painted” on to it.
See http://iiif.io/api/presentation/2.1/#canvas
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CanvasaddIIIFImage(String serviceUrl, ImageApiProfile profile)CanvasaddImage(ImageContent first, ImageContent... rest)CanvasaddOtherContent(AnnotationList first, AnnotationList... rest)IntegergetHeight()List<Annotation>getImages()List<AnnotationList>getOtherContent()Set<ViewingHint.Type>getSupportedViewingHintTypes()StringgetType()IntegergetWidth()voidsetHeight(Integer height)voidsetImages(List<Annotation> images)Sets the image annotations on this canvas.voidsetOtherContent(List<AnnotationList> otherContent)voidsetWidth(Integer width)voidsetWidthFromImage(Annotation imageAnno)-
Methods inherited from class de.digitalcollections.iiif.model.sharedcanvas.Resource
addAttribution, addDescription, addLabel, addLicense, addLogo, addLogo, addMetadata, addMetadata, addRelated, addRendering, addSeeAlso, addService, addThumbnail, addViewingHint, addWithin, getAlternatives, getAttribution, getAttributionString, getDescription, getDescriptionString, getFirstLicense, getIdentifier, getLabel, getLabelString, getLicenses, getLogos, getLogoUri, getMetadata, getRelated, getRenderings, getSeeAlso, getServices, getThumbnail, getThumbnails, getViewingHints, getWithin, isDefaultChoice, setAlternatives, setAttribution, setDescription, setIdentifier, setIsDefaultChoice, setLabel, setLicenses, setLogos, setRelated, setRenderings, setSeeAlso, setServices, setThumbnails, setViewingHints, setWithin, toString, verifyRendering
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.digitalcollections.iiif.model.openannotation.Choice
addAlternative
-
-
-
-
Field Detail
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getImages
public List<Annotation> getImages()
-
setImages
public void setImages(List<Annotation> images) throws IllegalArgumentException
Sets the image annotations on this canvas. Must all be instances ofImageContent- Parameters:
images- image annotations on this canvas- Throws:
IllegalArgumentException- if at least one of the image annotations is not anImageContent
-
addIIIFImage
public Canvas addIIIFImage(String serviceUrl, ImageApiProfile profile)
-
addImage
public Canvas addImage(ImageContent first, ImageContent... rest)
-
setWidthFromImage
public void setWidthFromImage(Annotation imageAnno)
-
getWidth
public Integer getWidth()
-
getHeight
public Integer getHeight()
-
setWidth
public void setWidth(Integer width)
-
setHeight
public void setHeight(Integer height)
-
getOtherContent
public List<AnnotationList> getOtherContent()
-
setOtherContent
public void setOtherContent(List<AnnotationList> otherContent)
-
addOtherContent
public Canvas addOtherContent(AnnotationList first, AnnotationList... rest)
-
getSupportedViewingHintTypes
public Set<ViewingHint.Type> getSupportedViewingHintTypes()
- Overrides:
getSupportedViewingHintTypesin classResource<Canvas>
-
-