Class RenderingHintsPreviewImage

java.lang.Object
de.digitalcollections.model.view.RenderingHintsPreviewImage

public class RenderingHintsPreviewImage extends Object
Contains hints for rendering a preview image, e.g. in a webpage as HTML.
These are related to an ImageFileResource but there may exist more than one rendering hints container, each per individual use case.
This makes it possible to use/embed an image in several projects and locations, each time rendered individually.
The rendering hints therefore are kept separate in an own rendering hints object and have to be stored in conjunction with each specific use case.

Example:
A person object has a portrait photo as preview image. On the detail page of this person (= use case) specific caption and link are defined.
So at the person storage an ImageFileResource is defined as preview image and individual filled rendering hints are stored beside at the person object (and not "centrally" at the reusable ImageFileResource).

This makes it possible to reuse an image in different use cases but with individual alt-text, caption, (mouseover) title and link.

  • Constructor Details

    • RenderingHintsPreviewImage

      public RenderingHintsPreviewImage()
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getAltText

      public LocalizedText getAltText()
      Returns:
      localized text that is shown as alternative if image can not be shown and for accessibility (e.g. screen-reader)
    • getCaption

      public LocalizedText getCaption()
      Returns:
      localized text that may be shown e.g. as "subtitle" under an image
    • getTargetLink

      public URL getTargetLink()
      Returns:
      url that is linked with the image and/or caption, e.g. used for click on image/caption as target location
    • getTitle

      public LocalizedText getTitle()
      Returns:
      localized text that may be shown e.g. as "mouseover" if image is rendered in an HTML page
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isOpenLinkInNewWindow

      public boolean isOpenLinkInNewWindow()
      Returns:
      if targetLink should be opened in new window
    • setAltText

      public void setAltText(LocalizedText altText)
      Parameters:
      altText - localized text that is shown as alternative if image can not be shown and for accessibility (e.g. screen-reader)
    • setCaption

      public void setCaption(LocalizedText caption)
      Parameters:
      caption - localized text that may be shown e.g. as "subtitle" under an image
    • setOpenLinkInNewWindow

      public void setOpenLinkInNewWindow(boolean openLinkInNewWindow)
      Parameters:
      openLinkInNewWindow - "true" if targetLink should be opened in new window
    • setTargetLink

      public void setTargetLink(URL targetLink)
      Parameters:
      targetLink - url that is linked with the image and/or caption, e.g. used for click on image/caption as target location
    • setTitle

      public void setTitle(LocalizedText title)
      Parameters:
      title - localized text that may be shown e.g. as "mouseover" if image is rendered in an HTML page
    • toString

      public String toString()
      Overrides:
      toString in class Object