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 single Canvas.
Author:
Michael Spalti mspalti@willamette.edu, Andrea Bollini (andrea.bollini at 4science.it)
  • Constructor Details

    • CanvasGenerator

      public CanvasGenerator(@NotNull @NotNull String identifier)
      Constructor
      Parameters:
      identifier - the canvas identifier
  • Method Details

    • 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 motivation sc:painting must have an pixel height.
      Parameters:
      height - canvas height in pixels
    • setWidth

      public CanvasGenerator setWidth(int width)
      Sets the canvas width. A canvas annotation with motivation sc:painting must 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 field
      value - property value
    • generateResource

      public de.digitalcollections.iiif.model.sharedcanvas.Resource<de.digitalcollections.iiif.model.sharedcanvas.Canvas> generateResource()
      Returns the canvas.
      Specified by:
      generateResource in interface IIIFResource
      Returns:
      canvas model