Class CanvasGenerator
- java.lang.Object
-
- org.dspace.app.iiif.model.generator.CanvasGenerator
-
- All Implemented Interfaces:
IIIFResource
public class CanvasGenerator extends Object implements IIIFResource
This generator wraps the domain model for a singleCanvas.- Author:
- Michael Spalti mspalti@willamette.edu, Andrea Bollini (andrea.bollini at 4science.it)
-
-
Constructor Summary
Constructors Constructor Description CanvasGenerator(@NotNull String identifier)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CanvasGeneratoraddImage(de.digitalcollections.iiif.model.sharedcanvas.Resource<de.digitalcollections.iiif.model.ImageContent> imageContent)Add to the list of image content resources for the canvas.voidaddMetadata(String field, String value, String... rest)Adds single metadata field to Manifest.CanvasGeneratoraddThumbnail(de.digitalcollections.iiif.model.sharedcanvas.Resource<de.digitalcollections.iiif.model.ImageContent> thumbnail)Adds the thumbnail resource that will be assigned to the canvas.de.digitalcollections.iiif.model.sharedcanvas.Resource<de.digitalcollections.iiif.model.sharedcanvas.Canvas>generateResource()Returns the canvas.StringgetIdentifier()CanvasGeneratorsetHeight(int height)Sets the canvas height.CanvasGeneratorsetLabel(String label)Adds a canvas label.CanvasGeneratorsetWidth(int width)Sets the canvas width.
-
-
-
Constructor Detail
-
CanvasGenerator
public CanvasGenerator(@NotNull @NotNull String identifier)Constructor- Parameters:
identifier- the canvas identifier
-
-
Method Detail
-
getIdentifier
public String getIdentifier()
-
setLabel
public CanvasGenerator setLabel(String label)
Adds a canvas label.- Parameters:
label-
-
setHeight
public CanvasGenerator setHeight(int height)
Sets the canvas height. A canvas annotation with motivationsc:paintingmust have an pixel height.- Parameters:
height- canvas height in pixels
-
setWidth
public CanvasGenerator setWidth(int width)
Sets the canvas width. A canvas annotation with motivationsc:paintingmust have a pixel width.- Parameters:
width- canvas width in pixels
-
addImage
public CanvasGenerator addImage(de.digitalcollections.iiif.model.sharedcanvas.Resource<de.digitalcollections.iiif.model.ImageContent> imageContent)
Add to the list of image content resources for the canvas.- Parameters:
imageContent- image content model
-
addThumbnail
public CanvasGenerator addThumbnail(de.digitalcollections.iiif.model.sharedcanvas.Resource<de.digitalcollections.iiif.model.ImageContent> thumbnail)
Adds the thumbnail resource that will be assigned to the canvas.- Parameters:
thumbnail- image content model
-
addMetadata
public void addMetadata(String field, String value, String... rest)
Adds single metadata field to Manifest.- Parameters:
field- property fieldvalue- property value
-
generateResource
public de.digitalcollections.iiif.model.sharedcanvas.Resource<de.digitalcollections.iiif.model.sharedcanvas.Canvas> generateResource()
Returns the canvas.- Specified by:
generateResourcein interfaceIIIFResource- Returns:
- canvas model
-
-