Package de.digitalcollections.model.view
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 anImageFileResource
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 anImageFileResource
is defined as preview image and individual filled rendering hints are stored beside at the person object (and not "centrally" at the reusableImageFileResource
).This makes it possible to reuse an image in different use cases but with individual alt-text, caption, (mouseover) title and link.
-
-
Constructor Summary
Constructors Constructor Description RenderingHintsPreviewImage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
LocalizedText
getAltText()
LocalizedText
getCaption()
URL
getTargetLink()
LocalizedText
getTitle()
int
hashCode()
boolean
isOpenLinkInNewWindow()
void
setAltText(LocalizedText altText)
void
setCaption(LocalizedText caption)
void
setOpenLinkInNewWindow(boolean openLinkInNewWindow)
void
setTargetLink(URL targetLink)
void
setTitle(LocalizedText title)
-
-
-
Method Detail
-
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
-
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
-
-