Package com.helger.html.hc.html.embedded
Interface IHCImg<IMPLTYPE extends IHCImg<IMPLTYPE>>
-
- Type Parameters:
IMPLTYPE- Implementation type
- All Superinterfaces:
com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>,com.helger.commons.hierarchy.IHasChildren<IHCNode>,com.helger.commons.hierarchy.IHasChildrenRecursive<IHCNode>,com.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>,IHCElement<IMPLTYPE>,IHCHasCSSClasses<IMPLTYPE>,IHCHasCSSStyles<IMPLTYPE>,IHCHasID<IMPLTYPE>,IHCMediaElementChild<IMPLTYPE>,IHCNode,Serializable
- All Known Implementing Classes:
AbstractHCImg,HCImg
public interface IHCImg<IMPLTYPE extends IHCImg<IMPLTYPE>> extends IHCMediaElementChild<IMPLTYPE>
Interface for IMGs- Author:
- Philip Helger
-
-
Field Summary
-
Fields inherited from interface com.helger.html.hc.html.IHCElement
DEFAULT_TABINDEX
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetAlt()EHCCORSSettingsgetCrossOrigin()com.helger.commons.dimension.SizeIntgetExtent()intgetHeight(int nDefaultValue)StringgetSizes()com.helger.commons.url.ISimpleURLgetSrc()StringgetSrcSet()intgetWidth(int nDefaultValue)booleanhasExtent()IMPLTYPEscaleBestMatching(int nMaxWidth, int nMaxHeight)Scales the image so that neither with nor height are exceeded, keeping the aspect ratio.IMPLTYPEscaleToHeight(int nNewHeight)IMPLTYPEscaleToWidth(int nNewWidth)IMPLTYPEsetAlt(String sAlt)IMPLTYPEsetCrossOrigin(EHCCORSSettings eCrossOrigin)IMPLTYPEsetExtent(int nWidth, int nHeight)IMPLTYPEsetExtent(com.helger.commons.dimension.SizeInt aImageData)IMPLTYPEsetSizes(String sSizes)IMPLTYPEsetSrc(com.helger.commons.url.ISimpleURL aSrc)IMPLTYPEsetSrcSet(String sSrcSet)-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildren
forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getChildCount, getChildren, hasChildren, hasNoChildren
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenRecursive
forAllChildrenRecursive, forAllChildrenRecursive
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenSorted
findFirstChild, findFirstChildMapped, getAllChildren, getChildAtIndex, getFirstChild, getLastChild
-
Methods inherited from interface com.helger.html.hc.html.IHCElement
addEventHandler, containsEventHandler, customAttrs, getAccessKey, getContentEditable, getDirection, getDraggable, getElement, getEventHandler, getEventMap, getLanguage, getRole, getTabIndex, getTagName, getTitle, getTranslate, isHidden, isSpellCheck, isTranslateOff, isTranslateOn, isTranslateUndefined, isUnfocusable, prependEventHandler, removeAllEventHandler, setAccessKey, setContentEditable, setDirection, setDraggable, setEventHandler, setHidden, setLanguage, setRole, setSpellCheck, setTabIndex, setTitle, setTranslate, setTranslate, setUnfocusable, withCustomAttrs
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSClasses
addClass, addClasses, addClasses, addClasses, containsClass, getAllClasses, getAllClassesAsString, getAllClassNames, hasAnyClass, removeAllClasses, removeClass
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSStyles
addStyle, addStyle, addStyles, addStyles, addStyles, containsStyle, getAllStyles, getAllStylesAsString, getAllStyleValues, getStyleValue, hasAnyStyle, hasStyle, removeAllStyles, removeStyle
-
Methods inherited from interface com.helger.html.hc.IHCHasID
ensureID, getID, hasID, hasNoID, setID, setUniqueID
-
Methods inherited from interface com.helger.html.hc.IHCNode
canConvertToMicroNode, consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, getPlainText, registerExternalResources
-
-
-
-
Method Detail
-
getSrc
@Nullable com.helger.commons.url.ISimpleURL getSrc()
-
hasExtent
boolean hasExtent()
-
getWidth
int getWidth(int nDefaultValue)
-
getHeight
int getHeight(int nDefaultValue)
-
getExtent
@Nullable com.helger.commons.dimension.SizeInt getExtent()
-
setExtent
@Nonnull IMPLTYPE setExtent(@Nonnegative int nWidth, @Nonnegative int nHeight)
-
scaleToWidth
@Nonnull IMPLTYPE scaleToWidth(@Nonnegative int nNewWidth)
-
scaleToHeight
@Nonnull IMPLTYPE scaleToHeight(@Nonnegative int nNewHeight)
-
scaleBestMatching
@Nonnull IMPLTYPE scaleBestMatching(@Nonnegative int nMaxWidth, @Nonnegative int nMaxHeight)
Scales the image so that neither with nor height are exceeded, keeping the aspect ratio.- Parameters:
nMaxWidth- Maximum withnMaxHeight- Maximum height- Returns:
- the correctly resized image tag
-
getCrossOrigin
@Nullable EHCCORSSettings getCrossOrigin()
-
setCrossOrigin
@Nonnull IMPLTYPE setCrossOrigin(@Nullable EHCCORSSettings eCrossOrigin)
-
-